+++ /dev/null
-*.o
-*.lo
-*.a
-*.la
-.deps
-.libs
-*~
-*.gmo
-*.pc
-/configure
-/config.status
-Makefile
-Makefile.in
-/ABOUT-NLS
-/README
-/aclocal.m4
-/autom4te.cache/
-/config.cache
-/config.cache-env
-/config.guess
-/config.h
-/config.h.in
-/config.log
-/config.rpath
-/config.sub
-/depcomp
-/doc/ecore.dox
-/ecore.spec
-/install-sh
-/libtool
-/ltmain.sh
-/m4/codeset.m4
-/m4/gettext.m4
-/m4/glibc21.m4
-/m4/iconv.m4
-/m4/intdiv0.m4
-/m4/intmax.m4
-/m4/inttypes-pri.m4
-/m4/inttypes.m4
-/m4/inttypes_h.m4
-/m4/isc-posix.m4
-/m4/lcmessage.m4
-/m4/lib-ld.m4
-/m4/lib-link.m4
-/m4/lib-prefix.m4
-/m4/libtool.m4
-/m4/longdouble.m4
-/m4/longlong.m4
-/m4/ltoptions.m4
-/m4/ltsugar.m4
-/m4/ltversion.m4
-/m4/lt~obsolete.m4
-/m4/nls.m4
-/m4/po.m4
-/m4/printf-posix.m4
-/m4/progtest.m4
-/m4/signed.m4
-/m4/size_max.m4
-/m4/stdint_h.m4
-/m4/uintmax_t.m4
-/m4/ulonglong.m4
-/m4/wchar_t.m4
-/m4/wint_t.m4
-/m4/xsize.m4
-/m4/glibc2.m4
-/m4/intl.m4
-/m4/intldir.m4
-/m4/intlmacosx.m4
-/m4/lock.m4
-/m4/visibility.m4
-/missing
-/mkinstalldirs
-/po/Makefile.in.in
-/po/Makevars.template
-/po/POTFILES
-/po/Rules-quot
-/po/boldquot.sed
-/po/ecore.pot
-/po/en@boldquot.header
-/po/en@quot.header
-/po/insert-header.sin
-/po/quot.sed
-/po/remove-potcdate.sed
-/po/remove-potcdate.sin
-/po/stamp-po
-/stamp-h1
-/doc/Doxyfile
-/src/bin/ecore_test
-/src/lib/ecore_x/xcb/ecore_xcb_keysym_table.h
-/src/util/makekeys
-debian/*.debhelper.log
-debian/*.substvars
-debian/*.debhelper
-debian/libecore-bin/
-config.guess.cdbs-orig
-config.sub.cdbs-orig
-debian/files
-debian/libecore-con/
-debian/libecore-config/
-debian/libecore-data/
-debian/libecore-dbg/
-debian/libecore-dev/
-debian/libecore-doc/
-debian/libecore-evas/
-debian/libecore-fb/
-debian/libecore-file/
-debian/libecore-imf/
-debian/libecore-input/
-debian/libecore-ipc/
-debian/libecore-x/
-debian/libecore/
-debian/stamp-*
-debian/tmp/
-doc/html/
-doc/latex/
-doc/man/
+Myoungwoon Roy Kim(roy_kim) <myoungwoon.kim@samsung.com> <myoungwoon@gmail.com>
The Rasterman <raster@rasterman.com>
Tom Gilbert <tom@linuxbrit.co.uk>
Burra <burra@colorado.edu>
Bluezery <ohpowel@gmail.com>
Doyoun Kang <wayofmine@gmail.com> <doyoun.kang@samsung.com>
Haifeng Deng <haifeng.deng@samsung.com>
+Jérémy Zurcher <jeremy@asynk.ch>
+Vikram Narayanan <vikram186@gmail.com>
2011-12-02 Carsten Haitzler (The Rasterman)
1.1.0 release
-
+
2011-12-02 Mike Blumenkrantz
* Use mempools for allocations
* Set ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL as default layout in ecore_imf_context_add.
* Add Ecore_IMF function to set or get the input panel-specific data.
+
+2012-02-07 Jihoon Kim (jihoon)
+
+ * Support ecore_imf_context_input_panel_show/hide in XIM and SCIM module.
+
+2012-02-08 Carsten Haitzler (The Rasterman)
+
+ * Add ecore_con_url_http_version_set() to set url request version
+
+2012-02-09 Jihoon Kim (jihoon)
+
+ * Provide compose, string in key down/up event in case of scim-input-pad.
+
+2012-02-10 Christopher Michael (devilhorns)
+
+ * Add Ecore_Evas function to allow setting a mouse pointer from efl/elm wayland clients.
+
+2012-02-15 Jihoon Kim (jihoon)
+
+ * Add ecore_imf APIs to set return key type, disable return key.
+
+2012-02-16 Leif Middelschulte (T_UNIX)
+
+ * Add ecore_x_randr_mode_add to add a mode to a display
+ * Add ecore_x_randr_mode_del to remove a mode from the display
+ * Add ecore_x_randr_output_mode_add to add a mode to an output
+ * Add ecore_x_randr_output_mode_del to remove a mode from an output
+
+2012-02-10 Jérémy Zurcher
+
+ * Improve callbacks in ecore_evas to use typedefs for readability.
+
+2012-02-23 Cedric Bail
+
+ * Move to Evas buffer engine for Ecore_Evas SDL software backend.
+
+2012-02-23 Leif Middelschulte (T_UNIX)
+
+ * Add ecore_x_randr_window_crtcs_get to get the crtcs that display a
+ window.
+ * Deprecate ecore_x_randr_current_output_get. Use
+ ecore_x_randr_window_crtcs_get instead.
+
+2012-02-24 Doyun Kang
+
+ * Add indicator controls to ecore_x
+
+2012-02-26 Carsten Haitzler (The Rasterman)
+
+ * Fix ecore_file_download to not limit downloads to 30sec.
+
+2012-02-28 Carsten Haitzler (The Rasterman)
+
+ * Add ecore_x_netwm_icons_set()
+ * Add ecore_evas_window_group_set() ecore_evas_window_group_get()
+ ecore_evas_aspect_set() ecore_evas_aspect_get()
+ ecore_evas_urgent_set() ecore_evas_urgent_get()
+ ecore_evas_modal_set() ecore_evas_modal_get()
+ ecore_evas_demand_attention_set()
+ ecore_evas_demand_attention_get()
+ ecore_evas_focus_skip_set() ecore_evas_focus_skip_get()
+ ecore_evas_callback_state_change_set()
+
+2012-02-28 Christopher Michael (devilhorns)
+
+ * Refactor Ecore_Wayland code to improve running EFL
+ applications as Wayland Clients.
+ * Refactor Ecore_Evas Wayland code to match changes in
+ Ecore_Wayland
+
+2012-02-29 Jihoon Kim (jihoon)
+
+ * Add ecore_imf_context_input_panel_caps_lock_mode_set/get to set the caps lock mode on the input panel
+
+2012-03-07 ChunEon Park (Hermet)
+
+ * Add ecore_x_illume_clipboard_state_set()
+ ecore_x_illume_clipboard_state_get()
+ ecore_x_illume_clipboard_geometry_set()
+ ecore_x_illume_clipboard_geometry_get()
+
+2012-03-07 Carsten Haitzler (The Rasterman)
+
+ * Add atoms and api for rotation and indicator transparency in
+ ecore_x/ecore_evas
+
+2012-03-07 Mike Blumenkrantz (discomfitor/zmike)
+
+ * Add ecore_con_url_status_code_get() to check return code at any time
+
+2012-03-09 Carsten Haitzler (The Rasterman)
+
+ * Fix ecore_thread_feedback_run to work as the documentation and logic tell us.
+
+2012-03-10 Cedric Bail
+
+ * Fix double free at end of execution of Ecore_Thread with feedback.
+
+2012-03-13 Leif Middelschulte (T_UNIX)
+
+ * Fix ecore_x_randr_modes_info_get to not cut off the trailing '\0'
+ anymore
+
+2012-03-20 Vincent Torri
+
+ * Rename ecore_win32_window_focus_set() to ecore_win32_window_focus()
+ to match ecore_x API.
+ * Add ecore_wince_window_focus(), ecore_wince_window_focus_get()
+ and ecore_win32_window_focus_get().
+
+2012-03-26 Shinwoo Kim
+
+ * Do not autorepeat Ctrl, Shift, Alt and Win keys on Windows
+
+2012-03-26 Christopher Michael (devilhorns)
+
+ Ecore_Wayland:
+ * Add ecore_wl_dpi_get
+ * Implement functions for input grab/ungrab
+ * Implement setting surface input & opaque regions
+ * Implement popup windows
+ * Implement ecore_wl_window_transparent_set function
+ * Implement function to allow setting Ecore_Wl_Window type.
+
+2012-03-26 Jihoon Kim (jihoon)
+
+ * scim-immodule: fix bug candidate window covers the preedit string when preedit string appears in 2 line.
+
+2012-03-29 Carsten Haitzler (The Rasterman)
+
+ * Fix range of issues with ecore_fb and even ecore_evas where
+ it didn't work right on the fb. (timestamps wrong, focus
+ handling etc.). This makes it work fully again.
+
m4/ecore_check_options.m4 \
m4/efl_doxygen.m4 \
m4/efl_path_max.m4 \
+m4/efl_shm_open.m4 \
m4/efl_tests.m4 \
m4/efl_threads.m4
- ECORE_CON_REMOTE_CORK
- ecore_con_url_proxy_set()
- ecore_con_url_timeout_set()
- - ecore_con_url_proxy_username_set
+ - ecore_con_url_proxy_username_set()
- ecore_con_url_proxy_password_set()
+ - ecore_con_url_http_version_set()
+ - ecore_con_url_status_code_get()
* ecore_x:
- ecore_x_randr_output_backlight_available()
+ - ecore_x_randr_window_crtcs_get()
* ecore_evas:
- Add Shm and Egl engines for ecore_evas to draw in Wayland.
- Add Socket and Plug to draw other process area.
* ecore_wayland
- Add Ecore_Wayland (backend to support Wayland).
+ * ecore_imf
+ - ecore_imf_context_event_callback_add()
+ - ecore_imf_context_event_callback_del()
+ - ecore_imf_context_event_callback_call()
+ - ecore_imf_context_input_panel_imdata_set()
+ - ecore_imf_context_input_panel_imdata_get()
+ - ecore_imf_context_input_panel_return_key_type_set()
+ - ecore_imf_context_input_panel_return_key_type_get()
+ - ecore_imf_context_input_panel_return_key_disabled_set()
+ - ecore_imf_context_input_panel_return_key_disabled_get()
+ - ecore_imf_context_input_panel_caps_lock_mode_set()
+ - ecore_imf_context_input_panel_caps_lock_mode_get()
+ * ecore_win32:
+ - ecore_win32_focus()
+ - ecore_win32_focus_get()
+ * ecore_wince:
+ - ecore_wince_focus()
+ - ecore_wince_focus_get()
+
+Fixes:
+ * ecore_thread:
+ - ecore_thread_feedback_run now handle try_no_queue the way it logically should.
+ - prevent double free that could cause crash when an Ecore_Thread stop.
+ * ecore_x:
+ - ecore_x_randr_modes_info_get does not cut off the trailing '\0' anymore.
+ * ecore_win32/wince:
+ - do not autorepeat Ctrl, Shift, Alt and Win keys
Improvements:
* ecore:
- certificates can now be added for STARTTTLS
* ecore_win32:
- fix modifiers value on Windows XP
+ * ecore_evas:
+ - use Evas buffer backend for SDL software engine
+
+Deprecations:
+ * ecore_x:
+ - ecore_x_randr_crtc_current_get()
+Removal:
+ * ecore_win32:
+ - ecore_win32_focus_set()
Ecore 1.1.0
-Ecore 1.1.0
+Ecore 1.2.0
******************************************************************************
Must:
libc
- libm
eina (1.1.0 or better)
(For windows you also need: evil)
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
m4_define([v_maj], [1])
-m4_define([v_min], [1])
-m4_define([v_mic], [99])
+m4_define([v_min], [2])
+m4_define([v_mic], [0])
m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n' | sed 's/Unversioneddirectory/0/' | tr -d '\n']))
m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))])
##-- When released, remove the dnl on the below line
-dnl m4_undefine([v_rev])
+m4_undefine([v_rev])
##-- When doing snapshots - change soname. remove dnl on below line
dnl m4_define([relname], [ver-pre-svn-07])
dnl m4_define([v_rel], [-release relname])
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##
-AC_INIT([ecore], [v_ver], [enlightenment-devel@lists.sourceforge.net])
+AC_INIT([ecore], [v_ver]-alpha, [enlightenment-devel@lists.sourceforge.net])
AC_PREREQ([2.52])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
want_ecore_evas_fb="no"
want_ecore_evas_software_16_wince="no"
want_ecore_evas_ews="yes"
+want_ecore_evas_extn="yes"
want_ecore_evas_wayland_shm="no"
want_ecore_evas_wayland_egl="no"
want_ecore_imf_scim="no"
case "$host_os" in
- mingw32ce* | cegcc*)
+ mingw32ce*)
want_ecore_con="no"
want_ecore_ipc="no"
want_ecore_wince="yes"
want_ecore_evas_software_16_wince="yes"
+ want_ecore_evas_extn="no"
;;
mingw*)
want_notify_win32="yes"
requirements_ecore_imf_scim=""
requirements_ecore_wayland=""
-AC_CHECK_DECL([MAXHOSTNAMELEN],[FOUND_MAXHOSTNAMELEN=yes])
-
-if test x$FOUND_MAXHOSTNAMELEN != xyes ; then
- AC_MSG_CHECKING([for header that defines MAXHOSTNAMELEN])
-
- FOUND_MAXHOSTNAMELEN='not found'
-
- AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([#include <sys/param.h>],
- [int h = MAXHOSTNAMELEN;]),
- [FOUND_MAXHOSTNAMELEN='sys/param.h'
- AC_DEFINE(NEED_SYS_PARAM_H,1,
- [Define to 1 if you need <sys/param.h> to define MAXHOSTNAMELEN])])
-
- AC_COMPILE_IFELSE(
- AC_LANG_PROGRAM([#include <netdb.h>],
- [int h = MAXHOSTNAMELEN;]),
- [FOUND_MAXHOSTNAMELEN='netdb.h'
- AC_DEFINE(NEED_NETDB_H,1,
- [Define to 1 if you need <netdb.h> to define MAXHOSTNAMELEN])])
-
- AC_MSG_RESULT([$FOUND_MAXHOSTNAMELEN])
-fi
-
### Additional options to configure
want_glib_integration_always=no
AC_DEFINE([ENABLE_XIM], [1], [Enable X Input Method])
fi
-# Unit tests
-
-EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
-
### Checks for programs
m4_ifdef([AC_PROG_OBJC],
;;
esac
+
+### Checks for portability layer
+
+PKG_CHECK_MODULES([EXOTIC],
+ [exotic],
+ [enable_exotic="yes"],
+ [enable_exotic="no"])
+
+if test "x${enable_exotic}" = "xyes"; then
+ requirements_ecore="exotic ${requirements_ecore}"
+
+ AC_DEFINE([HAVE_EXOTIC], [1], [Define to 1 if you have Exotic.])
+fi
+AM_CONDITIONAL([ECORE_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"])
+
AC_SUBST(EFL_ECORE_BUILD)
AC_SUBST(EFL_ECORE_CON_BUILD)
AC_SUBST(EFL_ECORE_EVAS_BUILD)
# Eina library
-PKG_CHECK_MODULES(EINA, [eina >= 1.1.0])
+PKG_CHECK_MODULES(EINA, [eina >= 1.2.0])
#FIXME check all the requirements when the eina move will be finished
-requirements_ecore="eina >= 1.1.0 ${requirements_ecore}"
-requirements_ecore_con="ecore >= 1.1.0 eina >= 1.1.0 ${requirements_ecore_con}"
-#requirements_ecore_config="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_config}"
-requirements_ecore_directfb="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_directfb}"
-requirements_ecore_evas="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_evas}"
-requirements_ecore_fb="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_fb}"
-requirements_ecore_file="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_file}"
-requirements_ecore_imf="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_imf}"
-requirements_ecore_imf_evas="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_imf_evas}"
-requirements_ecore_input="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_input}"
-requirements_ecore_input_evas="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_input_evas}"
-requirements_ecore_ipc="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_ipc}"
-requirements_ecore_cocoa="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_cocoa}"
-requirements_ecore_sdl="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_sdl}"
-requirements_ecore_psl1ght="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_sdl}"
-requirements_ecore_win32="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_win32}"
-requirements_ecore_wince="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_wince}"
-requirements_ecore_x="ecore >= 1.1.99 eina >= 1.1.0 ${requirements_ecore_x}"
+requirements_ecore="eina >= 1.2.0 ${requirements_ecore}"
+requirements_ecore_con="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_con}"
+#requirements_ecore_config="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_config}"
+requirements_ecore_directfb="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_directfb}"
+requirements_ecore_evas="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_evas}"
+requirements_ecore_fb="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_fb}"
+requirements_ecore_file="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_file}"
+requirements_ecore_imf="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_imf}"
+requirements_ecore_imf_evas="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_imf_evas}"
+requirements_ecore_input="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_input}"
+requirements_ecore_input_evas="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_input_evas}"
+requirements_ecore_ipc="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_ipc}"
+requirements_ecore_cocoa="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_cocoa}"
+requirements_ecore_sdl="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_sdl}"
+requirements_ecore_psl1ght="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_sdl}"
+requirements_ecore_win32="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_win32}"
+requirements_ecore_wince="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_wince}"
+requirements_ecore_x="ecore >= 1.2.0 eina >= 1.2.0 ${requirements_ecore_x}"
# glib support (main loop integration)
# Xlib and XCB (ecore_x)
+AC_CHECK_DECL([MAXHOSTNAMELEN], [FOUND_MAXHOSTNAMELEN=yes])
+
+if test "x${FOUND_MAXHOSTNAMELEN}" != "xyes" ; then
+ AC_MSG_CHECKING([for header that defines MAXHOSTNAMELEN])
+ FOUND_MAXHOSTNAMELEN="not found"
+
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[
+#include <sys/param.h>
+ ]],
+ [[
+int h = MAXHOSTNAMELEN;
+ ]])
+ ],
+ [
+ FOUND_MAXHOSTNAMELEN="sys/param.h"
+ AC_DEFINE([NEED_SYS_PARAM_H], [1], [Define to 1 if you need <sys/param.h> to define MAXHOSTNAMELEN])
+ ])
+
+ AC_COMPILE_IFELSE(
+ [
+ AC_LANG_PROGRAM(
+ [[
+#include <netdb.h>
+ ]],
+ [[
+int h = MAXHOSTNAMELEN;
+ ]])
+ ],
+ [
+ FOUND_MAXHOSTNAMELEN="netdb.h"
+ AC_DEFINE([NEED_NETDB_H], [1], [Define to 1 if you need <netdb.h> to define MAXHOSTNAMELEN])
+ ])
+
+ AC_MSG_RESULT([$FOUND_MAXHOSTNAMELEN])
+fi
+
have_x="no"
have_ecore_x="no"
have_ecore_x_xlib="no"
# Evas library (ecore_config, ecore_input_evas, ecore_imf_evas and ecore_evas)
-PKG_CHECK_MODULES([EVAS], [evas >= 1.1.99],
+PKG_CHECK_MODULES([EVAS], [evas >= 1.2.0],
[have_evas="yes"],
[have_evas="no"])
# ecore_con
-AC_CHECK_HEADERS([arpa/inet.h arpa/nameser.h netinet/tcp.h net/if.h netinet/in.h sys/socket.h sys/un.h ws2tcpip.h netdb.h])
+AC_CHECK_HEADERS([sys/socket.h])
+AC_CHECK_HEADERS([net/if.h], [], [],
+[
+#include <stdio.h>
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+])
+AC_CHECK_HEADERS([sys/un.h arpa/inet.h arpa/nameser.h netinet/tcp.h netinet/in.h ws2tcpip.h netdb.h])
if test "x${ac_cv_header_netdb_h}" = "xyes" ; then
have_addrinfo="yes"
])
fi
+# shm_open
+EFL_CHECK_SHM_OPEN([have_shm_open="yes"], [have_shm_open="no"])
+
### Checks for optionnal feature
AC_CHECK_FUNC([mallinfo],
[
# ecore_ipc
ECORE_CHECK_MODULE([ipc], [${want_ecore_ipc}], [Ipc], [${have_ecore_con}],
[
- requirements_ecore_ipc="ecore-con >= 1.1.99 ${requirements_ecore_ipc}"
- requirements_ecore_evas="ecore-ipc >= 1.1.99 ${requirements_ecore_evas}"
+ requirements_ecore_ipc="ecore-con >= 1.2.0 ${requirements_ecore_ipc}"
+ requirements_ecore_evas="ecore-ipc >= 1.2.0 ${requirements_ecore_evas}"
])
# ecore_file
ECORE_CHECK_NOTIFY_WIN32([${want_notify_win32}], [have_notify_win32="yes"], [have_notify_win32="no"])
if test "x${have_ecore_con}" = "xyes" ; then
- requirements_ecore_file="ecore-con >= 1.1.99 ${requirements_ecore_file}"
+ requirements_ecore_file="ecore-con >= 1.2.0 ${requirements_ecore_file}"
else
ECORE_CHECK_CURL([${want_curl}],
[
#fi
#ECORE_CHECK_MODULE([config], [${want_ecore_config}], [Config], [${ecore_config_deps}],
-# [requirements_ecore_config="ecore-ipc >= 1.1.99 evas >= 1.1.99 eet >= 1.5.0 ${requirements_ecore_config}"])
+# [requirements_ecore_config="ecore-ipc >= 1.2.0 evas >= 1.2.0 eet >= 1.6.0 ${requirements_ecore_config}"])
AM_CONDITIONAL(BUILD_ECORE_CONFIG, false)
fi
ECORE_CHECK_MODULE([imf-evas], [${want_ecore_imf}], [Imf_Evas], [${ecore_imf_evas_deps}],
- [requirements_ecore_imf_evas="ecore-imf >= 1.1.99 evas >= 1.1.99 ${requirements_ecore_imf_evas}"])
+ [requirements_ecore_imf_evas="ecore-imf >= 1.2.0 evas >= 1.2.0 ${requirements_ecore_imf_evas}"])
# ecore_input{_evas}
ECORE_CHECK_MODULE([input], [${want_ecore_input}], [Input])
ECORE_CHECK_MODULE([input-evas], [${want_ecore_input}], [Input_Evas], [${have_evas}],
- [requirements_ecore_input_evas="ecore-input >= 1.1.99 evas >= 1.1.99 ${requirements_ecore_input}"])
+ [requirements_ecore_input_evas="ecore-input >= 1.2.0 evas >= 1.2.0 ${requirements_ecore_input}"])
# ecore_imf_xim
AM_CONDITIONAL(BUILD_ECORE_IMF_XIM, false)
fi
ECORE_CHECK_MODULE([imf-xim], [${want_ecore_imf}], [Imf_XIM], [${ecore_imf_xim_deps}],
- [requirements_ecore_imf_xim="ecore-imf >= 1.1.99 ecore-x >= 1.1.99 ecore-input >= 1.1.99 ${requirements_ecore_imf_xim}"])
+ [requirements_ecore_imf_xim="ecore-imf >= 1.2.0 ecore-x >= 1.2.0 ecore-input >= 1.2.0 ${requirements_ecore_imf_xim}"])
# ecore_imf_scim
PKG_CHECK_MODULES([SCIM], [scim], [have_scim="yes"], [have_scim="no"])
fi
ECORE_CHECK_MODULE([imf-scim], [${want_ecore_imf}], [Imf_SCIM], [${ecore_imf_scim_deps}],
- [requirements_ecore_imf_scim="ecore-imf >= 1.1.0 ecore-x >= 1.1.0 ecore-input >= 1.1.0 ${requirements_ecore_imf_scim}"])
+ [requirements_ecore_imf_scim="ecore-imf >= 1.2.0 ecore-x >= 1.2.0 ecore-input >= 1.2.0 ${requirements_ecore_imf_scim}"])
## Graphic systems
ECORE_CHECK_MODULE([x], [${want_ecore_x}], [X], [${ecore_x_deps}],
[
ecore_x_libs="$ecore_x_libs $x_libs"
- requirements_ecore_x="ecore-input >= 1.1.99 ${requirements_ecore_x}"
+ requirements_ecore_x="ecore-input >= 1.2.0 ${requirements_ecore_x}"
])
# ecore_win32
ECORE_CHECK_MODULE([win32], [${want_ecore_win32}], [Win32], [${have_ecore_input}],
[
ecore_win32_libs="-lole32 -lgdi32"
- requirements_ecore_win32="ecore-input >= 1.1.99 ${requirements_ecore_win32}"
+ requirements_ecore_win32="ecore-input >= 1.2.0 ${requirements_ecore_win32}"
])
AC_SUBST(ecore_win32_libs)
fi
ECORE_CHECK_MODULE([cocoa], [${want_ecore_cocoa}], [Cocoa], [${ecore_cocoa_deps}],
- [requirements_ecore_cocoa="ecore-input >= 1.1.99 ${requirements_ecore_cocoa}"])
+ [requirements_ecore_cocoa="ecore-input >= 1.2.0 ${requirements_ecore_cocoa}"])
# ecore_sdl
fi
ECORE_CHECK_MODULE([sdl], [${want_ecore_sdl}], [Sdl], [${ecore_sdl_deps}],
- [requirements_ecore_sdl="ecore-input >= 1.1.99 ${requirements_ecore_sdl}"])
+ [requirements_ecore_sdl="ecore-input >= 1.2.0 ${requirements_ecore_sdl}"])
ECORE_CHECK_MODULE([psl1ght], [${want_ecore_psl1ght}], [psl1ght], [${ecore_psl1ght_deps}],
- [requirements_ecore_psl1ght="ecore-input >= 1.1.99 ${requirements_ecore_psl1ght}"])
+ [requirements_ecore_psl1ght="ecore-input >= 1.2.0 ${requirements_ecore_psl1ght}"])
# ecore_fb
ECORE_CHECK_MODULE([fb], [${want_ecore_fb}], [FB], [$have_fb])
# ecore_wince
ECORE_CHECK_MODULE([wince], [${want_ecore_wince}], [WinCE], [${have_ecore_input}],
- [requirements_ecore_win32="ecore-input >= 1.1.99 ${requirements_ecore_win32}"])
+ [requirements_ecore_win32="ecore-input >= 1.2.0 ${requirements_ecore_win32}"])
## Ecore Evas
# ecore_evas
ecore_evas_deps="no"
-if test "x${have_evas}" = "xyes" -a "x${have_ecore_input}" = "xyes" -a "x${have_ecore_input_evas}" = "xyes" ; then
+if test "x${have_evas}" = "xyes" && test "x${have_ecore_input}" = "xyes" && test "x${have_ecore_input_evas}" = "xyes" ; then
ecore_evas_deps="yes"
fi
ECORE_CHECK_MODULE([evas], [${want_ecore_evas}], [Evas], [${ecore_evas_deps}],
- [requirements_ecore_evas="ecore-input >= 1.1.99 ecore-input-evas >= 1.1.99 evas >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-input >= 1.2.0 ecore-input-evas >= 1.2.0 evas >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_buffer
"x$have_ecore_evas_software_16_x11" = "xyes" -o \
"x$have_ecore_evas_software_xcb" = "xyes"; then
AC_DEFINE(BUILD_ECORE_EVAS_X11, 1, [Support for X Window Engines in Ecore_Evas])
- requirements_ecore_evas="ecore-x >= 1.1.99 ${requirements_ecore_evas}"
+ requirements_ecore_evas="ecore-x >= 1.2.0 ${requirements_ecore_evas}"
fi
# ecore_evas_win32
"x${have_ecore_evas_opengl_glew}" = "xyes" -o \
"x${have_ecore_evas_software_16_ddraw}" = "xyes" ; then
AC_DEFINE(BUILD_ECORE_EVAS_WIN32, 1, [Support for Win32 Engine in Ecore_Evas])
- requirements_ecore_evas="ecore-win32 >= 1.1.99 ${requirements_ecore_evas}"
+ requirements_ecore_evas="ecore-win32 >= 1.2.0 ${requirements_ecore_evas}"
fi
# ecore_evas_software_sdl
-ECORE_EVAS_CHECK_MODULE([software-sdl],
- [${want_ecore_evas_software_sdl}],
- [Software SDL],
- [${have_ecore_sdl}],
- [requirements_ecore_evas="ecore-sdl >= 1.1.99 ${requirements_ecore_evas}"])
+have_ecore_evas_software_sdl="no"
+if test "x${have_ecore_sdl}" = "xyes"; then
+ requirements_ecore_evas="ecore-sdl >= 1.2.0 ${requirements_ecore_evas}"
+ have_ecore_evas_software_sdl="yes"
+ AC_DEFINE(BUILD_ECORE_EVAS_SOFTWARE_SDL, 1, [Support for Software SDL Engine in Ecore_Evas])
+ requirements_ecore_evas="ecore-sdl >= 1.2.0 ${requirements_ecore_evas}"
+fi
# ecore_evas_gl_sdl
[${want_ecore_evas_gl_sdl}],
[OpenGL SDL],
[${have_ecore_sdl}],
- [requirements_ecore_evas="ecore-sdl >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-sdl >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_cocoa
[${want_ecore_evas_gl_cocoa}],
[OpenGL Cocoa],
[${have_ecore_cocoa}],
- [requirements_ecore_evas="ecore-cocoa >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-cocoa >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_directfb
[${want_ecore_evas_directfb}],
[DirectFB],
[${have_ecore_directfb}],
- [requirements_ecore_evas="ecore-directfb >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-directfb >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_fb
[${want_ecore_evas_fb}],
[Linux Framebuffer],
[${have_ecore_fb}],
- [requirements_ecore_evas="ecore-fb >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-fb >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_wince
[${want_ecore_evas_software_16_wince}],
[16 bpp Software Windows CE],
[${have_ecore_wince}],
- [requirements_ecore_evas="ecore-wince >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-wince >= 1.2.0 ${requirements_ecore_evas}"])
# ecore_evas_ews
[Ecore Evas Single Process Windowing System],
[yes], [])
+# ecore_evas_extn
+
+have_extn="yes"
+if test "x${have_ecore_ipc}" = "xno" || \
+ test "x${have_ecore_evas_software_buffer}" = "xno" || \
+ test "x${have_shm_open}" = "xno" ; then
+ have_extn="no"
+fi
+
+dnl THIS IS SPECIAL - dont use normal ECORE_EVAS_CHECK_MODULE
+have_ecore_evas_extn="no"
+if test "x${want_ecore_evas_extn}" = "xyes" && \
+ test "x${have_extn}" = "xyes" && \
+ test "x${have_ecore_evas}" = "xyes"; then
+ AC_DEFINE([BUILD_ECORE_EVAS_EXTN], [1], [Support for Extn Engine in Ecore_Evas])
+ have_ecore_evas_extn="yes"
+fi
+
# ecore_evas_psl1ght
ECORE_EVAS_CHECK_MODULE([psl1ght],
[${want_ecore_evas_psl1ght}],
[PSL1GHT],
[${have_ecore_psl1ght}],
- [requirements_ecore_evas="ecore-psl1ght >= 1.1.99 ${requirements_ecore_evas}"])
+ [requirements_ecore_evas="ecore-psl1ght >= 1.2.0 ${requirements_ecore_evas}"])
### WAYLAND
[${have_ecore_wayland}],
[requirements_ecore_evas="${requirements_ecore_wayland} ${requirements_ecore_evas}"])
-ECORE_EVAS_CHECK_MODULE_FULL([wayland-egl], [wayland-egl],
+ECORE_EVAS_CHECK_MODULE_FULL([wayland-egl], [wayland-egl egl >= 7.10],
[${want_ecore_evas_wayland_egl}],
[Wayland Egl],
[${have_ecore_wayland}],
[
PKG_CHECK_MODULES([WAYLAND_EGL], [wayland-egl], [have_wayland_egl="yes"], [have_wayland_egl="no"])
if test "x${have_wayland_egl}" = "xyes" ; then
- requirements_ecore_evas="wayland-egl egl ${requirements_ecore_wayland} ${requirements_ecore_evas}"
+ requirements_ecore_evas="wayland-egl egl >= 7.10 ${requirements_ecore_wayland} ${requirements_ecore_evas}"
fi
])
+### Unit tests
+
+EFL_CHECK_TESTS([enable_tests="yes"], [enable_tests="no"])
+
### install and build examples
EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"])
echo " Sing.Proc. Windowing System: $have_ecore_evas_ews"
echo " Wayland Shm................: $have_ecore_evas_wayland_shm"
echo " Wayland Egl................: $have_ecore_evas_wayland_egl"
+ echo " Extn (Plug/socket Extn)....: $have_ecore_evas_extn"
fi
echo
echo " Tests................: ${enable_tests}"
+ecore (1.1.0+svn.69655slp2+build01) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69655slp2+build01
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Wed, 28 Mar 2012 14:28:49 +0900
+
+ecore (1.1.0+svn.69424slp2+build03) unstable; urgency=low
+
+ * [ECORE_X] remove feature - illume window state for app-in-app
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69424slp2+build03
+
+ -- Doyoun Kang <doyoun.kang@samsung.com> Mon, 26 Mar 2012 13:56:33 +0900
+
+ecore (1.1.0+svn.69424slp2+build02) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69424slp2+build02
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Sun, 18 Mar 2012 14:02:16 +0900
+
+ecore (1.1.0+svn.69424slp2+build01) unstable; urgency=low
+
+ * EFL migration
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69424slp2+build01
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Fri, 16 Mar 2012 21:50:01 +0900
+
+ecore (1.1.0+svn.69115slp2+build04) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69115slp2+build04
+
+ -- WooHyun Jung <wh0705.jung@samsung.com> Thu, 15 Mar 2012 21:23:10 +0900
+
+ecore (1.1.0+svn.69115slp2+build03) unstable; urgency=low
+
+ * [Ecore_X] Remove unused APIs, unused Atoms and duplicated Atoms
+ - ecore_x_e_comp_dri_buff_flip_supported_set
+ - ecore_x_e_comp_dri_buff_flip_supported_get
+ - ECORE_X_ATOM_E_USER_CREATED_WINDOW
+ - ECORE_X_ATOM_E_PARENT_BORDER_WINDOW
+ - ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED
+ - ECORE_X_ATOM_E_ILLUME_ROTATE_OPERATOR
+ - ECORE_X_ATOM_USER_CREATED_WINDOW
+ - ECORE_X_ATOM_PARENT_BORDER_WINDOW
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69115slp2+build03
+
+ -- Doyoun Kang <doyoun.kang@samsung.com> Wed, 14 Mar 2012 09:01:03 +0900
+
+ecore (1.1.0+svn.69115slp2+build02) unstable; urgency=low
+
+ * Change parameter of ecore_imf_context_input_panel_language_locale_get
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69115slp2+build02
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com> Mon, 12 Mar 2012 14:43:53 +0900
+
+ecore (1.1.0+svn.69115slp2+build01) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.69115slp2+build01
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Sat, 10 Mar 2012 13:51:23 +0900
+
+ecore (1.1.0+svn.68762slp2+build02) unstable; urgency=low
+
+ * 69115
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.68762slp2+build02
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Sat, 10 Mar 2012 13:20:45 +0900
+
+ecore (1.1.0+svn.68762slp2+build01) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.68762slp2+build01
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Wed, 07 Mar 2012 16:44:23 +0900
+
+ecore (1.1.0+svn.68529slp2+build01) unstable; urgency=low
+
+ * Package upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.68529slp2+build01
+
+ -- Jeonghyun Yun <jh0506.yun@samsung.com> Fri, 02 Mar 2012 06:32:15 -0500
+
+ecore (1.1.0+svn.67695slp2+build06) unstable; urgency=low
+
+ * [ecore_imf] add language_locale_get, candidate_panel_geometry_get API
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.67695slp2+build06
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com> Fri, 02 Mar 2012 11:44:15 +0900
+
+ecore (1.1.0+svn.67695slp2+build05) unstable; urgency=low
+
+ * [ecore_imf] add ecore_imf_context_input_panel_caps_lock_mode_set/get
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.67695slp2+build05
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com> Wed, 29 Feb 2012 14:21:16 +0900
+
+ecore (1.1.0+svn.67695slp2+build04) unstable; urgency=low
+
+ * [ecore_imf] cleanup code
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.67695slp2+build04
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com> Thu, 23 Feb 2012 17:36:50 +0900
+
+ecore (1.1.0+svn.67695slp2+build03) unstable; urgency=low
+
+ * Package Upload
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.67695slp2+build03
+
+ -- ChunEon Park <chuneon.park@samsung.com> Mon, 20 Feb 2012 20:15:54 +0900
+
+ecore (1.1.0+svn.67695slp2+build02) unstable; urgency=low
+
+ * Add APIs related to input panel control
+ * Git: slp/pkgs/e/ecore
+ * Tag: ecore_1.1.0+svn.67695slp2+build02
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com> Mon, 20 Feb 2012 09:23:47 +0900
+
ecore (1.1.0+svn.67695slp2+build01) unstable; urgency=low
* Package Upload
Hyoyoung Chang <hyoyoung.chang@samsung.com>,
Myoungwoon Kim <myoungwoon.kim@samsung.com>,
Seokjae Jeong <seok.j.jeong@samsung.com>,
- Mike McCormack <mj.mccormack@samsung.com>
+ Mike McCormack <mj.mccormack@samsung.com>,
+ Jeonghyun Yun <jh0506.yun@samsung.com>
Uploaders: Tae-Hwan Kim <the81.kim@samsung.com>
Build-Depends: dpkg-dev,
debhelper (>= 6),
* @li @ref ecore_timer_example_c
* @li @ref ecore_idler_example_c
* @li @ref ecore_job_example_c
- * @li @ref ecore_event_example_c
+ * @li @ref ecore_event_example_01_c
+ * @li @ref ecore_event_example_02_c
* @li @ref ecore_fd_handler_example_c
* @li @ref ecore_poller_example_c
* @li @ref ecore_con_lookup_example_c
* @li @ref ecore_evas_callbacks_example_c
* @li @ref ecore_evas_object_example_c
* @li @ref ecore_evas_basics_example_c
- * @li Ecore_Evas_Window_Sizes_Example_c
- * @li Ecore_Evas_Buffer_Example_01_c
- * @li Ecore_Evas_Buffer_Example_02_c
+ * @li @ref Ecore_Evas_Window_Sizes_Example_c
+ * @li @ref Ecore_Evas_Buffer_Example_01_c
+ * @li @ref Ecore_Evas_Buffer_Example_02_c
*/
/**
* displaying the time, it sleeps for 1 second, then call display the time
* again using the 3 functions.
*
- * Since everything occurs inside the same mainloop iteration, the internal
+ * Since everything occurs inside the same main loop iteration, the internal
* ecore time variable will not be updated, and calling ecore_loop_time_get()
* before and after the sleep() call will return the same result.
*
*
* This example shows how to setup timer callbacks. It starts a timer that will
* tick (expire) every 1 second, and then setup other timers that will expire
- * only once, but each of them will affect the firts timer still executing with
+ * only once, but each of them will affect the first timer still executing with
* a different API, to demonstrate its usage. To see the full code for this
* example, click @ref ecore_timer_example.c "here".
*
*/
/**
- * @page ecore_event_example_c ecore events and handlers - Setup and use
+ * @page ecore_event_example_01_c Handling events example
+ * This example shows the simplest possible way to register a handler for an
+ * ecore event, this way we can focus on the important aspects. The example will
+ * start the main loop and quit it when it receives the ECORE_EVENT_SIGNAL_EXIT
+ * event. This event is triggered by a SIGTERM(pressing ctrl+c).
+ *
+ * So let's start with the function we want called when we receive the event,
+ * instead of just stopping the main loop we'll also print a message, that's
+ * just so it's clear that it got called:
+ * @dontinclude ecore_event_example_01.c
+ * @skip static
+ * @until }
+ * @note We return ECORE_CALLBACK_DONE because we don't want any other handlers
+ * for this event to be called, the program is quitting after all.
+ *
+ * We then have our main function and the obligatory initialization of ecore:
+ * @until ecore_init
+ *
+ * We then get to the one line of our example that makes everything work, the
+ * registering of the callback:
+ * @until handler_add
+ * @note The @c NULL there is because there is no need to pass data to the
+ * callback.
+ *
+ * And the all that is left to do is start the main loop:
+ * @until }
+ *
+ * Full source code for this example: @ref ecore_event_example_01.c.
+ */
+
+/**
+ * @page ecore_event_example_02_c ecore events and handlers - Setup and use
* This example shows how to create a new type of event, setup some event
* handlers to it, fire the event and have the callbacks called. After
* finishing, we delete the event handlers so no memory will leak.
*
* Let's start the example from the beginning:
*
- * @dontinclude ecore_event_example.c
+ * @dontinclude ecore_event_example_02.c
* @until _event_type
*
* First thing is to declare a struct that will be passed as context to the
* the fd handler returned by the ecore_main_fd_handler_add() call. It can be
* used, for example, to retrieve which file descriptor triggered this callback,
* since it could be added to more than one file descriptor, or to check what
- * tipe of activity there's in the file descriptor.
+ * type of activity there's in the file descriptor.
*
* The code is very simple: we first check if the type of activity was an error.
* It probably won't happen with the default input, but could be the case of a
* lookup, by looking at the return code of the ecore_con_lookup() function.
*
* The callback @c _lookup_done_cb passed as argument to ecore_con_lookup() just
- * prints the resolved canonical name, ip, address of the sockaddr structure,
+ * prints the resolved canonical name, IP, address of the sockaddr structure,
* and the length of the socket address (in bytes).
*
* Finally, we start the main loop, and after that we finalize the libraries and
* This callback will associate a data structure to this client, that will be
* used to count how many bytes were received from it. It also prints some info
* about the client, and send a welcome string to it. ecore_con_client_flush()
- * is used to ensure that the string is sent immediately, instead of be
- * bufferized.
+ * is used to ensure that the string is sent immediately, instead of being
+ * buffered.
*
* A timeout for idle specific for this client is also set, to demonstrate that
* it is independent of the general timeout of the server.
*/
/**
- * @example ecore_event_example.c
+ * @example ecore_event_example_01.c
+ * This example shows how to create an event handler. Explanation: @ref
+ * ecore_event_example_01_c
+ */
+
+/**
+ * @example ecore_event_example_02.c
* This example shows how to setup, change, and delete event handlers. See
- * @ref ecore_event_example_c "the explanation here".
+ * @ref ecore_event_example_02_c "the explanation here".
*/
/**
* @dontinclude ecore_pipe_simple_example.c
*
* This example shows some simple usage of ecore_pipe. We are going to create a
- * pipe, fork our process, and then the child is going to comunicate to the
+ * pipe, fork our process, and then the child is going to communicate to the
* parent the result of its processing through the pipe.
*
* As always we start with our includes, nothing special:
*
* Next up is our function for handling data arriving in the pipe. It copies the
* data to another buffer, adds a terminating NULL and prints it. Also if it
- * receives a certain string it stops the main loop(efectvely ending the
+ * receives a certain string it stops the main loop(effectively ending the
* program):
* @until }
* @until }
* For this example we are going to animate a rectangle growing, moving and
* changing color, and then move it back to it's initial state with a
* different animation. We are also going to have a second rectangle moving
- * along the bootom of the screen. To do this we are going to use ecore_evas,
+ * along the bottom of the screen. To do this we are going to use ecore_evas,
* but since that is not the focus here we won't going into detail about it.
*
* @skip #include
*
* Here we have the callback function for our first animation, which first
* takes @p pos(where in the timeline we are), maps it to a SPRING curve that
- * which will wooble 15 times and will decay by a factor of 1.2:
+ * which will wobble 15 times and will decay by a factor of 1.2:
* @until pos_map
*
* Now that we have the frame we can adjust the rectangle to its appropriate
* @note For this animation we made the frametime much larger which means our
* animation might get "jerky".
*
- * The callback for our second animation, our savy reader no doubt noted that
+ * The callback for our second animation, our savvy reader no doubt noted that
* it's very similar to the callback for the first animation. What we change for
* this one is the type of animation to BOUNCE and the number of times it will
* bounce to 50:
* thread's storage, we create it and save it there for future jobs to find
* it. If creation fails, we cancel ourselves, so the main loop knows that
* we didn't just exit normally, meaning the job could not be done. The main
- * part of the function checks in each iteration if it was cancelled by the
+ * part of the function checks in each iteration if it was canceled by the
* main loop, and if it was, it stops processing and clears the data from the
* storage (we assume @c cancel means no one else will need this, but this is
* really application dependent).
* value changed.
* @until }
*
- * When a thread finishes its job or gets cancelled, the main loop is notified
+ * When a thread finishes its job or gets canceled, the main loop is notified
* through the callbacks set when creating the task. In this case, we just
- * print what happen and keep track of one of them used to exemplify cancelling.
+ * print what happen and keep track of one of them used to exemplify canceling.
* Here we are pretending one of our short jobs has a timeout, so if it doesn't
- * finish before a timer is triggered, it will be cancelled.
+ * finish before a timer is triggered, it will be canceled.
* @skip static void
* @until _cancel_timer_cb
* @until }
* The main function does some setup that includes reading parameters from
* the command line to change its behaviour and test different results.
* These are:
- * @li -t <some_num> maximum number of threads to run at the same time.
- * @li -p <some_path> adds @c some_path to the list used by the feedback jobs.
+ * @li -t \<some_num\> maximum number of threads to run at the same time.
+ * @li -p \<some_path\> adds @c some_path to the list used by the feedback jobs.
* This parameter can be used multiple times.
- * @li -m <some_num> the number of messages to process before the program is
+ * @li -m \<some_num\> the number of messages to process before the program is
* signalled to exit.
*
* Skipping some bits, we init Ecore and our application data.
* @until appdata.max_msgs
*
* If any paths for the feedback jobs were given, we use them, otherwise we
- * fallback to some defaults. Always initting the proper mutexes used by the
+ * fallback to some defaults. Always initializing the proper mutexes used by the
* threaded job.
* @skip path_list
* @until EINA_LIST_FREE
* @note Make sure you minimize, resize, give and remove focus to see more
* callbacks called.
*
- * Here you have the full-source of the code:
+ * The example is constituted of two main parts, first is the implementation of
+ * callbacks that will be called for each event(all our callbacks do is print
+ * their own name) and the second is the main function where we register the
+ * event callbacks and run the main loop:
* @include ecore_evas_callbacks.c
* @example ecore_evas_callbacks.c
*/
/**
- * @page Ecore_Evas_Window_Sizes_Example_c Ecore_Evas window sizes
+ * @page Ecore_Evas_Window_Sizes_Example_c Ecore_Evas window size hints
*
* On this example, we show you how to deal with @c Ecore_Evas window
* size hints, which are implemented <b>per Evas engine</b>.
* @page ecore_evas_basics_example_c Ecore Evas basics example
* @dontinclude ecore_evas_basics_example.c
*
- * This example will ilustrate the usage of some basic Ecore_Evas functions.
+ * This example will illustrates the usage of some basic Ecore_Evas functions.
* This example will list the available evas engines, check which one we used to
* create our window and set some data on our Ecore_Evas. It also allows you to
* hide/show all windows in this process(we only have one, but if there were
* more they would be hidden), to hide the windows type 'h' and hit return, to
* show them, type 's' and hit return.
*
- * The very first thing we'll do is init ecore_evas:
+ * The very first thing we'll do is initialize ecore_evas:
* @skipline evas_init
* @until return 1
*
* @until ecore_evas_engines_free
*
* We then create an Ecore_Evas(window) with the first available engine, on
- * position 0,0 with size 200,200 and no especial flags:
+ * position 0,0 with size 200,200 and no especial flags, set it's title and show
+ * it:
* @until evas_show
*
* We now add some important data to our Ecore_Evas:
* @until data_set
*
- * And since our data is dinamically allocated we'll need to free it when the
+ * And since our data is dynamically allocated we'll need to free it when the
* Ecore_Evas dies:
* @until delete_request
* @dontinclude ecore_evas_basics_example.c
* We now print which Evas engine is being used for our example:
* @until printf
*
- * Next we are going to add a background to our window, for which we'll need to
- * get the canvas(Evas) on which to draw it:
+ * We are going to add a background to our window but before we can do that
+ * we'll need to get the canvas(Evas) on which to draw it:
* @until canvas
*
- * We then do a sanity check, veryfing if the Ecore_Evas of the Evas is the
+ * We then do a sanity check, verifying if the Ecore_Evas of the Evas is the
* Ecore_Evas from which we got the Evas:
* @until printf
*
- * Once all else is done we run our main loop, and when that is done(application
- * is exiting) we free our Ecore_Evas and shutdown the ecore_evas subsystem:
+ * Now we can actually add the background:
+ * @until ecore_evas_object_associate
+ *
+ * To hide and show the windows of this process when the user presses 'h' and
+ * 's' respectively we need to know when the user types something, so we
+ * register a callback for when we can read something from @c stdin:
+ * @until )
+ *
+ * The callback that actually does the hiding and showing is pretty simple, it
+ * does a @c scanf(which we know won't block since there is something to read on
+ * @c stdin) and if the character is an 'h' we iterate over all windows calling
+ * @c ecore_evas_hide on them, if the character is an 's' we call @c
+ * ecore_evas_show instead:
+ * @dontinclude ecore_evas_basics_example.c
+ * @skip static Eina_Bool
+ * @until }
+ * @skip ecore_main_loop_begin
+ *
+ * Once all is done we run our main loop, and when that is done(application is
+ * exiting) we free our Ecore_Evas and shutdown the ecore_evas subsystem:
* @until shutdown
*
* Here you have the full-source of the code:
*
* Since it's a buffer canvas and we're using it to only save its
* contents on a file, we even needn't ecore_evas_show() it. We make
- * it render itself, forcefully, without the aid of Ecore's mainloop,
+ * it render itself, forcefully, without the aid of Ecore's main loop,
* with ecore_evas_manual_render():
* @dontinclude ecore_evas_buffer_example_01.c
* @skip manual_render
@pkgconfig_requires_private@: @requirements_ecore_win32@
Version: @VERSION@
Libs: -L${libdir} -lecore_win32
-Libs.private:
+Libs.private: @WIN32_LIBS@
Cflags: -I${includedir}/ecore-@VMAJ@
Description: Ecore event abstraction library
@pkgconfig_requires_private@: @requirements_ecore@
Version: @VERSION@
-Libs: -L${libdir} -lecore
+Libs: -L${libdir} -lecore @EINA_LIBS@
Libs.private: -lm
-Cflags: -I${includedir}/ecore-@VMAJ@
+Cflags: -I${includedir}/ecore-@VMAJ@ @EINA_CFLAGS@
AC_MSG_CHECKING([whether ecore_evas $4 support is to be built])
AC_MSG_RESULT([${want_module}])
-if test "x$5" = "xyes" -a \
- "x$have_ecore_evas" = "xyes" -a \
- "x$want_module" = "xyes" ; then
+if test "x$5" = "xyes" && \
+ test "x$have_ecore_evas" = "xyes" && \
+ test "x$want_module" = "xyes" ; then
PKG_CHECK_EXISTS([evas-$2],
[
AC_DEFINE([BUILD_ECORE_EVAS_]m4_defn([UP]), [1], [Support for $4 Engine in Ecore_Evas])
])
if test "x${_ecore_want_cares}" = "xyes" -o "x${_ecore_want_cares}" = "xauto" ; then
- PKG_CHECK_MODULES([CARES], [libcares >= 1.6.1 libcares != 1.7.5],
+ PKG_CHECK_MODULES([CARES], [libcares >= 1.6.1],
[_ecore_have_cares="yes"],
[_ecore_have_cares="no"])
fi
--- /dev/null
+dnl Copyright (C) 2011 Cedric Bail <cedric.bail@free.fr>
+dnl This code is public domain and can be freely used or copied.
+
+dnl Macro that check for gettimeofday definition
+
+dnl Usage: EFL_CHECK_GETTIMEOFDAY(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
+dnl Define EFL_HAVE_GETTIMEOFDAY
+
+AC_DEFUN([EFL_CHECK_GETTIMEOFDAY],
+[
+
+_efl_have_gettimeofday="no"
+
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <stdlib.h>
+#include <sys/time.h>
+ ]],
+ [[
+int res;
+res = gettimeofday(NULL, NULL);
+ ]])],
+ [_efl_have_gettimeofday="yes"],
+ [_efl_have_gettimeofday="no"])
+
+if test "x${_efl_have_gettimeofday}" = "xno" -a "x${enable_exotic}" = "xyes"; then
+ SAVE_LIBS="${LIBS}"
+ SAVE_CFLAGS="${CFLAGS}"
+ LIBS="${LIBS} ${EXOTIC_LIBS}"
+ CFLAGS="${CFLAGS} ${EXOTIC_CFLAGS}"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <Exotic.h>
+ ]],
+ [[
+int res;
+res = gettimeofday(NULL, NULL);
+ ]])],
+ [_efl_have_gettimeofday="yes"],
+ [_efl_have_gettimeofday="no"])
+fi
+
+if test "x${_efl_have_gettimeofday}" = "xyes"; then
+ AC_DEFINE([EFL_HAVE_GETTIMEOFDAY], [1], [Defined if gettimeofday is available.])
+fi
+
+AS_IF([test "x${_efl_have_gettimeofday}" = "xyes"], [$1], [$2])
+])
--- /dev/null
+dnl Copyright (C) 2010 Vincent Torri <vtorri at univ-evry dot fr>
+dnl That code is public domain and can be freely used or copied.
+
+dnl Macro that check if shm_open function is available or not.
+
+dnl Usage: EFL_CHECK_SHM_OPEN([, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+dnl Call AC_SUBST(EFL_SHM_OPEN_LIBS)
+dnl Define HAVE_SHM_OPEN to 1if shm_open is available
+
+AC_DEFUN([EFL_CHECK_SHM_OPEN],
+[
+_efl_have_shm_open="no"
+
+dnl Check is shm_open is in libc
+
+AC_MSG_CHECKING([for shm_open in libc])
+AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/mman.h>
+#include <sys/stat.h> /* For mode constants */
+#include <fcntl.h> /* For O_* constants */
+ ]],
+ [[
+int fd;
+
+fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ ]])],
+ [_efl_have_shm_open="yes"],
+ [_efl_have_shm_open="no"])
+
+AC_MSG_RESULT([${_efl_have_shm_open}])
+
+if test "x$_efl_have_shm_open" = "xno" ; then
+ AC_MSG_CHECKING([for shm_open in librt])
+
+ LIBS_save="${LIBS}"
+ LIBS="${LIBS} -lrt"
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#include <sys/mman.h>
+#include <sys/stat.h> /* For mode constants */
+#include <fcntl.h> /* For O_* constants */
+ ]],
+ [[
+int fd;
+
+fd = shm_open("/dev/null", O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO);
+ ]])],
+ [
+ EFL_SHM_OPEN_LIBS="-lrt"
+ _efl_have_shm_open="yes"],
+ [_efl_have_shm_open="no"])
+
+ LIBS="${LIBS_save}"
+
+ AC_MSG_RESULT([${_efl_have_shm_open}])
+fi
+
+AC_SUBST([EFL_SHM_OPEN_LIBS])
+
+if test "x$_efl_have_shm_open" = "xyes" ; then
+ AC_DEFINE([HAVE_SHM_OPEN], [1], [Define to 1 if you have the `shm_open' function.])
+fi
+
+AS_IF([test "x$_efl_have_shm_open" = "xyes"], [$1], [$2])
+
+])
+#sbs-git:slp/pkgs/e/ecore ecore 1.1.0+svn.69115slp2+build01 f1fcb7acee67ba61b43c4c5bcf6a0255195b3bbe
Name: ecore
Summary: Enlightened Core X interface library
-Version: 1.1.0+svn.67695slp2
-Release: 1.2
-Group: TO_BE/FILLED_IN
+Version: 1.2.0+svn.69928slp2+build01
+Release: 1
+Group: System/Libraries
License: BSD
URL: http://www.enlightenment.org
Source0: %{name}-%{version}.tar.gz
%build
+export CFLAGS+=" -fvisibility=hidden -fPIC"
+export LDFLAGS+=" -fvisibility=hidden -Wl,--hash-style=both -Wl,--as-needed"
%autogen
%configure --disable-static \
+ --enable-ecore-fb \
+ --enable-dependency-tracking \
+ --disable-ecore-directfb \
+ --enable-ecore-evas-fb \
+ --disable-rpath \
+ --disable-openssl \
+ --disable-gnutls \
+ --disable-tslib \
+ --enable-simple-x11 \
+ --enable-ecore-evas-opengl-x11 \
+ --disable-ecore-evas-xrender-x11 \
+ --enable-curl \
--enable-glib-integration-always \
- --disable-xim
+ --enable-ecore-x-gesture \
+ --disable-xim \
+ --disable-ecore-imf-scim
make %{?jobs:-j%jobs}
msgstr ""
"Project-Id-Version: ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2011-10-23 01:28+0100\n"
"Last-Translator: Daniel Kolesa <quaker66@gmail.com>\n"
"Language-Team: Czech <kde-i18n-doc@kde.org>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Verze:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Použití:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [volby]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Copyright:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licence:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Typ: "
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Výchozí: "
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Možnosti: "
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Volby:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "CHYBA: neznámá volba --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "CHYBA: neznámá volba -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "CHYBA: "
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "hodnota nemá nastaven pointer.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "neznámá boolean hodnota %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "neznámý číselný formát %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "neznámá volba \"%s\". Možné hodnoty jsou: "
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "chybějící parametr k připojení.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "nemůžu parsovat hodnotu.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "chybějící parametr.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "chybějící callback funkce!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "nebyla definována verze.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "nebyl definován copyright.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "nebyla definována licence.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "CHYBA: neznámá volba --%s, ignoruji.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "CHYBA: volba --%s vyžaduje argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "CHYBA: neznámá volba -%c, ignoruji.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "CHYBA: volba -%c vyžaduje argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "CHYBA: nebyl poskytnut parser.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "CHYBA: nebyly poskytnuty hodnoty.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "CHYBA: nebyly poskytnuty argumenty.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "CHYBA: nalezeny neplatné volby."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " viz. --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " viz. -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "CHYBA: neplatná hodnota geometrie '%s'\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "CHYBA: neplatná hodnota velikosti '%s'\n"
msgstr ""
"Project-Id-Version: ecore 0.9.9.063-2\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2010-01-03 21:52+GMT\n"
"Last-Translator: Fabian Nowak <timystery@arcor.de>\n"
"Language-Team: German <debian-l10n-german@lists.debian.org>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Version:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Aufruf:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [Optionen]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Copyright:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Lizenz:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Typ: "
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Standard: "
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Auswahlmöglichkeiten: "
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Optionen:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "FEHLER: Unbekannte Option --%s\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "FEHLER: Unbekannte Option -%c\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "FEHLER: "
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "kein Zeiger auf Wert gesetzt\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "unbekannter boolescher Wert %s\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "ungültiges Zahlenformat %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "ungültige Auswahl \"%s\". Gültige Werte sind: "
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "fehlender Parameter zum Anhängen.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "Wert kann nicht ausgewertet werden.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "fehlender Parameter.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "fehlende Rückruffunktion!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "es wurde keine Version angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "es wurde kein Copyright angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "es wurde keine Lizenz angegeben.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "FEHLER: Unbekannte Option --%s, ignoriert\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "FEHLER: Option --%s benötigt ein Argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "FEHLER: Unbekannte Option -%c, ignoriert\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "FEHLER: Option -%c benötigt ein Argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "FEHLER: Kein Parser bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "FEHLER: Keine Werte bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "FEHLER: Keine Argumente bereitgestellt.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "FEHLER: Ungültige Optionen gefunden."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " Siehe --%s\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " Siehe -%c\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "FEHLER: Falscher Geometriewert \"%s\"\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "FEHLER: Falscher Größenwert \"%s\"\n"
msgstr ""
"Project-Id-Version: Ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2011-11-20 22:42+0200\n"
"Last-Translator: George Rizopoulos <george.rizopoulos.1@gmail.com>\n"
"Language-Team: Greek\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Έκδοση:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Χρήση:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [επιλογές]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Πνευματικά δικαιώματα:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Άδεια:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Τύπος:"
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Προκαθορισμένο:"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Επιλογές:"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Επιλογές:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "ΣΦΑΛΜΑ: άγνωστη επιλογή --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "ΣΦΑΛΜΑ: άγνωστη επιλογή -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "ΣΦΑΛΜΑ:"
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "η τιμή δεν έχει δείκτη ορισμένο.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "άγνωστη τιμή boolean %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "άγνωστη μορφή αριθμού %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "μη έγκυρη επιλογή \"%s\". Οι έγκυρες τιμές είναι: "
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "ελλιπής παράμετρος προς επισύναψη.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "αδυναμία ανάλυσης τιμών.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "ελλιπής παράμετρος.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "λείπει η λειτουργία επανάκλησης!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "δεν έχει οριστεί έκδοση.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "δεν έχουν οριστεί πνευματικά δικαιώματα.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "δεν έχει οριστεί άδεια.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "ΣΦΑΛΜΑ:άγνωστη επιλογή --%s, αγνοήθηκε.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "ΣΦΑΛΜΑ: η επιλογή --%s απαιτεί παραμέτρους!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "ΣΦΑΛΜΑ: άγνωστη επιλογή -%c, αγνοήθηκε.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "ΣΦAΛΜΑ: η επιλογή -%c απαιτεί μία παράμετρο!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
#, fuzzy
msgid "ERROR: no parser provided.\n"
msgstr "ΣΦΑΛΜΑ:δεν παρέχεται αναλυτής.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "ΣΦΑΛΜΑ:δεν έχουν δοθεί τιμές.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "ΣΦΑΛΜΑ:δεν έχουν δοθεί παράμετροι.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "ΣΦΑΛΜΑ: βρέθηκαν μη έγκυρες επιλογές."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " Δείτε --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " Δείτε -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "ΣΦΑΛΜΑ: μη έγκυρη γεωμετρική τιμή '%s'\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "ΣΦΑΛΜΑ: μη έγκυρη τιμή μεγέθους '%s'\n"
msgstr ""
"Project-Id-Version: Ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2010-07-11 11:01+0400\n"
"Last-Translator: batden <batden@orange.fr>\n"
"Language-Team: Enlightenment French Team <pourunmondesansgourou@gmail.com>\n"
"X-Poedit-Country: FRANCE\n"
"X-Poedit-SourceCharset: utf-8\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Version :"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Usage :"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [options]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Copyright :"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licence :"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Type : "
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Par défaut :"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Choix :"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Options :\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "ERREUR : option inconnue --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "ERREUR : option inconnue -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "ERREUR :"
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "la valeur n'a aucun pointeur défini.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "valeur booléenne inconnue %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "format du nombre non valide %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "choix non valide « %s ». Les valeurs valides sont : "
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "paramètre manquant à ajouter.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "analyse de la valeur impossible.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "paramètre manquant.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "fonction de rappel manquante !\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "aucune version n'est définie.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "aucun copyright n'est défini.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "aucune licence n'est définie.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "ERREUR : option inconnue --%s, non prise en compte.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "ERREUR : l'option --%s requiert un argument !\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "ERREUR : option inconnue -%c, non prise en compte.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "ERREUR : l'option -%c requiert un argument !\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "ERREUR : aucun analyseur n'est fourni.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "ERREUR : aucune valeur n'est fournie.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "ERREUR : aucun argument n'est fourni.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "ERREUR : options non valides détectées."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " Voir --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " Voir -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "ERREUR : valeur géométrique incorrecte « %s »\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "ERREUR : valeur de taille incorrecte « %s »\n"
msgstr ""
"Project-Id-Version: Ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2009-10-27 19:36+0100\n"
"Last-Translator: quaker66 <quaker66@gmail.com>\n"
"Language-Team: none\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Versione:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Uso:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [opzioni]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Copyright:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licenza:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Tipo: "
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Predefinito:"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Scelte:"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Opzioni:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "ERRORE: opzione sconosciuta --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "ERRORE: opzione sconosciuta -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "ERRORE:"
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "il valore non ha puntatori impostati.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "valore booleano sconosciuto %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "formato numero non valido %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "scelta non valida \"%s\". I valori ammessi sono: "
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "parametro da appendere mancante.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "impossibile il parsing del valore.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "parametro mancante.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "funzione callback mancante!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "nessuna versione definita.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "nessun copyright definito.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "nessuna licenza definita.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "ERRORE: opzione sconosciuta --%s, ignorata.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "ERRORE: l'opzione --%s richiede un argomento!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "ERRORE: opzione sconosciuta -%c, ignorata.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "ERRORE: l'opzione -%c richiede un argomento!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "ERRORE: nessun parser fornito.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "ERRORE: nessun valore fornito.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "ERRORE: nessun argomento fornito.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "ERRORE: trovate opzioni non valide."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " Vedere --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " Vedere -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "ERRORE: valore geometrico non corretto '%s'\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "ERRORE: valore dimensione non corretto '%s'\n"
msgstr ""
"Project-Id-Version: Ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2011-09-03 15:48+0100\n"
"Last-Translator: Heimen Stoffels <vistausss@gmail.com>\n"
"Language-Team: <vistausss@gmail.com>\n"
"X-Poedit-Language: NL\n"
"X-Poedit-Country: Nederland\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Versie:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Gebruik:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [opties]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Copyright:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licentie:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Type:"
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Standaard:"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Keuzes:"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Opties:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "FOUT: onbekende optie --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "FOUT: onbekende optie -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "FOUT:"
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "waarde heeft geen pointer ingsteld.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "onbekende boolean-waarde %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "ongeldig nummerformaat %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "ongeldige keuze \"%s\". Geldige waardes zijn:"
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "parameter om toe te wijzen ontbreekt.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "kon waarde niet doorvoeren.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "paramater ontbreekt.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "ontbrekende terugroep-functie!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "geen versie was gedefinieerd.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "geen copyright was gedefinieerd.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "geen licentie was gedefinieerd.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "FOUT: onbekende optie --%s, genegeerd.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "FOUT: optie --%s vereist een argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "FOUT: onbekende opties -%c, genegeerd.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "FOUT: optie -%c vereist een argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "FOUT: geen doorvoerder beschikbaar gesteld.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "FOUT: geen waarden beschikbaar gesteld.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "FOUT: geen argumenten beschibaar gesteld.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "FOUT: ongeldige opties gevonden."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr "Zie --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr "Zie -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "Fout: foutieve wiskundige waarde '%s'\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "FOUT: foutieve grootte-waarden '%s'\n"
msgstr ""
"Project-Id-Version: ecore\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2010-10-06 12:37-0000\n"
"Last-Translator: Sérgio Marques <smarquespt@gmail.com>\n"
"Language-Team: \n"
"X-Poedit-Language: Portuguese\n"
"X-Poedit-Country: Portugal\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Versão:"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Utilização:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s [opções]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Direitos de autor:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licença:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Tipo:"
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Omissão:"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Escolhas:"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Opções:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "ERRO: opção desconhecida --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "ERRO: opção desconhecida -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "ERRO: "
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "o valor não está definido.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "valor booleano desconhecido %s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "formato do número inválido %s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "escolha inválida \"%s\". O valores possíveis são:"
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "faltam os parâmetros a anexar.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "incapaz de analisar o valor.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "parâmetro em falta.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "função de chamada em falta!\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "nenhuma versão definida.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "direitos de autor não definidos.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "licença não definida.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "ERRO: opção desconhecida --%s, ignorada.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "ERRO: a opção --%s requer um argumento!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "ERRO: opção desconhecida --%c, ignorada.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "ERRO: a opção --%c requer um argumento!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "ERRO: nenhum analisador fornecido.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "ERRO: nenhum valor fornecido.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "ERRO: nenhum argumento fornecido.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "ERRO: encontradas opções inválidas."
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr " Veja --%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr " Veja -%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "ERRO: valor geométrico incorreto \"%s\"\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "ERRO: tamanho incorreto \"%s\"\n"
msgstr ""
"Project-Id-Version: ecore 1.0\n"
"Report-Msgid-Bugs-To: enlightenment-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-12-26 13:27+0900\n"
+"POT-Creation-Date: 2012-03-17 11:44+0900\n"
"PO-Revision-Date: 2011-02-24 16:54+0100\n"
"Last-Translator: r1to <renato.rener@gmail.com>\n"
"Language-Team: Slovenian <sl@li.org>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-#: src/lib/ecore/ecore_getopt.c:91
+#: src/lib/ecore/ecore_getopt.c:95
msgid "Version:"
msgstr "Različica"
-#: src/lib/ecore/ecore_getopt.c:100
+#: src/lib/ecore/ecore_getopt.c:104
msgid "Usage:"
msgstr "Uporaba:"
-#: src/lib/ecore/ecore_getopt.c:105
+#: src/lib/ecore/ecore_getopt.c:109
#, c-format
msgid "%s [options]\n"
msgstr "%s·[možnosti]\n"
-#: src/lib/ecore/ecore_getopt.c:260
+#: src/lib/ecore/ecore_getopt.c:264
msgid "Copyright:"
msgstr "Avtorstvo:"
-#: src/lib/ecore/ecore_getopt.c:272
+#: src/lib/ecore/ecore_getopt.c:276
msgid "License:"
msgstr "Licenca:"
-#: src/lib/ecore/ecore_getopt.c:453
+#: src/lib/ecore/ecore_getopt.c:457
msgid "Type: "
msgstr "Vrsta:·"
-#: src/lib/ecore/ecore_getopt.c:529
+#: src/lib/ecore/ecore_getopt.c:533
msgid "Default: "
msgstr "Privzeto:·"
-#: src/lib/ecore/ecore_getopt.c:556
+#: src/lib/ecore/ecore_getopt.c:560
msgid "Choices: "
msgstr "Izbire:·"
-#: src/lib/ecore/ecore_getopt.c:657
+#: src/lib/ecore/ecore_getopt.c:661
msgid "Options:\n"
msgstr "Možnosti:\n"
-#: src/lib/ecore/ecore_getopt.c:782
+#: src/lib/ecore/ecore_getopt.c:786
#, c-format
msgid "ERROR: unknown option --%s.\n"
msgstr "NAPAKA:·Neznana možnost·--%s.\n"
-#: src/lib/ecore/ecore_getopt.c:784
+#: src/lib/ecore/ecore_getopt.c:788
#, c-format
msgid "ERROR: unknown option -%c.\n"
msgstr "NAPAKA:·neznana možnost·-%c.\n"
-#: src/lib/ecore/ecore_getopt.c:842
+#: src/lib/ecore/ecore_getopt.c:846
msgid "ERROR: "
msgstr "NAPAKA:"
-#: src/lib/ecore/ecore_getopt.c:925 src/lib/ecore/ecore_getopt.c:1062
-#: src/lib/ecore/ecore_getopt.c:1078 src/lib/ecore/ecore_getopt.c:1093
-#: src/lib/ecore/ecore_getopt.c:1110 src/lib/ecore/ecore_getopt.c:1157
-#: src/lib/ecore/ecore_getopt.c:1277 src/lib/ecore/ecore_getopt.c:1318
+#: src/lib/ecore/ecore_getopt.c:929 src/lib/ecore/ecore_getopt.c:1066
+#: src/lib/ecore/ecore_getopt.c:1082 src/lib/ecore/ecore_getopt.c:1097
+#: src/lib/ecore/ecore_getopt.c:1114 src/lib/ecore/ecore_getopt.c:1161
+#: src/lib/ecore/ecore_getopt.c:1281 src/lib/ecore/ecore_getopt.c:1322
msgid "value has no pointer set.\n"
msgstr "vrednost nima nastavljenega kazalnika.\n"
-#: src/lib/ecore/ecore_getopt.c:957 src/lib/ecore/ecore_getopt.c:1177
+#: src/lib/ecore/ecore_getopt.c:961 src/lib/ecore/ecore_getopt.c:1181
#, c-format
msgid "unknown boolean value %s.\n"
msgstr "neznana Boolova vrednost·%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1008 src/lib/ecore/ecore_getopt.c:1265
+#: src/lib/ecore/ecore_getopt.c:1012 src/lib/ecore/ecore_getopt.c:1269
#, c-format
msgid "invalid number format %s\n"
msgstr "napačen·format števila·%s\n"
-#: src/lib/ecore/ecore_getopt.c:1123
+#: src/lib/ecore/ecore_getopt.c:1127
#, c-format
msgid "invalid choice \"%s\". Valid values are: "
msgstr "napačna izbira·\"%s\".·Pravilne izbire so:·"
-#: src/lib/ecore/ecore_getopt.c:1151
+#: src/lib/ecore/ecore_getopt.c:1155
msgid "missing parameter to append.\n"
msgstr "manjka·parameter·za dodajo.\n"
-#: src/lib/ecore/ecore_getopt.c:1255
+#: src/lib/ecore/ecore_getopt.c:1259
msgid "could not parse value.\n"
msgstr "vrednosti ni bilo možno razčleniti.\n"
-#: src/lib/ecore/ecore_getopt.c:1312
+#: src/lib/ecore/ecore_getopt.c:1316
msgid "missing parameter.\n"
msgstr "manjkajoči·parameter.\n"
-#: src/lib/ecore/ecore_getopt.c:1325
+#: src/lib/ecore/ecore_getopt.c:1329
msgid "missing callback function!\n"
msgstr "manjkajoča povratno-zasilna funkcija !\n"
-#: src/lib/ecore/ecore_getopt.c:1354
+#: src/lib/ecore/ecore_getopt.c:1358
msgid "no version was defined.\n"
msgstr "definirana ni bila nobena različica.\n"
-#: src/lib/ecore/ecore_getopt.c:1371
+#: src/lib/ecore/ecore_getopt.c:1375
msgid "no copyright was defined.\n"
msgstr "definirano ni bilo nobeno avtorstvo.\n"
-#: src/lib/ecore/ecore_getopt.c:1388
+#: src/lib/ecore/ecore_getopt.c:1392
msgid "no license was defined.\n"
msgstr "definirana ni bila nobena licenca.\n"
-#: src/lib/ecore/ecore_getopt.c:1463
+#: src/lib/ecore/ecore_getopt.c:1467
#, c-format
msgid "ERROR: unknown option --%s, ignored.\n"
msgstr "NAPAKA:·neznana možnost·--%s,·prezrto.\n"
-#: src/lib/ecore/ecore_getopt.c:1496
+#: src/lib/ecore/ecore_getopt.c:1500
#, c-format
msgid "ERROR: option --%s requires an argument!\n"
msgstr "NAPAKA:·možnost·--%s·zahteva argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1538
+#: src/lib/ecore/ecore_getopt.c:1542
#, c-format
msgid "ERROR: unknown option -%c, ignored.\n"
msgstr "NAPAKA:·neznana možnost·-%c,·prezrto.\n"
-#: src/lib/ecore/ecore_getopt.c:1576
+#: src/lib/ecore/ecore_getopt.c:1580
#, c-format
msgid "ERROR: option -%c requires an argument!\n"
msgstr "NAPAKA:·možnost·-%c zahteva argument!\n"
-#: src/lib/ecore/ecore_getopt.c:1785
+#: src/lib/ecore/ecore_getopt.c:1789
msgid "ERROR: no parser provided.\n"
msgstr "NAPAKA:·ni podan razčlenjevalnik.\n"
-#: src/lib/ecore/ecore_getopt.c:1790
+#: src/lib/ecore/ecore_getopt.c:1794
msgid "ERROR: no values provided.\n"
msgstr "NAPAKA::·ni podanih vrednosti.\n"
-#: src/lib/ecore/ecore_getopt.c:1799
+#: src/lib/ecore/ecore_getopt.c:1803
msgid "ERROR: no arguments provided.\n"
msgstr "NAPAKA::·ni podanih argumentov.\n"
-#: src/lib/ecore/ecore_getopt.c:1825
+#: src/lib/ecore/ecore_getopt.c:1829
msgid "ERROR: invalid options found."
msgstr "NAPAKA::·najdene nepravilne možnosti"
-#: src/lib/ecore/ecore_getopt.c:1831
+#: src/lib/ecore/ecore_getopt.c:1835
#, c-format
msgid " See --%s.\n"
msgstr "·Glej·--%s.\n"
-#: src/lib/ecore/ecore_getopt.c:1833
+#: src/lib/ecore/ecore_getopt.c:1837
#, c-format
msgid " See -%c.\n"
msgstr "·Glej·-%c.\n"
-#: src/lib/ecore/ecore_getopt.c:1874
+#: src/lib/ecore/ecore_getopt.c:1879
#, c-format
msgid "ERROR: incorrect geometry value '%s'\n"
msgstr "NAPAKA::·nepravilna geometrijska vrednost·'%s'\n"
-#: src/lib/ecore/ecore_getopt.c:1901
+#: src/lib/ecore/ecore_getopt.c:1907
#, c-format
msgid "ERROR: incorrect size value '%s'\n"
msgstr "NAPAKA::·nepravilna vrednost velikosti·'%s'\n"
ecore_animator_example.c \
ecore_fd_handler_example.c \
ecore_poller_example.c \
- ecore_event_example.c \
+ ecore_event_example_01.c \
+ ecore_event_example_02.c \
ecore_idler_example.c \
ecore_timer_example.c \
ecore_time_functions_example.c \
ecore_animator_example \
ecore_fd_handler_example \
ecore_poller_example \
- ecore_event_example \
+ ecore_event_example_01 \
+ ecore_event_example_02 \
ecore_idler_example \
ecore_job_example \
ecore_timer_example \
evas_object_show(bg);
ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
- ecore_main_fd_handler_add(STDIN_FILENO,
- ECORE_FD_READ | ECORE_FD_ERROR,
- _stdin_cb,
- NULL, NULL, NULL);
+ ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _stdin_cb, NULL, NULL, NULL);
ecore_main_loop_begin();
--- /dev/null
+/*
+ * Compile with:
+ * gcc -g -Wall `pkg-config --cflags --libs ecore` -o ecore_event_example ecore_event_example.c
+ */
+
+#include <Ecore.h>
+
+static Eina_Bool
+_quitter(void *data, int ev_type, void *event)
+{
+ printf("Leaving already?\n");
+ ecore_main_loop_quit();
+ return ECORE_CALLBACK_DONE;
+}
+
+int
+main(int argc, char **argv)
+{
+ ecore_init();
+
+ ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _quitter, NULL);
+ ecore_main_loop_begin();
+
+ return 0;
+}
--- /dev/null
+#include <Ecore.h>
+#include <unistd.h>
+
+struct context { // helper struct to give some context to the callbacks
+ const char *str1, *str2;
+ Ecore_Event_Handler *handler1;
+ Ecore_Event_Handler *handler2;
+};
+
+static _event_type = 0; // a new type of event will be defined and stored here
+
+static Eina_Bool
+_event_handler1_cb(void *data, int type, void *event)
+{
+ int *number = event;
+ const char *str = data;
+
+ printf("event_handler1: number=%d, data=\"%s\".\n", *number, str);
+
+ if ((*number % 2) == 0)
+ return ECORE_CALLBACK_DONE;
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
+static Eina_Bool
+_event_handler2_cb(void *data, int type, void *event) // event callback
+{
+ struct context *ctxt = data;
+ int *number = event;
+
+ printf("event_handler2: number=%d.\n", *number);
+
+ if (*number == 5)
+ {
+ const char *old = NULL;
+ old = ecore_event_handler_data_set(ctxt->handler1, (void *)ctxt->str2);
+ printf("changed handler1 data from \"%s\" to \"%s\".\n",
+ old, ctxt->str2);
+ }
+ else if (*number >= 10)
+ {
+ printf("finish main loop.\n");
+ ecore_main_loop_quit();
+ }
+
+ return ECORE_CALLBACK_DONE; // same as EINA_FALSE
+}
+
+int main(int argc, char **argv)
+{
+ struct context ctxt = {0};
+ int i;
+ ctxt.str1 = "dataone";
+ ctxt.str2 = "datatwo";
+
+ if (!ecore_init())
+ {
+ printf("ERROR: Cannot init Ecore!\n");
+ return -1;
+ }
+
+ _event_type = ecore_event_type_new();
+
+ ctxt.handler1 = ecore_event_handler_add(_event_type,
+ _event_handler1_cb,
+ ctxt.str1);
+ ctxt.handler2 = ecore_event_handler_add(_event_type,
+ _event_handler2_cb,
+ &ctxt);
+
+ for (i = 0; i <= 15; i++)
+ {
+ int *event_data = malloc(sizeof(*event_data));
+ *event_data = i;
+ ecore_event_add(_event_type, event_data, NULL, NULL);
+ }
+
+ printf("start the main loop.\n");
+
+ ecore_main_loop_begin();
+
+ ecore_shutdown();
+
+ return 0;
+}
if (ctxt->timer)
ctxt->timer = NULL;
- return ECORE_CALLBACK_CANCEL; // same as EINA_TRUE
+ return ECORE_CALLBACK_CANCEL; // same as EINA_FALSE
}
int main(int argc, char **argv)
@li @ref Ecore_Main_Loop_Group
@li @ref Ecore_File_Group
@li @ref Ecore_Con_Group
- @li @link Ecore_Evas.h Ecore_Evas - Evas convenience functions. @endlink
+ @li @ref Ecore_Evas_Group
@li @ref Ecore_FB_Group
@li @link Ecore_Ipc.h Ecore_IPC - Inter Process Communication functions. @endlink
@li @link Ecore_X.h Ecore_X - X Windows System wrapper. @endlink
*/
/**
- @page Ecore_Main_Loop_Page The Ecore Main Loop
-
- @section intro What is Ecore?
-
- Ecore is a clean and tiny event loop library with many modules to do lots of
- convenient things for a programmer, to save time and effort.
-
- It's small and lean, designed to work on embedded systems all the way to
- large and powerful multi-cpu workstations. It serialises all system signals,
- events etc. into a single event queue, that is easily processed without
- needing to worry about concurrency. A properly written, event-driven program
- using this kind of programming doesn't need threads, nor has to worry about
- concurrency. It turns a program into a state machine, and makes it very
- robust and easy to follow.
-
- Ecore gives you other handy primitives, such as timers to tick over for you
- and call specified functions at particular times so the programmer can use
- this to do things, like animate, or time out on connections or tasks that take
- too long etc.
-
- Idle handlers are provided too, as well as calls on entering an idle state
- (often a very good time to update the state of the program). All events that
- enter the system are passed to specific callback functions that the program
- sets up to handle those events. Handling them is simple and other Ecore
- modules produce more events on the queue, coming from other sources such as
- file descriptors etc.
-
- Ecore also lets you have functions called when file descriptors become active
- for reading or writing, allowing for streamlined, non-blocking IO.
-
- Here is an example of a simple program and its basic event loop flow:
-
- @image html prog_flow.png
- @image latex prog_flow.eps width=\textwidth
-
-
-
- @section work How does Ecore work?
-
- Ecore is very easy to learn and use. All the function calls are designed to
- be easy to remember, explicit in describing what they do, and heavily
- name-spaced. Ecore programs can start and be very simple.
-
- For example:
-
- @code
- #include <Ecore.h>
-
- int
- main(int argc, const char **argv)
- {
- ecore_init();
- ecore_app_args_set(argc, argv);
- ecore_main_loop_begin();
- ecore_shutdown();
- return 0;
- }
- @endcode
-
- This program is very simple and doesn't check for errors, but it does start up
- and begin a main loop waiting for events or timers to tick off. This program
- doesn't set up any, but now we can expand on this simple program a little
- more by adding some event handlers and timers.
-
- @code
- #include <Ecore.h>
-
- Ecore_Timer *timer1 = NULL;
- Ecore_Event_Handler *handler1 = NULL;
- double start_time = 0.0;
-
- int
- timer_func(void *data)
- {
- printf("Tick timer. Sec: %3.2f\n", ecore_time_get() - start_time);
- return 1;
- }
-
- int
- exit_func(void *data, int ev_type, void *ev)
- {
- Ecore_Event_Signal_Exit *e;
-
- e = (Ecore_Event_Signal_Exit *)ev;
- if (e->interrupt) printf("Exit: interrupt\n");
- else if (e->quit) printf("Exit: quit\n");
- else if (e->terminate) printf("Exit: terminate\n");
- ecore_main_loop_quit();
- return 1;
- }
-
- int
- main(int argc, const char **argv)
- {
- ecore_init();
- ecore_app_args_set(argc, argv);
- start_time = ecore_time_get();
- handler1 = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL);
- timer1 = ecore_timer_add(0.5, timer_func, NULL);
- ecore_main_loop_begin();
- ecore_shutdown();
- return 0;
- }
- @endcode
-
- In the previous example, we initialize our application and get the time at
- which our program has started so we can calculate an offset. We set
- up a timer to tick off in 0.5 seconds, and since it returns 1, will
- keep ticking off every 0.5 seconds until it returns 0, or is deleted
- by hand. An event handler is set up to call a function -
- exit_func(),
- whenever an event of type ECORE_EVENT_SIGNAL_EXIT is received (CTRL-C
- on the command line will cause such an event to happen). If this event
- occurs it tells you what kind of exit signal was received, and asks
- the main loop to quit when it is finished by calling
- ecore_main_loop_quit().
-
- The handles returned by ecore_timer_add() and
- ecore_event_handler_add() are
- only stored here as an example. If you don't need to address the timer or
- event handler again you don't need to store the result, so just call the
- function, and don't assign the result to any variable.
-
- This program looks slightly more complex than needed to do these simple
- things, but in principle, programs don't get any more complex. You add more
- event handlers, for more events, will have more timers and such, BUT it all
- follows the same principles as shown in this example.
-
+ * @page Ecore_Main_Loop_Page The Ecore Main Loop
+ *
+ * @section intro What is Ecore?
+ *
+ * Ecore is a clean and tiny event loop library with many modules to do lots of
+ * convenient things for a programmer, to save time and effort. It's small and
+ * lean, designed to work from embedded systems all the way up to large and
+ * powerful multi-cpu workstations. The main loop has a number of primitives to
+ * be used with its main loop. It serializes all the primitives and allows for
+ * great responsiveness without the need for threads(or any other concurrency).
+ *
+ * @subsection timers Timers
+ *
+ * Timers serve two main purposes: doing something at a specified time and
+ * repeatedly doing something with a set interval.
+ * @see Ecore_Timer_Group
+ *
+ * @subsection poolers Poolers
+ *
+ * Poolers allow for pooling to be centralized into a single place therefore
+ * alleviating the need for different parts of the program to wake up at
+ * different times to do pooling, thereby making the code simpler and more
+ * efficient.
+ * @see Ecore_Poller_Group
+ *
+ * @subsection idler Idlers
+ *
+ * There are three types of idlers, enterers, idlers(proper) and exiters, they
+ * are called, respectively, when the program is about to enter an idle state,
+ * when the program is idle and when the program is leaving an idle state. Idler
+ * enterers are usually a good place to update the program state. Proper idlers
+ * are the appropriate place to do heavy computational tasks thereby using what
+ * would otherwise be wasted CPU cycles. Exiters are the perfect place to do
+ * anything your program should do just before processing events(also timers,
+ * poolers, file descriptor handlers and animators)
+ * @see Ecore_Idle_Group
+ *
+ * @subsection fd_handler File descriptor handlers
+ *
+ * File descriptor handlers allow you to monitor when there is data available to
+ * read on file descriptors, when writing will not block or if there was an
+ * error. Any valid file descriptor can be used with this API, regardless of if
+ * was gotten with an OS specific API or from ecore.
+ * @see Ecore_FD_Handler_Group
+ *
+ * @subsection animators Animators
+ *
+ * Ecore provides a facility called animators, so named since the intended use
+ * was in animations, that facilitates knowing what percentage of a given
+ * interval has elapsed. This is perfect for performing animations, but is not
+ * limited to that use, it can, for example, also be used to create a progress
+ * bar.
+ * @see Ecore_Animator_Group
+ *
+ * @subsection ev_handlers Event handlers
+ *
+ * Event handlers are, arguably, the most important feature of the ecore main
+ * loop, they are what allows the programmer to easily handle user interaction.
+ * Events however are not only things the user does, events can represent
+ * anything for which a type is created.
+ * @see Ecore_Event_Group
+ *
+ * All of these primitives are discussed in more detail in their respective
+ * pages linked above.
+ *
+ * Here is a diagram of the main loop flow of a simple program:
+ *
+ * @image html prog_flow.png
+ * @image latex prog_flow.eps width=\textwidth
+ *
+ *
+ *
+ * @section work How does Ecore work?
+ *
+ * Ecore is very easy to learn and use. All the function calls are designed to
+ * be easy to remember, explicit in describing what they do, and heavily
+ * name-spaced. Ecore programs can start and be very simple.
+ *
+ * For example:
+ *
+ * @code
+ * #include <Ecore.h>
+ *
+ * int
+ * main(int argc, const char **argv)
+ * {
+ * ecore_init();
+ * ecore_app_args_set(argc, argv);
+ * ecore_main_loop_begin();
+ * ecore_shutdown();
+ * return 0;
+ * }
+ * @endcode
+ *
+ * This program is very simple and doesn't check for errors, but it does start up
+ * and begin a main loop waiting for events or timers to tick off. This program
+ * doesn't set up any, but now we can expand on this simple program a little
+ * more by adding some event handlers and timers.
+ *
+ * @code
+ * #include <Ecore.h>
+ *
+ * Ecore_Timer *timer1 = NULL;
+ * Ecore_Event_Handler *handler1 = NULL;
+ * double start_time = 0.0;
+ *
+ * int
+ * timer_func(void *data)
+ * {
+ * printf("Tick timer. Sec: %3.2f\n", ecore_time_get() - start_time);
+ * return 1;
+ * }
+ *
+ * int
+ * exit_func(void *data, int ev_type, void *ev)
+ * {
+ * Ecore_Event_Signal_Exit *e;
+ *
+ * e = (Ecore_Event_Signal_Exit *)ev;
+ * if (e->interrupt) printf("Exit: interrupt\n");
+ * else if (e->quit) printf("Exit: quit\n");
+ * else if (e->terminate) printf("Exit: terminate\n");
+ * ecore_main_loop_quit();
+ * return 1;
+ * }
+ *
+ * int
+ * main(int argc, const char **argv)
+ * {
+ * ecore_init();
+ * ecore_app_args_set(argc, argv);
+ * start_time = ecore_time_get();
+ * handler1 = ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_func, NULL);
+ * timer1 = ecore_timer_add(0.5, timer_func, NULL);
+ * ecore_main_loop_begin();
+ * ecore_shutdown();
+ * return 0;
+ * }
+ * @endcode
+ *
+ * In the previous example, we initialize our application and get the time at
+ * which our program has started so we can calculate an offset. We set
+ * up a timer to tick off in 0.5 seconds, and since it returns 1, will
+ * keep ticking off every 0.5 seconds until it returns 0, or is deleted
+ * by hand. An event handler is set up to call a function -
+ * exit_func(),
+ * whenever an event of type ECORE_EVENT_SIGNAL_EXIT is received (CTRL-C
+ * on the command line will cause such an event to happen). If this event
+ * occurs it tells you what kind of exit signal was received, and asks
+ * the main loop to quit when it is finished by calling
+ * ecore_main_loop_quit().
+ *
+ * The handles returned by ecore_timer_add() and
+ * ecore_event_handler_add() are
+ * only stored here as an example. If you don't need to address the timer or
+ * event handler again you don't need to store the result, so just call the
+ * function, and don't assign the result to any variable.
+ *
+ * This program looks slightly more complex than needed to do these simple
+ * things, but in principle, programs don't get any more complex. You add more
+ * event handlers, for more events, will have more timers and such, BUT it all
+ * follows the same principles as shown in this example.
+ *
*/
/*
@page Ecore_Config_Page The Enlightened Property Library
- The Enlightened Property Library (Ecore_Config) is an adbstraction
+ The Enlightened Property Library (Ecore_Config) is an abstraction
from the complexities of writing your own configuration. It provides
many features using the Enlightenment 17 development libraries.
# include <signal.h>
#else
# include <sys/time.h>
-# include <signal.h>
+# if !defined (EXOTIC_NO_SIGNAL)
+# include <signal.h>
+# endif
#endif
#include <sys/types.h>
*/
/**
+ * @defgroup Ecore_Main_Loop_Group Ecore main loop
*
- * @defgroup Ecore_Main_Loop_Group Ecore main loop functions
- *
- * These are functions acting on Ecore's main loop itself or on
- * events and infrastructure directly linked to it. This loop is
- * designed to work on embedded systems all the way to large and
- * powerful multi-cpu workstations.
- *
- * It serialises all system signals and events into a single event
- * queue, that can be easily processed without needing to worry
- * about concurrency. A properly written, event-driven program
- * using this kind of programming does not need threads. It makes
- * the program very robust and easy to follow.
+ * This group discusses functions that are acting on Ecore's main loop itself or
+ * on events and infrastructure directly linked to it. Most programs only need
+ * to start and end the main loop, the rest of the function discussed here are
+ * meant to be used in special situations, and with great care.
*
- * For example, for the main loop to be of any use, you need to be
- * able to add @b events and event handlers on it. Events for file
- * descriptor events are covered in @ref Ecore_FD_Handler_Group.
- *
- * Timer functions are covered in @ref Ecore_Time_Group.
- *
- * There is also provision for callbacks for when the loop enters or
- * exits an @b idle state. See @ref Ecore_Idle_Group for more
- * information on it.
- *
- * Functions are also provided for spawning child processes using
- * @c fork(). See @ref Ecore_Exe_Group for more details on it.
- *
- * Here is an example of simple program and its basic event loop
- * flow:
- *
- * @image html prog_flow.png
- * @image latex prog_flow.eps width=\textwidth
- *
- * For examples of setting up and using a main loop, see
- * @ref Ecore_Main_Loop_Page.
+ * For details on the usage of ecore's main loop and how it interacts with other
+ * ecore facilities see: @ref Ecore_Main_Loop_Page.
*
* @{
*/
#define ECORE_VERSION_MAJOR 1
-#define ECORE_VERSION_MINOR 0
+#define ECORE_VERSION_MINOR 2
typedef struct _Ecore_Version
{
* in this thread, if the main loop was suspended correctly. If not, it return @c -1.
*
* This function suspend the main loop in a know state, this let you
- * use any EFL call you want after it return. Be carefull, the main loop
+ * use any EFL call you want after it return. Be carefully, the main loop
* is blocked until you call ecore_thread_main_loop_end(). This is
* the only sane way to achieve pseudo thread safety.
*
* the main loop is unlocked again. @c -1 will be returned if you are trying to unlock
* when there wasn't enough call to ecore_thread_main_loop_begin().
*
- * After a call to ecore_thread_main_loop_begin(), you need to absolutly
+ * After a call to ecore_thread_main_loop_begin(), you need to absolutely
* call ecore_thread_main_loop_end(), or you application will stay frozen.
*/
EAPI int ecore_thread_main_loop_end(void);
/**
* @defgroup Ecore_Event_Group Ecore Event functions
*
- * Ecore events are used to wake up the Ecore main loop to warn
- * about state changes, tasks completed, data available for reading
- * or writing, etc. They are the base of the event oriented
- * programming.
- *
- * The idea is to write many functions (callbacks) that will be
- * registered to specific events, and called when these events
- * happen. This way, when the system state changes (a mouse click is
- * detected, a key is pressed, or the content of a file changes, for
- * example), the respective callbacks will be called with some
- * information about that event. Usually the function/callback will
- * have a data pointer to the event info (the position in the screen
- * where the mouse was clicked, the name of the key that was
- * pressed, or the name of the file that has changed).
- *
- * The basic usage, when one needs to watch for an existing event,
- * is to register a callback to it using ecore_event_add(). Of
- * course it's necessary to know beforehand what are the types of
- * events that the system/library will emmit. This should be
- * available with the documentation from that system/library.
- *
- * When writing a library or group of functions that need to inform
- * about something, and you already are running on top of a main
- * loop, it is usually a good approach to use events. This way you
- * allow others to register as many callbacks as necessary to this
- * event, and don't have to care about who is registering to it. The
- * functions ecore_event_type_new() and ecore_event_add() are
- * available for this purpose.
- *
- * Example that deals with events:
- *
- * @li @ref ecore_event_example_c
+ * Ecore events provide two main features that are of use to those using ecore:
+ * creating events and being notified of events. Those two will usually be used
+ * in different contexts, creating events is mainly done by libraries wrapping
+ * some system functionality while being notified of events is mainly a
+ * necessity of applications.
+ *
+ * For a program to be notified of events it's interested in it needs to have a
+ * function to process the event and to register that function as the callback
+ * to the event, that's all:
+ * @code
+ * ecore_event_handler_add(EVENT_TYPE, _my_event_handler, some_data);
+ * ...
+ * static Eina_Bool
+ * _my_event_handler(void *data, int type, void *event)
+ * {
+ * //data is some_data
+ * //event is provided by whoever created the event
+ * //Do really cool stuff with event
+ * }
+ * @endcode
+ *
+ * One very important thing to note here is the @c EVENT_TYPE, to register a
+ * handler for an event you must know its type before hand. Ecore provides
+ * the following events which are emitted in response to POSIX
+ * signals(https://en.wikipedia.org/wiki/Signal_%28computing%29):
+ * @li @b ECORE_EVENT_SIGNAL_USER
+ * @li @b ECORE_EVENT_SIGNAL_HUP
+ * @li @b ECORE_EVENT_SIGNAL_POWER
+ * @li @b ECORE_EVENT_SIGNAL_EXIT
+ *
+ * @warning Don't override these using the @c signal or @c sigaction calls.
+ * These, however, aren't the only signals one can handle. Many
+ * libraries(including ecore modules) have their own signals that can be
+ * listened for and handled, to do that one only needs to know the type of the
+ * event. This information can be found on the documentation of the library
+ * emitting the signal, so, for example, for events related to windowing one
+ * would look in @ref Ecore_Evas_Group.
+ *
+ * Examples of libraries that integrate into ecore's main loop by providing
+ * events are @ref Ecore_Con_Group, @ref Ecore_Evas_Group and @ref
+ * Ecore_Exe_Group, amongst others. This usage can be divided into two parts,
+ * setup and adding events. The setup is very simple, all that needs doing is
+ * getting a type id for the event:
+ * @code
+ * int MY_EV_TYPE = ecore_event_type_new();
+ * @endcode
+ * @note This variable should be declared in the header since it'll be needed by
+ * anyone wishing to register a handler to your event.
+ *
+ * The complexity of adding of an event to the queue depends on whether that
+ * event sends uses @c event, if it doesn't it a one-liner:
+ * @code
+ * ecore_event_add(MY_EV_TYPE, NULL, NULL, NULL);
+ * @endcode
+ * The usage when an @c event is needed is not that much more complex and can be
+ * seen in @ref ecore_event_add.
+ *
+ * Examples that deals with events:
+ * @li @ref ecore_event_example_01_c
+ * @li @ref ecore_event_example_02_c
*
* @ingroup Ecore_Main_Loop_Group
*
int number; /**< The signal number. Either 1 or 2 */
void *ext_data; /**< Extension data - not used */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
{
void *ext_data; /**< Extension data - not used */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
{
Eina_Bool interrupt : 1; /**< Set if the exit request was an interrupt signal*/
Eina_Bool quit : 1; /**< set if the exit request was a quit signal */
- Eina_Bool terminate : 1; /**< Set if the exit request was a terminate singal */
+ Eina_Bool terminate : 1; /**< Set if the exit request was a terminate signal */
void *ext_data; /**< Extension data - not used */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
{
void *ext_data; /**< Extension data - not used */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
{
int num; /**< The realtime signal's number */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
+/**
+ * @brief Add an event handler.
+ * @param type The type of the event this handler will get called for
+ * @param func The function to call when the event is found in the queue
+ * @param data A data pointer to pass to the called function @p func
+ * @return A new Event handler, or NULL on failure
+ *
+ * Add an event handler to the list of handlers. This will, on success, return
+ * a handle to the event handler object that was created, that can be used
+ * later to remove the handler using ecore_event_handler_del(). The @p type
+ * parameter is the integer of the event type that will trigger this callback
+ * to be called. The callback @p func is called when this event is processed
+ * and will be passed the event type, a pointer to the private event
+ * structure that is specific to that event type, and a data pointer that is
+ * provided in this call as the @p data parameter.
+ *
+ * When the callback @p func is called, it must return 1 or 0. If it returns
+ * 1 (or ECORE_CALLBACK_PASS_ON), It will keep being called as per normal, for
+ * each handler set up for that event type. If it returns 0 (or
+ * ECORE_CALLBACK_DONE), it will cease processing handlers for that particular
+ * event, so all handler set to handle that event type that have not already
+ * been called, will not be.
+ */
EAPI Ecore_Event_Handler *ecore_event_handler_add(int type, Ecore_Event_Handler_Cb func, const void *data);
+/**
+ * @brief Delete an event handler.
+ * @param event_handler Event handler handle to delete
+ * @return Data passed to handler
+ *
+ * Delete a specified event handler from the handler list. On success this will
+ * delete the event handler and return the pointer passed as @p data when the
+ * handler was added by ecore_event_handler_add(). On failure NULL will be
+ * returned. Once a handler is deleted it will no longer be called.
+ */
EAPI void *ecore_event_handler_del(Ecore_Event_Handler *event_handler);
+/**
+ * @brief Add an event to the event queue.
+ * @param type The event type to add to the end of the event queue
+ * @param ev The data structure passed as @c event to event handlers
+ * @param func_free The function to be called to free @a ev
+ * @param data The data pointer to be passed to the free function
+ * @return A Handle for that event on success, otherwise NULL
+ *
+ * If it succeeds, an event of type @a type will be added to the queue for
+ * processing by event handlers added by ecore_event_handler_add(). The @a ev
+ * parameter will be passed as the @c event parameter of the handler. When the
+ * event is no longer needed, @a func_free will be called and passed @a ev for
+ * cleaning up. If @p func_free is NULL, free() will be called with the private
+ * structure pointer.
+ */
EAPI Ecore_Event *ecore_event_add(int type, void *ev, Ecore_End_Cb func_free, void *data);
+/**
+ * @brief Delete an event from the queue.
+ * @param event The event handle to delete
+ * @return The data pointer originally set for the event free function
+ *
+ * This deletes the event @p event from the event queue, and returns the
+ * @p data parameter originally set when adding it with ecore_event_add(). This
+ * does not immediately call the free function, and it may be called later on
+ * cleanup, and so if the free function depends on the data pointer to work,
+ * you should defer cleaning of this till the free function is called later.
+ */
EAPI void *ecore_event_del(Ecore_Event *event);
+/**
+ * @brief Get the data associated with an #Ecore_Event_Handler
+ * @param eh The event handler
+ * @return The data
+ *
+ * This function returns the data previously associated with @p eh by
+ * ecore_event_handler_add().
+ */
EAPI void *ecore_event_handler_data_get(Ecore_Event_Handler *eh);
+/**
+ * @brief Set the data associated with an #Ecore_Event_Handler
+ * @param eh The event handler
+ * @param data The data to associate
+ * @return The previous data
+ *
+ * This function sets @p data to @p eh and returns the old data pointer
+ * which was previously associated with @p eh by ecore_event_handler_add().
+ */
EAPI void *ecore_event_handler_data_set(Ecore_Event_Handler *eh, const void *data);
+/**
+ * @brief Allocate a new event type id sensibly and return the new id.
+ * @return A new event type id.
+ *
+ * This function allocates a new event type id and returns it. Once an event
+ * type has been allocated it can never be de-allocated during the life of
+ * the program. There is no guarantee of the contents of this event ID, or how
+ * it is calculated, except that the ID will be unique to the current instance
+ * of the process.
+ */
EAPI int ecore_event_type_new(void);
+/**
+ * @brief Add a filter the current event queue.
+ *
+ * @param func_start Function to call just before filtering and return data
+ * @param func_filter Function to call on each event
+ * @param func_end Function to call after the queue has been filtered
+ * @param data Data to pass to the filter functions
+ * @return A filter handle on success, NULL otherwise
+ *
+ * Adds a callback to filter events from the event queue. Filters are called on
+ * the queue just before Event handler processing to try and remove redundant
+ * events. Just as processing is about to start @a func_start is called and
+ * passed the @a data pointer, the return value of this functions is passed to
+ * @a func_filter as loop_data. @a func_filter is also passed @a data and the
+ * event type and event structure. If this @a func_filter returns #EINA_FALSE,
+ * the event is removed from the queue, if it returns #EINA_TRUE, the event is
+ * kept. When processing is finished @p func_end is called and is passed the
+ * loop_data(returned by @c func_start) and @p data pointer to clean up.
+ */
EAPI 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);
+/**
+ * @brief Delete an event filter.
+ * @param ef The event filter handle
+ * @return The data set for the filter on success, NULL otherwise
+ *
+ * Delete a filter that has been added by its @p ef handle.
+ */
EAPI void *ecore_event_filter_del(Ecore_Event_Filter *ef);
+/**
+ * @brief Return the current event type being handled.
+ * @return The current event type being handled if inside a handler callback,
+ * ECORE_EVENT_NONE otherwise
+ *
+ * If the program is currently inside an Ecore event handler callback this
+ * will return the type of the current event being processed.
+ *
+ * This is useful when certain Ecore modules such as Ecore_Evas "swallow"
+ * events and not all the original information is passed on. In special cases
+ * this extra information may be useful or needed and using this call can let
+ * the program know if the event type being handled is one it wants to get more
+ * information about.
+ */
EAPI int ecore_event_current_type_get(void);
+/**
+ * @brief Return the current event type pointer handled.
+ * @return The current event pointer being handled if inside a handler callback,
+ * NULL otherwise
+ *
+ * If the program is currently inside an Ecore event handler callback this
+ * will return the pointer of the current event being processed.
+ *
+ * This is useful when certain Ecore modules such as Ecore_Evas "swallow"
+ * events and not all the original information is passed on. In special cases
+ * this extra information may be useful or needed and using this call can let
+ * the program access the event data if the type of the event is handled by
+ * the program.
+ */
EAPI void *ecore_event_current_event_get(void);
/**
* @{
*/
- #define ECORE_EXE_PRIORITY_INHERIT 9999
+/** Inherit priority from parent process */
+#define ECORE_EXE_PRIORITY_INHERIT 9999
EAPI extern int ECORE_EXE_EVENT_ADD; /**< A child process has been added */
EAPI extern int ECORE_EXE_EVENT_DEL; /**< A child process has been deleted (it exited, naming consistent with the rest of ecore). */
Eina_Bool exited : 1; /** < set to 1 if the process exited of its own accord */
Eina_Bool signalled : 1; /** < set to 1 id the process exited due to uncaught signal */
void *ext_data; /**< Extension data - not used */
-#if !defined (_WIN32) && !defined (__lv2ppu__)
+#if !defined (_WIN32) && !defined (__lv2ppu__) && !defined (EXOTIC_NO_SIGNAL)
siginfo_t data; /**< Signal info */
#endif
};
/**
* @defgroup Ecore_FD_Handler_Group File Event Handling Functions
*
- * Functions that deal with file descriptor handlers.
+ * @brief Functions that deal with file descriptor handlers.
+ *
+ * File descriptor handlers facilitate reading, writing and checking for errors
+ * without blocking the program or doing expensive pooling. This can be used to
+ * monitor a socket, pipe, or other stream for which an FD can be had.
*
- * The @ref Ecore_Fd_Handler can be used to watch a file descriptor
- * for data available for reading, for the availability to write
- * without blocking, and for errors on the file descriptor.
+ * @warning This function @b can't be used for monitoring to regular files!
*
- *ecore_main_fd_handler_add() is used to setup a handler for a
- * given file descriptor. This file descriptor can be the standard
- * input, a network socket, a stream received through some driver
- * of a hardware decoder, etc. Thus it can contain errors, like a
- * disconnection, a broken pipe, and so, and that's why it's
- * possible to check for these errors with the @ref ECORE_FD_ERROR
- * flag.
+ * One common FD to be monitored is the standard input(stdin), monitoring it for
+ * reading requires a single call:
+ * @code
+ * static Eina_Bool
+ * _my_cb_func(void *data, Ecore_Fd_Handler *handler)
+ * {
+ * char c;
+ * scanf("%c", &c); //Guaranteed not to block
+ * ... do stuff with c ...
+ * }
+ * ecore_main_fd_handler_add(STDIN_FILENO, ECORE_FD_READ, _my_cb_func, NULL, NULL, NULL);
+ * @endcode
*
- * An @ref Ecore_Fd_Handler can be used to watch on a file
- * descriptor without blocking, still being able to receive events,
- * expire timers, and other watch for other things that happen in
- * the Ecore main loop.
+ * When using a socket, pipe or other stream it's important to remember that
+ * errors may occur and as such to monitor not only for reading/writing but also
+ * for errors using the @ref ECORE_FD_ERROR flag.
*
* Example of use of a file descriptor handler:
* @li @ref ecore_fd_handler_example_c
*/
typedef Eina_Bool (*Ecore_Win32_Handle_Cb)(void *data, Ecore_Win32_Handler *wh);
+/**
+ * @brief Adds a callback for activity on the given file descriptor.
+ *
+ * @param fd The file descriptor to watch.
+ * @param flags To monitor it for reading use @c ECORE_FD_READ, for writing @c
+ * ECORE_FD_WRITE, and for error @c ECORE_FD_ERROR. Values bay |(ored).
+ * @param func The callback function.
+ * @param data The data to pass to the callback.
+ * @param buf_func The function to call to check if any data has been buffered
+ * and already read from the fd. May be @c NULL.
+ * @param buf_data The data to pass to the @p buf_func function.
+ * @return A fd handler handle on success, @c NULL otherwise.
+ *
+ * @a func will be called during the execution of @ref Ecore_Main_Loop_Page
+ * when the file descriptor is available for reading, writing, or there has been
+ * an error(depending on the given @a flags).
+ *
+ * When @a func returns ECORE_CALLBACK_CANCEL, it indicates that the
+ * handler should be marked for deletion (identical to calling @ref
+ * ecore_main_fd_handler_del).
+ *
+ * @warning @a buf_func is meant for @b internal use only and should be @b
+ * avoided.
+ *
+ * The return value of @a buf_func has a different meaning, when it returns
+ * ECORE_CALLBACK_CANCEL, it indicates that @a func @b shouldn't be called, and
+ * when it returns ECORE_CALLBACK_RENEW it indicates @a func should be called.
+ * The return value of @a buf_func will not cause the FD handler to be deleted.
+ *
+ * @a buf_func is called during event loop handling to check if data that has
+ * been read from the file descriptor is in a buffer and is available to read.
+ * Some systems, notably xlib, handle their own buffering, and would otherwise
+ * not work with select(). These systems should use a @a buf_func. This is a
+ * most annoying hack, only ecore_x uses it, so refer to that for an example.
+ */
EAPI 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);
+/**
+ * @brief Set the prepare callback with data for a given #Ecore_Fd_Handler
+ *
+ * @param fd_handler The fd handler
+ * @param func The prep function
+ * @param data The data to pass to the prep function
+ *
+ * This function will be called prior to any fd handler's callback function
+ * (even the other fd handlers), before entering the main loop select function.
+ *
+ * @note Once a prepare callback is set for a fd handler, it cannot be changed.
+ * You need to delete the fd handler and create a new one, to set another
+ * callback.
+ * @note You probably don't need this function. It is only necessary for very
+ * uncommon cases that need special behavior.
+ */
EAPI void ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Prep_Cb func, const void *data);
+/**
+ * @brief Marks an FD handler for deletion.
+ * @param fd_handler The FD handler.
+ * @return The data pointer set using @ref ecore_main_fd_handler_add, for @a
+ * fd_handler on success, @c NULL otherwise.
+ * This function marks an fd handler to be deleted during an iteration of the
+ * main loop. It does NOT close the associated fd!
+ *
+ * @warning If the underlying fd is already closed ecore may complain if the
+ * main loop is using epoll internally, and also in some rare cases this may
+ * cause crashes and instability. Remember to delete your fd handlers before the
+ * fds they listen to are closed.
+ */
EAPI void *ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler);
+/**
+ * @brief Retrieves the file descriptor that the given handler is handling.
+ * @param fd_handler The given FD handler.
+ * @return The file descriptor the handler is watching.
+ */
EAPI int ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler);
+/**
+ * @brief Gets which flags are active on an FD handler.
+ * @param fd_handler The given FD handler.
+ * @param flags The flags, @c ECORE_FD_READ, @c ECORE_FD_WRITE or @c
+ * ECORE_FD_ERROR to query.
+ * @return #EINA_TRUE if any of the given flags are active, #EINA_FALSE
+ * otherwise.
+ */
EAPI Eina_Bool ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
+/**
+ * @brief Set what active streams the given FD handler should be monitoring.
+ * @param fd_handler The given FD handler.
+ * @param flags The flags to be watching.
+ */
EAPI void ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler, Ecore_Fd_Handler_Flags flags);
EAPI Ecore_Win32_Handler *ecore_main_win32_handler_add(void *h, Ecore_Win32_Handle_Cb func, const void *data);
/**
* @defgroup Ecore_Poller_Group Ecore Poll functions
*
- * These functions are for the need to poll information, but provide
- * a shared abstracted API to pool such polling to minimise wakeup
- * and ensure all the polling happens in as few spots as possible
- * areound a core poll interval. For now only 1 core poller type is
- * supprted: ECORE_POLLER_CORE
+ * Ecore poller provides infrastructure for the creation of pollers. Pollers
+ * are, in essence, callbacks that share a single timer per type. Because not
+ * all pollers need to be called at the same frequency the user may specify the
+ * frequency in ticks(each expiration of the shared timer is called a tick, in
+ * ecore poller parlance) for each added poller. Ecore pollers should only be
+ * used when the poller doesn't have specific requirements on the exact times
+ * to poll.
*
- * Example of @ref Ecore_Poller :
+ * This architecture means that the main loop is only woken up once to handle
+ * all pollers of that type, this will save power as the CPU has more of a
+ * chance to go into a low power state the longer it is asleep for, so this
+ * should be used in situations where power usage is a concern.
+ *
+ * For now only 1 core poller type is supported: ECORE_POLLER_CORE, the default
+ * interval for ECORE_POLLER_CORE is 0.125(or 1/8th) second.
+ *
+ * The creation of a poller is extremely simple and only requires one line:
+ * @code
+ * ecore_poller_add(ECORE_POLLER_CORE, 1, my_poller_function, NULL);
+ * @endcode
+ * This sample creates a poller to call @c my_poller_function at every tick with
+ * @c NULL as data.
+ *
+ * Example:
* @li @ref ecore_poller_example_c
*
* @ingroup Ecore_Main_Loop_Group
typedef struct _Ecore_Poller Ecore_Poller; /**< A handle for pollers */
+/**
+ * @brief Sets the time(in seconds) between ticks for the given poller type.
+ * @param type The poller type to adjust.
+ * @param poll_time The time(in seconds) between ticks of the timer.
+ *
+ * This will adjust the time between ticks of the given timer type defined by
+ * @p type to the time period defined by @p poll_time.
+ */
EAPI void ecore_poller_poll_interval_set(Ecore_Poller_Type type, double poll_time);
+/**
+ * @brief Gets the time(in seconds) between ticks for the given poller type.
+ * @param type The poller type to query.
+ * @return The time in seconds between ticks of the poller timer.
+ *
+ * This will get the time between ticks of the specified poller timer.
+ */
EAPI double ecore_poller_poll_interval_get(Ecore_Poller_Type type);
+/**
+ * @brief Changes the polling interval rate of @p poller.
+ * @param poller The Ecore_Poller to change the interval of.
+ * @param interval The tick interval to set; must be a power of 2 and <= 32768.
+ * @return Returns true on success, false on failure.
+ *
+ * This allows the changing of a poller's polling interval. It is useful when
+ * you want to alter a poll rate without deleting and re-creating a poller.
+ */
EAPI Eina_Bool ecore_poller_poller_interval_set(Ecore_Poller *poller, int interval);
+/**
+ * @brief Gets the polling interval rate of @p poller.
+ * @param poller The Ecore_Poller to change the interval of.
+ * @return Returns the interval, in ticks, that @p poller polls at.
+ *
+ * This returns a poller's polling interval, or 0 on error.
+ */
EAPI int ecore_poller_poller_interval_get(Ecore_Poller *poller);
+/**
+ * @brief Creates a poller to call the given function at a particular tick interval.
+ * @param type The ticker type to attach the poller to. Must be ECORE_POLLER_CORE.
+ * @param interval The poll interval.
+ * @param func The poller function.
+ * @param data Data to pass to @a func when it is called.
+ * @return A poller object on success, @c NULL otherwise.
+ *
+ * This function adds @a func as a poller callback that will be called every @a
+ * interval ticks together with other pollers of type @a type. @a func will be
+ * passed the @p data pointer as a parameter.
+ *
+ * The @p interval must be between 1 and 32768 inclusive, and must be a power of
+ * 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768). The exact tick in which @a func
+ * will be called is undefined, as only the interval between calls can be
+ * defined. Ecore will endeavor to keep pollers synchronized and to call as
+ * many in 1 wakeup event as possible. If @a interval is not a power of two, the
+ * closest power of 2 greater than @a interval will be used.
+ *
+ * When the poller @p func is called, it must return a value of either
+ * ECORE_CALLBACK_RENEW(or 1) or ECORE_CALLBACK_CANCEL(or 0). If it
+ * returns 1, it will be called again at the next tick, or if it returns
+ * 0 it will be deleted automatically making any references/handles for it
+ * invalid.
+ */
EAPI Ecore_Poller *ecore_poller_add(Ecore_Poller_Type type, int interval, Ecore_Task_Cb func, const void *data);
+/**
+ * @brief Delete the specified poller from the timer list.
+ * @param poller The poller to delete.
+ * @return The data pointer set for the timer when @ref ecore_poller_add was
+ * called on success, @c NULL otherwise.
+ *
+ * @note @a poller must be a valid handle. If the poller function has already
+ * returned 0, the handle is no longer valid (and does not need to be deleted).
+ */
EAPI void *ecore_poller_del(Ecore_Poller *poller);
/**
typedef Eina_Bool (*Ecore_Timeline_Cb)(void *data, double pos);
/**
- * @brief Add an animator to call @p func at every animaton tick during main
+ * @brief Add an animator to call @p func at every animation tick during main
* loop execution.
*
* @param func The function to call when it ticks off
*
* @param animator The animator to delete
*
- * The specified @p animator will be temporarly removed from the set of
+ * The specified @p animator will be temporarily removed from the set of
* animators that are executed during main loop.
*
* @warning Freezing an animator doesn't freeze accounting of how long that
* has "overshot" the mark) using some interpolation (mapping) algorithm.
*
* This function useful to create non-linear animations. It offers a variety
- * of possible animaton curves to be used:
+ * of possible animation curves to be used:
* @li ECORE_POS_MAP_LINEAR - Linear, returns @p pos
* @li ECORE_POS_MAP_ACCELERATE - Start slow then speed up
* @li ECORE_POS_MAP_DECELERATE - Start fast then slow down
* y = (y1 * out) + (y2 * (1.0 - out));
* move_my_object_to(myobject, x, y);
* @endcode
- * This will make an animaton that bounces 7 each times diminishing by a
+ * This will make an animation that bounces 7 each times diminishing by a
* factor of 1.8.
*
* @see _Ecore_Pos_Map
*/
/**
- * @defgroup Ecore_Time_Group Ecore Time functions
- *
- * Functions that deal with time. These functions include those
- * that simply retrieve it in a given format, and those that create
- * events based on it.
+ * @defgroup Ecore_Time_Group Ecore time functions
*
- * The timer allows callbacks to be called at specific intervals.
+ * These are function to retrieve time in a given format.
*
- * Examples with functions that deal with time:
+ * Examples:
* @li @ref ecore_time_functions_example_c
+ * @{
+ */
+EAPI double ecore_time_get(void);
+EAPI double ecore_time_unix_get(void);
+EAPI double ecore_loop_time_get(void);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup Ecore_Timer_Group Ecore Timer functions
+ *
+ * Ecore provides very flexible timer functionality. The basic usage of timers,
+ * to call a certain function at a certain interval can be achieved with a
+ * single line:
+ * @code
+ * Eina_Bool my_func(void *data) {
+ * do_funky_stuff_with_data(data);
+ * return EINA_TRUE;
+ * }
+ * ecore_timer_add(interval_in_seconds, my_func, data_given_to_function);
+ * @endcode
+ * @note If the function was to be executed only once simply return EINA_FALSE
+ * instead.
+ *
+ * An example that shows the usage of a lot of these:
* @li @ref ecore_timer_example_c
*
* @ingroup Ecore_Main_Loop_Group
typedef struct _Ecore_Timer Ecore_Timer; /**< A handle for timers */
-EAPI double ecore_time_get(void);
-EAPI double ecore_time_unix_get(void);
-EAPI double ecore_loop_time_get(void);
-
EAPI Ecore_Timer *ecore_timer_add(double in, Ecore_Task_Cb func, const void *data);
EAPI Ecore_Timer *ecore_timer_loop_add(double in, Ecore_Task_Cb func, const void *data);
EAPI void *ecore_timer_del(Ecore_Timer *timer);
/**
* @defgroup Ecore_Idle_Group Ecore Idle functions
*
- * Callbacks that are called when the program enters or exits an
- * idle state.
+ * The idler functionality in Ecore allows for callbacks to be called when the
+ * program isn't handling @ref Ecore_Event_Group "events", @ref Ecore_Timer_Group
+ * "timers" or @ref Ecore_FD_Handler_Group "fd handlers".
*
- * The ecore main loop enters an idle state when it is waiting for
- * timers to time out, data to come in on a file descriptor or any
- * other event to occur. You can set callbacks to be called when
- * the main loop enters an idle state, during an idle state or just
- * after the program wakes up.
+ * There are three types of idlers: Enterers, Idlers(proper) and Exiters. They
+ * are called, respectively, when the program is about to enter an idle state,
+ * when the program is in an idle state and when the program has just left an
+ * idle state and will begin processing @ref Ecore_Event_Group "events", @ref
+ * Ecore_Timer_Group "timers" or @ref Ecore_FD_Handler_Group "fd handlers".
*
* Enterer callbacks are good for updating your program's state, if
* it has a state engine. Once all of the enterer handlers are
* enterer handlers. They are useful for interfaces that require
* polling and timers would be too slow to use.
*
+ * Exiter callbacks are called when the main loop wakes up from an idle state.
+ *
* If no idler callbacks are specified, then the process literally
* goes to sleep. Otherwise, the idler callbacks are called
* continuously while the loop is "idle", using as much CPU as is
* available to the process.
*
- * Exiter callbacks are called when the main loop wakes up from an
- * idle state.
- *
* @note Idle state doesn't mean that the @b program is idle, but
* that the <b>main loop</b> is idle. It doesn't have any timers,
* events, fd handlers or anything else to process (which in most
* thread, the one running the main loop. This problem can be solved
* by running a thread that sends messages to the main one using an
* @ref Ecore_Pipe_Group "Ecore_Pipe", but when you need to handle other
- * things like cancelling the thread, your code grows in coplexity and gets
+ * things like cancelling the thread, your code grows in complexity and gets
* much harder to maintain.
*
* Ecore Thread is here to solve that problem. It is @b not a simple wrapper
*/
EAPI Ecore_Thread *ecore_thread_run(Ecore_Thread_Cb func_blocking, Ecore_Thread_Cb func_end, Ecore_Thread_Cb func_cancel, const void *data);
/**
- * Launch a thread to run a task than can talk back to the main thread
+ * Launch a thread to run a task that can talk back to the main thread
*
* @param func_heavy The function that should run in another thread.
* @param func_notify Function that receives the data sent from the thread
* with ecore_thread_feedback().
*
* Like with ecore_thread_run(), a new thread will be launched to run
- * @p func_heavy unless the maximum number of simultaneous threadas has been
+ * @p func_heavy unless the maximum number of simultaneous threads has been
* reached, in which case the function will be scheduled to run whenever a
* running task ends and a thread becomes free. But if @p try_no_queue is
* set, Ecore will first try to launch a thread outside of the pool to run
* also will be executed in the order in which they were added.
*
* A good use for them is when you don't want to execute an action
- * immeditately, but want to give the control back to the main loop
+ * immediately, but want to give the control back to the main loop
* so that it will call your job callback when jobs start being
* processed (and if there are other jobs added before yours, they
* will be processed first). This also gives the chance to other
else
+if ECORE_HAVE_EXOTIC
+
+libecore_la_SOURCES +=
+
+else
+
libecore_la_SOURCES += ecore_signal.c ecore_exe.c
endif
endif
+endif
+
libecore_la_LIBADD = @dlopen_libs@ @EINA_LIBS@ @EVIL_LIBS@ @GLIB_LIBS@ @WIN32_LIBS@ @LTLIBINTL@ @EFL_PTHREAD_LIBS@ @rt_libs@ -lm
libecore_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@ @EFL_PTHREAD_LIBS@
if (!ecore_mempool_init()) goto shutdown_mempool;
_ecore_main_loop_init();
_ecore_signal_init();
- _ecore_thread_init();
+#ifndef HAVE_EXOTIC
_ecore_exe_init();
+#endif
+ _ecore_thread_init();
_ecore_glib_init();
_ecore_job_init();
_ecore_time_init();
_ecore_glib_shutdown();
_ecore_job_shutdown();
_ecore_thread_shutdown();
+#ifndef HAVE_EXOTIC
_ecore_exe_shutdown();
+#endif
_ecore_idle_enterer_shutdown();
_ecore_idle_exiter_shutdown();
_ecore_idler_shutdown();
{
Ecore_Animator *animator;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
animator = _ecore_animator_add(func, data);
_ecore_unlock();
{
Ecore_Animator *animator;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (runtime <= 0.0) runtime = 0.0;
animator = _ecore_animator_add(_ecore_animator_run, NULL);
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
EAPI void
ecore_animator_frametime_set(double frametime)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (frametime < 0.0) frametime = 0.0;
if (animators_frametime == frametime) goto unlock;
EAPI double
ecore_animator_frametime_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
return animators_frametime;
}
EAPI void
ecore_animator_freeze(Ecore_Animator *animator)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
EAPI void
ecore_animator_thaw(Ecore_Animator *animator)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(animator, ECORE_MAGIC_ANIMATOR))
{
EAPI void
ecore_animator_source_set(Ecore_Animator_Source source)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
src = source;
_end_tick();
EAPI Ecore_Animator_Source
ecore_animator_source_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
return src;
}
ecore_animator_custom_source_tick_begin_callback_set(Ecore_Cb func,
const void *data)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
begin_tick_cb = func;
begin_tick_data = data;
ecore_animator_custom_source_tick_end_callback_set(Ecore_Cb func,
const void *data)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
end_tick_cb = func;
end_tick_data = data;
EAPI void
ecore_animator_custom_tick(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (src == ECORE_ANIMATOR_SOURCE_CUSTOM) _do_tick();
_ecore_unlock();
EAPI void
ecore_app_restart(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
#ifdef HAVE_EXECVP
char *args[4096];
int i;
static void _ecore_event_purge_deleted(void);
static void *_ecore_event_del(Ecore_Event *event);
-/**
- * @addtogroup Ecore_Event_Group
- *
- * @{
- */
-
-/**
- * Add an event handler.
- * @param type The type of the event this handler will get called for
- * @param func The function to call when the event is found in the queue
- * @param data A data pointer to pass to the called function @p func
- * @return A new Event handler, or NULL on failure
- *
- * Add an event handler to the list of handlers. This will, on success, return
- * a handle to the event handler object that was created, that can be used
- * later to remove the handler using ecore_event_handler_del(). The @p type
- * parameter is the integer of the event type that will trigger this callback
- * to be called. The callback @p func is called when this event is processed
- * and will be passed the event type, a pointer to the private event
- * structure that is specific to that event type, and a data pointer that is
- * provided in this call as the @p data parameter.
- *
- * When the callback @p func is called, it must return 1 or 0. If it returns
- * 1 (or ECORE_CALLBACK_PASS_ON), It will keep being called as per normal, for
- * each handler set up for that event type. If it returns 0 (or
- * ECORE_CALLBACK_DONE), it will cease processing handlers for that particular
- * event, so all handler set to handle that event type that have not already
- * been called, will not be.
- */
EAPI Ecore_Event_Handler *
ecore_event_handler_add(int type,
Ecore_Event_Handler_Cb func,
{
Ecore_Event_Handler *eh = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
return eh;
}
-/**
- * Delete an event handler.
- * @param event_handler Event handler handle to delete
- * @return Data passed to handler
- *
- * Delete a specified event handler from the handler list. On success this will
- * delete the event handler and return the pointer passed as @p data when the
- * handler was added by ecore_event_handler_add(). On failure NULL will be
- * returned. Once a handler is deleted it will no longer be called.
- */
EAPI void *
ecore_event_handler_del(Ecore_Event_Handler *event_handler)
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(event_handler, ECORE_MAGIC_EVENT_HANDLER))
{
return data;
}
-/**
- * @brief Get the data associated with an #Ecore_Event_Handler
- * @param eh The event handler
- * @return The data
- *
- * This function returns the data previously associated with @p eh by
- * ecore_event_handler_add().
- */
EAPI void *
ecore_event_handler_data_get(Ecore_Event_Handler *eh)
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(eh, ECORE_MAGIC_EVENT_HANDLER))
{
return data;
}
-/**
- * @brief Set the data associated with an #Ecore_Event_Handler
- * @param eh The event handler
- * @param data The data to associate
- * @return The previous data
- *
- * This function sets @p data to @p eh and returns the old data pointer
- * which was previously associated with @p eh by ecore_event_handler_add().
- */
EAPI void *
ecore_event_handler_data_set(Ecore_Event_Handler *eh,
const void *data)
{
void *old = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(eh, ECORE_MAGIC_EVENT_HANDLER))
{
_ecore_event_generic_free(void *data __UNUSED__,
void *event)
{ /* DO NOT MEMPOOL FREE THIS */
- free (event);
+ free(event);
}
-/**
- * Add an event to the event queue.
- * @param type The event type to add to the end of the event queue
- * @param ev The private data structure for this event type
- * @param func_free The function to be called to free this private structure
- * @param data The data pointer to be passed to the free function
- * @return A Handle for that event
- *
- * On success this function returns a handle to an event on the event queue, or
- * NULL if it fails. If it succeeds, an event of type @p type will be added
- * to the queue for processing by event handlers added by
- * ecore_event_handler_add(). The @p ev parameter will be a pointer to the event
- * private data that is specific to that event type. When the event is no
- * longer needed, @p func_free will be called and passed the private structure
- * pointer for cleaning up. If @p func_free is NULL, free() will be called
- * with the private structure pointer.
- * func_free is passed @p data as its data parameter.
- */
EAPI Ecore_Event *
ecore_event_add(int type,
void *ev,
{
Ecore_Event *event = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
/* if (!ev) goto unlock; */
return event;
}
-/**
- * Delete an event from the queue.
- * @param event The event handle to delete
- * @return The data pointer originally set for the event free function
- *
- * This deletes the event @p event from the event queue, and returns the
- * @p data parameer originally set when adding it with ecore_event_add(). This
- * does not immediately call the free function, and it may be called later on
- * cleanup, and so if the free function depends on the data pointer to work,
- * you should defer cleaning of this till the free function is called later.
- */
EAPI void *
ecore_event_del(Ecore_Event *event)
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(event, ECORE_MAGIC_EVENT))
{
return data;
}
-/**
- * Allocate a new event type id sensibly and return the new id.
- * @return A new event type id.
- *
- * This function allocates a new event type id and returns it. Once an event
- * type has been allocated it can never be de-allocated during the life of
- * the program. There is no guarantee of the contents of this event ID, or how
- * it is calculated, except that the ID will be unique to the current instance
- * of the process.
- */
EAPI int
ecore_event_type_new(void)
{
int id;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
_ecore_lock();
id = event_id_max++;
_ecore_unlock();
return id;
}
-/**
- * Add a filter the current event queue.
- * @param func_start Function to call just before filtering and return data
- * @param func_filter Function to call on each event
- * @param func_end Function to call after the queu has been filtered
- * @param data Data to pass to the filter functions
- * @return A filter handle
- *
- * This adds a filter to call callbacks to loop through the event queue and
- * filter events out of the queue. On failure NULL is returned. On success a
- * Filter handle is returned. Filters are called on the queue just before
- * Event handler processing to try and remove redundant events. Just as
- * processing starts @p func_start is called and passed the @p data pointer.
- * This function returns a pointer that is used as loop_data that is now passed to
- * @p func_filter as loop_data. @p func_filter is also passed @p data and the
- * event type and private event structure. If this callback returns 0, the
- * event is removed from the queue. If it returns 1, the event is kept. When
- * processing is finished @p func_end is called and is passed the loop_data
- * and @p data pointer to clean up.
- */
EAPI Ecore_Event_Filter *
ecore_event_filter_add(Ecore_Data_Cb func_start,
Ecore_Filter_Cb func_filter,
{
Ecore_Event_Filter *ef = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func_filter) goto unlock;
ef = ecore_event_filter_calloc(1);
return ef;
}
-/**
- * Delete an event filter.
- * @param ef The event filter handle
- * @return The data set for the filter
- *
- * Delete a filter that has been added by its @p ef handle. On success this
- * will return the data pointer set when this filter was added. On failure
- * NULL is returned.
- */
EAPI void *
ecore_event_filter_del(Ecore_Event_Filter *ef)
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(ef, ECORE_MAGIC_EVENT_FILTER))
{
return data;
}
-/**
- * Return the current event type being handled.
- * @return The current event type being handled if inside a handler callback
- *
- * If the program is currently inside an Ecore event handler callback this
- * will return the type of the current event being processed. If Ecore is
- * not inside an event handler, ECORE_EVENT_NONE is returned.
- *
- * This is useful when certain Ecore modules such as Ecore_Evas "swallow"
- * events and not all the original information is passed on. In special cases
- * this extra information may be useful or needed and using this call can let
- * the program know if the event type being handled is one it wants to get more
- * information about.
- */
EAPI int
ecore_event_current_type_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
return ecore_raw_event_type;
}
-/**
- * Return the current event type pointer handled.
- * @return The current event pointer being handled if inside a handler callback
- *
- * If the program is currently inside an Ecore event handler callback this
- * will return the pointer of the current event being processed. If Ecore is
- * not inside an event handler, NULL will be returned.
- *
- * This is useful when certain Ecore modules such as Ecore_Evas "swallow"
- * events and not all the original information is passed on. In special cases
- * this extra information may be useful or needed and using this call can let
- * the program access the event data if the type of the event is handled by
- * the program.
- */
EAPI void *
ecore_event_current_event_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
return ecore_raw_event_event;
}
-/**
- * @}
- */
-
EAPI void *
_ecore_event_handler_del(Ecore_Event_Handler *event_handler)
{
* This sets the priority of processes run by ecore_exe_run() and
* ecore_exe_pipe_run().
* @li On Windows, the child process is created by default with the
- * #ECORE_EXE_WIN32_PRIORITY_NORMAL priority, unless the calling
- * process is in #ECORE_EXE_WIN32_PRIORITY_IDLE or
- * #ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL priority. In that case, the
+ * @ref ECORE_EXE_WIN32_PRIORITY_NORMAL priority, unless the calling
+ * process is in @ref ECORE_EXE_WIN32_PRIORITY_IDLE or
+ * @ref ECORE_EXE_WIN32_PRIORITY_BELOW_NORMAL priority. In that case, the
* child process inherits this priority.
- * @li On other platforms, if set to #ECORE_EXE_PRIORITY_INHERIT child
+ * @li On other platforms, if set to @ref ECORE_EXE_PRIORITY_INHERIT child
* processes inherits the priority of their parent. This is the default.
*
* @param pri value a Ecore_Exe_Win32_Priority value on Windows, -20
- * to 19 or ECORE_EXE_PRIORITY_INHERIT on other OS.
+ * to 19 or @ref ECORE_EXE_PRIORITY_INHERIT on other OS.
*/
EAPI void
ecore_exe_run_priority_set(int pri)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
run_pri = pri;
}
EAPI int
ecore_exe_run_priority_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
return run_pri;
}
ecore_exe_run(const char *exe_cmd,
const void *data)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
return ecore_exe_pipe_run(exe_cmd, 0, data);
}
int ok = 1;
int result;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!exe_cmd) return NULL;
exe = calloc(1, sizeof(Ecore_Exe));
if (!exe) return NULL;
ecore_exe_callback_pre_free_set(Ecore_Exe *exe,
Ecore_Exe_Cb func)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE,
{
void *buf;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(EINA_FALSE);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_send");
EAPI void
ecore_exe_close_stdin(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_close_stdin");
int start_lines,
int end_lines)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_auto_limits_set");
*
* @param exe The given process handle.
* @param flags Is this a ECORE_EXE_PIPE_READ or ECORE_EXE_PIPE_ERROR?
+ * @return The event data.
*/
EAPI Ecore_Exe_Event_Data *
ecore_exe_event_data_get(Ecore_Exe *exe,
unsigned char *inbuf;
int inbuf_num;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_event_data_get");
ecore_exe_tag_set(Ecore_Exe *exe,
const char *tag)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_tag_set");
EAPI const char *
ecore_exe_tag_get(const Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_tag_get");
int ok = 0;
int result;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_free");
EAPI pid_t
ecore_exe_pid_get(const Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_pid_get");
EAPI const char *
ecore_exe_cmd_get(const Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_cmd_get");
EAPI void *
ecore_exe_data_get(const Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_data_get");
void *data)
{
void *ret;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, __func__);
EAPI Ecore_Exe_Flags
ecore_exe_flags_get(const Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_data_get");
EAPI void
ecore_exe_pause(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_pause");
EAPI void
ecore_exe_continue(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_continue");
EAPI void
ecore_exe_interrupt(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_interrupt");
EAPI void
ecore_exe_quit(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_quit");
EAPI void
ecore_exe_terminate(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_terminate");
{
struct _ecore_exe_dead_exe *dead;
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_kill");
ecore_exe_signal(Ecore_Exe *exe,
int num)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_signal");
EAPI void
ecore_exe_hup(Ecore_Exe *exe)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(exe, ECORE_MAGIC_EXE))
{
ECORE_MAGIC_FAIL(exe, ECORE_MAGIC_EXE, "ecore_exe_hup");
# include <Evil.h>
#endif
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
+#endif
+
#include "Ecore.h"
#include "Ecore_Getopt.h"
static const char *prog = NULL;
-static char **argv = NULL;
-static int argc = 0;
+static char **_argv = NULL;
+static int _argc = 0;
static int cols = 80;
static int helpcol = 80 / 3;
*
* Message will be print to stderr.
*/
-void
+EAPI void
ecore_getopt_help(FILE *fp,
const Ecore_Getopt *parser)
{
const char *var;
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!parser) return;
- if (argc < 1)
+ if (_argc < 1)
{
- ecore_app_args_get(&argc, &argv);
- if ((argc > 0) && (argv[0]))
- prog = argv[0];
+ ecore_app_args_get(&_argc, &_argv);
+ if ((_argc > 0) && (_argv[0]))
+ prog = _argv[0];
else
prog = parser->prog;
}
*
* @return EINA_TRUE if there are duplicates, EINA_FALSE otherwise.
*/
-Eina_Bool
+EAPI Eina_Bool
ecore_getopt_parser_has_duplicates(const Ecore_Getopt *parser)
{
const Ecore_Getopt_Desc *desc = parser->descs;
*
* @return index of first non-option parameter or -1 on error.
*/
-int
+EAPI int
ecore_getopt_parse(const Ecore_Getopt *parser,
Ecore_Getopt_Value *values,
int argc,
* @param list pointer to list to be freed.
* @return always NULL, so you can easily make your list head NULL.
*/
-Eina_List *
+EAPI Eina_List *
ecore_getopt_list_free(Eina_List *list)
{
void *data;
* @param str Geometry value
* @param storage must be a pointer to @c Eina_Rectangle and will be used to
* store the four values passed in the given string.
+ * @return EINA_TRUE on success, EINA_FALSE on incorrect geometry value.
*
* @c callback_data value is ignored, you can safely use @c NULL.
*/
-Eina_Bool
+EAPI Eina_Bool
ecore_getopt_callback_geometry_parse(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc __UNUSED__,
const char *str,
* @param storage must be a pointer to @c Eina_Rectangle and will be used to
* store the two values passed in the given string and 0 in the x and y
* fields.
+ * @return EINA_TRUE on success, EINA_FALSE on incorrect size value.
*
* @c callback_data value is ignored, you can safely use @c NULL.
*/
-Eina_Bool
+EAPI Eina_Bool
ecore_getopt_callback_size_parse(const Ecore_Getopt *parser __UNUSED__,
const Ecore_Getopt_Desc *desc __UNUSED__,
const char *str,
{
GPollFD *itr = pfds, *itr_end = pfds + count;
- for (; itr < itr_end && ready > 0; itr++)
+ for (; (itr < itr_end) && (ready > 0); itr++)
{
itr->revents = 0;
- if (FD_ISSET(itr->fd, rfds))
+ if (FD_ISSET(itr->fd, rfds) && (itr->events & G_IO_IN))
{
itr->revents |= G_IO_IN;
ready--;
}
- if (FD_ISSET(itr->fd, wfds))
+ if (FD_ISSET(itr->fd, wfds) && (itr->events & G_IO_OUT))
{
itr->revents |= G_IO_OUT;
ready--;
}
- if (FD_ISSET(itr->fd, efds))
+ if (FD_ISSET(itr->fd, efds) && (itr->events & (G_IO_HUP | G_IO_ERR)))
{
itr->revents |= G_IO_ERR;
ready--;
{
Ecore_Idle_Enterer *ie = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
{
Ecore_Idle_Enterer *ie = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
{
void *data;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(idle_enterer, ECORE_MAGIC_IDLE_ENTERER))
{
ECORE_MAGIC_FAIL(idle_enterer, ECORE_MAGIC_IDLE_ENTERER,
{
Ecore_Idle_Exiter *ie = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
ie = ecore_idle_exiter_calloc(1);
{
void *data;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(idle_exiter, ECORE_MAGIC_IDLE_EXITER))
{
ECORE_MAGIC_FAIL(idle_exiter, ECORE_MAGIC_IDLE_EXITER,
{
Ecore_Idler *ie = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
ie = ecore_idler_calloc(1);
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(idler, ECORE_MAGIC_IDLER))
{
ECORE_MAGIC_FAIL(idler, ECORE_MAGIC_IDLER,
{
Ecore_Job *job;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!func) return NULL;
job = ecore_job_calloc(1);
{
void *data;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(job, ECORE_MAGIC_JOB))
{
ECORE_MAGIC_FAIL(job, ECORE_MAGIC_JOB,
#ifdef _WIN32
Ecore_Select_Function main_loop_select = _ecore_main_win32_select;
#else
-# ifdef HAVE_SYS_SELECT_H
-# include <sys/select.h>
-# endif
+# if !defined EXOTIC_NO_SELECT
+# ifdef HAVE_SYS_SELECT_H
+# include <sys/select.h>
+# endif
Ecore_Select_Function main_loop_select = select;
+# else
+Ecore_Select_Function main_loop_select = NULL;
+# endif
#endif
#ifndef USE_G_MAIN_LOOP
EAPI int
ecore_main_loop_iterate_may_block(int may_block)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
#ifndef USE_G_MAIN_LOOP
_ecore_lock();
in_main_loop++;
EAPI void
ecore_main_loop_iterate(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
#ifndef USE_G_MAIN_LOOP
_ecore_lock();
_ecore_main_loop_iterate_internal(1);
EAPI void
ecore_main_loop_begin(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
#ifndef USE_G_MAIN_LOOP
_ecore_lock();
in_main_loop++;
EAPI void
ecore_main_loop_quit(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
do_quit = 1;
#ifdef USE_G_MAIN_LOOP
if (ecore_main_loop)
EAPI void
ecore_main_loop_select_func_set(Ecore_Select_Function func)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
main_loop_select = func;
}
EAPI Ecore_Select_Function
ecore_main_loop_select_func_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
return main_loop_select;
}
-/**
- * Adds a callback for activity on the given file descriptor.
- *
- * @p func will be called during the execution of @ref ecore_main_loop_begin
- * when the file descriptor is available for reading, or writing, or both.
- *
- * Normally when @p func returns ECORE_CALLBACK_CANCEL, it indicates that the
- * handler should be marked for deletion (identical to calling @ref ecore_main_fd_handler_del).
- * However, if the @p buf_func is supplied, then the return value from the @p func indicates that
- * @p func should be called repeatedly until it returns ECORE_CALLBACK_CANCEL.
- *
- * @p buf_func is called during event loop handling to check if data that has
- * been read from the file descriptor is in a buffer and is available to
- * read. Some systems (notably xlib) handle their own buffering, and would
- * otherwise not work with select(). These systems should use a @p buf_func.
- * This is a most annoying hack, only ecore_x uses it, so refer to that for
- * an example. NOTE - @p func should probably return ECORE_CALLBACK_RENEW always if
- * @p buf_func is used, to avoid confusion with the other return value
- * semantics.
- *
- * @param fd The file descriptor to watch.
- * @param flags To watch it for read (@c ECORE_FD_READ) and/or
- * (@c ECORE_FD_WRITE) write ability. @c ECORE_FD_ERROR
- *
- * @param func The callback function.
- * @param data The data to pass to the callback.
- * @param buf_func The function to call to check if any data has been
- * buffered and already read from the fd. Can be @c NULL.
- * @param buf_data The data to pass to the @p buf_func function.
- * @return A fd handler handle if successful. @c NULL otherwise.
- * @note This function CANNOT be used for reading/writing to regular files!
- * @ingroup Ecore_FD_Handler_Group
- */
EAPI Ecore_Fd_Handler *
ecore_main_fd_handler_add(int fd,
Ecore_Fd_Handler_Flags flags,
{
Ecore_Fd_Handler *fdh = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if ((fd < 0) || (flags == 0) || (!func)) goto unlock;
{
Ecore_Win32_Handler *wh;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!h || !func) return NULL;
wh = ecore_win32_handler_calloc(1);
#endif
-/**
- * Marks an FD handler for deletion.
- * @param fd_handler The FD handler.
- * @return The data pointer set using @ref ecore_main_fd_handler_add,
- * for @p fd_handler on success. @c NULL otherwise.
- * @ingroup Ecore_FD_Handler_Group
- * This function marks an fd handler to be deleted during an iteration of the main loop.
- * It does NOT close the associated fd!
- *
- * @note If the underlying fd is already closed ecore may complain if the main loop
- * is using epoll internally, and also in some rare cases this may cause
- * crashes and instability. Remember to delete your fd handlers before the
- * fds they listen to are closed.
- */
EAPI void *
ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
{
void *ret = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
EAPI void *
ecore_main_win32_handler_del(Ecore_Win32_Handler *win32_handler)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(win32_handler, ECORE_MAGIC_WIN32_HANDLER))
{
ECORE_MAGIC_FAIL(win32_handler, ECORE_MAGIC_WIN32_HANDLER,
#endif
-/**
- * @brief Set the prepare callback with data for a given #Ecore_Fd_Handler
- *
- * @param fd_handler The fd handler
- * @param func The prep function
- * @param data The data to pass to the prep function
- *
- * This function will be called prior to any fd handler's callback function
- * (even the other fd handlers), before entering the main loop select function.
- *
- * @note Once a prepare callback is set for a fd handler, it cannot be changed.
- * You need to delete the fd handler and create a new one, to set another
- * callback.
- * @note You probably don't need this function. It is only necessary for very
- * uncommon cases that need special behavior.
- *
- * @ingroup Ecore_FD_Handler_Group
- */
EAPI void
ecore_main_fd_handler_prepare_callback_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Prep_Cb func,
const void *data)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
_ecore_unlock();
}
-/**
- * Retrieves the file descriptor that the given handler is handling.
- * @param fd_handler The given FD handler.
- * @return The file descriptor the handler is watching.
- * @ingroup Ecore_FD_Handler_Group
- */
EAPI int
ecore_main_fd_handler_fd_get(Ecore_Fd_Handler *fd_handler)
{
int fd = -1;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(-1);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
return fd;
}
-/**
- * Return if read, write or error, or a combination thereof, is active on the
- * file descriptor of the given FD handler.
- * @param fd_handler The given FD handler.
- * @param flags The flags, @c ECORE_FD_READ, @c ECORE_FD_WRITE or
- * @c ECORE_FD_ERROR to query.
- * @return #EINA_TRUE if any of the given flags are active. #EINA_FALSE otherwise.
- * @ingroup Ecore_FD_Handler_Group
- */
EAPI Eina_Bool
ecore_main_fd_handler_active_get(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags)
{
int ret = EINA_FALSE;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(EINA_FALSE);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
return ret;
}
-/**
- * Set what active streams the given FD handler should be monitoring.
- * @param fd_handler The given FD handler.
- * @param flags The flags to be watching.
- * @ingroup Ecore_FD_Handler_Group
- */
EAPI void
ecore_main_fd_handler_active_set(Ecore_Fd_Handler *fd_handler,
Ecore_Fd_Handler_Flags flags)
{
int ret;
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(fd_handler, ECORE_MAGIC_FD_HANDLER))
# include <Escape.h>
#endif
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
+#endif
+
#include "Ecore.h"
#include "ecore_private.h"
-#ifdef _WIN32
-# define FMT_SSIZE_T "%Id"
-#else
-# define FMT_SSIZE_T "%zd"
-#endif
-
/* How of then we should retry to write to the pipe */
#define ECORE_PIPE_WRITE_RETRY 6
#endif /* ! _WIN32 */
+#include <Ecore.h>
+#include "ecore_private.h"
+
struct _Ecore_Pipe
{
ECORE_MAGIC;
Ecore_Pipe *p;
int fds[2];
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!handler) return NULL;
p = ecore_pipe_calloc(1);
{
void *data;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE))
{
ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_del");
EAPI void
ecore_pipe_read_close(Ecore_Pipe *p)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE))
{
ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_close");
EAPI void
ecore_pipe_freeze(Ecore_Pipe *p)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE))
{
ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_freeze");
EAPI void
ecore_pipe_thaw(Ecore_Pipe *p)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(p, ECORE_MAGIC_PIPE))
{
ECORE_MAGIC_FAIL(p, ECORE_MAGIC_PIPE, "ecore_pipe_read_thaw");
int ret;
int total = 0;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(-1);
if (p->fd_read == PIPE_FD_INVALID)
return -1;
FD_SET(p->fd_read, &rset);
if (wait >= 0.0)
- end = ecore_time_get() + wait;
+ end = ecore_loop_time_get() + wait;
timeout = wait;
while (message_count > 0 && (timeout > 0.0 || wait <= 0.0))
}
if (wait >= 0.0)
- timeout = end - ecore_time_get();
+ timeout = end - ecore_loop_time_get();
}
return total;
;
else
{
- ERR("An unhandled error (ret: " FMT_SSIZE_T " errno: %d)"
+ ERR("An unhandled error (ret: %zd errno: %d)"
"occurred while writing to the pipe the length",
ret, errno);
}
;
else
{
- ERR("An unhandled error (ret: " FMT_SSIZE_T " errno: %d)"
+ ERR("An unhandled error (ret: %zd errno: %d)"
"occurred while writing to the pipe the length",
ret, errno);
}
return ECORE_CALLBACK_RENEW;
}
-/**
- * @addtogroup Ecore_Poller_Group
- *
- * @{
- */
-
-/**
- * Sets the time between ticks (in seconds) for the given ticker clock.
- * @param type The ticker type to adjust
- * @param poll_time The time (in seconds) between ticks of the clock
- *
- * This will adjust the time between ticks of the given ticker type defined
- * by @p type to the time period defined by @p poll_time.
- */
EAPI void
ecore_poller_poll_interval_set(Ecore_Poller_Type type __UNUSED__,
double poll_time)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
poll_interval = poll_time;
_ecore_poller_next_tick_eval();
}
-/**
- * Gets the time between ticks (in seconds) for the given ticker clock.
- * @param type The ticker type to query
- * @return The time in seconds between ticks of the ticker clock
- *
- * This will get the time between ticks of the specified ticker clock.
- */
EAPI double
ecore_poller_poll_interval_get(Ecore_Poller_Type type __UNUSED__)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
return poll_interval;
}
-/**
- * Creates a poller to call the given function at a particular tick interval.
- * @param type The ticker type to attach the poller to
- * @param interval The poll interval
- * @param func The given function. If @p func returns 1, the poller is
- * rescheduled for the next tick interval.
- * @param data Data to pass to @p func when it is called.
- * @return A poller object on success. @c NULL on failure.
- *
- * This function adds a poller callback that is to be called regularly
- * along with all other poller callbacks so the pollers are synchronized with
- * all other pollers running off the same poller type and at the same tick
- * interval. This should be used for polling things when polling is desired
- * or required, and you do not have specific requirements on the exact times
- * to poll and want to avoid extra process wakeups for polling. This will
- * save power as the CPU has more of a chance to go into a low power state
- * the longer it is asleep for, so this should be used if you are at all
- * power conscious.
- *
- * The @p type parameter defines the poller tick type (there is a virtual
- * clock ticking all the time - though ecore avoids making it tick when
- * there will not be any work to do at that tick point). There is only one
- * ticker at the moment - that is ECORE_POLLER_CORE. This is here for future
- * expansion if multiple clocks with different frequencies are really required.
- * The default time between ticks for the ECORE_POLLER_CORE ticker is 0.125
- * seconds.
- *
- * The @p interval is the number of ticker ticks that will pass by in between
- * invocations of the @p func callback. This must be between 1 and 32768
- * inclusive, and must be a power of 2 (i.e. 1, 2, 4, 8, 16, ... 16384, 32768).
- * If it is 1, then the function will be called every tick. if it is 2, then it
- * will be called every 2nd tick, if it is 8, then every 8th tick etc. Exactly
- * which tick is undefined, as only the interval between calls can be defined.
- * Ecore will endeavour to keep pollers synchronised and to call as many in
- * 1 wakeup event as possible.
- *
- * This function adds a poller and returns its handle on success and NULL on
- * failure. The function @p func will be called at tick intervals described
- * above. The function will be passed the @p data pointer as its parameter.
- *
- * When the poller @p func is called, it must return a value of either
- * 1 (or ECORE_CALLBACK_RENEW) or 0 (or ECORE_CALLBACK_CANCEL). If it
- * returns 1, it will be called again at the next tick, or if it returns
- * 0 it will be deleted automatically making any references/handles for it
- * invalid.
- */
EAPI Ecore_Poller *
ecore_poller_add(Ecore_Poller_Type type __UNUSED__,
int interval,
Ecore_Poller *poller;
int ibit;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!func) return NULL;
if (interval < 1) interval = 1;
return poller;
}
-/**
- * Changes the polling interval rate of @p poller.
- *
- * @param poller The Ecore_Poller to change the interval of
- * @param interval The tick interval to set; must be a power of 2 but <= 32768
- * @return Returns true on success, false on failure
- *
- * This allows the changing of a poller's polling interval. It is useful when you want to alter
- * a poll rate without deleting and re-creating a poller.
- */
EAPI Eina_Bool
ecore_poller_poller_interval_set(Ecore_Poller *poller,
int interval)
{
int ibit;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(EINA_FALSE);
if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
{
ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
return EINA_TRUE;
}
-/**
- * Gets the polling interval rate of @p poller.
- *
- * @param poller The Ecore_Poller to change the interval of
- * @return Returns the interval, in ticks, that @p poller polls at
- *
- * This returns a poller's polling interval, or 0 on error.
- */
EAPI int
ecore_poller_poller_interval_get(Ecore_Poller *poller)
{
int ibit, interval = 1;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0);
if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
{
ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
return interval;
}
-/**
- * Delete the specified poller from the timer list.
- * @param poller The poller to delete.
- * @return The data pointer set for the timer when @ref ecore_poller_add was
- * called. @c NULL is returned if the function is unsuccessful.
- *
- * Note: @p poller must be a valid handle. If the poller function has already
- * returned 0, the handle is no longer valid (and does not need to be delete).
- */
EAPI void *
ecore_poller_del(Ecore_Poller *poller)
{
void *data;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
if (!ECORE_MAGIC_CHECK(poller, ECORE_MAGIC_POLLER))
{
ECORE_MAGIC_FAIL(poller, ECORE_MAGIC_POLLER,
void _ecore_main_shutdown(void);
-#if defined (_WIN32) || defined (__lv2ppu__)
+#if defined (_WIN32) || defined (__lv2ppu__) || defined (HAVE_EXOTIC)
static inline void _ecore_signal_shutdown(void) { }
static inline void _ecore_signal_init(void) { }
EINA_MAIN_LOOP_CHECK_RETURN;
#endif
_ecore_main_lock_count++;
- assert(_ecore_main_lock_count == 1);
+ /* assert(_ecore_main_lock_count == 1); */
}
static inline void
_ecore_unlock(void)
{
_ecore_main_lock_count--;
- assert(_ecore_main_lock_count == 0);
+ /* assert(_ecore_main_lock_count == 0); */
#ifdef HAVE_THREAD_SAFETY
eina_lock_release(&_ecore_main_loop_lock);
#endif
EAPI void
ecore_throttle_adjust(double amount)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
int adj = amount * 1000000.0;
throttle_val += adj;
if (throttle_val < 0) throttle_val = 0;
EAPI double
ecore_throttle_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
return (double)throttle_val / 1000000.0;
}
#include <time.h>
-#ifdef HAVE_CLOCK_GETTIME
+#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME)
static clockid_t _ecore_time_clock_id = -1;
#elif defined(__APPLE__) && defined(__MACH__)
static double _ecore_time_clock_conversion = 1e-9;
EAPI double
ecore_time_get(void)
{
-#ifdef HAVE_CLOCK_GETTIME
+#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME)
struct timespec t;
if (EINA_UNLIKELY(_ecore_time_clock_id < 0))
void
_ecore_time_init(void)
{
-#ifdef HAVE_CLOCK_GETTIME
+#if defined (HAVE_CLOCK_GETTIME) || defined (EXOTIC_PROVIDE_CLOCK_GETTIME)
struct timespec t;
if (_ecore_time_clock_id != -1) return;
static double precision = 10.0 / 1000000.0;
/**
- * @addtogroup Ecore_Time_Group
+ * @addtogroup Ecore_Timer_Group
*
* @{
*/
/**
* Retrieves the current precision used by timer infrastructure.
- *
+ * @return Current precision.
* @see ecore_timer_precision_set()
*/
EAPI double
ecore_timer_precision_get(void)
{
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
return precision;
}
/**
- * Sets the precision to be used by timer infrastructure.
+ * @brief Sets the precision to be used by timer infrastructure.
+ *
+ * @param value allowed introduced timeout delay, in seconds.
*
- * When system calculates time to expire the next timer we'll be able
- * to delay the timer by the given amount so more timers will fit in
- * the same dispatch, waking up the system less often and thus being
- * able to save power.
+ * This sets the precision for @b all timers. The precision determines how much
+ * of an difference from the requested interval is acceptable. One common reason
+ * to use this function is to @b increase the allowed timeout and thus @b
+ * decrease precision of the timers, this is because less precise the timers
+ * result in the system waking up less often and thus consuming less resources.
*
* Be aware that kernel may delay delivery even further, these delays
* are always possible due other tasks having higher priorities or
* @note Ecore is smart enough to see if there are timers in the
* precision range, if it does not, in our example if no second timer
* in (T + precision) existed, then it would use the minimum timeout.
- *
- * @param value allowed introduced timeout delay, in seconds.
*/
EAPI void
ecore_timer_precision_set(double value)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (value < 0.0)
double now;
Ecore_Timer *timer = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!func) goto unlock;
if (in < 0.0) in = 0.0;
{
Ecore_Timer *timer;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
timer = _ecore_timer_loop_add(in, func, data);
_ecore_unlock();
{
void *data = NULL;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(NULL);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
ecore_timer_interval_set(Ecore_Timer *timer,
double in)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
double interval;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
ecore_timer_delay(Ecore_Timer *timer,
double add)
{
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
ecore_timer_reset(Ecore_Timer *timer)
{
double now, add;
+ EINA_MAIN_LOOP_CHECK_RETURN;
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
ECORE_MAGIC_FAIL(timer, ECORE_MAGIC_TIMER,
* Get the pending time regarding a timer.
*
* @param timer The timer to learn from.
- * @ingroup Ecore_Time_Group
+ * @return The pending time.
+ * @ingroup Ecore_Timer_Group
*/
EAPI double
ecore_timer_pending_get(Ecore_Timer *timer)
double now;
double ret = 0.0;
+ EINA_MAIN_LOOP_CHECK_RETURN_VAL(0.0);
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
double now;
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
{
double now;
+ EINA_MAIN_LOOP_CHECK_RETURN;
_ecore_lock();
if (!ECORE_MAGIC_CHECK(timer, ECORE_MAGIC_TIMER))
int living_timer = 0;
int unknow_timer = 0;
+ EINA_MAIN_LOOP_CHECK_RETURN(NULL);
_ecore_lock();
result = eina_strbuf_new();
/**
- * @defgroup Ecore_Con_Events_Group Events
+ * @defgroup Ecore_Con_Events_Group Ecore Connection Events Functions
*
* @li ECORE_CON_CLIENT_ADD: Whenever a client connection is made to an
* @c Ecore_Con_Server, an event of this type is emitted, allowing the
*/
/**
- * @defgroup Ecore_Con_Buffer Buffering
+ * @defgroup Ecore_Con_Buffer Ecore Connection Buffering
*
* As Ecore_Con works on an event driven design, as data arrives, events will
* be produced containing the data that arrived. It is up to the user of
*/
EAPI Ecore_Con_Socks *ecore_con_socks4_remote_add(const char *ip, int port, const char *username);
-EAPI void ecore_con_socks4_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable);
-EAPI Eina_Bool ecore_con_socks4_lookup_get(Ecore_Con_Socks *ecs);
EAPI Eina_Bool ecore_con_socks4_remote_exists(const char *ip, int port, const char *username);
EAPI void ecore_con_socks4_remote_del(const char *ip, int port, const char *username);
+EAPI Ecore_Con_Socks *ecore_con_socks5_remote_add(const char *ip, int port, const char *username, const char *password);
+EAPI Eina_Bool ecore_con_socks5_remote_exists(const char *ip, int port, const char *username, const char *password);
+EAPI void ecore_con_socks5_remote_del(const char *ip, int port, const char *username, const char *password);
+EAPI void ecore_con_socks_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable);
+EAPI Eina_Bool ecore_con_socks_lookup_get(Ecore_Con_Socks *ecs);
EAPI void ecore_con_socks_bind_set(Ecore_Con_Socks *ecs, Eina_Bool is_bind);
EAPI Eina_Bool ecore_con_socks_bind_get(Ecore_Con_Socks *ecs);
EAPI unsigned int ecore_con_socks_version_get(Ecore_Con_Socks *ecs);
*
* Setting up a server is very simple: you just need to start it with
* ecore_con_server_add() and setup some callbacks to the events
- * #ECORE_CON_EVENT_CLIENT_ADD, #ECORE_CON_EVENT_CLIENT_DEL and
- * #ECORE_CON_EVENT_CLIENT_DATA, that will be called when a client is
+ * @ref ECORE_CON_EVENT_CLIENT_ADD, @ref ECORE_CON_EVENT_CLIENT_DEL and
+ * @ref ECORE_CON_EVENT_CLIENT_DATA, that will be called when a client is
* communicating with the server:
*
* @code
*
* However, even if this call returns a valid @ref Ecore_Con_Server, the
* connection will only be successfully completed if an event of type
- * #ECORE_CON_EVENT_SERVER_ADD is received. If it fails to complete, an
- * #ECORE_CON_EVENT_SERVER_DEL will be received.
+ * @ref ECORE_CON_EVENT_SERVER_ADD is received. If it fails to complete, an
+ * @ref ECORE_CON_EVENT_SERVER_DEL will be received.
*
* The @p data parameter can be fetched later using ecore_con_server_data_get()
* or changed with ecore_con_server_data_set().
} Ecore_Con_Url_Time;
/**
+ * @typedef Ecore_Con_Url_Http_Version
+ * @enum _Ecore_Con_Url_Http_Version
+ * The http version to use
+ * @since 1.2
+ */
+typedef enum _Ecore_Con_Url_Http_Version
+{
+ /**
+ * HTTP version 1.0
+ * @since 1.2
+ */
+ ECORE_CON_URL_HTTP_VERSION_1_0,
+ /**
+ * HTTP version 1.1 (default)
+ * @since 1.2
+ */
+ ECORE_CON_URL_HTTP_VERSION_1_1
+} Ecore_Con_Url_Http_Version;
+
+/**
+ * Change the HTTP version used for the request
+ * @param url_con Connection object through which the request will be sent.
+ * @param version The version to be used
+ * @return EINA_TRUE on success, EINA_FALSE on failure to change version
+ * @since 1.2
+ * @see ecore_con_url_pipeline_get()
+ */
+EAPI Eina_Bool ecore_con_url_http_version_set(Ecore_Con_Url *url_con, Ecore_Con_Url_Http_Version version);
+
+/**
* Initialises the Ecore_Con_Url library.
* @return Number of times the library has been initialised without being
* shut down.
const char *password,
Eina_Bool safe);
/**
- * Sends a request.
- *
- * @param url_con Connection object to perform a request on, previously created
- * with ecore_con_url_new() or ecore_con_url_custom_new().
- * @param data Payload (data sent on the request)
- * @param length Payload length. If @c -1, rely on automatic length
- * calculation via @c strlen() on @p data.
- * @param content_type Content type of the payload (e.g. text/xml)
- *
- * @return #EINA_TRUE on success, #EINA_FALSE on error.
- *
- * @see ecore_con_url_custom_new()
- * @see ecore_con_url_additional_headers_clear()
- * @see ecore_con_url_additional_header_add()
- * @see ecore_con_url_data_set()
- * @see ecore_con_url_data_get()
- * @see ecore_con_url_response_headers_get()
- * @see ecore_con_url_time()
- * @see ecore_con_url_get()
- * @see ecore_con_url_post()
- *
- * @deprecated Use ecore_con_url_post() instead of this.
- */
-EINA_DEPRECATED EAPI Eina_Bool ecore_con_url_send(Ecore_Con_Url *url_con,
- const void *data, long length,
- const char *content_type);
-/**
* Sends a get request.
*
* @param url_con Connection object to perform a request on, previously created
*
* @see ecore_con_url_proxy_set()
*
-<<<<<<< HEAD
- * @since 1.2
-=======
* @since 1.2
->>>>>>> origin/upstream
*/
EAPI Eina_Bool ecore_con_url_proxy_username_set(Ecore_Con_Url *url_con, const char *username);
EAPI void ecore_con_url_timeout_set(Ecore_Con_Url *url_con, double timeout);
/**
+ * Get the returned HTTP STATUS code
+ *
+ * This is used to, at any time, try to return the status code for a transmission.
+ * @param url_con Connection object
+ * @return A valid HTTP STATUS code, or 0 on failure
+ *
+ * @since 1.2
+ */
+EAPI int ecore_con_url_status_code_get(Ecore_Con_Url *url_con);
+/**
* @}
*/
if (cl->delete_me)
DBG("Multi kill request for client %p", cl);
else
- ecore_con_event_client_del(cl);
+ {
+ ecore_con_event_client_del(cl);
+ if (cl->buf) return;
+ }
INF("Lost client %s", (cl->ip) ? cl->ip : "");
if (cl->fd_handler)
ecore_main_fd_handler_del(cl->fd_handler);
(!ecore_con_lookup(svr->name, (Ecore_Con_Dns_Cb)ecore_con_socks_dns_cb, svr)))
goto error;
if (svr->ecs->lookup)
- svr->ecs_state = ECORE_CON_SOCKS_STATE_RESOLVED;
+ svr->ecs_state = ECORE_CON_PROXY_STATE_RESOLVED;
}
}
if (ecore_con_ssl_server_prepare(svr, compl_type & ECORE_CON_SSL))
e->server = svr;
if (svr->ecs)
{
- svr->ecs_state = svr->ecs->lookup ? ECORE_CON_SOCKS_STATE_RESOLVED : ECORE_CON_SOCKS_STATE_DONE;
+ svr->ecs_state = svr->ecs->lookup ? ECORE_CON_PROXY_STATE_RESOLVED : ECORE_CON_PROXY_STATE_DONE;
eina_stringshare_replace(&svr->proxyip, NULL);
svr->proxyport = 0;
}
if (cl->event_count) return;
ECORE_MAGIC_SET(cl, ECORE_MAGIC_NONE);
- free(cl->buf);
+ if (cl->buf) eina_binbuf_free(cl->buf);
if (cl->host_server->type & ECORE_CON_SSL)
ecore_con_ssl_client_shutdown(cl);
if (so_err)
{
/* we lost our server! */
- ecore_con_event_server_error(svr, strerror(errno));
+ ecore_con_event_server_error(svr, strerror(so_err));
ERR("Connection lost: %s", strerror(so_err));
_ecore_con_server_kill(svr);
return ECORE_CON_DISCONNECTED;
ecore_con_event_server_add(svr);
return ECORE_CALLBACK_RENEW;
}
- if (svr->ecs && svr->ecs_state && (svr->ecs_state < ECORE_CON_SOCKS_STATE_READ) && (!svr->ecs_buf))
+ if (svr->ecs && svr->ecs_state && (svr->ecs_state < ECORE_CON_PROXY_STATE_READ) && (!svr->ecs_buf))
{
- if (svr->ecs_state < ECORE_CON_SOCKS_STATE_INIT)
+ if (svr->ecs_state < ECORE_CON_PROXY_STATE_INIT)
{
INF("PROXY STATE++");
svr->ecs_state++;
static void
_ecore_con_client_flush(Ecore_Con_Client *cl)
{
- int num, count = 0;
+ int num = 0, count = 0;
#ifdef _WIN32
if (ecore_con_local_win32_client_flush(cl))
}
if (count) ecore_con_event_client_write(cl, count);
- cl->buf_offset += count;
+ cl->buf_offset += count, num -= count;
if (cl->buf_offset >= eina_binbuf_length_get(cl->buf))
{
cl->buf_offset = 0;
if (cl->fd_handler)
ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_READ);
}
- else if ((count < num) && cl->fd_handler)
+ else if (cl->fd_handler && (num >= 0))
ecore_main_fd_handler_active_set(cl->fd_handler, ECORE_FD_WRITE);
}
typedef struct _Ecore_Con_Lookup Ecore_Con_Lookup;
typedef struct _Ecore_Con_Info Ecore_Con_Info;
-typedef struct Ecore_Con_Socks_v4 Ecore_Con_Socks_v4;
+typedef struct Ecore_Con_Socks Ecore_Con_Socks_v4;
typedef struct Ecore_Con_Socks_v5 Ecore_Con_Socks_v5;
typedef void (*Ecore_Con_Info_Cb)(void *data, Ecore_Con_Info *infos);
ECORE_CON_SSL_STATE_INIT
} Ecore_Con_Ssl_State;
-typedef enum Ecore_Con_Socks_State
-{
- ECORE_CON_SOCKS_STATE_DONE = 0,
- ECORE_CON_SOCKS_STATE_RESOLVED,
- ECORE_CON_SOCKS_STATE_INIT,
- ECORE_CON_SOCKS_STATE_READ
-} Ecore_Con_Socks_State;
+typedef enum Ecore_Con_Proxy_State
+{ /* named PROXY instead of SOCKS in case some handsome and enterprising
+ * developer decides to add HTTP CONNECT support
+ */
+ ECORE_CON_PROXY_STATE_DONE = 0,
+ ECORE_CON_PROXY_STATE_RESOLVED,
+ ECORE_CON_PROXY_STATE_INIT,
+ ECORE_CON_PROXY_STATE_READ,
+ ECORE_CON_PROXY_STATE_AUTH,
+ ECORE_CON_PROXY_STATE_REQUEST,
+ ECORE_CON_PROXY_STATE_CONFIRM,
+} Ecore_Con_Proxy_State;
struct _Ecore_Con_Client
{
pid_t ppid;
/* socks */
Ecore_Con_Socks *ecs;
- Ecore_Con_Socks_State ecs_state;
+ Ecore_Con_Proxy_State ecs_state;
int ecs_addrlen;
unsigned char ecs_addr[16];
unsigned int ecs_buf_offset;
Eina_List *response_headers;
const char *url;
long proxy_type;
+ int status;
Ecore_Timer *timer;
int received;
int write_fd;
+
+ unsigned int event_count;
+ Eina_Bool dead : 1;
+ Eina_Bool multi : 1;
};
#endif
v5 = (Ecore_Con_Socks_v5*)(X); \
else
-struct Ecore_Con_Socks
-{
- unsigned char version;
-
- const char *ip;
- int port;
- const char *username;
- Eina_Bool lookup : 1;
- Eina_Bool bind : 1;
-};
-
-struct Ecore_Con_Socks_v4
+struct Ecore_Con_Socks /* v4 */
{
unsigned char version;
const char *ip;
int port;
const char *username;
+ unsigned int ulen;
Eina_Bool lookup : 1;
Eina_Bool bind : 1;
};
const char *ip;
int port;
const char *username;
+ unsigned int ulen;
Eina_Bool lookup : 1;
Eina_Bool bind : 1;
+ /* v5 only */
+ unsigned char method;
+ const char *password;
+ unsigned int plen;
};
extern Ecore_Con_Socks *_ecore_con_proxy_once;
#include <unistd.h>
#include <fcntl.h>
+#ifdef HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#endif
+
#ifdef HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif
# include <arpa/inet.h>
#endif
-#ifdef HAVE_SYS_SOCKET_H
-# include <sys/socket.h>
-#endif
-
#ifdef HAVE_SYS_UN_H
# include <sys/un.h>
#endif
#include "Ecore_Con.h"
#include "ecore_con_private.h"
+/* http://tools.ietf.org/html/rfc1928
+ o X'00' NO AUTHENTICATION REQUIRED
+ o X'01' GSSAPI
+ o X'02' USERNAME/PASSWORD
+ o X'03' to X'7F' IANA ASSIGNED
+ o X'80' to X'FE' RESERVED FOR PRIVATE METHODS
+ o X'FF' NO ACCEPTABLE METHODS
+*/
+#define ECORE_CON_SOCKS_V5_METHOD_NONE 0
+#define ECORE_CON_SOCKS_V5_METHOD_GSSAPI 1
+#define ECORE_CON_SOCKS_V5_METHOD_USERPASS 2
+
+static int ECORE_CON_SOCKS_V5_METHODS[] =
+{
+ ECORE_CON_SOCKS_V5_METHOD_NONE,
+// ECORE_CON_SOCKS_V5_METHOD_GSSAPI, TODO
+ ECORE_CON_SOCKS_V5_METHOD_USERPASS
+};
+
+#define ECORE_CON_SOCKS_V5_TOTAL_METHODS sizeof(ECORE_CON_SOCKS_V5_METHODS)
+
#define _ecore_con_server_kill(svr) do { \
DBG("KILL %p", (svr)); \
_ecore_con_server_kill((svr)); \
Eina_List *ecore_con_socks_proxies = NULL;
static Ecore_Con_Socks *
-_ecore_con_socks_find(unsigned char version, const char *ip, int port, const char *username)
+_ecore_con_socks_find(unsigned char version, const char *ip, int port, const char *username, size_t ulen, const char *password, size_t plen)
{
Eina_List *l;
- Ecore_Con_Socks *ecs;
+ Ecore_Con_Socks_v5 *ecs;
if (!ecore_con_socks_proxies) return NULL;
if (ecs->version != version) continue;
if (strcmp(ecs->ip, ip)) continue;
if ((port != -1) && (port != ecs->port)) continue;
+ if (ulen != ecs->ulen) continue;
if (username && strcmp(ecs->username, username)) continue;
- return ecs;
+ if (version == 5)
+ {
+ if (plen != ecs->plen) continue;
+ if (password && strcmp(ecs->password, password)) continue;
+ }
+ return (Ecore_Con_Socks*)ecs;
}
return NULL;
}
eina_stringshare_del(ecs->username);
free(ecs);
}
-/////////////////////////////////////////////////////////////////////////////////////
-void
-ecore_con_socks_shutdown(void)
+
+static Eina_Bool
+_ecore_con_socks_svr_init_v4(Ecore_Con_Server *svr, Ecore_Con_Socks_v4 *v4)
{
- Ecore_Con_Socks *ecs;
- EINA_LIST_FREE(ecore_con_socks_proxies, ecs)
- _ecore_con_socks_free(ecs);
- _ecore_con_proxy_once = NULL;
- _ecore_con_proxy_global = NULL;
+ size_t addrlen, buflen, ulen = 1;
+ unsigned char *sbuf;
+
+ addrlen = v4->lookup ? strlen(svr->name) + 1 : 0;
+ if (v4->username) ulen += v4->ulen;
+ buflen = sizeof(char) * (8 + ulen + addrlen);
+ sbuf = malloc(buflen);
+ if (!sbuf)
+ {
+ ecore_con_event_server_error(svr, "Memory allocation failure!");
+ _ecore_con_server_kill(svr);
+ return EINA_FALSE;
+ }
+ /* http://en.wikipedia.org/wiki/SOCKS */
+ sbuf[0] = 4;
+ sbuf[1] = v4->bind ? 2 : 1;
+ sbuf[2] = svr->port >> 8;
+ sbuf[3] = svr->port & 0xff;
+ if (addrlen)
+ {
+ sbuf[4] = sbuf[5] = sbuf[6] = 0;
+ sbuf[7] = 1;
+ }
+ else
+ /* SOCKSv4 only handles IPV4, so addrlen is always 4 */
+ memcpy(sbuf + 4, svr->ecs_addr, 4);
+ if (v4->username)
+ memcpy(sbuf + 8, v4->username, ulen);
+ else
+ sbuf[8] = 0;
+ if (addrlen) memcpy(sbuf + 8 + ulen, svr->name, addrlen);
+
+ svr->ecs_buf = eina_binbuf_manage_new_length(sbuf, buflen);
+ return EINA_TRUE;
}
-void
-ecore_con_socks_read(Ecore_Con_Server *svr, unsigned char *buf, int num)
+static Eina_Bool
+_ecore_con_socks_svr_init_v5(Ecore_Con_Server *svr, Ecore_Con_Socks_v5 *v5)
+{
+ size_t buflen;
+ unsigned int x;
+ unsigned char *sbuf;
+
+ if (v5->username)
+ buflen = sizeof(char) * (2 + ECORE_CON_SOCKS_V5_TOTAL_METHODS);
+ else
+ buflen = 3;
+ sbuf = malloc(buflen);
+ if (!sbuf)
+ {
+ ecore_con_event_server_error(svr, "Memory allocation failure!");
+ _ecore_con_server_kill(svr);
+ return EINA_FALSE;
+ }
+ /* http://en.wikipedia.org/wiki/SOCKS
+ * http://tools.ietf.org/html/rfc1928
+ */
+ sbuf[0] = 5;
+ if (v5->username)
+ {
+ sbuf[1] = ECORE_CON_SOCKS_V5_TOTAL_METHODS;
+ for (x = 2; x < 2 + ECORE_CON_SOCKS_V5_TOTAL_METHODS; x++)
+ sbuf[x] = ECORE_CON_SOCKS_V5_METHODS[x - 2];
+ }
+ else
+ {
+ sbuf[1] = 1;
+ sbuf[2] = ECORE_CON_SOCKS_V5_METHOD_NONE;
+ }
+
+ svr->ecs_buf = eina_binbuf_manage_new_length(sbuf, buflen);
+ return EINA_TRUE;
+}
+
+#define ECORE_CON_SOCKS_READ(EXACT) \
+ if (num < EXACT) \
+ { \
+ if (!svr->ecs_recvbuf) svr->ecs_recvbuf = eina_binbuf_new(); \
+ if (!svr->ecs_recvbuf) goto error; \
+ eina_binbuf_append_length(svr->ecs_recvbuf, buf, num); \
+ /* the slowest connection on earth */ \
+ if (eina_binbuf_length_get(svr->ecs_recvbuf) != EXACT) return; \
+ data = eina_binbuf_string_get(svr->ecs_recvbuf); \
+ } \
+ else if (num > EXACT) goto error; \
+ else \
+ data = buf
+
+static void
+_ecore_con_socks_read_v4(Ecore_Con_Server *svr, Ecore_Con_Socks_v4 *v4 __UNUSED__, const unsigned char *buf, unsigned int num)
{
const unsigned char *data;
- ECORE_CON_SOCKS_CAST_ELSE(svr->ecs) return;
+ DBG("SOCKS: %d bytes", num);
+ ECORE_CON_SOCKS_READ(8);
- if (svr->ecs_state != ECORE_CON_SOCKS_STATE_READ) return;
+/* http://ufasoft.com/doc/socks4_protocol.htm */
+ if (data[0]) goto error;
+ switch (data[1])
+ {
+ case 90:
+ /* success! */
+ break;
+ case 91:
+ ecore_con_event_server_error(svr, "proxy request rejected or failed");
+ goto error;
+ case 92:
+ ecore_con_event_server_error(svr, "proxying SOCKS server could not perform authentication");
+ goto error;
+ case 93:
+ ecore_con_event_server_error(svr, "proxy request authentication rejected");
+ goto error;
+ default:
+ ecore_con_event_server_error(svr, "garbage data from proxy");
+ goto error;
+ }
+ if (svr->ecs->bind)
+ {
+ unsigned int nport;
+ char naddr[IF_NAMESIZE];
- if (v4)
+ memcpy(&nport, &data[2], 2);
+ svr->proxyport = ntohl(nport);
+
+ if (!inet_ntop(AF_INET, &data[4], naddr, sizeof(naddr))) goto error;
+ svr->proxyip = eina_stringshare_add(naddr);
+ ecore_con_event_proxy_bind(svr);
+ }
+ svr->ecs_state = ECORE_CON_PROXY_STATE_DONE;
+ INF("PROXY CONNECTED");
+ if (svr->ecs_recvbuf) eina_binbuf_free(svr->ecs_recvbuf);
+ svr->ecs_recvbuf = NULL;
+ svr->ecs_buf_offset = svr->ecs_addrlen = 0;
+ memset(svr->ecs_addr, 0, sizeof(svr->ecs_addr));
+ if (!svr->ssl_state)
+ ecore_con_event_server_add(svr);
+ if (svr->ssl_state || (svr->buf && eina_binbuf_length_get(svr->buf)))
+ ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
+ return;
+error:
+ _ecore_con_server_kill(svr);
+}
+
+static Eina_Bool
+_ecore_con_socks_auth_v5(Ecore_Con_Server *svr, Ecore_Con_Socks_v5 *v5)
+{
+ size_t size;
+ unsigned char *data;
+ switch (v5->method)
+ {
+ case ECORE_CON_SOCKS_V5_METHOD_NONE:
+ svr->ecs_state = ECORE_CON_PROXY_STATE_REQUEST;
+ return EINA_TRUE;
+ case ECORE_CON_SOCKS_V5_METHOD_GSSAPI:
+ return EINA_TRUE;
+ case ECORE_CON_SOCKS_V5_METHOD_USERPASS:
+ if (!v5->username) return EINA_FALSE;
+ if (!v5->password) v5->plen = 1;
+ /* http://tools.ietf.org/html/rfc1929 */
+ size = sizeof(char) * (3 + v5->ulen + v5->plen);
+ data = malloc(size);
+ if (!data) break;
+ data[0] = 1;
+ data[1] = v5->ulen;
+ memcpy(&data[2], v5->username, v5->ulen);
+ data[1 + v5->ulen] = v5->plen;
+ if (v5->password)
+ memcpy(&data[2 + v5->ulen], v5->password, v5->plen);
+ else
+ data[2 + v5->ulen] = 0;
+ svr->ecs_buf = eina_binbuf_manage_new_length(data, size);
+ return EINA_TRUE;
+ default:
+ break;
+ }
+ return EINA_FALSE;
+}
+
+static void
+_ecore_con_socks_read_v5(Ecore_Con_Server *svr, Ecore_Con_Socks_v5 *v5, const unsigned char *buf, unsigned int num)
+{
+ const unsigned char *data;
+
+ DBG("SOCKS: %d bytes", num);
+ switch (svr->ecs_state)
{
- DBG("SOCKS: %d bytes", num);
- if (num < 8)
- {
- if (!svr->ecs_recvbuf) svr->ecs_recvbuf = eina_binbuf_new();
- if (!svr->ecs_recvbuf) goto error;
- eina_binbuf_append_length(svr->ecs_recvbuf, buf, num);
- /* the slowest connection on earth */
- if (eina_binbuf_length_get(svr->ecs_recvbuf) != 8) return;
- data = eina_binbuf_string_get(svr->ecs_recvbuf);
- }
- else if (num > 8) goto error;
- else
- data = buf;
- /* http://ufasoft.com/doc/socks4_protocol.htm */
- if (data[0]) goto error;
- switch (data[1])
+ case ECORE_CON_PROXY_STATE_READ:
+ ECORE_CON_SOCKS_READ(2);
+ /* http://en.wikipedia.org/wiki/SOCKS */
+ if (data[0] != 5) goto error;
+ if (data[1] == 0xFF)
+ {
+ ecore_con_event_server_error(svr, "proxy authentication methods rejected");
+ goto error;
+ }
+ v5->method = data[1];
+ if (!_ecore_con_socks_auth_v5(svr, v5)) goto error;
+ if (svr->ecs_state == ECORE_CON_PROXY_STATE_REQUEST)
+ {
+ /* run again to skip auth reading */
+ _ecore_con_socks_read_v5(svr, v5, NULL, 0);
+ return;
+ }
+ ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_WRITE);
+ svr->ecs_state = ECORE_CON_PROXY_STATE_AUTH;
+ break;
+ case ECORE_CON_PROXY_STATE_AUTH:
+ ECORE_CON_SOCKS_READ(2);
+ switch (v5->method)
+ {
+ case ECORE_CON_SOCKS_V5_METHOD_NONE:
+ CRIT("HOW DID THIS HAPPEN?????????");
+ goto error;
+ case ECORE_CON_SOCKS_V5_METHOD_GSSAPI:
+ /* TODO: this */
+ break;
+ case ECORE_CON_SOCKS_V5_METHOD_USERPASS:
+ if (data[0] != 1)
+ {
+ ecore_con_event_server_error(svr, "protocol error");
+ goto error; /* wrong version */
+ }
+ if (data[1])
+ {
+ ecore_con_event_server_error(svr, "proxy request authentication rejected");
+ goto error;
+ }
+ default:
+ break;
+ }
+ case ECORE_CON_PROXY_STATE_REQUEST:
{
- case 90:
- /* success! */
- break;
- case 91:
- ecore_con_event_server_error(svr, "proxy request rejected or failed");
- goto error;
- case 92:
- ecore_con_event_server_error(svr, "proxying SOCKS server could not perform authentication");
- goto error;
- case 93:
- ecore_con_event_server_error(svr, "proxy request authentication rejected");
- goto error;
- default:
- ecore_con_event_server_error(svr, "garbage data from proxy");
- goto error;
+ size_t addrlen, buflen;
+ unsigned char *sbuf;
+ addrlen = v5->lookup ? strlen(svr->name) + 1 : (unsigned int)svr->ecs_addrlen;
+ buflen = sizeof(char) * (6 + addrlen);
+ sbuf = malloc(buflen);
+ if (!sbuf)
+ {
+ ecore_con_event_server_error(svr, "Memory allocation failure!");
+ goto error;
+ }
+ sbuf[0] = 5;
+ sbuf[1] = v5->bind ? 2 : 1; /* TODO: 0x03 for UDP port association */
+ sbuf[2] = 0;
+ if (v5->lookup) /* domain name */
+ {
+ sbuf[3] = 3;
+ sbuf[4] = addrlen - 1;
+ memcpy(sbuf + 5, svr->name, addrlen - 1);
+ }
+ else
+ {
+ sbuf[3] = (svr->ecs_addrlen == 4) ? 1 : 4;
+ memcpy(sbuf + 4, svr->ecs_addr, addrlen);
+ }
+ sbuf[addrlen + 4] = svr->port >> 8;
+ sbuf[addrlen + 5] = svr->port & 0xff;
+
+ svr->ecs_buf = eina_binbuf_manage_new_length(sbuf, buflen);
+ ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_WRITE);
+ break;
}
- if (svr->ecs->bind)
+ case ECORE_CON_PROXY_STATE_CONFIRM:
{
- unsigned int nport;
- char naddr[IF_NAMESIZE];
-
- memcpy(&nport, &data[2], 2);
- svr->proxyport = ntohl(nport);
-
- if (!inet_ntop(AF_INET, &data[4], naddr, sizeof(naddr))) goto error;
- svr->proxyip = eina_stringshare_add(naddr);
- ecore_con_event_proxy_bind(svr);
+ /* this is ugly because we have to read an exact number of bytes,
+ * but we don't know what that number is until we've already read
+ * at least 5 bytes to determine the length of the unknown stream.
+ * yep.
+ */
+ size_t to_read, len = svr->ecs_recvbuf ? eina_binbuf_length_get(svr->ecs_recvbuf) : 0;
+ if (num + len < 5)
+ {
+ /* guarantees we get called again */
+ ECORE_CON_SOCKS_READ(5);
+ }
+ if (len >= 5)
+ {
+ data = eina_binbuf_string_get(svr->ecs_recvbuf);
+ data += 3;
+ }
+ else
+ data = buf + 3 - len;
+ switch (data[0])
+ {
+ case 1:
+ to_read = 4;
+ break;
+ case 3:
+ to_read = data[1] + 1;
+ break;
+ case 4:
+ to_read = 16;
+ /* lazy debugging stub comment */
+ break;
+ default:
+ ecore_con_event_server_error(svr, "protocol error");
+ goto error;
+ }
+ /* at this point, we finally know exactly how much we need to read */
+ ECORE_CON_SOCKS_READ(6 + to_read);
+
+ if (data[0] != 5)
+ {
+ ecore_con_event_server_error(svr, "protocol error");
+ goto error; /* wrong version */
+ }
+ switch (data[1])
+ {
+ case 0:
+ break;
+ case 1:
+ ecore_con_event_server_error(svr, "general proxy failure");
+ goto error;
+ case 2:
+ ecore_con_event_server_error(svr, "connection not allowed by ruleset");
+ goto error;
+ case 3:
+ ecore_con_event_server_error(svr, "network unreachable");
+ goto error;
+ case 4:
+ ecore_con_event_server_error(svr, "host unreachable");
+ goto error;
+ case 5:
+ ecore_con_event_server_error(svr, "connection refused by destination host");
+ goto error;
+ case 6:
+ ecore_con_event_server_error(svr, "TTL expired");
+ goto error;
+ case 7:
+ ecore_con_event_server_error(svr, "command not supported / protocol error");
+ goto error;
+ case 8:
+ ecore_con_event_server_error(svr, "address type not supported");
+ default:
+ goto error;
+ }
+ if (data[2])
+ {
+ ecore_con_event_server_error(svr, "protocol error");
+ goto error;
+ }
+ memset(svr->ecs_addr, 0, sizeof(svr->ecs_addr));
+ if (!svr->ssl_state)
+ ecore_con_event_server_add(svr);
+ if (svr->ssl_state || (svr->buf && eina_binbuf_length_get(svr->buf)))
+ ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
+ svr->ecs_buf_offset = svr->ecs_addrlen = 0;
+ svr->ecs_state = ECORE_CON_PROXY_STATE_DONE;
+ INF("PROXY CONNECTED");
+ break;
}
- svr->ecs_state = ECORE_CON_SOCKS_STATE_DONE;
- INF("PROXY CONNECTED");
- if (svr->ecs_recvbuf) eina_binbuf_free(svr->ecs_recvbuf);
- svr->ecs_recvbuf = NULL;
- svr->ecs_buf_offset = svr->ecs_addrlen = 0;
- memset(svr->ecs_addr, 0, sizeof(svr->ecs_addr));
- if (!svr->ssl_state)
- ecore_con_event_server_add(svr);
- if (svr->ssl_state || (svr->buf && eina_binbuf_length_get(svr->buf)))
- ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_READ | ECORE_FD_WRITE);
+ default:
+ break;
}
+ if (svr->ecs_recvbuf) eina_binbuf_free(svr->ecs_recvbuf);
+ svr->ecs_recvbuf = NULL;
+
return;
error:
_ecore_con_server_kill(svr);
}
+/////////////////////////////////////////////////////////////////////////////////////
+void
+ecore_con_socks_shutdown(void)
+{
+ Ecore_Con_Socks *ecs;
+ EINA_LIST_FREE(ecore_con_socks_proxies, ecs)
+ _ecore_con_socks_free(ecs);
+ _ecore_con_proxy_once = NULL;
+ _ecore_con_proxy_global = NULL;
+}
+
+void
+ecore_con_socks_read(Ecore_Con_Server *svr, unsigned char *buf, int num)
+{
+ ECORE_CON_SOCKS_CAST_ELSE(svr->ecs) return;
+
+ if (svr->ecs_state < ECORE_CON_PROXY_STATE_READ) return;
+
+ if (v4) _ecore_con_socks_read_v4(svr, v4, buf, (unsigned int)num);
+ else _ecore_con_socks_read_v5(svr, v5, buf, (unsigned int)num);
+}
+
Eina_Bool
ecore_con_socks_svr_init(Ecore_Con_Server *svr)
{
- unsigned char *sbuf;
ECORE_CON_SOCKS_CAST_ELSE(svr->ecs) return EINA_FALSE;
if (!svr->ip) return EINA_FALSE;
if (svr->ecs_buf) return EINA_FALSE;
- if (svr->ecs_state != ECORE_CON_SOCKS_STATE_INIT) return EINA_FALSE;
+ if (svr->ecs_state != ECORE_CON_PROXY_STATE_INIT) return EINA_FALSE;
ecore_main_fd_handler_active_set(svr->fd_handler, ECORE_FD_WRITE);
- if (v4)
- {
- size_t addrlen, buflen, ulen = 1;
- addrlen = svr->ecs->lookup ? strlen(svr->name) + 1: 0;
- if (svr->ecs->username) ulen += strlen(svr->ecs->username);
- buflen = sizeof(char) * (8 + ulen + addrlen);
- sbuf = malloc(buflen);
- if (!sbuf)
- {
- ecore_con_event_server_error(svr, "Memory allocation failure!");
- _ecore_con_server_kill(svr);
- return EINA_FALSE;
- }
- /* http://en.wikipedia.org/wiki/SOCKS */
- sbuf[0] = 4;
- sbuf[1] = v4->bind ? 2 : 1;
- sbuf[2] = svr->port >> 8;
- sbuf[3] = svr->port & 0xff;
- if (addrlen)
- {
- sbuf[4] = sbuf[5] = sbuf[6] = 0;
- sbuf[7] = 1;
- }
- else
- memcpy(sbuf + 4, svr->ecs_addr, 4);
- if (svr->ecs->username)
- memcpy(sbuf + 8, svr->ecs->username, ulen);
- else
- sbuf[8] = 0;
- if (addrlen) memcpy(sbuf + 8 + ulen, svr->name, addrlen);
-
- svr->ecs_buf = eina_binbuf_manage_new_length(sbuf, buflen);
- }
- return EINA_TRUE;
+ if (v4) return _ecore_con_socks_svr_init_v4(svr, v4);
+ return _ecore_con_socks_svr_init_v5(svr, v5);
}
void
-ecore_con_socks_dns_cb(const char *canonname __UNUSED__, const char *ip, struct sockaddr *addr, int addrlen, Ecore_Con_Server *svr)
+ecore_con_socks_dns_cb(const char *canonname __UNUSED__, const char *ip, struct sockaddr *addr, int addrlen __UNUSED__, Ecore_Con_Server *svr)
{
svr->ip = eina_stringshare_add(ip);
- svr->ecs_addrlen = addrlen;
svr->ecs_state++;
if (addr->sa_family == AF_INET)
- memcpy(svr->ecs_addr, &((struct sockaddr_in *)addr)->sin_addr.s_addr, 4);
+ {
+ memcpy(svr->ecs_addr, &((struct sockaddr_in *)addr)->sin_addr.s_addr, 4);
+ svr->ecs_addrlen = 4;
+ }
#ifdef HAVE_IPV6
else
- memcpy(svr->ecs_addr, &((struct sockaddr_in6 *)addr)->sin6_addr.s6_addr, addrlen);
+ {
+ memcpy(svr->ecs_addr, &((struct sockaddr_in6 *)addr)->sin6_addr.s6_addr, 16);
+ svr->ecs_addrlen = 16;
+ }
#endif
ecore_con_socks_svr_init(svr);
}
ecore_con_socks_init(void)
{
const char *socks;
- char *u, *h, *p, *l;
- char buf[64];
+ char *h, *p, *l, *u = NULL;
+ char buf[512];
int port, lookup = 0;
+ Eina_Bool v5 = EINA_FALSE;
Ecore_Con_Socks *ecs;
unsigned char addr[sizeof(struct in_addr)];
+#ifdef HAVE_IPV6
+ unsigned char addr6[sizeof(struct in6_addr)];
+#endif
- /* ECORE_CON_SOCKS_V4=user@host:port:[1|0] */
+ /* ECORE_CON_SOCKS_V4=[user@]host:port-[1|0] */
socks = getenv("ECORE_CON_SOCKS_V4");
- if ((!socks) || (!socks[0]) || (strlen(socks) > 64)) return;
+ if (!socks)
+ {
+ /* ECORE_CON_SOCKS_V5=[user@]host-port:[1|0] */
+ socks = getenv("ECORE_CON_SOCKS_V5");
+ v5 = EINA_TRUE;
+ }
+ if ((!socks) || (!socks[0]) || (strlen(socks) > 512)) return;
strncpy(buf, socks, sizeof(buf));
h = strchr(buf, '@');
- u = NULL;
/* username */
if (h && (h - buf > 0)) *h++ = 0, u = buf;
else h = buf;
/* host ip; I ain't resolvin shit here */
- p = strchr(h, ':');
+ p = strchr(h, '-');
if (!p) return;
*p++ = 0;
- if (!inet_pton(AF_INET, h, addr)) return;
+ if (!inet_pton(AF_INET, h, addr))
+#ifdef HAVE_IPV6
+ {
+ if (!v5) return;
+ if (!inet_pton(AF_INET6, h, addr6))
+ return;
+ }
+#else
+ return;
+#endif
errno = 0;
port = strtol(p, &l, 10);
if (errno || (port < 0) || (port > 65535)) return;
if (l && (l[0] == ':'))
lookup = (l[1] == '1');
- ecs = ecore_con_socks4_remote_add(h, port, u);
+ if (v5)
+ ecs = ecore_con_socks5_remote_add(h, port, u, NULL);
+ else
+ ecs = ecore_con_socks4_remote_add(h, port, u);
if (!ecs) return;
- ecore_con_socks4_lookup_set(ecs, lookup);
+ ecore_con_socks_lookup_set(ecs, lookup);
ecore_con_socks_apply_always(ecs);
INF("Added global proxy server %s%s%s:%d - DNS lookup %s",
u ?: "", u ? "@" : "", h, port, lookup ? "ENABLED" : "DISABLED");
ecore_con_socks4_remote_add(const char *ip, int port, const char *username)
{
Ecore_Con_Socks *ecs;
+ size_t ulen = 0;
if ((!ip) || (!ip[0]) || (port < 0) || (port > 65535)) return NULL;
- ecs = _ecore_con_socks_find(4, ip, port, username);
+ if (username)
+ {
+ ulen = strlen(username);
+ /* max length for protocol */
+ if ((!ulen) || (ulen > 255)) return NULL;
+ }
+ ecs = _ecore_con_socks_find(4, ip, port, username, ulen, NULL, 0);
if (ecs) return ecs;
ecs = calloc(1, sizeof(Ecore_Con_Socks_v4));
ecs->ip = eina_stringshare_add(ip);
ecs->port = port;
ecs->username = eina_stringshare_add(username);
+ ecs->ulen = ulen;
ecore_con_socks_proxies = eina_list_append(ecore_con_socks_proxies, ecs);
return ecs;
}
/**
- * Set DNS lookup mode on an existing SOCKS v4 proxy
+ * Find a SOCKS v4 proxy in the proxy list
*
- * According to RFC, SOCKS v4 does not require that a proxy perform
- * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
- * for this. If you want to enable remote DNS lookup and are sure that your
- * proxy supports it, use this function.
- * @param ecs The proxy object
- * @param enable If true, the proxy will perform the dns lookup
- * @note By default, this setting is DISABLED.
+ * Use this to determine if a SOCKS proxy was previously added by checking
+ * the proxy list against the parameters given.
+ * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
+ * @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
+ * @param username The username used for the proxy (OPTIONAL)
+ * @return true only if a proxy exists matching the given params
+ * @note This function matches slightly more loosely than ecore_con_socks4_remote_add(), and
+ * ecore_con_socks4_remote_add() should be used to return the actual object.
* @since 1.2
*/
-EAPI void
-ecore_con_socks4_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable)
+EAPI Eina_Bool
+ecore_con_socks4_remote_exists(const char *ip, int port, const char *username)
{
- ECORE_CON_SOCKS_CAST_ELSE(ecs) return;
- if (v4) v4->lookup = !!enable;
+ if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0])))
+ return EINA_FALSE;
+ return !!_ecore_con_socks_find(4, ip, port, username, username ? strlen(username) : 0, NULL, 0);
}
/**
- * Get DNS lookup mode on an existing SOCKS v4 proxy
+ * Remove a SOCKS v4 proxy from the proxy list and delete it
*
- * According to RFC, SOCKS v4 does not require that a proxy perform
- * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
- * for this. This function returns whether lookups are enabled on a proxy object.
- * @param ecs The proxy object
- * @return If true, the proxy will perform the dns lookup
- * @note By default, this setting is DISABLED.
+ * Use this to remove a SOCKS proxy from the proxy list by checking
+ * the list against the parameters given. The proxy will then be deleted.
+ * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
+ * @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
+ * @param username The username used for the proxy (OPTIONAL)
+ * @note This function matches in the same way as ecore_con_socks4_remote_exists().
+ * @warning Be aware that deleting a proxy which is being used WILL ruin your life.
* @since 1.2
*/
-EAPI Eina_Bool
-ecore_con_socks4_lookup_get(Ecore_Con_Socks *ecs)
+EAPI void
+ecore_con_socks4_remote_del(const char *ip, int port, const char *username)
{
- ECORE_CON_SOCKS_CAST_ELSE(ecs) return EINA_FALSE;
- return v4 ? v4->lookup : EINA_FALSE;
+ Ecore_Con_Socks_v4 *v4;
+
+ if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0]))) return;
+ if (!ecore_con_socks_proxies) return;
+
+ v4 = (Ecore_Con_Socks_v4*)_ecore_con_socks_find(4, ip, port, username, username ? strlen(username) : 0, NULL, 0);
+ if (!v4) return;
+ ecore_con_socks_proxies = eina_list_remove(ecore_con_socks_proxies, v4);
+ _ecore_con_socks_free((Ecore_Con_Socks*)v4);
+}
+/**
+ * Add a SOCKS v5 proxy to the proxy list
+ *
+ * Use this to create (or return, if previously added) a SOCKS proxy
+ * object which can be used by any ecore_con servers.
+ * @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
+ * @param port The port to connect to on the proxy
+ * @param username The username to use for the proxy (OPTIONAL)
+ * @param password The password to use for the proxy (OPTIONAL)
+ * @return An allocated proxy object, or NULL on failure
+ * @note This object NEVER needs to be explicitly freed.
+ * @since 1.2
+ */
+EAPI Ecore_Con_Socks *
+ecore_con_socks5_remote_add(const char *ip, int port, const char *username, const char *password)
+{
+ Ecore_Con_Socks_v5 *ecs5;
+ size_t ulen = 0, plen = 0;
+
+ if ((!ip) || (!ip[0]) || (port < 0) || (port > 65535)) return NULL;
+
+ if (username)
+ {
+ ulen = strlen(username);
+ /* max length for protocol */
+ if ((!ulen) || (ulen > 255)) return NULL;
+ }
+ if (password)
+ {
+ plen = strlen(password);
+ /* max length for protocol */
+ if ((!plen) || (plen > 255)) return NULL;
+ }
+ ecs5 = (Ecore_Con_Socks_v5*)_ecore_con_socks_find(5, ip, port, username, ulen, password, plen);
+ if (ecs5) return (Ecore_Con_Socks*)ecs5;
+
+ ecs5 = calloc(1, sizeof(Ecore_Con_Socks_v5));
+ if (!ecs5) return NULL;
+
+ ecs5->version = 5;
+ ecs5->ip = eina_stringshare_add(ip);
+ ecs5->port = port;
+ ecs5->username = eina_stringshare_add(username);
+ ecs5->ulen = ulen;
+ ecs5->password = eina_stringshare_add(password);
+ ecs5->plen = plen;
+ ecore_con_socks_proxies = eina_list_append(ecore_con_socks_proxies, ecs5);
+ return (Ecore_Con_Socks*)ecs5;
}
/**
- * Find a SOCKS v4 proxy in the proxy list
+ * Find a SOCKS v5 proxy in the proxy list
*
* Use this to determine if a SOCKS proxy was previously added by checking
* the proxy list against the parameters given.
* @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
* @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
* @param username The username used for the proxy (OPTIONAL)
+ * @param password The password used for the proxy (OPTIONAL)
* @return true only if a proxy exists matching the given params
- * @note This function matches slightly more loosely than ecore_con_socks4_remote_add(), and
- * ecore_con_socks4_remote_add() should be used to return the actual object.
+ * @note This function matches slightly more loosely than ecore_con_socks5_remote_add(), and
+ * ecore_con_socks5_remote_add() should be used to return the actual object.
* @since 1.2
*/
EAPI Eina_Bool
-ecore_con_socks4_remote_exists(const char *ip, int port, const char *username)
+ecore_con_socks5_remote_exists(const char *ip, int port, const char *username, const char *password)
{
- if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0])))
+ if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0])) || (password && (!password[0])))
return EINA_FALSE;
- return !!_ecore_con_socks_find(4, ip, port, username);
+ return !!_ecore_con_socks_find(5, ip, port, username, username ? strlen(username) : 0, password, password ? strlen(password) : 0);
}
/**
- * Remove a SOCKS v4 proxy from the proxy list and delete it
+ * Remove a SOCKS v5 proxy from the proxy list and delete it
*
* Use this to remove a SOCKS proxy from the proxy list by checking
* the list against the parameters given. The proxy will then be deleted.
* @param ip The ip address of the proxy (NOT DOMAIN NAME. IP ADDRESS.)
* @param port The port to connect to on the proxy, or -1 to match the first proxy with @p ip
* @param username The username used for the proxy (OPTIONAL)
+ * @param password The password used for the proxy (OPTIONAL)
* @note This function matches in the same way as ecore_con_socks4_remote_exists().
* @warning Be aware that deleting a proxy which is being used WILL ruin your life.
* @since 1.2
*/
EAPI void
-ecore_con_socks4_remote_del(const char *ip, int port, const char *username)
+ecore_con_socks5_remote_del(const char *ip, int port, const char *username, const char *password)
{
- Ecore_Con_Socks_v4 *v4;
+ Ecore_Con_Socks_v5 *v5;
- if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0]))) return;
+ if ((!ip) || (!ip[0]) || (port < -1) || (port > 65535) || (username && (!username[0])) || (password && (!password[0])))
+ return;
if (!ecore_con_socks_proxies) return;
- v4 = (Ecore_Con_Socks_v4*)_ecore_con_socks_find(4, ip, port, username);
- if (!v4) return;
- ecore_con_socks_proxies = eina_list_remove(ecore_con_socks_proxies, v4);
- _ecore_con_socks_free((Ecore_Con_Socks*)v4);
+ v5 = (Ecore_Con_Socks_v5*)_ecore_con_socks_find(5, ip, port, username, username ? strlen(username) : 0, password, password ? strlen(password) : 0);
+ if (!v5) return;
+ ecore_con_socks_proxies = eina_list_remove(ecore_con_socks_proxies, v5);
+ _ecore_con_socks_free((Ecore_Con_Socks*)v5);
+}
+
+/**
+ * Set DNS lookup mode on an existing SOCKS proxy
+ *
+ * According to RFC, SOCKS v4 does not require that a proxy perform
+ * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
+ * for this. SOCKS v5 allows DNS lookups.
+ * If you want to enable remote DNS lookup and are sure that your
+ * proxy supports it, use this function.
+ * @param ecs The proxy object
+ * @param enable If true, the proxy will perform the dns lookup
+ * @note By default, this setting is DISABLED.
+ * @since 1.2
+ */
+EAPI void
+ecore_con_socks_lookup_set(Ecore_Con_Socks *ecs, Eina_Bool enable)
+{
+ ECORE_CON_SOCKS_CAST_ELSE(ecs) return;
+ ecs->lookup = !!enable;
+}
+
+/**
+ * Get DNS lookup mode on an existing SOCKS proxy
+ *
+ * According to RFC, SOCKS v4 does not require that a proxy perform
+ * its own DNS lookups for addresses. SOCKS v4a specifies the protocol
+ * for this. SOCKS v5 allows DNS lookups.
+ * This function returns whether lookups are enabled on a proxy object.
+ * @param ecs The proxy object
+ * @return If true, the proxy will perform the dns lookup
+ * @note By default, this setting is DISABLED.
+ * @since 1.2
+ */
+EAPI Eina_Bool
+ecore_con_socks_lookup_get(Ecore_Con_Socks *ecs)
+{
+ ECORE_CON_SOCKS_CAST_ELSE(ecs) return EINA_FALSE;
+ return ecs->lookup;
}
/**
return ecs->bind;
}
+/**
+ * Return SOCKS version of a SOCKS proxy
+ *
+ * Use this function to return the SOCKS protocol version of a proxy
+ * @param ecs The proxy object
+ * @return 0 on error, else 4/5
+ * @since 1.2
+ */
EAPI unsigned int
ecore_con_socks_version_get(Ecore_Con_Socks *ecs)
{
* @see ecore_con_socks_apply_once()
* @since 1.2
* @note ecore-con supports setting this through environment variables like so:
- * ECORE_CON_SOCKS_V4=[user@]server:port:lookup
+ * ECORE_CON_SOCKS_V4=[user@]server-port:lookup
+ * ECORE_CON_SOCKS_V5=[user@]server-port:lookup
* user is the OPTIONAL string that would be passed to the proxy as the username
* server is the IP_ADDRESS of the proxy server
* port is the port to connect to on the proxy server
* Use this function to add a SSL PEM certificate.
* Simply specify the cert here to use it in the server object for connecting or listening.
* If there is an error loading the certificate, an error will automatically be logged.
+ * @param svr The server object
* @param cert The path to the certificate.
* @return EINA_FALSE if the file cannot be loaded, otherwise EINA_TRUE.
*/
* Use this function to add a SSL PEM CA file.
* Simply specify the file here to use it in the server object for connecting or listening.
* If there is an error loading the CAs, an error will automatically be logged.
+ * @param svr The server object
* @param ca_file The path to the CA file.
* @return EINA_FALSE if the file cannot be loaded, otherwise EINA_TRUE.
* @note since 1.2, this function can load directores
* Use this function to add a SSL PEM private key
* Simply specify the key file here to use it in the server object for connecting or listening.
* If there is an error loading the key, an error will automatically be logged.
+ * @param svr The server object
* @param key_file The path to the key file.
* @return EINA_FALSE if the file cannot be loaded,
* otherwise EINA_TRUE.
* Use this function to add a SSL PEM CRL file
* Simply specify the CRL file here to use it in the server object for connecting or listening.
* If there is an error loading the CRL, an error will automatically be logged.
+ * @param svr The server object
* @param crl_file The path to the CRL file.
* @return EINA_FALSE if the file cannot be loaded,
* otherwise EINA_TRUE.
#include "Ecore_Con.h"
#include "ecore_con_private.h"
+#define CURL_MIN_TIMEOUT 100
+
int ECORE_CON_EVENT_URL_DATA = 0;
int ECORE_CON_EVENT_URL_COMPLETE = 0;
int ECORE_CON_EVENT_URL_PROGRESS = 0;
#ifdef HAVE_CURL
+static void _ecore_con_url_event_url_complete(Ecore_Con_Url *url_con, CURLMsg *curlmsg);
+static void _ecore_con_url_multi_remove(Ecore_Con_Url *url_con);
static Eina_Bool _ecore_con_url_perform(Ecore_Con_Url *url_con);
-static size_t _ecore_con_url_header_cb(void *ptr,
- size_t size,
- size_t nitems,
- void *stream);
-static size_t _ecore_con_url_data_cb(void *buffer,
- size_t size,
- size_t nitems,
- void *userp);
-static int _ecore_con_url_progress_cb(void *clientp,
- double dltotal,
- double dlnow,
- double ultotal,
- double ulnow);
-static size_t _ecore_con_url_read_cb(void *ptr,
- size_t size,
- size_t nitems,
- void *stream);
-static void _ecore_con_event_url_free(void *data __UNUSED__,
- void *ev);
-static Eina_Bool _ecore_con_url_idler_handler(void *data);
-static Eina_Bool _ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__);
+static size_t _ecore_con_url_header_cb(void *ptr, size_t size, size_t nitems, void *stream);
+static size_t _ecore_con_url_data_cb(void *buffer, size_t size, size_t nitems, void *userp);
+static int _ecore_con_url_progress_cb(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow);
+static size_t _ecore_con_url_read_cb(void *ptr, size_t size, size_t nitems, void *stream);
+static void _ecore_con_event_url_free(Ecore_Con_Url *url_con, void *ev);
+static Eina_Bool _ecore_con_url_timer(void *data);
+static Eina_Bool _ecore_con_url_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_con_url_timeout_cb(void *data);
+static void _ecore_con_url_status_get(Ecore_Con_Url *url_con);
static Eina_List *_url_con_list = NULL;
static Eina_List *_fd_hd_list = NULL;
static CURLM *_curlm = NULL;
-static fd_set _current_fd_set;
static int _init_count = 0;
-static Ecore_Timer *_curl_timeout = NULL;
+static Ecore_Timer *_curl_timer = NULL;
static Eina_Bool pipelining = EINA_FALSE;
#endif
ecore_con_url_init(void)
{
#ifdef HAVE_CURL
+ long ms;
if (++_init_count > 1) return _init_count;
- if (!ECORE_CON_EVENT_URL_DATA) ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
- if (!ECORE_CON_EVENT_URL_COMPLETE) ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
- if (!ECORE_CON_EVENT_URL_PROGRESS) ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
+ ECORE_CON_EVENT_URL_DATA = ecore_event_type_new();
+ ECORE_CON_EVENT_URL_COMPLETE = ecore_event_type_new();
+ ECORE_CON_EVENT_URL_PROGRESS = ecore_event_type_new();
+
+ // curl_global_init() is not thread safe!
+ if (curl_global_init(CURL_GLOBAL_ALL)) return --_init_count;
+ _curlm = curl_multi_init();
if (!_curlm)
{
- long ms;
-
- // curl_global_init() is not thread safe!
- if (curl_global_init(CURL_GLOBAL_ALL)) return --_init_count;
-
- _curlm = curl_multi_init();
- if (!_curlm) return --_init_count;
+ curl_global_cleanup();
+ return --_init_count;
+ }
- curl_multi_timeout(_curlm, &ms);
- if (ms <= 0) ms = 100;
+ curl_multi_timeout(_curlm, &ms);
+ if (ms >= CURL_MIN_TIMEOUT || ms <= 0) ms = CURL_MIN_TIMEOUT;
- _curl_timeout = ecore_timer_add((double)ms / 1000, _ecore_con_url_idler_handler, (void *)0xACE);
- ecore_timer_freeze(_curl_timeout);
- }
+ _curl_timer = ecore_timer_add((double)ms / 1000, _ecore_con_url_timer, NULL);
+ ecore_timer_freeze(_curl_timer);
return _init_count;
#else
ecore_con_url_shutdown(void)
{
#ifdef HAVE_CURL
+ Ecore_Con_Url *url_con;
+ Ecore_Fd_Handler *fd_handler;
if (_init_count == 0) return 0;
+ --_init_count;
+ if (_init_count) return _init_count;
- if (--_init_count == 0)
+ if (_curl_timer)
{
- Ecore_Con_Url *con_url;
- Ecore_Fd_Handler *fd_handler;
-
- if (_curl_timeout)
- {
- ecore_timer_del(_curl_timeout);
- _curl_timeout = NULL;
- }
+ ecore_timer_del(_curl_timer);
+ _curl_timer = NULL;
+ }
- FD_ZERO(&_current_fd_set);
- EINA_LIST_FREE(_url_con_list, con_url) ecore_con_url_free(con_url);
- EINA_LIST_FREE(_fd_hd_list, fd_handler) ecore_main_fd_handler_del(fd_handler);
+ EINA_LIST_FREE(_url_con_list, url_con)
+ ecore_con_url_free(url_con);
+ EINA_LIST_FREE(_fd_hd_list, fd_handler)
+ ecore_main_fd_handler_del(fd_handler);
- if (_curlm)
- {
- curl_multi_cleanup(_curlm);
- _curlm = NULL;
- }
- curl_global_cleanup();
- }
- return _init_count;
+ if (_curlm)
+ {
+ curl_multi_cleanup(_curlm);
+ _curlm = NULL;
+ }
+ curl_global_cleanup();
+ return 0;
#endif
return 1;
}
ecore_con_url_pipeline_set(Eina_Bool enable)
{
#ifdef HAVE_CURL
- if (enable)
- curl_multi_setopt(_curlm, CURLMOPT_PIPELINING, 1);
- else
- curl_multi_setopt(_curlm, CURLMOPT_PIPELINING, 0);
- pipelining = enable;
+ if (enable == pipelining) return;
+ curl_multi_setopt(_curlm, CURLMOPT_PIPELINING, !!enable);
+ pipelining = enable;
#else
- return;
- (void)enable;
+ return;
+ (void)enable;
#endif
}
ecore_con_url_pipeline_get(void)
{
#ifdef HAVE_CURL
- return pipelining;
+ return pipelining;
#endif
- return EINA_FALSE;
+ return EINA_FALSE;
}
+extern Ecore_Con_Socks *_ecore_con_proxy_global;
+
EAPI Ecore_Con_Url *
ecore_con_url_new(const char *url)
{
return NULL;
}
+ // Read socks proxy
url_con->proxy_type = -1;
- if (_ecore_con_proxy_global)
+ if (_ecore_con_proxy_global && _ecore_con_proxy_global->ip &&
+ (_ecore_con_proxy_global->version == 4 ||
+ _ecore_con_proxy_global->version == 5))
{
- if (_ecore_con_proxy_global->ip)
+ char proxy[256];
+ char host[256];
+
+ if (_ecore_con_proxy_global->version == 5)
{
- char host[128];
- if (_ecore_con_proxy_global->port > 0 &&
- _ecore_con_proxy_global->port <= 65535)
- snprintf(host, sizeof(host), "socks4://%s:%d",
- _ecore_con_proxy_global->ip,
- _ecore_con_proxy_global->port);
- else
- snprintf(host, sizeof(host), "socks4://%s",
+ if (_ecore_con_proxy_global->lookup)
+ snprintf(host, sizeof(host), "socks5h://%s",
+ _ecore_con_proxy_global->ip);
+ else snprintf(host, sizeof(host), "socks5://%s",
+ _ecore_con_proxy_global->ip);
+ }
+ else if (_ecore_con_proxy_global->version == 4)
+ {
+ if (_ecore_con_proxy_global->lookup)
+ snprintf(host, sizeof(host), "socks4a://%s",
_ecore_con_proxy_global->ip);
- ecore_con_url_proxy_set(url_con, host);
+ else snprintf(host, sizeof(host), "socks4://%s",
+ _ecore_con_proxy_global->ip);
}
+
+ if (_ecore_con_proxy_global->port > 0 &&
+ _ecore_con_proxy_global->port <= 65535)
+ snprintf(proxy, sizeof(proxy), "%s:%d", host,
+ _ecore_con_proxy_global->port);
+ else snprintf(proxy, sizeof(proxy), "%s", host);
+
+ ecore_con_url_proxy_set(url_con, proxy);
+ ecore_con_url_proxy_username_set(url_con,
+ _ecore_con_proxy_global->username);
}
ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_ENCODING, "gzip,deflate");
{
#ifdef HAVE_CURL
char *s;
- CURLMcode ret;
- if (!url_con)
- return;
+ if (!url_con) return;
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
return;
}
- ECORE_MAGIC_SET(url_con, ECORE_MAGIC_NONE);
-
if (url_con->curl_easy)
{
+ // FIXME : How can we delete curl_easy's fds ?? (Curl do not give this info.)
+ // This cause "Failed to delete epoll fd xx!" error messages
curl_easy_setopt(url_con->curl_easy, CURLOPT_PROGRESSFUNCTION, NULL);
curl_easy_setopt(url_con->curl_easy, CURLOPT_NOPROGRESS, EINA_TRUE);
- if (eina_list_data_find(_url_con_list, url_con))
+ if (url_con->multi)
{
- ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
- if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
+ _ecore_con_url_multi_remove(url_con);
_url_con_list = eina_list_remove(_url_con_list, url_con);
}
}
if (url_con->timer) ecore_timer_del(url_con->timer);
+ url_con->curl_easy = NULL;
+ url_con->timer = NULL;
+ url_con->dead = EINA_TRUE;
+ if (url_con->event_count) return;
+ ECORE_MAGIC_SET(url_con, ECORE_MAGIC_NONE);
+
curl_slist_free_all(url_con->headers);
EINA_LIST_FREE(url_con->additional_headers, s)
free(s);
#endif
}
+EAPI int
+ecore_con_url_status_code_get(Ecore_Con_Url *url_con)
+{
+#ifdef HAVE_CURL
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, __func__);
+ return 0;
+ }
+
+ if (url_con->status) return url_con->status;
+ _ecore_con_url_status_get(url_con);
+ return url_con->status;
+#else
+ return -1;
+ (void)url_con;
+#endif
+}
+
EAPI Eina_Bool
-ecore_con_url_url_set(Ecore_Con_Url *url_con,
- const char *url)
+ecore_con_url_url_set(Ecore_Con_Url *url_con, const char *url)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
-
+ if (url_con->dead) return EINA_FALSE;
eina_stringshare_replace(&url_con->url, url);
if (url_con->url)
}
EAPI void
-ecore_con_url_data_set(Ecore_Con_Url *url_con,
- void *data)
+ecore_con_url_data_set(Ecore_Con_Url *url_con, void *data)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
}
EAPI void
-ecore_con_url_additional_header_add(Ecore_Con_Url *url_con,
- const char *key,
- const char *value)
+ecore_con_url_additional_header_add(Ecore_Con_Url *url_con, const char *key, const char *value)
{
#ifdef HAVE_CURL
char *tmp;
+ if (url_con->dead) return;
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL,
return;
}
+ if (url_con->dead) return;
tmp = malloc(strlen(key) + strlen(value) + 3);
if (!tmp)
return;
}
EAPI void
-ecore_con_url_time(Ecore_Con_Url *url_con,
- Ecore_Con_Url_Time condition,
- double timestamp)
+ecore_con_url_time(Ecore_Con_Url *url_con, Ecore_Con_Url_Time condition, double timestamp)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return;
}
+ if (url_con->dead) return;
url_con->time_condition = condition;
url_con->timestamp = timestamp;
#else
}
EAPI void
-ecore_con_url_fd_set(Ecore_Con_Url *url_con,
- int fd)
+ecore_con_url_fd_set(Ecore_Con_Url *url_con, int fd)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return;
}
+ if (url_con->dead) return;
url_con->write_fd = fd;
#else
return;
}
EAPI Eina_Bool
-ecore_con_url_httpauth_set(Ecore_Con_Url *url_con,
- const char *username,
- const char *password,
- Eina_Bool safe)
+ecore_con_url_httpauth_set(Ecore_Con_Url *url_con, const char *username, const char *password, Eina_Bool safe)
{
#ifdef HAVE_CURL
CURLcode ret;
return EINA_FALSE;
}
+ if (url_con->dead) return EINA_FALSE;
# if LIBCURL_VERSION_NUM >= 0x071301
if ((username) && (password))
{
#define MODE_POST 2
static Eina_Bool
-_ecore_con_url_send(Ecore_Con_Url *url_con,
- int mode,
- const void *data,
- long length,
- const char *content_type)
+_ecore_con_url_send(Ecore_Con_Url *url_con, int mode, const void *data, long length, const char *content_type)
{
#ifdef HAVE_CURL
Eina_List *l;
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
-
- if (!url_con->url)
- return EINA_FALSE;
+ if (!url_con->url) return EINA_FALSE;
+ if (url_con->dead) return EINA_FALSE;
/* Free response headers from previous send() calls */
EINA_LIST_FREE(url_con->response_headers, s)
free((char *)s);
url_con->response_headers = NULL;
+ url_con->status = 0;
curl_slist_free_all(url_con->headers);
url_con->headers = NULL;
#endif
}
-EINA_DEPRECATED EAPI Eina_Bool
-ecore_con_url_send(Ecore_Con_Url *url_con,
- const void *data,
- long length,
- const char *content_type)
-{
- return _ecore_con_url_send(url_con, MODE_AUTO, data, length, content_type);
-}
-
EAPI Eina_Bool
ecore_con_url_get(Ecore_Con_Url *url_con)
{
}
EAPI Eina_Bool
-ecore_con_url_post(Ecore_Con_Url *url_con,
- const void *data,
- long length,
- const char *content_type)
+ecore_con_url_post(Ecore_Con_Url *url_con, const void *data, long length, const char *content_type)
{
return _ecore_con_url_send(url_con, MODE_POST, data, length, content_type);
}
EAPI Eina_Bool
-ecore_con_url_ftp_upload(Ecore_Con_Url *url_con,
- const char *filename,
- const char *user,
- const char *pass,
- const char *upload_dir)
+ecore_con_url_ftp_upload(Ecore_Con_Url *url_con, const char *filename, const char *user, const char *pass, const char *upload_dir)
{
#ifdef HAVE_CURL
char url[4096];
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
+ if (url_con->dead) return EINA_FALSE;
+ if (!url_con->url) return EINA_FALSE;
+ if ((!filename) || (!filename[0])) return EINA_FALSE;
- if (!url_con->url)
+ if (stat(filename, &file_info))
return EINA_FALSE;
- if (filename)
+ snprintf(userpwd, sizeof(userpwd), "%s:%s", user, pass);
+ ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_USERPWD, userpwd);
+ if (ret != CURLE_OK)
{
- if (stat(filename, &file_info))
- return EINA_FALSE;
-
- snprintf(userpwd, sizeof(userpwd), "%s:%s", user, pass);
- ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_USERPWD, userpwd);
- if (ret != CURLE_OK)
- {
- ERR("Could not set username and password for FTP upload: %s",
- curl_easy_strerror(ret));
- return EINA_FALSE;
- }
+ ERR("Could not set username and password for FTP upload: %s",
+ curl_easy_strerror(ret));
+ return EINA_FALSE;
+ }
- char tmp[PATH_MAX];
- snprintf(tmp, PATH_MAX, "%s", filename);
+ char tmp[PATH_MAX];
+ snprintf(tmp, PATH_MAX, "%s", filename);
- if (upload_dir)
- snprintf(url, sizeof(url), "ftp://%s/%s/%s", url_con->url,
- upload_dir, basename(tmp));
- else
- snprintf(url, sizeof(url), "ftp://%s/%s", url_con->url,
- basename(tmp));
+ if (upload_dir)
+ snprintf(url, sizeof(url), "ftp://%s/%s/%s", url_con->url,
+ upload_dir, basename(tmp));
+ else
+ snprintf(url, sizeof(url), "ftp://%s/%s", url_con->url,
+ basename(tmp));
- if (!ecore_con_url_url_set(url_con, url))
- return EINA_FALSE;
+ if (!ecore_con_url_url_set(url_con, url))
+ return EINA_FALSE;
- curl_easy_setopt(url_con->curl_easy, CURLOPT_INFILESIZE_LARGE,
- (curl_off_t)file_info.st_size);
- curl_easy_setopt(url_con->curl_easy, CURLOPT_UPLOAD, 1);
- curl_easy_setopt(url_con->curl_easy, CURLOPT_READFUNCTION,
- _ecore_con_url_read_cb);
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_INFILESIZE_LARGE,
+ (curl_off_t)file_info.st_size);
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_UPLOAD, 1);
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_READFUNCTION,
+ _ecore_con_url_read_cb);
- fd = fopen(filename, "rb");
- if (!fd)
- {
- ERR("Could not open \"%s\" for FTP upload", filename);
- return EINA_FALSE;
- }
- curl_easy_setopt(url_con->curl_easy, CURLOPT_READDATA, fd);
-
- return _ecore_con_url_perform(url_con);
+ fd = fopen(filename, "rb");
+ if (!fd)
+ {
+ ERR("Could not open \"%s\" for FTP upload", filename);
+ return EINA_FALSE;
}
+ curl_easy_setopt(url_con->curl_easy, CURLOPT_READDATA, fd);
+
+ return _ecore_con_url_perform(url_con);
#else
return EINA_FALSE;
(void)url_con;
(void)pass;
(void)upload_dir;
#endif
-
- return EINA_FALSE;
}
EAPI void
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEFILE, "");
#else
return;
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIESESSION, ignore);
#else
return;
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "ALL");
#else
return;
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "SESS");
#else
return;
}
EAPI void
-ecore_con_url_cookies_file_add(Ecore_Con_Url *url_con, const char * const file_name)
+ecore_con_url_cookies_file_add(Ecore_Con_Url *url_con, const char *const file_name)
{
#ifdef HAVE_CURL
if (!url_con)
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEFILE, file_name);
#else
return;
}
EAPI Eina_Bool
-ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con, const char * const cookiejar_file)
+ecore_con_url_cookies_jar_file_set(Ecore_Con_Url *url_con, const char *const cookiejar_file)
{
#ifdef HAVE_CURL
CURLcode ret;
return EINA_FALSE;
}
+ if (url_con->dead) return EINA_FALSE;
ret = curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIEJAR,
cookiejar_file);
if (ret != CURLE_OK)
return;
}
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_COOKIELIST, "FLUSH");
#else
return;
}
EAPI void
-ecore_con_url_verbose_set(Ecore_Con_Url *url_con,
- Eina_Bool verbose)
+ecore_con_url_verbose_set(Ecore_Con_Url *url_con, Eina_Bool verbose)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return;
}
- if (eina_list_data_find(_url_con_list, url_con)) return;
-
if (!url_con->url)
return;
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_VERBOSE, (int)verbose);
#else
return;
}
EAPI void
-ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con,
- Eina_Bool use_epsv)
+ecore_con_url_ftp_use_epsv_set(Ecore_Con_Url *url_con, Eina_Bool use_epsv)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return;
}
- if (eina_list_data_find(_url_con_list, url_con)) return;
-
if (!url_con->url)
return;
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_FTP_USE_EPSV, (int)use_epsv);
#else
return;
* @since 1.1.0
*/
EAPI void
-ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con,
- Eina_Bool verify)
+ecore_con_url_ssl_verify_peer_set(Ecore_Con_Url *url_con, Eina_Bool verify)
{
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
return;
}
- if (eina_list_data_find(_url_con_list, url_con)) return;
-
if (!url_con->url)
return;
+ if (url_con->dead) return;
curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, (int)verify);
#else
return;
#ifdef HAVE_CURL
if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
{
- ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_ssl_ca_set");
- return -1;
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_ssl_ca_set");
+ return -1;
}
- if (eina_list_data_find(_url_con_list, url_con)) return -1;
if (!url_con->url) return -1;
+ if (url_con->dead) return -1;
if (ca_path == NULL)
res = curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, 0);
else
{
- res = curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, 1);
- if (!res)
- res = curl_easy_setopt(url_con->curl_easy, CURLOPT_CAINFO, ca_path);
+ res = curl_easy_setopt(url_con->curl_easy, CURLOPT_SSL_VERIFYPEER, 1);
+ if (!res)
+ res = curl_easy_setopt(url_con->curl_easy, CURLOPT_CAINFO, ca_path);
}
#else
return -1;
}
EAPI Eina_Bool
+ecore_con_url_http_version_set(Ecore_Con_Url *url_con, Ecore_Con_Url_Http_Version version)
+{
+#ifdef HAVE_CURL
+ int res = -1;
+ if (!ECORE_MAGIC_CHECK(url_con, ECORE_MAGIC_CON_URL))
+ {
+ ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_http_version_set");
+ return EINA_FALSE;
+ }
+ if (url_con->dead) return EINA_FALSE;
+ switch (version)
+ {
+ case ECORE_CON_URL_HTTP_VERSION_1_0:
+ res = curl_easy_setopt(url_con->curl_easy,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_1_0);
+ break;
+
+ case ECORE_CON_URL_HTTP_VERSION_1_1:
+ res = curl_easy_setopt(url_con->curl_easy,
+ CURLOPT_HTTP_VERSION,
+ CURL_HTTP_VERSION_1_1);
+ break;
+
+ default:
+ break;
+ }
+ if (res != CURLE_OK)
+ {
+ ERR("curl http version setting failed: %s", curl_easy_strerror(res));
+ return EINA_FALSE;
+ }
+ return EINA_TRUE;
+#else
+ (void)url_con;
+ (void)version;
+ return EINA_FALSE;
+#endif
+}
+
+EAPI Eina_Bool
ecore_con_url_proxy_set(Ecore_Con_Url *url_con, const char *proxy)
{
#ifdef HAVE_CURL
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
if (!url_con->url) return EINA_FALSE;
+ if (url_con->dead) return EINA_FALSE;
if (!proxy) res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXY, "");
else
if (vers->version_num < 0x71507)
{
url_con->proxy_type = CURLPROXY_HTTP;
- if (strstr(proxy, "socks4")) url_con->proxy_type = CURLPROXY_SOCKS4;
- else if (strstr(proxy, "socks4a")) url_con->proxy_type = CURLPROXY_SOCKS4A;
- else if (strstr(proxy, "socks5")) url_con->proxy_type = CURLPROXY_SOCKS5;
- else if (strstr(proxy, "socks5h")) url_con->proxy_type = CURLPROXY_SOCKS5_HOSTNAME;
- res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXYTYPE, url_con->proxy_type);
+ if (strstr(proxy, "socks4a"))
+ url_con->proxy_type = CURLPROXY_SOCKS4A;
+ else if (strstr(proxy, "socks4"))
+ url_con->proxy_type = CURLPROXY_SOCKS4;
+ else if (strstr(proxy, "socks5h"))
+ url_con->proxy_type = CURLPROXY_SOCKS5_HOSTNAME;
+ else if (strstr(proxy, "socks5"))
+ url_con->proxy_type = CURLPROXY_SOCKS5;
+ res = curl_easy_setopt(url_con->curl_easy, CURLOPT_PROXYTYPE,
+ url_con->proxy_type);
if (res != CURLE_OK)
{
- ERR("curl proxy type setting failed: %s", curl_easy_strerror(res));
+ ERR("curl proxy type setting failed: %s",
+ curl_easy_strerror(res));
url_con->proxy_type = -1;
return EINA_FALSE;
}
return;
}
- if (eina_list_data_find(_url_con_list, url_con)) return;
+ if (url_con->dead) return;
if (!url_con->url || timeout < 0) return;
if (url_con->timer) ecore_timer_del(url_con->timer);
url_con->timer = ecore_timer_add(timeout, _ecore_con_url_timeout_cb, url_con);
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
+ if (url_con->dead) return EINA_FALSE;
if (!url_con->url) return EINA_FALSE;
- if (!username) return EINA_FALSE;
+ if ((!username) || (!username[0])) return EINA_FALSE;
if (url_con->proxy_type == CURLPROXY_SOCKS4 || url_con->proxy_type == CURLPROXY_SOCKS4A)
{
ERR("Proxy type should be socks5 and above");
ECORE_MAGIC_FAIL(url_con, ECORE_MAGIC_CON_URL, "ecore_con_url_proxy_password_set");
return EINA_FALSE;
}
- if (eina_list_data_find(_url_con_list, url_con)) return EINA_FALSE;
if (!url_con->url) return EINA_FALSE;
+ if (url_con->dead) return EINA_FALSE;
if (!password) return EINA_FALSE;
if (url_con->proxy_type == CURLPROXY_SOCKS4 || url_con->proxy_type == CURLPROXY_SOCKS4A)
{
*/
#ifdef HAVE_CURL
+static void
+_ecore_con_url_status_get(Ecore_Con_Url *url_con)
+{
+ long status = 0;
+
+ if (!url_con->curl_easy) return;
+ if (!curl_easy_getinfo(url_con->curl_easy, CURLINFO_RESPONSE_CODE, &status))
+ url_con->status = status;
+ else
+ url_con->status = 0;
+}
+
+static void
+_ecore_con_url_event_url_complete(Ecore_Con_Url *url_con, CURLMsg *curlmsg)
+{
+ Ecore_Con_Event_Url_Complete *e;
+
+ e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
+ if (!e) return;
+
+ if (curlmsg && (curlmsg->data.result == CURLE_OK))
+ {
+ if (!url_con->status)
+ _ecore_con_url_status_get(url_con);
+ }
+ else if (curlmsg)
+ ERR("Curl message have errors: %d", curlmsg->data.result);
+ else
+ CRIT("THIS IS BAD.");
+
+ e->status = url_con->status;
+ e->url_con = url_con;
+ url_con->event_count++;
+ ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, (Ecore_End_Cb)_ecore_con_event_url_free, url_con);
+}
+
+static void
+_ecore_con_url_multi_remove(Ecore_Con_Url *url_con)
+{
+ CURLMcode ret;
+
+ ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
+ url_con->multi = EINA_FALSE;
+ if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
+}
+
static Eina_Bool
_ecore_con_url_timeout_cb(void *data)
{
Ecore_Con_Url *url_con = data;
- CURLMcode ret;
- Ecore_Con_Event_Url_Complete *e;
if (!url_con) return ECORE_CALLBACK_CANCEL;
if (!url_con->curl_easy) return ECORE_CALLBACK_CANCEL;
- if (!eina_list_data_find(_url_con_list, url_con)) return ECORE_CALLBACK_CANCEL;
- ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
- if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
+ _ecore_con_url_multi_remove(url_con);
_url_con_list = eina_list_remove(_url_con_list, url_con);
curl_slist_free_all(url_con->headers);
url_con->timer = NULL;
- e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
- if (e)
- {
- e->url_con = url_con;
- e->status = 0;
- ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
- }
+ _ecore_con_url_event_url_complete(url_con, NULL);
return ECORE_CALLBACK_CANCEL;
}
static size_t
-_ecore_con_url_data_cb(void *buffer,
- size_t size,
- size_t nitems,
- void *userp)
+_ecore_con_url_data_cb(void *buffer, size_t size, size_t nitems, void *userp)
{
Ecore_Con_Url *url_con;
Ecore_Con_Event_Url_Data *e;
url_con->received += real_size;
+ INF("reading from %s", url_con->url);
if (url_con->write_fd < 0)
{
e =
e->url_con = url_con;
e->size = real_size;
memcpy(e->data, buffer, real_size);
- ecore_event_add(ECORE_CON_EVENT_URL_DATA, e, _ecore_con_event_url_free, NULL);
+ url_con->event_count++;
+ ecore_event_add(ECORE_CON_EVENT_URL_DATA, e, (Ecore_End_Cb)_ecore_con_event_url_free, url_con);
}
}
else
}
static size_t
-_ecore_con_url_header_cb(void *ptr,
- size_t size,
- size_t nitems,
- void *stream)
+_ecore_con_url_header_cb(void *ptr, size_t size, size_t nitems, void *stream)
{
size_t real_size = size * nitems;
Ecore_Con_Url *url_con = stream;
}
static int
-_ecore_con_url_progress_cb(void *clientp,
- double dltotal,
- double dlnow,
- double ultotal,
- double ulnow)
+_ecore_con_url_progress_cb(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
{
Ecore_Con_Event_Url_Progress *e;
Ecore_Con_Url *url_con;
e->down.now = dlnow;
e->up.total = ultotal;
e->up.now = ulnow;
- ecore_event_add(ECORE_CON_EVENT_URL_PROGRESS, e, _ecore_con_event_url_free, NULL);
+ url_con->event_count++;
+ ecore_event_add(ECORE_CON_EVENT_URL_PROGRESS, e, (Ecore_End_Cb)_ecore_con_event_url_free, url_con);
}
return 0;
}
static size_t
-_ecore_con_url_read_cb(void *ptr,
- size_t size,
- size_t nitems,
- void *stream)
+_ecore_con_url_read_cb(void *ptr, size_t size, size_t nitems, void *stream)
{
size_t retcode = fread(ptr, size, nitems, stream);
while ((curlmsg = curl_multi_info_read(_curlm, &n_remaining)))
{
+ Eina_List *l, *ll;
+ Ecore_Con_Url *url_con = NULL;
+ DBG("Curl message: %d", curlmsg->msg);
+
if (curlmsg->msg == CURLMSG_DONE)
{
- Eina_List *l, *ll;
- Ecore_Con_Url *url_con;
-
EINA_LIST_FOREACH_SAFE(_url_con_list, l, ll, url_con)
{
if (curlmsg->easy_handle == url_con->curl_easy)
- {
- CURLMcode ret;
- Ecore_Con_Event_Url_Complete *e;
-
- e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
- if (e)
- {
- e->url_con = url_con;
- e->status = 0;
- if (curlmsg->data.result == CURLE_OK)
- {
- long status; /* curl API uses long, not int */
- status = 0;
- curl_easy_getinfo(curlmsg->easy_handle, CURLINFO_RESPONSE_CODE, &status);
- e->status = status;
- }
- ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
- }
-
- ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
- if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
- _url_con_list = eina_list_remove(_url_con_list, url_con);
- break;
- }
+ _ecore_con_url_event_url_complete(url_con, curlmsg);
}
- }
+ }
}
}
static void
_ecore_con_url_curl_clear(void)
{
+ Ecore_Fd_Handler *fdh;
Ecore_Con_Url *url_con;
- FD_ZERO(&_current_fd_set);
- if (_fd_hd_list)
- {
- Ecore_Fd_Handler *fd_handler;
- EINA_LIST_FREE(_fd_hd_list, fd_handler)
- {
- int fd = ecore_main_fd_handler_fd_get(fd_handler);
- FD_CLR(fd, &_current_fd_set);
- // FIXME: ecore_main_fd_handler_del() sometimes give errors
- // because curl do not make fd itself controlled by users, but it can be ignored.
- ecore_main_fd_handler_del(fd_handler);
- }
- }
-
- EINA_LIST_FREE(_url_con_list, url_con)
- {
- CURLMcode ret;
- Ecore_Con_Event_Url_Complete *e;
-
- e = calloc(1, sizeof(Ecore_Con_Event_Url_Complete));
- if (e)
- {
- e->url_con = url_con;
- e->status = 0;
- ecore_event_add(ECORE_CON_EVENT_URL_COMPLETE, e, _ecore_con_event_url_free, NULL);
- }
- ret = curl_multi_remove_handle(_curlm, url_con->curl_easy);
- if (ret != CURLM_OK) ERR("curl_multi_remove_handle failed: %s", curl_multi_strerror(ret));
- }
+ EINA_LIST_FREE(_fd_hd_list, fdh) ecore_main_fd_handler_del(fdh);
+ EINA_LIST_FREE(_url_con_list, url_con) _ecore_con_url_multi_remove(url_con);
}
static Eina_Bool
_ecore_con_url_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
{
- if (_fd_hd_list)
- {
- Ecore_Fd_Handler *fd_handler;
- EINA_LIST_FREE(_fd_hd_list, fd_handler)
- {
- int fd = ecore_main_fd_handler_fd_get(fd_handler);
- FD_CLR(fd, &_current_fd_set);
- // FIXME: ecore_main_fd_handler_del() sometimes give errors
- // because curl do not make fd itself controlled by users, but it can be ignored.
- ecore_main_fd_handler_del(fd_handler);
- }
- }
- ecore_timer_thaw(_curl_timeout);
- return ECORE_CALLBACK_RENEW;
+ Ecore_Fd_Handler *fdh;
+ EINA_LIST_FREE(_fd_hd_list, fdh) ecore_main_fd_handler_del(fdh);
+ ecore_timer_interval_set(_curl_timer, 0.1);
+ return ECORE_CALLBACK_CANCEL;
}
static void
CURLMcode ret;
fd_set read_set, write_set, exc_set;
int fd, fd_max;
- Ecore_Fd_Handler *fd_handler;
FD_ZERO(&read_set);
FD_ZERO(&write_set);
for (fd = 0; fd <= fd_max; fd++)
{
int flags = 0;
- if (FD_ISSET(fd, &read_set)) flags |= ECORE_FD_READ;
+ if (FD_ISSET(fd, &read_set)) flags |= ECORE_FD_READ;
if (FD_ISSET(fd, &write_set)) flags |= ECORE_FD_WRITE;
- if (FD_ISSET(fd, &exc_set)) flags |= ECORE_FD_ERROR;
+ if (FD_ISSET(fd, &exc_set)) flags |= ECORE_FD_ERROR;
if (flags)
{
- if (!FD_ISSET(fd, &_current_fd_set))
- {
- FD_SET(fd, &_current_fd_set);
- fd_handler = ecore_main_fd_handler_add(fd, flags, _ecore_con_url_fd_handler, NULL, NULL, NULL);
- if (fd_handler) _fd_hd_list = eina_list_append(_fd_hd_list, fd_handler);
- ecore_timer_freeze(_curl_timeout);
- }
+ // FIXME: Who is owner (easy_handle) of this fd?? (Curl do not give this info.)
+ // This cause "Failed to delete epoll fd xx!" error messages
+ Ecore_Fd_Handler *fd_handler;
+ fd_handler = ecore_main_fd_handler_add(fd, flags,
+ _ecore_con_url_fd_handler,
+ NULL, NULL, NULL);
+ if (fd_handler)
+ _fd_hd_list = eina_list_append(_fd_hd_list, fd_handler);
}
}
}
static Eina_Bool
-_ecore_con_url_idler_handler(void *data __UNUSED__)
+_ecore_con_url_timer(void *data __UNUSED__)
{
+ Ecore_Fd_Handler *fdh;
int still_running;
CURLMcode ret;
+ EINA_LIST_FREE(_fd_hd_list, fdh) ecore_main_fd_handler_del(fdh);
+ _ecore_con_url_info_read();
+
ret = curl_multi_perform(_curlm, &still_running);
if (ret == CURLM_CALL_MULTI_PERFORM)
{
- DBG("Call multiperform again");
+ DBG("curl_multi_perform() again immediately");
return ECORE_CALLBACK_RENEW;
}
else if (ret != CURLM_OK)
{
ERR("curl_multi_perform() failed: %s", curl_multi_strerror(ret));
_ecore_con_url_curl_clear();
- ecore_timer_freeze(_curl_timeout);
- return ECORE_CALLBACK_RENEW;
+ ecore_timer_freeze(_curl_timer);
}
- _ecore_con_url_info_read();
if (still_running)
{
- DBG("multiperform is still_running");
+ long ms;
_ecore_con_url_fdset();
+ curl_multi_timeout(_curlm, &ms);
+ DBG("multiperform is still running: %d, timeout: %ld", still_running, ms);
+ if (ms >= CURL_MIN_TIMEOUT || ms <= 0) ms = CURL_MIN_TIMEOUT;
+ ecore_timer_interval_set(_curl_timer, (double)ms / 1000);
}
else
{
DBG("multiperform ended");
+ _ecore_con_url_info_read();
_ecore_con_url_curl_clear();
- ecore_timer_freeze(_curl_timeout);
+ ecore_timer_freeze(_curl_timer);
}
return ECORE_CALLBACK_RENEW;
return EINA_FALSE;
}
+ url_con->multi = EINA_TRUE;
_url_con_list = eina_list_append(_url_con_list, url_con);
- ecore_timer_thaw(_curl_timeout);
+ ecore_timer_thaw(_curl_timer);
return EINA_TRUE;
}
static void
-_ecore_con_event_url_free(void *data __UNUSED__,
- void *ev)
+_ecore_con_event_url_free(Ecore_Con_Url *url_con, void *ev)
{
free(ev);
+ url_con->event_count--;
+ if (url_con->dead && (!url_con->event_count))
+ ecore_con_url_free(url_con);
}
#endif
* @li @ref ecore_evas_callbacks_example_c
* @li @ref ecore_evas_object_example_c
* @li @ref ecore_evas_basics_example_c
+ * @li @ref Ecore_Evas_Window_Sizes_Example_c
+ * @li @ref Ecore_Evas_Buffer_Example_01_c
+ * @li @ref Ecore_Evas_Buffer_Example_02_c
*/
/* FIXME:
/**
* @defgroup Ecore_Evas_Group Ecore_Evas wrapper/helper set of functions
*
+ * Ecore evas is a set of functions that makes it easy to tie together ecore's
+ * main loop and input handling to evas. As such it's a natural base for EFL
+ * applications. While this combination makes it easy to create the basic
+ * aspects all applications need, for normal applications(ones with buttons,
+ * checkboxes and layouts) one should consider using Elementary.
+ *
+ * Ecore evas is extremely well suited for applications that are not based on
+ * widgets. It has a main loop that delivers events, does basic window handling
+ * and leaves all of the drawing up to the user. This works very well if used
+ * in conjunction with Edje or if doing custom drawing as, for example, is done
+ * in games.
+ *
* This is a list of examples of these functions:
- * - @ref Ecore_Evas_Window_Sizes_Example_c
- * - @ref Ecore_Evas_Buffer_Example_01_c
- * - @ref Ecore_Evas_Buffer_Example_02_c
+ * @li @ref ecore_evas_basics_example_c
+ * @li @ref ecore_evas_object_example_c
+ * @li @ref ecore_evas_callbacks_example_c
+ * @li @ref Ecore_Evas_Window_Sizes_Example_c
+ * @li @ref Ecore_Evas_Buffer_Example_01_c
+ * @li @ref Ecore_Evas_Buffer_Example_02_c
+ *
* @{
*/
#ifndef _ECORE_EVAS_PRIVATE_H
/* basic data types */
typedef struct _Ecore_Evas Ecore_Evas;
+typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee); /**< Callback used for several ecore evas events @since 1.2 */
+#endif
+
+#ifndef _ECORE_WAYLAND_H_
+#define _ECORE_WAYLAND_WINDOW_PREDEF
+typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
#endif
/* module setup/shutdown calls */
* This function allows you to make an Ecore_Evas translucent using an
* alpha channel. See ecore_evas_shaped_set() for details. The difference
* between a shaped window and a window with an alpha channel is that an
- * alpha channel supports multiple levels of transpararency, as opposed to
+ * alpha channel supports multiple levels of transparency, as opposed to
* the 1 bit transparency of a shaped window (a pixel is either opaque, or
* it's transparent).
*
* This function takes four pointers to (already allocated) ints, and places
* the geometry which @p ee was latest recently requested . If any of the parameters is not desired you
* may pass NULL on them.
- * This function can represent recently requested geomety.
+ * This function can represent recently requested geometry.
* ecore_evas_geometry_get function returns the value is updated after engine finished request.
* By comparison, ecore_evas_request_geometry_get returns recently requested value.
*
* This function iconifies @p ee if @p on is EINA_TRUE, or uniconifies @p ee if
* @p on is EINA_FALSE.
*
- * @note Iconify and minize are synonims.
+ * @note Iconify and minimize are synonyms.
*
* @warning Support for this depends on the underlying windowing system.
*/
* @param ee The Ecore_Evas to set
* @return EINA_TRUE if @p ee is iconified, EINA_FALSE if not.
*
- * @note Iconify and minize are synonims.
+ * @note Iconify and minimize are synonyms.
*
* @see ecore_evas_iconified_set()
*/
*/
EAPI Eina_Bool ecore_evas_fullscreen_get(const Ecore_Evas *ee);
/**
+ * @brief Set another window that this window is a group member of
+ *
+ * @param ee The Ecore_Evas
+ * @param ee_group The other group member
+ *
+ * If @p ee_group is NULL, @p ee is removed from the group, otherwise it is
+ * added. Note that if you free the @p ee_group canvas before @p ee, then
+ * getting the group canvas with ecore_evas_window_group_get() will return
+ * an invalid handle.
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group);
+/**
+ * @brief Get the canvas group set.
+ *
+ * This returns the handle set by ecore_evas_window_group_set().
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The Canvas group handle
+ *
+ * @see ecore_evas_window_group_set()
+ * @since 1.2
+ */
+EAPI const Ecore_Evas *ecore_evas_window_group_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the aspect ratio of a canvas window
+ *
+ * @param ee The Ecore_Evas
+ * @param aspect The aspect ratio (width divided by height), or 0 to disable
+ *
+ * This sets the desired aspect ratio of a canvas window
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_aspect_set(Ecore_Evas *ee, double aspect);
+/**
+ * @brief Get the aspect ratio of a canvas window
+ *
+ * This returns the value set by ecore_evas_aspect_set().
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The aspect ratio
+ *
+ * @see ecore_evas_aspect_set()
+ * @since 1.2
+ */
+EAPI double ecore_evas_aspect_get(const Ecore_Evas *ee);
+/**
+ * @brief Set The urgent hint flag
+ *
+ * @param ee The Ecore_Evas
+ * @param urgent The urgent state flag
+ *
+ * This sets the "urgent" state hint on a window so the desktop environment
+ * can highlight it somehow.
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent);
+/**
+ * @brief Get the urgent state on the cavas window
+ *
+ * This returns the value set by ecore_evas_urgent_set()
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The urgent state set
+ *
+ * @see ecore_evas_urgent_set()
+ * @since 1.2
+ */
+EAPI Eina_Bool ecore_evas_urgent_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the modal state flag on the canvas window
+ *
+ * @param ee The Ecore_Evas
+ * @param modal The modal hint flag
+ *
+ * This hints if the window should be modal (eg if it is also transient
+ * for another window, the other window will maybe be denied focus by
+ * the desktop window manager).
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal);
+/**
+ * @brief Get The modal flag
+ *
+ * This returns the value set by ecore_evas_modal_set().
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The modal flag
+ *
+ * @see ecore_evas_modal_set()
+ * @since 1.2
+ */
+EAPI Eina_Bool ecore_evas_modal_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the "i demand attention" flag on a canvas window
+ *
+ * @param ee The Ecore_Evas
+ * @param demand The flag state to set
+ *
+ * A window may demand attention now (eg you must enter a password before
+ * continuing), and so it may flag a window with this.
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand);
+/**
+ * @brief Get the "i demand attention" flag
+ *
+ * This returns the value set by ecore_evas_demand_attention_set().
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The "i demand attention" flag.
+ *
+ * @see ecore_evas_demand_attention_set()
+ * @since 1.2
+ */
+EAPI Eina_Bool ecore_evas_demand_attention_get(const Ecore_Evas *ee);
+/**
+ * @brief Set the "focus skip" flag
+ *
+ * @param ee The Ecore_Evas
+ * @param skip The "focus skip" state to set.
+ *
+ * A window may not want to accept focus, be in the taskbar, pager etc.
+ * sometimes (example for a small notification window that hovers around
+ * a taskbar or panel, or hovers around a window until some activity
+ * dismisses it).
+ *
+ * @warning Support for this depends on the underlying windowing system.
+ * @since 1.2
+ */
+EAPI void ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip);
+/**
+ * @brief Get the "focus skip" flag
+ *
+ * This returns the value set by ecore_evas_focus_skip_set().
+ *
+ * @param ee The Ecore_Evas to set
+ * @return The "focus skip" flag.
+ *
+ * @see ecore_evas_focus_skip_set()
+ * @since 1.2
+ */
+EAPI Eina_Bool ecore_evas_focus_skip_get(const Ecore_Evas *ee);
+
+/**
* @brief Set if this evas should ignore @b all events.
*
* @param ee The Ecore_Evas whose window's to ignore events.
EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h);
EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee);
-EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame);
-EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame);
+
+EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
+EAPI Ecore_Evas *ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
EAPI void ecore_evas_wayland_resize(Ecore_Evas *ee, int location);
-EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
+/* EAPI void ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source); */
+EAPI void ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
+EAPI void ecore_evas_wayland_type_set(Ecore_Evas *ee, int type);
+EAPI Ecore_Wl_Window *ecore_evas_wayland_window_get(const Ecore_Evas *ee);
/**
* @brief Create a new @c Ecore_Evas canvas bound to the Evas
/**
* Returns the backing store image object that represents the given
* window in EWS.
+ * @return The evas object of EWS backing store.
*
* @note This should not be modified anyhow, but may be helpful to
* determine stacking and geometry of it for window managers
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas move events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas show events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas hide events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas delete request events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas destroy events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas focus in events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas focus out events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas sticky events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas un-sticky events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas mouse in events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas mouse out events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas pre render events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas mouse post render events.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
/**
* Set a callback for Ecore_Evas pre-free event.
* @param ee The Ecore_Evas to set callbacks on
* @warning If and when this function is called depends on the underlying
* windowing system.
*/
-EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+EAPI void ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+/**
+ * Set a callback for Ecore_Evas state changes.
+ * @param ee The Ecore_Evas to set callbacks on
+ * @param func The function to call
+
+ * A call to this function will set a callback on an Ecore_Evas, causing
+ * @p func to be called whenever @p ee changes state.
+ *
+ * @since 1.2
+ * @warning If and when this function is called depends on the underlying
+ * windowing system.
+ */
+EAPI void ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+
EAPI Evas *ecore_evas_get(const Ecore_Evas *ee);
EAPI void ecore_evas_managed_move(Ecore_Evas *ee, int x, int y);
EAPI void ecore_evas_shaped_set(Ecore_Evas *ee, Eina_Bool shaped);
/**
* Return the internal backing store in use.
*
- * @note this will foced it to be created, making future calls to
+ * @note this will forced it to be created, making future calls to
* ecore_evas_ews_engine_set() void.
*
* @see ecore_evas_ews_evas_get()
/**
* Return the internal backing store in use.
*
- * @note this will foced it to be created, making future calls to
+ * @note this will forced it to be created, making future calls to
* ecore_evas_ews_engine_set() void.
*
* @see ecore_evas_ews_ecore_evas_get()
/**
* @brief Create a socket to provide the service for external ecore evas socket.
*
+ * @param ee The Ecore_Evas
* @param svcname The name of the service to be advertised. ensure that it is unique (when combined with @p svcnum) otherwise creation may fail.
* @param svcnum A number (any value, 0 beig the common default) to differentiate multiple instances of services with the same name.
* @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.
* image data so the external plug process will not render to it or alter it.
*
* You should only hold the lock for just as long as you need to read out the
- * image data or otherwise deal with it, and then unlokc it with
+ * image data or otherwise deal with it, and then unlock it with
* ecore_evas_extn_plug_object_data_unlock(). Keeping a lock over more than
* 1 iteration of the main ecore loop will be problematic, so avoid it. Also
* forgetting to unlock may cause the socket process to freeze and thus create
* in the canvas of the plug process in place of the image object. The image
* object by default is created to be filled (equivalent of
* evas_object_image_filled_add() on creation) so image content will scale
- * toi fill the image unless otherwise reconfigured. The Ecore_Evas size
+ * to fill the image unless otherwise reconfigured. The Ecore_Evas size
* of the plug is the master size and determines size in pixels of the
* plug canvas. You can change the size with something like:
*
@EVAS_LIBS@ \
@EINA_LIBS@ \
@EVIL_LIBS@ \
+@EFL_SHM_OPEN_LIBS@ \
@WAYLAND_EGL_LIBS@
libecore_evas_la_LDFLAGS = -no-undefined @lt_enable_auto_import@ -version-info @version_info@ @release_info@
return ee;
}
-
-static Ecore_Evas *
-_ecore_evas_constructor_sdl16(int x __UNUSED__, int y __UNUSED__, int w, int h, const char *extra_options)
-{
- Ecore_Evas *ee;
- unsigned int fullscreen = 0, hwsurface = 0, noframe = 0, alpha = 0;
- char *name = NULL;
-
- _ecore_evas_parse_extra_options_str(extra_options, "name=", &name);
- _ecore_evas_parse_extra_options_uint(extra_options, "fullscreen=", &fullscreen);
- _ecore_evas_parse_extra_options_uint(extra_options, "hwsurface=", &hwsurface);
- _ecore_evas_parse_extra_options_uint(extra_options, "alpha=", &alpha);
-
- ee = ecore_evas_sdl16_new(name, w, h, fullscreen, hwsurface, noframe, alpha);
- free(name);
-
- return ee;
-}
#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
_ecore_evas_constructor_wayland_shm(int x, int y, int w, int h, const char *extra_options)
{
char *disp_name = NULL;
- unsigned int frame = 0;
+ unsigned int frame = 0, parent = 0;
Ecore_Evas *ee;
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
- ee = ecore_evas_wayland_shm_new(disp_name, x, y, w, h, frame);
+ _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
+ ee = ecore_evas_wayland_shm_new(disp_name, parent, x, y, w, h, frame);
free(disp_name);
return ee;
_ecore_evas_constructor_wayland_egl(int x, int y, int w, int h, const char *extra_options)
{
char *disp_name = NULL;
- unsigned int frame = 0;
+ unsigned int frame = 0, parent = 0;
Ecore_Evas *ee;
_ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
_ecore_evas_parse_extra_options_uint(extra_options, "frame=", &frame);
- ee = ecore_evas_wayland_egl_new(disp_name, x, y, w, h, frame);
+ _ecore_evas_parse_extra_options_uint(extra_options, "parent=", &parent);
+ ee = ecore_evas_wayland_egl_new(disp_name, parent, x, y, w, h, frame);
free(disp_name);
return ee;
#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
{"sdl", _ecore_evas_constructor_sdl},
- {"software_16_sdl", _ecore_evas_constructor_sdl16},
#endif
/* independent */
#define IFE return;}
EAPI void
-ecore_evas_callback_resize_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_resize_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_move_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_move_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_show_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_show_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_hide_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_hide_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_destroy_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_destroy_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_focus_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_focus_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_focus_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_focus_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_sticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_sticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_unsticky_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_unsticky_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_mouse_in_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_mouse_out_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_pre_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_pre_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_post_render_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_post_render_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
}
EAPI void
-ecore_evas_callback_pre_free_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+ecore_evas_callback_pre_free_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
{
ee->func.fn_pre_free = func;
}
+EAPI void
+ecore_evas_callback_state_change_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "ecore_evas_callback_state_change_set");
+ return;
+ }
+ ee->func.fn_state_change = func;
+}
+
/**
* Get an Ecore_Evas's Evas
* @param ee The Ecore_Evas whose Evas you wish to get
}
EAPI void
+ecore_evas_window_group_set(Ecore_Evas *ee, const Ecore_Evas *ee_group)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_window_group_set) (ee, ee_group);
+ IFE;
+}
+
+EAPI const Ecore_Evas *
+ecore_evas_window_group_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.group_ee;
+}
+
+EAPI void
+ecore_evas_aspect_set(Ecore_Evas *ee, double aspect)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_aspect_set) (ee, aspect);
+ IFE;
+}
+
+EAPI double
+ecore_evas_aspect_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.aspect;
+}
+
+EAPI void
+ecore_evas_urgent_set(Ecore_Evas *ee, Eina_Bool urgent)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_urgent_set) (ee, urgent);
+ IFE;
+}
+
+EAPI Eina_Bool
+ecore_evas_urgent_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.urgent ? EINA_TRUE : EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_modal_set(Ecore_Evas *ee, Eina_Bool modal)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_modal_set) (ee, modal);
+ IFE;
+}
+
+EAPI Eina_Bool
+ecore_evas_modal_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.modal ? EINA_TRUE : EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_demand_attention_set(Ecore_Evas *ee, Eina_Bool demand)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_demands_attention_set) (ee, demand);
+ IFE;
+}
+
+EAPI Eina_Bool
+ecore_evas_demand_attention_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.demand_attention ? EINA_TRUE : EINA_FALSE;
+}
+
+EAPI void
+ecore_evas_focus_skip_set(Ecore_Evas *ee, Eina_Bool skip)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return;
+ }
+
+ IFC(ee, fn_focus_skip_set) (ee, skip);
+ IFE;
+}
+
+EAPI Eina_Bool
+ecore_evas_focus_skip_get(const Ecore_Evas *ee)
+{
+ if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
+ {
+ ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
+ "XXX");
+ return EINA_FALSE;
+ }
+ return ee->prop.focus_skip ? EINA_TRUE : EINA_FALSE;
+}
+
+EAPI void
ecore_evas_ignore_events_set(Ecore_Evas *ee, Eina_Bool ignore)
{
if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
}
EAPI void
-ecore_evas_wayland_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
+ecore_evas_wayland_type_set(Ecore_Evas *ee, int type)
{
- if ((!ee) || (!source)) return;
- if (!ee->engine.wl.surface) return;
+ if (!ee) return;
+ ecore_wl_window_type_set(ee->engine.wl.win, type);
+}
- if (!strcmp(ee->driver, "wayland_shm"))
- {
-#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
- _ecore_evas_wayland_shm_drag_start(ee, drag_ee, source);
-#endif
- }
- else if (!strcmp(ee->driver, "wayland_egl"))
- {
-#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
- _ecore_evas_wayland_egl_drag_start(ee, drag_ee, source);
-#endif
- }
+EAPI Ecore_Wl_Window *
+ecore_evas_wayland_window_get(const Ecore_Evas *ee)
+{
+ return ee->engine.wl.win;
+}
+
+EAPI void
+ecore_evas_wayland_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y)
+{
+ Ecore_Wl_Window *win;
+
+ win = ecore_evas_wayland_window_get(ee);
+ /* ecore_wl_window_pointer_set(win, ee->engine.wl.buffer, hot_x, hot_y); */
}
+
#else
EAPI void
ecore_evas_wayland_resize(Ecore_Evas *ee __UNUSED__, int location __UNUSED__)
}
EAPI void
-ecore_evas_wayland_drag_start(Ecore_Evas *ee __UNUSED__, Ecore_Evas *drag_ee __UNUSED__, void *source __UNUSED__)
+ecore_evas_wayland_type_set(Ecore_Evas *ee __UNUSED__, int type __UNUSED__)
+{
+
+}
+
+EAPI Ecore_Wl_Window *
+ecore_evas_wayland_window_get(const Ecore_Evas *ee __UNUSED__)
+{
+ return NULL;
+}
+
+EAPI void
+ecore_evas_wayland_pointer_set(Ecore_Evas *ee __UNUSED__, int hot_x __UNUSED__, int hot_y __UNUSED__)
{
}
_ecore_evas_buffer_alpha_set,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
_ecore_evas_buffer_render,
NULL // screen_geometry_get
};
#ifdef BUILD_ECORE_EVAS_OPENGL_COCOA
#include <Ecore_Cocoa.h>
-#include <Evas_Engine_Gl_Cocoa.h>
+#include <Evas_Engine_GL_Cocoa.h>
#endif
#include "ecore_evas_private.h"
NULL,
NULL,
NULL, //transparent
+
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL
};
NULL, /* alpha */
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL // screen_geometry_get
};
_ecore_evas_ews_ignore_events_set,
_ecore_evas_ews_alpha_set,
_ecore_evas_ews_transparent_set,
+
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
_ecore_evas_ews_render,
_ecore_evas_ews_screen_geometry_get
};
# include <config.h>
#endif
+#include <stdio.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <math.h>
+#include <time.h>
+#ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+#endif
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/file.h>
#include <unistd.h>
#include <Ecore.h>
#include "ecore_private.h"
#include <Ecore_Input.h>
-#ifdef BUILD_ECORE_IPC
-# ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
-# define EXTN_ENABLED 1
-# endif
+#ifdef BUILD_ECORE_EVAS_EXTN
+
+#include <Ecore_Ipc.h>
+
#endif
#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
-#ifdef EXTN_ENABLED
-#include "Ecore_Ipc.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <math.h>
-#include <time.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/file.h>
+
+#ifdef BUILD_ECORE_EVAS_EXTN
+
typedef struct _Shmfile Shmfile;
NULL,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL // screen_geometry_get
};
_ecore_evas_extn_shutdown(void)
{
}
-#endif
+
+#endif /* BUILD_ECORE_EVAS_EXTN */
EAPI Evas_Object *
ecore_evas_extn_plug_new(Ecore_Evas *ee_target)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Evas_Object *o;
Ecore_Evas *ee;
int w = 1, h = 1;
EAPI Eina_Bool
ecore_evas_extn_plug_connect(Evas_Object *obj, const char *svcname, int svcnum, Eina_Bool svcsys)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Extn *extn;
Ecore_Evas *ee = NULL;
EAPI void
ecore_evas_extn_plug_object_data_lock(Evas_Object *obj)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Ecore_Evas *ee;
ee = ecore_evas_object_ecore_evas_get(obj);
EAPI void
ecore_evas_extn_plug_object_data_unlock(Evas_Object *obj)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Ecore_Evas *ee;
ee = ecore_evas_object_ecore_evas_get(obj);
#endif
}
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
static void
_ecore_evas_socket_resize(Ecore_Evas *ee, int w, int h)
{
#define STRGET(val) \
do { \
- if ((ipc->val) && (ipc->val < (char *)(e->size - 1))) \
+ if ((ipc->val) && (ipc->val < (char *)(long)(e->size - 1))) \
ipc->val = ((char *)ipc) + (long)ipc->val; \
else \
ipc->val = NULL; \
_ecore_evas_extn_socket_alpha_set,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
_ecore_evas_extn_socket_render, // render
NULL // screen_geometry_get
};
EAPI Ecore_Evas *
ecore_evas_extn_socket_new(int w, int h)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Evas_Engine_Info_Buffer *einfo;
Ecore_Evas *ee;
int rmethod;
EAPI Eina_Bool
ecore_evas_extn_socket_listen(Ecore_Evas *ee, const char *svcname, int svcnum, Eina_Bool svcsys)
{
-#ifdef EXTN_ENABLED
+#ifdef BUILD_ECORE_EVAS_EXTN
Extn *extn;
extn = calloc(1, sizeof(Extn));
}
static void
+_ecore_evas_hide(Ecore_Evas *ee)
+{
+ if (ee->prop.focused)
+ {
+ ee->prop.focused = 0;
+ evas_focus_out(ee->evas);
+ if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
+ }
+}
+
+static void
_ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{
Ecore_Evas *ee;
_ecore_evas_rotation_set,
NULL,
_ecore_evas_show,
- NULL,
+ _ecore_evas_hide,
NULL,
NULL,
NULL,
NULL,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL // screen_geometry_get
};
ee->prop.max.w = 0;
ee->prop.max.h = 0;
ee->prop.layer = 0;
- ee->prop.focused = 1;
+ ee->prop.focused = 0;
ee->prop.borderless = 1;
ee->prop.override = 1;
ee->prop.maximized = 1;
#define IDLE_FLUSH_TIME 0.5
#ifndef _ECORE_EVAS_H
typedef struct _Ecore_Evas Ecore_Evas;
+typedef void (*Ecore_Evas_Event_Cb) (Ecore_Evas *ee);
#endif
typedef struct _Ecore_Evas_Engine Ecore_Evas_Engine;
struct _Ecore_Evas_Engine_Func
{
void (*fn_free) (Ecore_Evas *ee);
- void (*fn_callback_resize_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_move_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_show_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_hide_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_delete_request_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_destroy_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_focus_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_focus_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_sticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_unsticky_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_pre_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
- void (*fn_callback_post_render_set) (Ecore_Evas *ee, void (*func) (Ecore_Evas *ee));
+ void (*fn_callback_resize_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_move_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_show_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_hide_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_delete_request_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_destroy_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_focus_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_focus_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_mouse_in_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_mouse_out_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_sticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_unsticky_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_pre_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
+ void (*fn_callback_post_render_set) (Ecore_Evas *ee, Ecore_Evas_Event_Cb func);
void (*fn_move) (Ecore_Evas *ee, int x, int y);
void (*fn_managed_move) (Ecore_Evas *ee, int x, int y);
void (*fn_resize) (Ecore_Evas *ee, int w, int h);
void (*fn_alpha_set) (Ecore_Evas *ee, int alpha);
void (*fn_transparent_set) (Ecore_Evas *ee, int transparent);
+ void (*fn_window_group_set) (Ecore_Evas *ee, const Ecore_Evas *ee_group);
+ void (*fn_aspect_set) (Ecore_Evas *ee, double aspect);
+ void (*fn_urgent_set) (Ecore_Evas *ee, int urgent);
+ void (*fn_modal_set) (Ecore_Evas *ee, int modal);
+ void (*fn_demands_attention_set) (Ecore_Evas *ee, int demand);
+ void (*fn_focus_skip_set) (Ecore_Evas *ee, int skip);
+
int (*fn_render) (Ecore_Evas *ee);
void (*fn_screen_geometry_get) (const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
};
#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
struct
{
+ Ecore_Wl_Window *parent, *win;
Evas_Object *frame;
- struct wl_shell_surface *shell_surface;
- struct wl_surface *surface;
+# if defined(BUILD_ECORE_EVAS_WAYLAND_SHM)
struct wl_buffer *buffer;
+# endif
+
} wl;
#endif
int layer;
Ecore_Window window;
unsigned char avoid_damage;
+ Ecore_Evas *group_ee;
+ Ecore_Window group_ee_win;
+ double aspect;
char focused : 1;
char iconified : 1;
char borderless : 1;
char sticky : 1;
char request_pos : 1;
char draw_frame : 1;
- } prop;
+ char hwsurface : 1;
+ char urgent : 1;
+ char modal : 1;
+ char demand_attention : 1;
+ char focus_skip : 1;
+ } prop;
struct {
void (*fn_resize) (Ecore_Evas *ee);
void (*fn_pre_render) (Ecore_Evas *ee);
void (*fn_post_render) (Ecore_Evas *ee);
void (*fn_pre_free) (Ecore_Evas *ee);
+ void (*fn_state_change) (Ecore_Evas *ee);
} func;
Ecore_Evas_Engine engine;
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
void _ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
+void _ecore_evas_wayland_shm_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
+void _ecore_evas_wayland_shm_type_set(Ecore_Evas *ee, int type);
#endif
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
void _ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source);
+void _ecore_evas_wayland_egl_pointer_set(Ecore_Evas *ee, int hot_x, int hot_y);
+void _ecore_evas_wayland_egl_type_set(Ecore_Evas *ee, int type);
#endif
void _ecore_evas_fps_debug_init(void);
}
static void
-_ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+_ecore_evas_psl1ght_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
ee->func.fn_delete_request = func;
}
NULL,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
_ecore_evas_screen_geometry_get // screen_geometry_get
};
#include <Ecore_Input_Evas.h>
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
# include <Ecore_Sdl.h>
-# ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
-# include <Evas_Engine_SDL.h>
-# endif
# ifdef BUILD_ECORE_EVAS_OPENGL_SDL
# include <Evas_Engine_GL_SDL.h>
# endif
#include <stdlib.h>
#include <string.h>
+#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
+#include <SDL/SDL.h>
+#endif
+
#include "ecore_evas_private.h"
#include "Ecore_Evas.h"
-// fixme: 1 sdl window only at a time? seems wrong
+/**
+ ** SDL only handle one window at a time. That's by definition, there is nothing wrong here.
+ **
+ **/
#if defined(BUILD_ECORE_EVAS_SOFTWARE_SDL) || defined(BUILD_ECORE_EVAS_OPENGL_SDL)
return sdl_ee;
}
+static void *
+_ecore_evas_sdl_switch_buffer(void *data, void *dest __UNUSED__)
+{
+ SDL_Flip(data);
+ return ((SDL_Surface*)data)->pixels;
+}
+
static Eina_Bool
_ecore_evas_sdl_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
{
Ecore_Sdl_Event_Video_Resize *e;
Ecore_Evas *ee;
+ int rmethod;
e = event;
ee = _ecore_evas_sdl_match();
if (!ee) return ECORE_CALLBACK_PASS_ON; /* pass on event */
+
+ rmethod = evas_output_method_get(ee->evas);
+ if (rmethod == evas_render_method_lookup("buffer"))
+ {
+ Evas_Engine_Info_Buffer *einfo;
+
+ einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
+ if (einfo)
+ {
+ einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
+ einfo->info.switch_data = SDL_SetVideoMode(e->w, e->h, 32,
+ (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
+ | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0)
+ | (ee->alpha ? SDL_SRCALPHA : 0)
+ | SDL_DOUBLEBUF);
+ if (!einfo->info.switch_data)
+ {
+ return EINA_FALSE;
+ }
+
+ SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
+ SDL_FillRect(einfo->info.switch_data, NULL, 0);
+
+ einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
+ einfo->info.dest_buffer_row_bytes = e->w * sizeof (int);
+ einfo->info.use_color_key = 0;
+ einfo->info.alpha_threshold = 0;
+ einfo->info.func.new_update_region = NULL;
+ einfo->info.func.free_update_region = NULL;
+ einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
+ {
+ return EINA_FALSE;
+ }
+ }
+ }
+
+ ee->w = e->w;
+ ee->h = e->h;
+
evas_output_size_set(ee->evas, e->w, e->h);
+ evas_output_viewport_set(ee->evas, 0, 0, e->w, e->h);
return ECORE_CALLBACK_PASS_ON;
}
_ecore_evas_init_count--;
if (_ecore_evas_init_count == 0)
{
- int i;
+ unsigned int i;
for (i = 0; i < sizeof (ecore_evas_event_handlers) / sizeof (Ecore_Event_Handler*); i++)
ecore_event_handler_del(ecore_evas_event_handlers[i]);
static void
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
{
+ int rmethod;
+
if ((w == ee->w) && (h == ee->h)) return;
ee->w = w;
ee->h = h;
+ rmethod = evas_output_method_get(ee->evas);
+ if (rmethod == evas_render_method_lookup("buffer"))
+ {
+ Evas_Engine_Info_Buffer *einfo;
+
+ einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
+ if (einfo)
+ {
+ einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
+ einfo->info.switch_data = SDL_SetVideoMode(w, h, 32,
+ (ee->prop.hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
+ | (ee->prop.fullscreen ? SDL_FULLSCREEN : 0)
+ | (ee->alpha ? SDL_SRCALPHA : 0)
+ | SDL_DOUBLEBUF);
+ if (!einfo->info.switch_data)
+ {
+ return ;
+ }
+
+ SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
+ SDL_FillRect(einfo->info.switch_data, NULL, 0);
+
+ einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
+ einfo->info.dest_buffer_row_bytes = w * sizeof (int);
+ einfo->info.use_color_key = 0;
+ einfo->info.alpha_threshold = 0;
+ einfo->info.func.new_update_region = NULL;
+ einfo->info.func.free_update_region = NULL;
+ einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
+ {
+ return ;
+ }
+ }
+ }
+
evas_output_size_set(ee->evas, ee->w, ee->h);
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
NULL,
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL // screen_geometry_get
};
static Ecore_Evas*
_ecore_evas_internal_sdl_new(int rmethod, const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
{
- void *einfo;
Ecore_Evas *ee;
if (!name)
ee->prop.withdrawn = 0;
ee->prop.sticky = 0;
ee->prop.window = 0;
+ ee->alpha = alpha;
+ ee->prop.hwsurface = hwsurface;
/* init evas here */
ee->evas = evas_new();
evas_output_size_set(ee->evas, w, h);
evas_output_viewport_set(ee->evas, 0, 0, w, h);
- if (rmethod == evas_render_method_lookup("software_sdl") ||
- rmethod == evas_render_method_lookup("software_16_sdl") )
+ if (rmethod == evas_render_method_lookup("buffer"))
{
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
- einfo = evas_engine_info_get(ee->evas);
+ Evas_Engine_Info_Buffer *einfo;
+
+ einfo = (Evas_Engine_Info_Buffer *) evas_engine_info_get(ee->evas);
if (einfo)
{
- ((Evas_Engine_Info_SDL *)einfo)->info.rotation = 0;
- ((Evas_Engine_Info_SDL *)einfo)->info.fullscreen = fullscreen;
- ((Evas_Engine_Info_SDL *)einfo)->info.hwsurface = hwsurface;
- ((Evas_Engine_Info_SDL *)einfo)->info.noframe = noframe;
- ((Evas_Engine_Info_SDL *)einfo)->info.alpha = alpha;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ SDL_Init(SDL_INIT_NOPARACHUTE);
+
+ if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0)
+ {
+ ERR("SDL_Init failed with %s", SDL_GetError());
+ SDL_Quit();
+ return NULL;
+ }
+
+ einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_RGB32;
+ einfo->info.switch_data = SDL_SetVideoMode(w, h, 32,
+ (hwsurface ? SDL_HWSURFACE : SDL_SWSURFACE)
+ | (fullscreen ? SDL_FULLSCREEN : 0)
+ | (noframe ? SDL_NOFRAME : 0)
+ | (alpha ? SDL_SRCALPHA : 0)
+ | SDL_DOUBLEBUF);
+ if (!einfo->info.switch_data)
+ {
+ ERR("SDL_SetVideoMode failed !");
+ ecore_evas_free(ee);
+ return NULL;
+ }
+
+ SDL_SetAlpha(einfo->info.switch_data, SDL_SRCALPHA, 0);
+ SDL_FillRect(einfo->info.switch_data, NULL, 0);
+
+ einfo->info.dest_buffer = ((SDL_Surface*)einfo->info.switch_data)->pixels;
+ einfo->info.dest_buffer_row_bytes = w * sizeof (int);
+ einfo->info.use_color_key = 0;
+ einfo->info.alpha_threshold = 0;
+ einfo->info.func.new_update_region = NULL;
+ einfo->info.func.free_update_region = NULL;
+ einfo->info.func.switch_buffer = _ecore_evas_sdl_switch_buffer;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *) einfo))
{
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
ecore_evas_free(ee);
ecore_evas_free(ee);
return NULL;
}
-#endif
}
else if (rmethod == evas_render_method_lookup("gl_sdl"))
{
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
- einfo = evas_engine_info_get(ee->evas);
+ Evas_Engine_Info_GL_SDL *einfo;
+
+ einfo = (Evas_Engine_Info_GL_SDL *) evas_engine_info_get(ee->evas);
if (einfo)
{
- ((Evas_Engine_Info_GL_SDL *)einfo)->flags.fullscreen = fullscreen;
- ((Evas_Engine_Info_GL_SDL *)einfo)->flags.noframe = noframe;
+ einfo->flags.fullscreen = fullscreen;
+ einfo->flags.noframe = noframe;
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
- SDL_ShowCursor(SDL_DISABLE);
+ SDL_ShowCursor(SDL_ENABLE);
ee->engine.func->fn_render = _ecore_evas_sdl_render;
_ecore_evas_register(ee);
Ecore_Evas *ee;
int rmethod;
- rmethod = evas_render_method_lookup("software_sdl");
+ rmethod = evas_render_method_lookup("buffer");
if (!rmethod) return NULL;
ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha);
- ee->driver = "sdl";
return ee;
}
#else
}
#endif
-#ifdef BUILD_ECORE_EVAS_SOFTWARE_SDL
-EAPI Ecore_Evas*
-ecore_evas_sdl16_new(const char* name, int w, int h, int fullscreen, int hwsurface, int noframe, int alpha)
-{
- Ecore_Evas *ee;
- int rmethod;
-
- rmethod = evas_render_method_lookup("software_16_sdl");
- if (!rmethod) return NULL;
-
- ee = _ecore_evas_internal_sdl_new(rmethod, name, w, h, fullscreen, hwsurface, noframe, alpha);
- ee->driver = "software_16_sdl";
- return ee;
-}
-#else
EAPI Ecore_Evas*
ecore_evas_sdl16_new(const char* name __UNUSED__, int w __UNUSED__, int h __UNUSED__, int fullscreen __UNUSED__, int hwsurface __UNUSED__, int noframe __UNUSED__, int alpha __UNUSED__)
{
ERR("OUTCH !");
return NULL;
}
-#endif
#ifdef BUILD_ECORE_EVAS_OPENGL_SDL
EAPI Ecore_Evas*
#ifdef HAVE_CONFIG_H
-# include <config.h>
+# include "config.h"
#endif
-#define LOGFNS 1
+//#define LOGFNS 1
#ifdef LOGFNS
# include <stdio.h>
#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
-# include <wayland-egl.h>
# include <Evas_Engine_Wayland_Egl.h>
# include <Ecore_Wayland.h>
/* local structures */
typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
-struct _EE_Wl_Smart_Data
+struct _EE_Wl_Smart_Data
{
- Evas_Object *frame, *text;
+ Evas_Object *frame;
+ Evas_Object *text;
Evas_Coord x, y, w, h;
};
static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
+static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_show(Ecore_Evas *ee);
static void _ecore_evas_wl_hide(Ecore_Evas *ee);
static void _ecore_evas_wl_raise(Ecore_Evas *ee);
-static void _ecore_evas_wl_lower(Ecore_Evas *ee);
-static void _ecore_evas_wl_activate(Ecore_Evas *ee);
-static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t);
+static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title);
static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
-static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
-static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
-static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__);
static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
-static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__);
+static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
+static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
+static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
+static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
static int _ecore_evas_wl_render(Ecore_Evas *ee);
static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
-static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
-
-static 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);
-static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__);
+static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event);
/* SMART stuff for frame */
static Evas_Smart *_ecore_evas_wl_smart = NULL;
/* local variables */
static int _ecore_evas_wl_init_count = 0;
-static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8];
-static uint32_t _ecore_evas_wl_btn_timestamp;
-static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener =
-{
- _ecore_evas_wl_handle_configure,
- _ecore_evas_wl_handle_popup_done
-};
+static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
{
- _ecore_evas_wl_free,
- _ecore_evas_wl_callback_resize_set,
- _ecore_evas_wl_callback_move_set,
- NULL, // callback show set
- NULL, // callback hide set
- _ecore_evas_wl_callback_delete_request_set,
- NULL, // callback destroy set
- _ecore_evas_wl_callback_focus_in_set,
- _ecore_evas_wl_callback_focus_out_set,
- _ecore_evas_wl_callback_mouse_in_set,
- NULL, // callback mouse out set
- NULL, // callback sticky set
- NULL, // callback unsticky set
- NULL, // callback pre render set
- NULL, // callback post render set
- _ecore_evas_wl_move,
- NULL, // func managed move
- _ecore_evas_wl_resize,
- NULL, // _ecore_evas_wl_move_resize,
- NULL, // func rotation set
- NULL, // func shaped set
- _ecore_evas_wl_show,
- _ecore_evas_wl_hide,
- _ecore_evas_wl_raise,
- _ecore_evas_wl_lower,
- _ecore_evas_wl_activate,
- _ecore_evas_wl_title_set,
- _ecore_evas_wl_name_class_set,
- _ecore_evas_wl_size_min_set,
- _ecore_evas_wl_size_max_set,
- _ecore_evas_wl_size_base_set,
- _ecore_evas_wl_size_step_set,
- _ecore_evas_wl_object_cursor_set,
- _ecore_evas_wl_layer_set,
- _ecore_evas_wl_focus_set,
- _ecore_evas_wl_iconified_set,
- NULL, // func borderless set
- NULL, // func override set
- _ecore_evas_wl_maximized_set,
+ _ecore_evas_wl_free,
+ _ecore_evas_wl_callback_resize_set,
+ _ecore_evas_wl_callback_move_set,
+ NULL,
+ NULL,
+ _ecore_evas_wl_callback_delete_request_set,
+ NULL,
+ _ecore_evas_wl_callback_focus_in_set,
+ _ecore_evas_wl_callback_focus_out_set,
+ _ecore_evas_wl_callback_mouse_in_set,
+ _ecore_evas_wl_callback_mouse_out_set,
+ NULL, // sticky_set
+ NULL, // unsticky_set
+ NULL, // pre_render_set
+ NULL, // post_render_set
+ _ecore_evas_wl_move,
+ NULL, // managed_move
+ _ecore_evas_wl_resize,
+ NULL, // move_resize
+ NULL, // rotation_set
+ NULL, // shaped_set
+ _ecore_evas_wl_show,
+ _ecore_evas_wl_hide,
+ _ecore_evas_wl_raise,
+ NULL, // lower
+ NULL, // activate
+ _ecore_evas_wl_title_set,
+ _ecore_evas_wl_name_class_set,
+ _ecore_evas_wl_size_min_set,
+ _ecore_evas_wl_size_max_set,
+ _ecore_evas_wl_size_base_set,
+ _ecore_evas_wl_size_step_set,
+ NULL, // object_cursor_set
+ _ecore_evas_wl_layer_set,
+ NULL, // focus set
+ _ecore_evas_wl_iconified_set,
+ NULL, // borderless set
+ NULL, // override set
+ _ecore_evas_wl_maximized_set,
_ecore_evas_wl_fullscreen_set,
- NULL, // _ecore_evas_wl_avoid_damage_set,
+ NULL, // func avoid_damage set
NULL, // func withdrawn set
NULL, // func sticky set
- NULL, // func ignore events set
- NULL, // func alpha set
- NULL, // func transparent set
+ _ecore_evas_wl_ignore_events_set,
+ _ecore_evas_wl_alpha_set,
+ _ecore_evas_wl_transparent_set,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
_ecore_evas_wl_render,
_ecore_evas_wl_screen_geometry_get
};
-#endif
+/* external variables */
-#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
+/* external functions */
EAPI Ecore_Evas *
-ecore_evas_wayland_egl_new(const char *disp_name, int x, int y, int w, int h, int frame)
+ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame)
{
+ Ecore_Wl_Window *p = NULL;
Evas_Engine_Info_Wayland_Egl *einfo;
Ecore_Evas *ee;
- int method = 0;
- static int _win_id = 1;
+ int method = 0, count = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!(method = evas_render_method_lookup("wayland_egl")))
+ if (!(method = evas_render_method_lookup("wayland_egl")))
{
- printf("Render method lookup failed for Wayland Egl");
+ ERR("Render method lookup failed for Wayland_Egl");
return NULL;
}
- if (!ecore_wl_init(disp_name))
+ count = ecore_wl_init(disp_name);
+ if (!count)
{
- printf("Failed to initialize Ecore Wayland");
+ ERR("Failed to initialize Ecore_Wayland");
return NULL;
}
+ else if (count == 1)
+ ecore_wl_display_iterate();
- if (!(ee = calloc(1, sizeof(Ecore_Evas))))
+ if (!(ee = calloc(1, sizeof(Ecore_Evas))))
{
- printf("Failed to allocate Ecore_Evas.");
+ ERR("Failed to allocate Ecore_Evas");
ecore_wl_shutdown();
return NULL;
}
if (w < 1) w = 1;
if (h < 1) h = 1;
- ee->req.x = ee->x = x;
- ee->req.y = ee->y = y;
- ee->req.w = ee->w = w;
- ee->req.h = ee->h = h;
+ ee->x = x;
+ ee->y = y;
+ ee->w = w;
+ ee->h = h;
+ ee->req.x = ee->x;
+ ee->req.y = ee->y;
+ ee->req.w = ee->w;
+ ee->req.h = ee->h;
ee->rotation = 0;
- ee->prop.max.w = ee->prop.max.h = 32767;
+ ee->prop.max.w = 32767;
+ ee->prop.max.h = 32767;
ee->prop.layer = 4;
ee->prop.request_pos = 0;
ee->prop.sticky = 0;
ee->prop.draw_frame = frame;
- ee->prop.window = _win_id++;
+ ee->alpha = EINA_FALSE;
ee->evas = evas_new();
evas_data_attach_set(ee->evas, ee);
evas_output_size_set(ee->evas, ee->w, ee->h);
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
- if (ee->prop.draw_frame)
+ /* FIXME: This needs to be set based on theme & scale */
+ if (ee->prop.draw_frame)
evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
- if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
+ if (parent)
+ p = ecore_wl_window_find(parent);
+
+ /* FIXME: Get if parent is alpha, and set */
+
+ ee->engine.wl.parent = p;
+ ee->engine.wl.win =
+ ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW);
+ ee->prop.window = ee->engine.wl.win->id;
+
+ if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
{
einfo->info.display = ecore_wl_display_get();
+ einfo->info.destination_alpha = EINA_FALSE;
einfo->info.rotation = ee->rotation;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
- printf("Failed to set Evas Engine Info for '%s'.", ee->driver);
+ ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
ecore_evas_free(ee);
+ _ecore_evas_wl_shutdown();
+ ecore_wl_shutdown();
return NULL;
}
}
else
{
- printf("Failed to get Evas Engine Info for '%s'.", ee->driver);
+ ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
ecore_evas_free(ee);
+ _ecore_evas_wl_shutdown();
+ ecore_wl_shutdown();
return NULL;
}
- /* NB: we need to be notified before 'free' so we can munmap the evas
- * engine destination */
ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
if (ee->prop.draw_frame)
/* local functions */
static int
-_ecore_evas_wl_init(void)
+_ecore_evas_wl_init(void)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (++_ecore_evas_wl_init_count != 1)
return _ecore_evas_wl_init_count;
- _ecore_evas_wl_event_handlers[0] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- _ecore_evas_wl_event_mouse_down, NULL);
- _ecore_evas_wl_event_handlers[1] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
- _ecore_evas_wl_event_mouse_up, NULL);
- _ecore_evas_wl_event_handlers[2] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
- _ecore_evas_wl_event_mouse_move, NULL);
- _ecore_evas_wl_event_handlers[3] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
- _ecore_evas_wl_event_mouse_wheel, NULL);
- _ecore_evas_wl_event_handlers[4] =
+ _ecore_evas_wl_event_hdls[0] =
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
- _ecore_evas_wl_event_mouse_in, NULL);
- _ecore_evas_wl_event_handlers[5] =
+ _ecore_evas_wl_cb_mouse_in, NULL);
+ _ecore_evas_wl_event_hdls[1] =
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
- _ecore_evas_wl_event_mouse_out, NULL);
- _ecore_evas_wl_event_handlers[6] =
+ _ecore_evas_wl_cb_mouse_out, NULL);
+ _ecore_evas_wl_event_hdls[2] =
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
- _ecore_evas_wl_event_focus_in, NULL);
- _ecore_evas_wl_event_handlers[7] =
+ _ecore_evas_wl_cb_focus_in, NULL);
+ _ecore_evas_wl_event_hdls[3] =
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
- _ecore_evas_wl_event_focus_out, NULL);
+ _ecore_evas_wl_cb_focus_out, NULL);
+ _ecore_evas_wl_event_hdls[4] =
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
+ _ecore_evas_wl_cb_window_configure, NULL);
ecore_event_evas_init();
}
static int
-_ecore_evas_wl_shutdown(void)
+_ecore_evas_wl_shutdown(void)
{
unsigned int i = 0;
if (--_ecore_evas_wl_init_count != 0)
return _ecore_evas_wl_init_count;
- for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++)
+ for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++)
{
- if (_ecore_evas_wl_event_handlers[i])
- ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]);
+ if (_ecore_evas_wl_event_hdls[i])
+ ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
}
ecore_event_evas_shutdown();
}
static void
-_ecore_evas_wl_free(Ecore_Evas *ee)
+_ecore_evas_wl_free(Ecore_Evas *ee)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (ee)
- {
- /* destroy shell surface */
- if (ee->engine.wl.shell_surface)
- wl_shell_surface_destroy(ee->engine.wl.shell_surface);
- ee->engine.wl.shell_surface = NULL;
+ if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
+ ee->engine.wl.win = NULL;
- /* destroy surface */
- if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
- ee->engine.wl.surface = NULL;
+ ecore_event_window_unregister(ee->prop.window);
+ ecore_evas_input_event_unregister(ee);
- ecore_event_window_unregister(ee->prop.window);
- ecore_evas_input_event_unregister(ee);
- }
_ecore_evas_wl_shutdown();
ecore_wl_shutdown();
}
}
static void
-_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
+_ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!ee) return;
+ ee->func.fn_mouse_out = func;
+}
+
+static void
+_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
-// if ((ee->x == x) && (ee->y == y)) return;
ee->req.x = x;
ee->req.y = y;
-
ee->x = x;
ee->y = y;
- if (ee->engine.wl.shell_surface)
- {
- wl_shell_surface_move(ee->engine.wl.shell_surface,
- ecore_wl_input_device_get(),
- _ecore_evas_wl_btn_timestamp);
- }
+ if (ee->engine.wl.win) ecore_wl_window_move(ee->engine.wl.win, x, y);
if (ee->func.fn_move) ee->func.fn_move(ee);
}
static void
-_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
+_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if (w < 1) w = 1;
if (h < 1) h = 1;
- if ((ee->w == w) && (ee->h == h)) return;
+// if ((ee->w == w) && (ee->h == h)) return;
+
+ if (ee->prop.min.w > w) w = ee->prop.min.w;
+ else if (w > ee->prop.max.w) w = ee->prop.max.w;
+ if (ee->prop.min.h > h) h = ee->prop.min.h;
+ else if (h > ee->prop.max.h) h = ee->prop.max.h;
ee->req.w = w;
ee->req.h = h;
- /* if (ee->visible) */
- /* { */
- /* damage old surface, if it exists */
-
- /* NB: This removes any lingering screen artifacts in the compositor.
- * This may be a 'HACK' if the issue is actually in the wayland
- * compositor, but for now lets implement this so we don't have screen
- * artifacts laying around during a resize */
- /* if (ee->engine.wl.surface) */
- /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
- /* } */
+// ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h);
ee->w = w;
ee->h = h;
-// ecore_wl_flush();
-
+ /* change evas output & viewport sizes */
evas_output_size_set(ee->evas, ee->w, ee->h);
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
if (ee->engine.wl.frame)
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
- /* if ((ee->visible) && (ee->engine.wl.surface)) */
- /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
+ /* set new engine destination */
+ /* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */
+
+ /* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */
+ ecore_wl_flush();
+
+ ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
static void
-_ecore_evas_wl_show(Ecore_Evas *ee)
+_ecore_evas_wl_show(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Egl *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ee) return;
- if (ee->visible) return;
-
- einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
+ if ((!ee) || (ee->visible)) return;
- /* create new surface */
- ee->engine.wl.surface =
- wl_compositor_create_surface(ecore_wl_compositor_get());
- wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window);
+ if (ee->engine.wl.win)
+ {
+ ecore_wl_window_show(ee->engine.wl.win);
+ ecore_wl_flush();
+ }
- /* create new shell surface */
- ee->engine.wl.shell_surface =
- wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface);
+ einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
+ if (!einfo)
+ {
+ ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
+ return;
+ }
- /* set the engine surface here. This should trigger an egl window create */
- einfo->info.surface = ee->engine.wl.surface;
+ einfo->info.surface = ecore_wl_window_surface_get(ee->engine.wl.win);
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- /* add listener for configure events (happen on shell surface resize) */
- wl_shell_surface_add_listener(ee->engine.wl.shell_surface,
- &_ecore_evas_wl_shell_surface_listener, ee);
-
- /* Raise this surface to the top */
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
-
if (ee->engine.wl.frame)
{
evas_object_show(ee->engine.wl.frame);
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
}
- ecore_wl_flush();
+ /* ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0); */
ee->visible = 1;
if (ee->func.fn_show) ee->func.fn_show(ee);
}
static void
-_ecore_evas_wl_hide(Ecore_Evas *ee)
+_ecore_evas_wl_hide(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Egl *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ee) return;
- if (!ee->visible) return;
-
- /* get engine info */
- einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
- einfo->info.surface = NULL;
- evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+ if ((!ee) || (!ee->visible)) return;
- /* destroy shell surface */
- if (ee->engine.wl.shell_surface)
- wl_shell_surface_destroy(ee->engine.wl.shell_surface);
- ee->engine.wl.shell_surface = NULL;
+ if (ee->engine.wl.win)
+ {
+ ecore_wl_window_hide(ee->engine.wl.win);
+ ecore_wl_flush();
+ }
- /* destroy surface */
- if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
- ee->engine.wl.surface = NULL;
+ einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas);
+ if (einfo)
+ {
+ einfo->info.surface = NULL;
+ evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
+ }
ee->visible = 0;
ee->should_be_visible = 0;
+
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
-}
-
-static void
-_ecore_evas_wl_lower(Ecore_Evas *ee)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->visible)) return;
- /* FIXME: Need a way to tell Wayland to lower */
-}
-
-static void
-_ecore_evas_wl_activate(Ecore_Evas *ee)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
+ ecore_wl_window_raise(ee->engine.wl.win);
}
static void
-_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t)
+_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
- if (t) ee->prop.title = strdup(t);
-
+ if (title) ee->prop.title = strdup(title);
if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
{
EE_Wl_Smart_Data *sd;
}
static void
-_ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
+_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
{
- int x = 0, y = 0;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
- ee->prop.cursor.object = NULL;
-
- if (!obj)
- {
- ee->prop.cursor.layer = 0;
- ee->prop.cursor.hot.x = 0;
- ee->prop.cursor.hot.y = 0;
- return;
- }
-
- ee->prop.cursor.object = obj;
- ee->prop.cursor.layer = layer;
- ee->prop.cursor.hot.x = hot_x;
- ee->prop.cursor.hot.y = hot_y;
-
- evas_pointer_output_xy_get(ee->evas, &x, &y);
- evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
- evas_object_move(ee->prop.cursor.object,
- x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y);
- evas_object_pass_events_set(ee->prop.cursor.object, 1);
- if (evas_pointer_inside_get(ee->evas))
- evas_object_show(ee->prop.cursor.object);
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _ecore_evas_wl_object_cursor_del, ee);
+ if (ee->prop.layer == layer) return;
+ if (layer < 1) layer = 1;
+ else if (layer > 255) layer = 255;
+ ee->prop.layer = layer;
}
static void
-_ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
+_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
{
- Ecore_Evas *ee;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!(ee = data)) return;
- ee->prop.cursor.object = NULL;
+ if (!ee) return;
+ if (ee->prop.iconified == iconify) return;
+ ee->prop.iconified = iconify;
+ /* FIXME: Implement this in Wayland someshow */
}
static void
-_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
+_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.layer == layer) return;
- if (layer < 1) layer = 1;
- else if (layer > 255) layer = 255;
- ee->prop.layer = layer;
+ if (ee->prop.maximized == max) return;
+ ee->prop.maximized = max;
+ ecore_wl_window_maximized_set(ee->engine.wl.win, max);
}
static void
-_ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__)
+_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
+ if (ee->prop.fullscreen == full) return;
+ ee->prop.fullscreen = full;
+ ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
}
static void
-_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
+_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.iconified == iconify) return;
- ee->prop.iconified = iconify;
- /* FIXME: Implement this in Wayland someshow */
+ ee->ignore_events = ignore;
+ /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
}
static void
-_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
+_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
{
+ Evas_Engine_Info_Wayland_Egl *einfo;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.maximized == max) return;
- ee->prop.maximized = max;
- /* FIXME: Implement this in Wayland someshow */
+ if ((ee->alpha == alpha)) return;
+ ee->alpha = alpha;
+ if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
+ {
+ einfo->info.destination_alpha = alpha;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ }
}
static void
-_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__)
+_ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
{
+ Evas_Engine_Info_Wayland_Egl *einfo;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface);
+ if (!ee) return;
+ if ((ee->transparent == transparent)) return;
+ ee->transparent = transparent;
+ if (!ee->visible) return;
+ if ((einfo = (Evas_Engine_Info_Wayland_Egl *)evas_engine_info_get(ee->evas)))
+ {
+ einfo->info.destination_alpha = transparent;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ }
}
static int
-_ecore_evas_wl_render(Ecore_Evas *ee)
+_ecore_evas_wl_render(Ecore_Evas *ee)
{
int rend = 0;
if ((updates = evas_render_updates(ee->evas)))
{
- /* if (ee->engine.wl.surface) */
- /* { */
- /* Eina_List *l = NULL; */
- /* Eina_Rectangle *r; */
+ Eina_List *l = NULL;
+ Eina_Rectangle *r;
- /* EINA_LIST_FOREACH(updates, l, r) */
- /* wl_surface_damage(ee->engine.wl.surface, */
- /* r->x, r->y, r->w, r->h); */
- /* } */
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ EINA_LIST_FOREACH(updates, l, r)
+ ecore_wl_window_damage(ee->engine.wl.win,
+ r->x, r->y, r->w, r->h);
+
+ /* ecore_wl_flush(); */
evas_render_updates_free(updates);
_ecore_evas_idle_timeout_update(ee);
rend = 1;
-
- ecore_wl_flush();
}
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
}
-
return rend;
}
ecore_wl_screen_size_get(w, h);
}
-static Eina_Bool
-_ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Button *ev;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- ev = event;
- _ecore_evas_wl_btn_timestamp = ev->timestamp;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Button *ev;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Move *ev;
-
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- ee->mouse.x = ev->x;
- ee->mouse.y = ev->y;
- evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
- return ECORE_CALLBACK_PASS_ON;
-}
-
-static Eina_Bool
-_ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
+void
+_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Wheel *ev;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
+ if (!ee) return;
+ if (ee->engine.wl.win)
+ ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
}
static Eina_Bool
-_ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Mouse_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
- evas_event_feed_mouse_in(ee->evas, ev->time, NULL);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
+ evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
+ _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
-_ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Mouse_Out *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
- evas_event_feed_mouse_out(ee->evas, ev->time, NULL);
+ _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
+ evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
-_ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Focus_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
ee->prop.focused = 1;
evas_focus_in(ee->evas);
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
}
static Eina_Bool
-_ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
- Ecore_Wl_Event_Focus_Out *ev;
+ Ecore_Wl_Event_Focus_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
evas_focus_out(ee->evas);
ee->prop.focused = 0;
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
return ECORE_CALLBACK_PASS_ON;
}
-static void
-_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)
+static Eina_Bool
+_ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
+ Ecore_Wl_Event_Window_Configure *ev;
- /* NB: Trap to prevent compositor from crashing */
- if ((width <= 0) || (height <= 0)) return;
-
- if (!(ee = data)) return;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
- printf("EGL Handle Configure Message\n");
- if ((shell_surface) && (ee->engine.wl.shell_surface))
+ ev = event;
+ ee = ecore_event_window_match(ev->win);
+ if (!ee) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((ee->x != ev->x) || (ee->y != ev->y))
{
- if (ee->engine.wl.shell_surface != shell_surface) return;
- ecore_evas_resize(ee, width, height);
+ ee->x = ev->x;
+ ee->y = ev->y;
+ ee->req.x = ee->x;
+ ee->req.y = ee->y;
+ if (ee->func.fn_move) ee->func.fn_move(ee);
+ }
+ if ((ee->req.w != ev->w) || (ee->req.h != ev->h))
+ {
+ ee->req.w = ev->w;
+ ee->req.h = ev->h;
+ if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
-}
-
-static void
-_ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__)
-{
+ return ECORE_CALLBACK_PASS_ON;
}
static void
return evas_object_smart_add(evas, _ecore_evas_wl_smart);
}
-void
-_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->engine.wl.shell_surface)) return;
- wl_shell_surface_resize(ee->engine.wl.shell_surface,
- ecore_wl_input_device_get(),
- _ecore_evas_wl_btn_timestamp, location);
-}
-
-void
-_ecore_evas_wayland_egl_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->engine.wl.surface)) return;
- if ((!source) || (!drag_ee)) return;
- ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer);
-}
-
#else
EAPI Ecore_Evas *
-ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)
+ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__)
{
return NULL;
}
# include <sys/mman.h>
#endif
-# include <Eina.h>
-# include <Evas.h>
-# include <Ecore.h>
+#include <Eina.h>
+#include <Evas.h>
+#include <Ecore.h>
-# include "ecore_evas_private.h"
-# include "Ecore_Evas.h"
+#include "ecore_evas_private.h"
+#include "Ecore_Evas.h"
#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
# include <Evas_Engine_Wayland_Shm.h>
static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
+static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_show(Ecore_Evas *ee);
static void _ecore_evas_wl_hide(Ecore_Evas *ee);
static void _ecore_evas_wl_raise(Ecore_Evas *ee);
-static void _ecore_evas_wl_lower(Ecore_Evas *ee);
-static void _ecore_evas_wl_activate(Ecore_Evas *ee);
-static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t);
+static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title);
static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
-static void _ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y);
-static void _ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__);
static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
-static void _ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__);
static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
-static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__);
+static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
+static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
+static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
+static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
static int _ecore_evas_wl_render(Ecore_Evas *ee);
static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest);
-static Eina_Bool _ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
-static Eina_Bool _ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
-
-static 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);
-static void _ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__);
+static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
+static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event);
/* SMART stuff for frame */
static Evas_Smart *_ecore_evas_wl_smart = NULL;
/* local variables */
static int _ecore_evas_wl_init_count = 0;
-static Ecore_Event_Handler *_ecore_evas_wl_event_handlers[8];
-static uint32_t _ecore_evas_wl_btn_timestamp;
-static const struct wl_shell_surface_listener _ecore_evas_wl_shell_surface_listener =
-{
- _ecore_evas_wl_handle_configure,
- _ecore_evas_wl_handle_popup_done
-};
+static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
{
- _ecore_evas_wl_free,
- _ecore_evas_wl_callback_resize_set,
- _ecore_evas_wl_callback_move_set,
- NULL, // callback show set
- NULL, // callback hide set
- _ecore_evas_wl_callback_delete_request_set,
- NULL, // callback destroy set
- _ecore_evas_wl_callback_focus_in_set,
- _ecore_evas_wl_callback_focus_out_set,
- _ecore_evas_wl_callback_mouse_in_set,
- NULL, // callback mouse out set
- NULL, // callback sticky set
- NULL, // callback unsticky set
- NULL, // callback pre render set
- NULL, // callback post render set
- _ecore_evas_wl_move,
- NULL, // func managed move
- _ecore_evas_wl_resize,
- NULL, // func move_resize
- NULL, // func rotation set
- NULL, // func shaped set
- _ecore_evas_wl_show,
- _ecore_evas_wl_hide,
- _ecore_evas_wl_raise,
- _ecore_evas_wl_lower,
- _ecore_evas_wl_activate,
- _ecore_evas_wl_title_set,
- _ecore_evas_wl_name_class_set,
- _ecore_evas_wl_size_min_set,
- _ecore_evas_wl_size_max_set,
- _ecore_evas_wl_size_base_set,
- _ecore_evas_wl_size_step_set,
- _ecore_evas_wl_object_cursor_set,
- _ecore_evas_wl_layer_set,
- _ecore_evas_wl_focus_set,
- _ecore_evas_wl_iconified_set,
- NULL, // func borderless set
- NULL, // func override set
- _ecore_evas_wl_maximized_set,
- _ecore_evas_wl_fullscreen_set,
+ _ecore_evas_wl_free,
+ _ecore_evas_wl_callback_resize_set,
+ _ecore_evas_wl_callback_move_set,
+ NULL,
+ NULL,
+ _ecore_evas_wl_callback_delete_request_set,
+ NULL,
+ _ecore_evas_wl_callback_focus_in_set,
+ _ecore_evas_wl_callback_focus_out_set,
+ _ecore_evas_wl_callback_mouse_in_set,
+ _ecore_evas_wl_callback_mouse_out_set,
+ NULL, // sticky_set
+ NULL, // unsticky_set
+ NULL, // pre_render_set
+ NULL, // post_render_set
+ _ecore_evas_wl_move,
+ NULL, // managed_move
+ _ecore_evas_wl_resize,
+ NULL, // move_resize
+ NULL, // rotation_set
+ NULL, // shaped_set
+ _ecore_evas_wl_show,
+ _ecore_evas_wl_hide,
+ _ecore_evas_wl_raise,
+ NULL, // lower
+ NULL, // activate
+ _ecore_evas_wl_title_set,
+ _ecore_evas_wl_name_class_set,
+ _ecore_evas_wl_size_min_set,
+ _ecore_evas_wl_size_max_set,
+ _ecore_evas_wl_size_base_set,
+ _ecore_evas_wl_size_step_set,
+ NULL, // object_cursor_set
+ _ecore_evas_wl_layer_set,
+ NULL, // focus set
+ _ecore_evas_wl_iconified_set,
+ NULL, // borderless set
+ NULL, // override set
+ _ecore_evas_wl_maximized_set,
+ _ecore_evas_wl_fullscreen_set,
NULL, // func avoid_damage set
NULL, // func withdrawn set
NULL, // func sticky set
- NULL, // func ignore_events set
- NULL, // func alpha set
- NULL, // func transparent set
+ _ecore_evas_wl_ignore_events_set,
+ _ecore_evas_wl_alpha_set,
+ _ecore_evas_wl_transparent_set,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
_ecore_evas_wl_render,
_ecore_evas_wl_screen_geometry_get
};
/* external variables */
-#endif
-#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
+/* external functions */
EAPI Ecore_Evas *
-ecore_evas_wayland_shm_new(const char *disp_name, int x, int y, int w, int h, int frame)
+ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame)
{
+ Ecore_Wl_Window *p = NULL;
Evas_Engine_Info_Wayland_Shm *einfo;
Ecore_Evas *ee;
- int method = 0;
- static int _win_id = 1;
+ int method = 0, count = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!(method = evas_render_method_lookup("wayland_shm")))
+ if (!(method = evas_render_method_lookup("wayland_shm")))
{
- ERR("Render method lookup failed.");
+ ERR("Render method lookup failed for Wayland_Shm");
return NULL;
}
- if (!(ecore_wl_init(disp_name)))
+ count = ecore_wl_init(disp_name);
+ if (!count)
{
- ERR("Failed to initialize Ecore Wayland.");
+ ERR("Failed to initialize Ecore_Wayland");
return NULL;
}
+ else if (count == 1)
+ ecore_wl_display_iterate();
- if (!(ee = calloc(1, sizeof(Ecore_Evas))))
+ if (!(ee = calloc(1, sizeof(Ecore_Evas))))
{
- ERR("Failed to allocate Ecore_Evas.");
+ ERR("Failed to allocate Ecore_Evas");
ecore_wl_shutdown();
return NULL;
}
if (w < 1) w = 1;
if (h < 1) h = 1;
- ee->req.x = ee->x = x;
- ee->req.y = ee->y = y;
- ee->req.w = ee->w = w;
- ee->req.h = ee->h = h;
+ ee->x = x;
+ ee->y = y;
+ ee->w = w;
+ ee->h = h;
+ ee->req.x = ee->x;
+ ee->req.y = ee->y;
+ ee->req.w = ee->w;
+ ee->req.h = ee->h;
ee->rotation = 0;
- ee->prop.max.w = ee->prop.max.h = 32767;
+ ee->prop.max.w = 32767;
+ ee->prop.max.h = 32767;
ee->prop.layer = 4;
ee->prop.request_pos = 0;
ee->prop.sticky = 0;
ee->prop.draw_frame = frame;
- ee->prop.window = _win_id++;
ee->evas = evas_new();
evas_data_attach_set(ee->evas, ee);
evas_output_size_set(ee->evas, ee->w, ee->h);
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
- if (ee->prop.draw_frame)
+ /* FIXME: This needs to be set based on theme & scale */
+ if (ee->prop.draw_frame)
evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
- if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
+ if (parent)
+ p = ecore_wl_window_find(parent);
+
+ /* FIXME: Get if parent is alpha, and set */
+
+ ee->engine.wl.parent = p;
+ ee->engine.wl.win =
+ ecore_wl_window_new(p, x, y, w, h, ECORE_WL_WINDOW_BUFFER_TYPE_SHM);
+ ee->prop.window = ee->engine.wl.win->id;
+
+ if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
{
einfo->info.rotation = ee->rotation;
einfo->info.debug = EINA_FALSE;
- if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
{
- ERR("Failed to set Evas Engine Info for '%s'.", ee->driver);
+ ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
ecore_evas_free(ee);
+ _ecore_evas_wl_shutdown();
+ ecore_wl_shutdown();
return NULL;
}
}
else
{
- ERR("Failed to get Evas Engine Info for '%s'.", ee->driver);
+ ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
ecore_evas_free(ee);
+ _ecore_evas_wl_shutdown();
+ ecore_wl_shutdown();
return NULL;
}
- /* NB: we need to be notified before 'free' so we can munmap the evas
- * engine destination */
ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free);
if (ee->prop.draw_frame)
if (++_ecore_evas_wl_init_count != 1)
return _ecore_evas_wl_init_count;
- _ecore_evas_wl_event_handlers[0] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- _ecore_evas_wl_event_mouse_down, NULL);
- _ecore_evas_wl_event_handlers[1] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
- _ecore_evas_wl_event_mouse_up, NULL);
- _ecore_evas_wl_event_handlers[2] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
- _ecore_evas_wl_event_mouse_move, NULL);
- _ecore_evas_wl_event_handlers[3] =
- ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
- _ecore_evas_wl_event_mouse_wheel, NULL);
- _ecore_evas_wl_event_handlers[4] =
+ _ecore_evas_wl_event_hdls[0] =
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
- _ecore_evas_wl_event_mouse_in, NULL);
- _ecore_evas_wl_event_handlers[5] =
+ _ecore_evas_wl_cb_mouse_in, NULL);
+ _ecore_evas_wl_event_hdls[1] =
ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
- _ecore_evas_wl_event_mouse_out, NULL);
- _ecore_evas_wl_event_handlers[6] =
+ _ecore_evas_wl_cb_mouse_out, NULL);
+ _ecore_evas_wl_event_hdls[2] =
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
- _ecore_evas_wl_event_focus_in, NULL);
- _ecore_evas_wl_event_handlers[7] =
+ _ecore_evas_wl_cb_focus_in, NULL);
+ _ecore_evas_wl_event_hdls[3] =
ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
- _ecore_evas_wl_event_focus_out, NULL);
+ _ecore_evas_wl_cb_focus_out, NULL);
+ _ecore_evas_wl_event_hdls[4] =
+ ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
+ _ecore_evas_wl_cb_window_configure, NULL);
ecore_event_evas_init();
if (--_ecore_evas_wl_init_count != 0)
return _ecore_evas_wl_init_count;
- for (i = 0; i < sizeof(_ecore_evas_wl_event_handlers) / sizeof(Ecore_Event_Handler *); i++)
+ for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++)
{
- if (_ecore_evas_wl_event_handlers[i])
- ecore_event_handler_del(_ecore_evas_wl_event_handlers[i]);
+ if (_ecore_evas_wl_event_hdls[i])
+ ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
}
ecore_event_evas_shutdown();
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- /* destroy frame */
if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
- /* get engine info */
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
if ((einfo) && (einfo->info.dest))
{
int ret = 0;
- /* munmap previous engine destination */
ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
+ if (!ret) ERR("Failed to unmap engine destination: %m");
}
}
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- /* destroy buffer */
if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
ee->engine.wl.buffer = NULL;
- /* destroy shell surface */
- if (ee->engine.wl.shell_surface)
- wl_shell_surface_destroy(ee->engine.wl.shell_surface);
- ee->engine.wl.shell_surface = NULL;
-
- /* destroy surface */
- if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
- ee->engine.wl.surface = NULL;
+ if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
+ ee->engine.wl.win = NULL;
ecore_event_window_unregister(ee->prop.window);
ecore_evas_input_event_unregister(ee);
}
static void
-_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
+_ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!ee) return;
+ ee->func.fn_mouse_out = func;
+}
+
+static void
+_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
-// if ((ee->x == x) && (ee->y == y)) return;
ee->req.x = x;
ee->req.y = y;
-
ee->x = x;
ee->y = y;
-
- if (ee->engine.wl.shell_surface)
- {
- wl_shell_surface_move(ee->engine.wl.shell_surface,
- ecore_wl_input_device_get(),
- _ecore_evas_wl_btn_timestamp);
- }
-
+ if (ee->engine.wl.win) ecore_wl_window_move(ee->engine.wl.win, x, y);
if (ee->func.fn_move) ee->func.fn_move(ee);
}
{
Evas_Engine_Info_Wayland_Shm *einfo;
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
if (!ee) return;
if (w < 1) w = 1;
if (h < 1) h = 1;
- if ((ee->w == w) && (ee->h == h)) return;
+// if ((ee->w == w) && (ee->h == h)) return;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (ee->prop.min.w > w) w = ee->prop.min.w;
+ else if (w > ee->prop.max.w) w = ee->prop.max.w;
+ if (ee->prop.min.h > h) h = ee->prop.min.h;
+ else if (h > ee->prop.max.h) h = ee->prop.max.h;
ee->req.w = w;
ee->req.h = h;
- if (ee->visible)
- {
- /* damage old surface, if it exists */
-
- /* NB: This removes any lingering screen artifacts in the compositor.
- * This may be a 'HACK' if the issue is actually in the wayland
- * compositor, but for now lets implement this so we don't have screen
- * artifacts laying around during a resize */
- if (ee->engine.wl.surface)
- wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h);
- }
+// ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h);
- /* get engine info */
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
- if (einfo->info.dest)
+ if ((einfo) && (einfo->info.dest))
{
int ret = 0;
- /* munmap previous engine destination */
ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
+ if (!ret) ERR("Failed to unmap engine destination: %m");
+ }
+ else if (!einfo)
+ {
+ ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
+ return;
}
- /* free old buffer */
if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
ee->engine.wl.buffer = NULL;
ee->w = w;
ee->h = h;
- /* create buffer @ new size (also mmaps the new destination) */
_ecore_evas_wl_buffer_new(ee, &einfo->info.dest);
-
- /* flush new buffer fd */
ecore_wl_flush();
/* change evas output & viewport sizes */
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
/* damage buffer */
- wl_buffer_damage(ee->engine.wl.buffer, 0, 0, ee->w, ee->h);
+// wl_buffer_damage(ee->engine.wl.buffer, 0, 0, ee->w, ee->h);
- if (ee->visible)
+ if (ee->engine.wl.win)
{
- /* damage surface */
- wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h);
-
- /* if visible, attach to surface */
- wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0);
+ ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer,
+ 0, 0);
+ /* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */
+ /* ecore_wl_flush(); */
+ ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h);
}
if (ee->func.fn_resize) ee->func.fn_resize(ee);
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ee) return;
- if (ee->visible) return;
+ if ((!ee) || (ee->visible)) return;
- /* get engine info */
- einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
+ if (ee->engine.wl.win)
+ ecore_wl_window_show(ee->engine.wl.win);
- /* create new surface */
- ee->engine.wl.surface =
- wl_compositor_create_surface(ecore_wl_compositor_get());
- wl_surface_set_user_data(ee->engine.wl.surface, (void *)ee->prop.window);
+ einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
+ if (!einfo)
+ {
+ ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
+ return;
+ }
- /* get new shell surface */
- ee->engine.wl.shell_surface =
- wl_shell_get_shell_surface(ecore_wl_shell_get(), ee->engine.wl.surface);
+ _ecore_evas_wl_buffer_new(ee, &einfo->info.dest);
+ ecore_wl_flush();
- /* set toplevel */
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
+ evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- /* create buffer @ new size (also mmaps the new destination) */
- _ecore_evas_wl_buffer_new(ee, &einfo->info.dest);
+ if (ee->engine.wl.win)
+ {
+ /* ecore_wl_window_show(ee->engine.wl.win); */
+ ecore_wl_window_buffer_attach(ee->engine.wl.win, ee->engine.wl.buffer, 0, 0);
+ }
- if (ee->engine.wl.frame)
+ if (ee->engine.wl.frame)
{
evas_object_show(ee->engine.wl.frame);
evas_object_resize(ee->engine.wl.frame, ee->w, ee->h);
}
- /* set new engine destination */
- evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
-
- /* add configure listener for wayland resize events */
- wl_shell_surface_add_listener(ee->engine.wl.shell_surface,
- &_ecore_evas_wl_shell_surface_listener, ee);
-
- /* flush new buffer fd */
- ecore_wl_flush();
-
- /* attach buffer to surface */
- wl_surface_attach(ee->engine.wl.surface, ee->engine.wl.buffer, 0, 0);
-
- /* NB: No need to do a damage here. If we do, we end up w/ screen
- * artifacts in the compositor */
- /* wl_surface_damage(ee->engine.wl.surface, 0, 0, ee->w, ee->h); */
-
ee->visible = 1;
if (ee->func.fn_show) ee->func.fn_show(ee);
}
static void
-_ecore_evas_wl_hide(Ecore_Evas *ee)
+_ecore_evas_wl_hide(Ecore_Evas *ee)
{
Evas_Engine_Info_Wayland_Shm *einfo;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!ee) return;
- if (!ee->visible) return;
+ if ((!ee) || (!ee->visible)) return;
- /* get engine info */
einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas);
- if (einfo->info.dest)
+ if ((einfo) && (einfo->info.dest))
{
int ret = 0;
- /* munmap previous engine destination */
ret = munmap(einfo->info.dest, ((ee->w * sizeof(int)) * ee->h));
- einfo->info.dest = NULL;
+ if (!ret) ERR("Failed to unmap engine destination: %m");
}
- /* free old buffer */
if (ee->engine.wl.buffer) wl_buffer_destroy(ee->engine.wl.buffer);
ee->engine.wl.buffer = NULL;
- /* set new engine destination */
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
- /* destroy shell surface */
- if (ee->engine.wl.shell_surface)
- wl_shell_surface_destroy(ee->engine.wl.shell_surface);
- ee->engine.wl.shell_surface = NULL;
-
- /* destroy surface */
- if (ee->engine.wl.surface) wl_surface_destroy(ee->engine.wl.surface);
- ee->engine.wl.surface = NULL;
+ ecore_wl_window_hide(ee->engine.wl.win);
ee->visible = 0;
ee->should_be_visible = 0;
+
if (ee->func.fn_hide) ee->func.fn_hide(ee);
}
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
+ ecore_wl_window_raise(ee->engine.wl.win);
}
static void
-_ecore_evas_wl_lower(Ecore_Evas *ee)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->visible)) return;
- /* FIXME: Need a way to tell Wayland to lower */
-}
-
-static void
-_ecore_evas_wl_activate(Ecore_Evas *ee)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
-}
-
-static void
-_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *t)
+_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
- if (t) ee->prop.title = strdup(t);
-
+ if (title) ee->prop.title = strdup(title);
if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
{
EE_Wl_Smart_Data *sd;
}
static void
-_ecore_evas_wl_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
+_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
{
- int x = 0, y = 0;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
- ee->prop.cursor.object = NULL;
-
- if (!obj)
- {
- ee->prop.cursor.layer = 0;
- ee->prop.cursor.hot.x = 0;
- ee->prop.cursor.hot.y = 0;
- return;
- }
-
- ee->prop.cursor.object = obj;
- ee->prop.cursor.layer = layer;
- ee->prop.cursor.hot.x = hot_x;
- ee->prop.cursor.hot.y = hot_y;
-
- evas_pointer_output_xy_get(ee->evas, &x, &y);
- evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
- evas_object_move(ee->prop.cursor.object,
- x - ee->prop.cursor.hot.x, y - ee->prop.cursor.hot.y);
- evas_object_pass_events_set(ee->prop.cursor.object, 1);
- if (evas_pointer_inside_get(ee->evas))
- evas_object_show(ee->prop.cursor.object);
-
- evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL,
- _ecore_evas_wl_object_cursor_del, ee);
+ if (ee->prop.layer == layer) return;
+ if (layer < 1) layer = 1;
+ else if (layer > 255) layer = 255;
+ ee->prop.layer = layer;
}
static void
-_ecore_evas_wl_object_cursor_del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event __UNUSED__)
+_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
{
- Ecore_Evas *ee;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!(ee = data)) return;
- ee->prop.cursor.object = NULL;
+ if (!ee) return;
+ if (ee->prop.iconified == iconify) return;
+ ee->prop.iconified = iconify;
+ /* FIXME: Implement this in Wayland someshow */
}
static void
-_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
+_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.layer == layer) return;
- if (layer < 1) layer = 1;
- else if (layer > 255) layer = 255;
- ee->prop.layer = layer;
+ if (ee->prop.maximized == max) return;
+ ee->prop.maximized = max;
+ ecore_wl_window_maximized_set(ee->engine.wl.win, max);
}
static void
-_ecore_evas_wl_focus_set(Ecore_Evas *ee, int focus __UNUSED__)
+_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_toplevel(ee->engine.wl.shell_surface);
+ if (ee->prop.fullscreen == full) return;
+ ee->prop.fullscreen = full;
+ ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
}
static void
-_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
+_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.iconified == iconify) return;
- ee->prop.iconified = iconify;
- /* FIXME: Implement this in Wayland someshow */
+ ee->ignore_events = ignore;
+ /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
}
static void
-_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
+_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
{
+ Evas_Engine_Info_Wayland_Shm *einfo;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ee) return;
- if (ee->prop.maximized == max) return;
- ee->prop.maximized = max;
- /* FIXME: Implement this in Wayland someshow */
+ if ((ee->alpha == alpha)) return;
+ ee->alpha = alpha;
+ if (ee->engine.wl.win)
+ ecore_wl_window_transparent_set(ee->engine.wl.win, alpha);
+ if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
+ {
+ einfo->info.destination_alpha = alpha;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ }
}
static void
-_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full __UNUSED__)
+_ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
{
+ Evas_Engine_Info_Wayland_Shm *einfo;
+
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if ((!ee) || (!ee->visible)) return;
- if (!ee->engine.wl.shell_surface) return;
- wl_shell_surface_set_fullscreen(ee->engine.wl.shell_surface);
+ if (!ee) return;
+ if ((ee->transparent == transparent)) return;
+ ee->transparent = transparent;
+ if (ee->engine.wl.win)
+ ecore_wl_window_transparent_set(ee->engine.wl.win, transparent);
+ if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
+ {
+ einfo->info.destination_alpha = transparent;
+ if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
+ ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
+ evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
+ }
}
static int
int rend = 0;
if (!ee) return 0;
- if (!ee->visible)
+ if (!ee->visible)
evas_norender(ee->evas);
- else
+ else
{
Eina_List *ll = NULL, *updates = NULL;
Ecore_Evas *ee2 = NULL;
Eina_List *l = NULL;
Eina_Rectangle *r;
- EINA_LIST_FOREACH(updates, l, r)
- {
- if (ee->engine.wl.buffer)
- wl_buffer_damage(ee->engine.wl.buffer,
- r->x, r->y, r->w, r->h);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (ee->engine.wl.surface)
- wl_surface_damage(ee->engine.wl.surface,
+ EINA_LIST_FOREACH(updates, l, r)
+ ecore_wl_window_damage(ee->engine.wl.win,
r->x, r->y, r->w, r->h);
- }
+
+ /* ecore_wl_flush(); */
evas_render_updates_free(updates);
_ecore_evas_idle_timeout_update(ee);
rend = 1;
-
- ecore_wl_flush();
}
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
}
-
return rend;
}
ecore_wl_screen_size_get(w, h);
}
-static Eina_Bool
-_ecore_evas_wl_event_mouse_down(void *data __UNUSED__, int type __UNUSED__, void *event)
+static void
+_ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest)
{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Button *ev;
+ struct wl_shm *shm;
+ static unsigned int format;
+ char tmp[PATH_MAX];
+ int fd = -1, stride = 0, size = 0;
+ void *ret;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ev = event;
- _ecore_evas_wl_btn_timestamp = ev->timestamp;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_down(ee->evas, ev->buttons, ev->modifiers,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
-}
+ if (dest) *dest = NULL;
+ if (!(shm = ecore_wl_shm_get())) return;
+ if (!format) format = WL_SHM_FORMAT_ARGB8888; //ecore_wl_format_get();
-static Eina_Bool
-_ecore_evas_wl_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Button *ev;
+ strcpy(tmp, "/tmp/ecore-wayland_shm-XXXXXX");
+ if ((fd = mkstemp(tmp)) < 0)
+ {
+ ERR("Could not create temporary file.");
+ return;
+ }
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ stride = (ee->w * sizeof(int));
+ size = (stride * ee->h);
+ if (ftruncate(fd, size) < 0)
+ {
+ ERR("Could not truncate temporary file.");
+ close(fd);
+ return;
+ }
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_up(ee->evas, ev->buttons, ev->modifiers,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
-}
+ ret = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
+ unlink(tmp);
-static Eina_Bool
-_ecore_evas_wl_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
-{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Move *ev;
+ if (ret == MAP_FAILED)
+ {
+ ERR("mmap of temporary file failed.");
+ close(fd);
+ return;
+ }
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- ee->mouse.x = ev->x;
- ee->mouse.y = ev->y;
- evas_event_feed_mouse_move(ee->evas, ev->x, ev->y, ev->timestamp, NULL);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
- return ECORE_CALLBACK_PASS_ON;
+ if (dest) *dest = ret;
+
+ ee->engine.wl.buffer =
+ wl_shm_create_buffer(shm, fd, ee->w, ee->h, stride, format);
+
+ close(fd);
}
-static Eina_Bool
-_ecore_evas_wl_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
+void
+_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
{
- Ecore_Evas *ee;
- Ecore_Event_Mouse_Wheel *ev;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- ev = event;
- ee = ecore_event_window_match(ev->window);
- if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z,
- ev->timestamp, NULL);
- return ECORE_CALLBACK_PASS_ON;
+ if (!ee) return;
+ if (ee->engine.wl.win)
+ ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
}
static Eina_Bool
-_ecore_evas_wl_event_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Mouse_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
- evas_event_feed_mouse_in(ee->evas, ev->time, NULL);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
+ evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
+ _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
-_ecore_evas_wl_event_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Mouse_Out *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
- _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->time);
- evas_event_feed_mouse_out(ee->evas, ev->time, NULL);
+ _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
+ evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
return ECORE_CALLBACK_PASS_ON;
}
static Eina_Bool
-_ecore_evas_wl_event_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
Ecore_Wl_Event_Focus_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
ee->prop.focused = 1;
evas_focus_in(ee->evas);
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
}
static Eina_Bool
-_ecore_evas_wl_event_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
+_ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
- Ecore_Wl_Event_Focus_Out *ev;
+ Ecore_Wl_Event_Focus_In *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
ev = event;
- ee = ecore_event_window_match(ev->window);
+ ee = ecore_event_window_match(ev->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
- if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
evas_focus_out(ee->evas);
ee->prop.focused = 0;
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
return ECORE_CALLBACK_PASS_ON;
}
-static void
-_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)
+static Eina_Bool
+_ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
-
- /* NB: Trap to prevent compositor from crashing */
- if ((width <= 0) || (height <= 0)) return;
-
- if (!(ee = data)) return;
-
- if ((shell_surface) && (ee->engine.wl.shell_surface))
- {
- if (ee->engine.wl.shell_surface != shell_surface) return;
- ecore_evas_resize(ee, width, height);
- }
-}
-
-static void
-_ecore_evas_wl_handle_popup_done(void *data __UNUSED__, struct wl_shell_surface *shell_surface __UNUSED__)
-{
-
-}
-
-static void
-_ecore_evas_wl_buffer_new(Ecore_Evas *ee, void **dest)
-{
- static unsigned int format;
- char tmp[PATH_MAX];
- int fd = -1, stride = 0, size = 0;
- void *ret;
+ Ecore_Wl_Event_Window_Configure *ev;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (dest) *dest = NULL;
-
- if (!format) format = ecore_wl_format_get();
-
- strcpy(tmp, "/tmp/ecore-wayland_shm-XXXXXX");
- if ((fd = mkstemp(tmp)) < 0)
- {
- ERR("Could not create temporary file.");
- return;
- }
-
- stride = (ee->w * sizeof(int));
- size = (stride * ee->h);
- if (ftruncate(fd, size) < 0)
+ ev = event;
+ ee = ecore_event_window_match(ev->win);
+ if (!ee) return ECORE_CALLBACK_PASS_ON;
+ if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
+ if ((ee->x != ev->x) || (ee->y != ev->y))
{
- ERR("Could not truncate temporary file.");
- close(fd);
- return;
+ ee->x = ev->x;
+ ee->y = ev->y;
+ ee->req.x = ee->x;
+ ee->req.y = ee->y;
+ if (ee->func.fn_move) ee->func.fn_move(ee);
}
-
- ret = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
- unlink(tmp);
-
- if (ret == MAP_FAILED)
+ if ((ee->req.w != ev->w) || (ee->req.h != ev->h))
{
- ERR("mmap of temporary file failed.");
- close(fd);
- return;
+ /* ee->w = ev->w; */
+ /* ee->h = ev->h; */
+ ee->req.w = ev->w;
+ ee->req.h = ev->h;
+ if (ee->func.fn_resize) ee->func.fn_resize(ee);
}
- if (dest) *dest = ret;
-
- ee->engine.wl.buffer =
- wl_shm_create_buffer(ecore_wl_shm_get(), fd, ee->w, ee->h, stride, format);
-
- close(fd);
+ return ECORE_CALLBACK_PASS_ON;
}
static void
return evas_object_smart_add(evas, _ecore_evas_wl_smart);
}
-void
-_ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->engine.wl.shell_surface)) return;
- wl_shell_surface_resize(ee->engine.wl.shell_surface,
- ecore_wl_input_device_get(),
- _ecore_evas_wl_btn_timestamp, location);
-}
-
-void
-_ecore_evas_wayland_shm_drag_start(Ecore_Evas *ee, Ecore_Evas *drag_ee, void *source)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if ((!ee) || (!ee->engine.wl.surface)) return;
- if ((!source) || (!drag_ee)) return;
- ecore_wl_drag_start(source, ee->engine.wl.surface, drag_ee->engine.wl.buffer);
-}
-
#else
EAPI Ecore_Evas *
-ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int frame __UNUSED__)
+ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__)
{
return NULL;
}
static void
_ecore_evas_win32_callback_delete_request_set(Ecore_Evas *ee,
- void (*func) (Ecore_Evas *ee))
+ Ecore_Evas_Event_Cb func)
{
ee->func.fn_delete_request = func;
}
{
INF("ecore evas activate");
- ecore_win32_window_focus_set((struct _Ecore_Win32_Window *)ee->prop.window);
+ ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window);
}
static void
static void
_ecore_evas_win32_focus_set(Ecore_Evas *ee, int on __UNUSED__)
{
- ecore_win32_window_focus_set((struct _Ecore_Win32_Window *)ee->prop.window);
+ ecore_win32_window_focus((struct _Ecore_Win32_Window *)ee->prop.window);
}
static void
if (on != 0)
{
- ecore_win32_window_shape_set((struct _Ecore_Win32_Window *)ee->prop.window,
- 0, 0, NULL);
ecore_win32_window_fullscreen_set((struct _Ecore_Win32_Window *)ee->prop.window,
on);
}
else
{
ecore_win32_window_fullscreen_set(window, on);
- ecore_win32_window_shape_set(window,
- window->shape.width,
- window->shape.height,
- window->shape.mask);
}
/* Nothing to be done for the GDI backend at the evas level */
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL //screen_geometry_get
};
static void
_ecore_evas_wince_callback_delete_request_set(Ecore_Evas *ee,
- void (*func) (Ecore_Evas *ee))
+ Ecore_Evas_Event_Cb func)
{
ee->func.fn_delete_request = func;
}
#endif
}
-/* static void */
-/* _ecore_evas_wince_focus_set(Ecore_Evas *ee, int on __UNUSED__) */
-/* { */
-/* ecore_wince_window_focus_set(ee->prop.window); */
-/* } */
+static void
+_ecore_evas_wince_focus_set(Ecore_Evas *ee, int on __UNUSED__)
+{
+ ecore_wince_window_focus(ee->prop.window);
+}
/* static void */
/* _ecore_evas_wince_iconified_set(Ecore_Evas *ee, int on) */
NULL, //_ecore_evas_wince_size_step_set,
_ecore_evas_wince_cursor_set,
NULL, /* _ecore_evas_x_layer_set */
- NULL, //_ecore_evas_wince_focus_set,
+ _ecore_evas_wince_focus_set,
NULL, //_ecore_evas_wince_iconified_set,
NULL, //_ecore_evas_wince_borderless_set,
NULL, /* _ecore_evas_x_override_set */
NULL, /* _ecore_evas_x_alpha_set */
NULL, //transparent
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+
NULL, // render
NULL // screen_geometry_get
};
static Ecore_X_Window leader_win = 0;
static void
+_ecore_evas_x_hints_update(Ecore_Evas *ee)
+{
+ ecore_x_icccm_hints_set
+ (ee->prop.window,
+ !ee->prop.focus_skip /* accepts_focus */,
+ ee->prop.iconified ? ECORE_X_WINDOW_STATE_HINT_ICONIC :
+ ee->prop.withdrawn ? ECORE_X_WINDOW_STATE_HINT_WITHDRAWN :
+ ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
+ 0 /* icon_pixmap */,
+ 0 /* icon_mask */,
+ 0 /* icon_window */,
+ ee->prop.group_ee_win /* window_group */,
+ ee->prop.urgent /* is_urgent */);
+}
+
+static void
_ecore_evas_x_group_leader_set(Ecore_Evas *ee)
{
leader_ref++;
{
Ecore_Evas *ee;
Ecore_X_Event_Window_Property *e;
+ int state_change = 0;
e = event;
ee = ecore_event_window_match(e->win);
{
unsigned int i, num;
Ecore_X_Window_State *state;
- int sticky = 0;
-
- /* TODO: we need to move those to the end, with if statements */
- ee->engine.x.state.modal = 0;
- ee->engine.x.state.maximized_v = 0;
- ee->engine.x.state.maximized_h = 0;
- ee->engine.x.state.shaded = 0;
+ struct {
+ struct {
+ unsigned char modal : 1;
+ unsigned char sticky : 1;
+ unsigned char maximized_v : 1;
+ unsigned char maximized_h : 1;
+ unsigned char shaded : 1;
+ unsigned char skip_taskbar : 1;
+ unsigned char skip_pager : 1;
+ unsigned char fullscreen : 1;
+ unsigned char above : 1;
+ unsigned char below : 1;
+ } x;
+ struct {
+ char modal : 1;
+ char maximized : 1;
+ char sticky : 1;
+ char fullscreen : 1;
+ char focus_skip : 1;
+ } prop;
+ } prev;
+
+ prev.x.modal = ee->engine.x.state.modal;
+ prev.x.sticky = ee->engine.x.state.sticky;
+ prev.x.maximized_v = ee->engine.x.state.maximized_v;
+ prev.x.maximized_h = ee->engine.x.state.maximized_h;
+ prev.x.shaded = ee->engine.x.state.shaded;
+ prev.x.skip_taskbar = ee->engine.x.state.skip_taskbar;
+ prev.x.skip_pager = ee->engine.x.state.skip_pager;
+ prev.x.fullscreen = ee->engine.x.state.fullscreen;
+ prev.x.above = ee->engine.x.state.above;
+ prev.x.below = ee->engine.x.state.below;
+
+ prev.prop.modal = ee->prop.modal;
+ prev.prop.maximized = ee->prop.maximized;
+ prev.prop.sticky = ee->prop.sticky;
+ prev.prop.fullscreen = ee->prop.fullscreen;
+ prev.prop.focus_skip = ee->prop.focus_skip;
+
+ ee->engine.x.state.modal = 0;
+ ee->engine.x.state.sticky = 0;
+ ee->engine.x.state.maximized_v = 0;
+ ee->engine.x.state.maximized_h = 0;
+ ee->engine.x.state.shaded = 0;
ee->engine.x.state.skip_taskbar = 0;
- ee->engine.x.state.skip_pager = 0;
+ ee->engine.x.state.skip_pager = 0;
+ ee->engine.x.state.fullscreen = 0;
+ ee->engine.x.state.above = 0;
+ ee->engine.x.state.below = 0;
+
+ ee->prop.modal = 0;
+ ee->prop.maximized = 0;
+ ee->prop.sticky = 0;
ee->prop.fullscreen = 0;
- ee->engine.x.state.fullscreen = 0;
- ee->engine.x.state.above = 0;
- ee->engine.x.state.below = 0;
-
+ ee->prop.focus_skip = 0;
+
ecore_x_netwm_window_state_get(e->win, &state, &num);
if (state)
{
switch (state[i])
{
case ECORE_X_WINDOW_STATE_MODAL:
- ee->engine.x.state.modal = 1;
- break;
+ ee->engine.x.state.modal = 1;
+ ee->prop.modal = 1;
+ break;
case ECORE_X_WINDOW_STATE_STICKY:
- if (ee->prop.sticky && ee->engine.x.state.sticky)
- break;
-
- sticky = 1;
- ee->prop.sticky = 1;
- ee->engine.x.state.sticky = 1;
- if (ee->func.fn_sticky) ee->func.fn_sticky(ee);
- break;
+ ee->prop.sticky = 1;
+ ee->engine.x.state.sticky = 1;
+ break;
case ECORE_X_WINDOW_STATE_MAXIMIZED_VERT:
- ee->engine.x.state.maximized_v = 1;
- break;
+ ee->engine.x.state.maximized_v = 1;
+ ee->prop.maximized = 1;
+ break;
case ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ:
- ee->engine.x.state.maximized_h = 1;
- break;
+ ee->engine.x.state.maximized_h = 1;
+ ee->prop.maximized = 1;
+ break;
case ECORE_X_WINDOW_STATE_SHADED:
- ee->engine.x.state.shaded = 1;
- break;
+ ee->engine.x.state.shaded = 1;
+ break;
case ECORE_X_WINDOW_STATE_SKIP_TASKBAR:
- ee->engine.x.state.skip_taskbar = 1;
- break;
+ ee->engine.x.state.skip_taskbar = 1;
+ ee->prop.focus_skip = 1;
+ break;
case ECORE_X_WINDOW_STATE_SKIP_PAGER:
- ee->engine.x.state.skip_pager = 1;
- break;
+ ee->engine.x.state.skip_pager = 1;
+ ee->prop.focus_skip = 1;
+ break;
case ECORE_X_WINDOW_STATE_FULLSCREEN:
- ee->prop.fullscreen = 1;
- ee->engine.x.state.fullscreen = 1;
- break;
+ ee->prop.fullscreen = 1;
+ ee->engine.x.state.fullscreen = 1;
+ break;
case ECORE_X_WINDOW_STATE_ABOVE:
- ee->engine.x.state.above = 1;
- break;
+ ee->engine.x.state.above = 1;
+ break;
case ECORE_X_WINDOW_STATE_BELOW:
- ee->engine.x.state.below = 1;
- break;
+ ee->engine.x.state.below = 1;
+ break;
default:
break;
}
}
free(state);
}
-
- if ((ee->prop.sticky) && (!sticky))
+ if (
+// (prev.x.modal != ee->engine.x.state.modal) ||
+ (prev.x.sticky != ee->engine.x.state.sticky) ||
+ (prev.x.maximized_v != ee->engine.x.state.maximized_v) ||
+ (prev.x.maximized_h != ee->engine.x.state.maximized_h) ||
+// (prev.x.shaded != ee->engine.x.state.shaded) ||
+// (prev.x.skip_taskbar != ee->engine.x.state.skip_taskbar) ||
+// (prev.x.skip_pager != ee->engine.x.state.skip_pager) ||
+ (prev.x.fullscreen != ee->engine.x.state.fullscreen) ||
+// (prev.x.above != ee->engine.x.state.above) ||
+// (prev.x.below != ee->engine.x.state.below) ||
+// (prev.prop.modal != ee->prop.modal) ||
+ (prev.prop.maximized != ee->prop.maximized) ||
+ (prev.prop.sticky != ee->prop.sticky) ||
+ (prev.prop.fullscreen != ee->prop.fullscreen) ||
+ (prev.prop.focus_skip != ee->prop.focus_skip))
+ state_change = 1;
+ }
+ else if (e->atom == ECORE_X_ATOM_WM_STATE)
+ {
+ Ecore_X_Window_State_Hint state;
+
+ // handle WM_STATE changes
+ state = ecore_x_icccm_state_get(e->win);
+ switch (state)
{
- ee->prop.sticky = 0;
- ee->engine.x.state.sticky = 0;
- if (ee->func.fn_unsticky) ee->func.fn_unsticky(ee);
+ case ECORE_X_WINDOW_STATE_HINT_WITHDRAWN:
+ if ((!ee->prop.withdrawn) || (ee->prop.iconified))
+ {
+ state_change = 1;
+ ee->prop.withdrawn = 1;
+ ee->prop.iconified = 0;
+ }
+ break;
+ case ECORE_X_WINDOW_STATE_HINT_ICONIC:
+ if ((!ee->prop.iconified) || (ee->prop.withdrawn))
+ {
+ state_change = 1;
+ ee->prop.iconified = 1;
+ ee->prop.withdrawn = 0;
+ }
+ break;
+ case ECORE_X_WINDOW_STATE_HINT_NORMAL:
+ if ((ee->prop.iconified) || (ee->prop.withdrawn))
+ {
+ state_change = 1;
+ ee->prop.iconified = 0;
+ ee->prop.withdrawn = 0;
+ }
+ break;
+ default:
+ break;
}
}
+ if (state_change)
+ {
+ if (ee->func.fn_state_change) ee->func.fn_state_change(ee);
+ }
return ECORE_CALLBACK_PASS_ON;
}
ee = ecore_event_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON;
+//xx// filtering with these doesnt help
+//xx// if (e->mode == ECORE_X_EVENT_MODE_UNGRAB) return ECORE_CALLBACK_PASS_ON;
ee->prop.focused = 1;
evas_focus_in(ee->evas);
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
ee = ecore_event_window_match(e->win);
if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON; /* pass on event */
if (e->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
- if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON;
+//xx// filtering with these doesnt help
+//xx// if (e->mode == ECORE_X_EVENT_MODE_GRAB) return ECORE_CALLBACK_PASS_ON;
+
// if (ee->prop.fullscreen)
// ecore_x_window_focus(ee->prop.window);
evas_focus_out(ee->evas);
ee->prop.base.h /* base_h */,
ee->prop.step.w /* step_x */,
ee->prop.step.h /* step_y */,
- 0 /* min_aspect */,
- 0 /* max_aspect */);
+ ee->prop.aspect /* min_aspect */,
+ ee->prop.aspect /* max_aspect */);
}
/* FIXME, should be in idler */
Ecore_X_Window_State state[10];
int num = 0;
- /*
- if (bd->client.netwm.state.modal)
+ if (ee->prop.modal)
state[num++] = ECORE_X_WINDOW_STATE_MODAL;
- */
- if (ee->engine.x.state.sticky)
+ if (ee->prop.sticky)
state[num++] = ECORE_X_WINDOW_STATE_STICKY;
- /*
- if (bd->client.netwm.state.maximized_v)
+ if (ee->prop.maximized)
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_VERT;
- if (bd->client.netwm.state.maximized_h)
+ if (ee->prop.maximized)
state[num++] = ECORE_X_WINDOW_STATE_MAXIMIZED_HORZ;
- if (bd->client.netwm.state.shaded)
- state[num++] = ECORE_X_WINDOW_STATE_SHADED;
- if (bd->client.netwm.state.skip_taskbar)
+// if (bd->client.netwm.state.shaded)
+// state[num++] = ECORE_X_WINDOW_STATE_SHADED;
+ if (ee->prop.focus_skip)
state[num++] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR;
- if (bd->client.netwm.state.skip_pager)
+ if (ee->prop.focus_skip)
state[num++] = ECORE_X_WINDOW_STATE_SKIP_PAGER;
- if (bd->client.netwm.state.hidden)
- state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
- */
+// if (bd->client.netwm.state.hidden)
+// state[num++] = ECORE_X_WINDOW_STATE_HIDDEN;
if (ee->engine.x.state.fullscreen)
state[num++] = ECORE_X_WINDOW_STATE_FULLSCREEN;
if (ee->engine.x.state.above)
state[num++] = ECORE_X_WINDOW_STATE_ABOVE;
if (ee->engine.x.state.below)
state[num++] = ECORE_X_WINDOW_STATE_BELOW;
+ if (ee->prop.demand_attention)
+ state[num++] = ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION;
ecore_x_netwm_window_state_set(ee->prop.window, state, num);
}
}
static void
-_ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, void (*func) (Ecore_Evas *ee))
+_ecore_evas_x_callback_delete_request_set(Ecore_Evas *ee, Ecore_Evas_Event_Cb func)
{
ee->func.fn_delete_request = func;
_ecore_evas_x_protocols_set(ee);
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_update(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
#endif
}
}
+
+static void
+_ecore_evas_x_window_group_set(Ecore_Evas *ee, const Ecore_Evas *group_ee)
+{
+ if (ee->prop.group_ee == group_ee) return;
+
+ ee->prop.group_ee = (Ecore_Evas *)group_ee;
+ if (ee->prop.group_ee)
+ ee->prop.group_ee_win = group_ee->prop.window;
+ else
+ ee->prop.group_ee_win = 0;
+ _ecore_evas_x_hints_update(ee);
+}
+
+static void
+_ecore_evas_x_aspect_set(Ecore_Evas *ee, double aspect)
+{
+ if (ee->prop.aspect == aspect) return;
+
+ ee->prop.aspect = aspect;
+ _ecore_evas_x_size_pos_hints_update(ee);
+// netwm state
+// if (ee->should_be_visible)
+// ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
+// ECORE_X_WINDOW_STATE_STICKY, -1, sticky);
+// else
+// _ecore_evas_x_state_update(ee);
+}
+
+static void
+_ecore_evas_x_urgent_set(Ecore_Evas *ee, int urgent)
+{
+ if (ee->prop.urgent == urgent) return;
+
+ ee->prop.urgent = urgent;
+ _ecore_evas_x_hints_update(ee);
+}
+
+static void
+_ecore_evas_x_modal_set(Ecore_Evas *ee, int modal)
+{
+ if (ee->prop.modal == modal) return;
+
+ ee->prop.modal = modal;
+ if (ee->should_be_visible)
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
+ ECORE_X_WINDOW_STATE_MODAL, -1, modal);
+ else
+ _ecore_evas_x_state_update(ee);
+}
+
+static void
+_ecore_evas_x_demand_attention_set(Ecore_Evas *ee, int demand)
+{
+ if (ee->prop.demand_attention == demand) return;
+
+ ee->prop.demand_attention = demand;
+ if (ee->should_be_visible)
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
+ ECORE_X_WINDOW_STATE_DEMANDS_ATTENTION, -1, demand);
+ else
+ _ecore_evas_x_state_update(ee);
+}
+
+static void
+_ecore_evas_x_focus_skip_set(Ecore_Evas *ee, int skip)
+{
+ if (ee->prop.focus_skip == skip) return;
+
+ ee->prop.focus_skip = skip;
+ if (ee->should_be_visible)
+ {
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
+ ECORE_X_WINDOW_STATE_SKIP_TASKBAR, -1, skip);
+ ecore_x_netwm_state_request_send(ee->prop.window, ee->engine.x.win_root,
+ ECORE_X_WINDOW_STATE_SKIP_PAGER, -1, skip);
+ }
+ else
+ _ecore_evas_x_state_update(ee);
+ _ecore_evas_x_hints_update(ee);
+}
+
#endif /* BUILD_ECORE_EVAS_X11 */
#ifdef BUILD_ECORE_EVAS_X11
{
if (ee->prop.iconified == on) return;
ee->prop.iconified = on;
+ _ecore_evas_x_hints_update(ee);
if (on)
- {
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_ICONIC /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
- ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root);
- }
+ ecore_x_icccm_iconic_request_send(ee->prop.window, ee->engine.x.win_root);
else
- {
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
- ecore_evas_show(ee);
- }
+ ecore_evas_show(ee);
}
static void
static void
_ecore_evas_x_withdrawn_set(Ecore_Evas *ee, int withdrawn)
{
- Ecore_X_Window_State_Hint hint;
-
if (ee->prop.withdrawn == withdrawn) return;
-
ee->prop.withdrawn = withdrawn;
- if (withdrawn)
- hint = ECORE_X_WINDOW_STATE_HINT_WITHDRAWN;
- else
- hint = ECORE_X_WINDOW_STATE_HINT_NORMAL;
-
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- hint /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
}
static void
_ecore_evas_x_ignore_events_set,
_ecore_evas_x_alpha_set,
_ecore_evas_x_transparent_set,
+
+ _ecore_evas_x_window_group_set,
+ _ecore_evas_x_aspect_set,
+ _ecore_evas_x_urgent_set,
+ _ecore_evas_x_modal_set,
+ _ecore_evas_x_demand_attention_set,
+ _ecore_evas_x_focus_skip_set,
NULL, // render
_ecore_evas_x_screen_geometry_get
}
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
// putenv((char*)"DESKTOP_STARTUP_ID=");
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
return NULL;
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
return NULL;
}
- ecore_x_icccm_hints_set(ee->prop.window,
- 1 /* accepts_focus */,
- ECORE_X_WINDOW_STATE_HINT_NORMAL /* initial_state */,
- 0 /* icon_pixmap */,
- 0 /* icon_mask */,
- 0 /* icon_window */,
- 0 /* window_group */,
- 0 /* is_urgent */);
+ _ecore_evas_x_hints_update(ee);
_ecore_evas_x_group_leader_set(ee);
ecore_x_window_defaults_set(ee->prop.window);
_ecore_evas_x_protocols_set(ee);
fb = open("/dev/fb0", O_RDWR);
if (fb < 0)
- {
- if (w) *w = 0;
- if (h) *h = 0;
- return;
- }
+ goto exit;
+
if (ioctl(fb, FBIOGET_VSCREENINFO, &fb_var) == -1)
- {
- if (w) *w = 0;
- if (h) *h = 0;
- close(fb);
- return;
- }
+ goto err_ioctl;
+
+ *w = fb_var.xres;
+ *h = fb_var.yres;
+
+err_ioctl:
close(fb);
- if (w) *w = fb_var.xres;
- if (h) *h = fb_var.yres;
+exit:
+ return;
}
/**
free(e);
goto retry;
}
+ e->window = 1;
+ e->event_window = e->window;
+ e->root_window = e->window;
+ e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_FB_EVENT_KEY_DOWN, e, _ecore_fb_event_free_key_down, NULL);
if (!strcmp(e->keyname, "Control_L"))
_ecore_fb_ctrl++;
free(e);
goto retry;
}
+ e->window = 1;
+ e->event_window = e->window;
+ e->root_window = e->window;
+ e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_FB_EVENT_KEY_UP, e, _ecore_fb_event_free_key_up, NULL);
if (!strcmp(e->keyname, "Control_L"))
_ecore_fb_ctrl--;
if (dev->keyboard.alt) e->modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
if (dev->keyboard.lock) e->modifiers |= ECORE_EVENT_LOCK_CAPS;
- e->timestamp = ecore_time_get();
+ e->timestamp = ecore_loop_time_get() * 1000.0;
e->window = (Ecore_Window)dev->window;
e->event_window = (Ecore_Window)dev->window;
e->root_window = (Ecore_Window)dev->window;
{
int button;
Ecore_Event_Mouse_Button *e;
- double current = ecore_time_get();
+ double current = ecore_loop_time_get();
button = ((iev->code & 0x00F) + 1);
if (iev->value)
if (!e)
return;
- e->timestamp = current;
+ e->timestamp = current * 1000.0;
e->window = (Ecore_Window)dev->window;
e->event_window = (Ecore_Window)dev->window;
e->root_window = (Ecore_Window)dev->window;
e->root.x = e->x;
e->root.y = e->y;
- e->timestamp = ecore_time_get();
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
if (dev->keyboard.alt) e->modifiers |= ECORE_EVENT_MODIFIER_SHIFT;
if (dev->keyboard.lock) e->modifiers |= ECORE_EVENT_LOCK_CAPS;
- e->timestamp = ecore_time_get();
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, e, NULL, NULL);
ev->y = dev->mouse.y;
ev->root.x = ev->x;
ev->root.y = ev->y;
- ev->timestamp = ecore_time_get();
+ ev->timestamp = ecore_loop_time_get() * 1000.0;
}
else if (dev->mouse.event == ECORE_EVENT_MOUSE_BUTTON_DOWN)
{
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->buttons = 1;
- ev->timestamp = ecore_time_get();
+ ev->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
}
else if (dev->mouse.event == ECORE_EVENT_MOUSE_BUTTON_UP)
ev->root.x = ev->x;
ev->root.y = ev->y;
ev->buttons = 1;
- ev->timestamp = ecore_time_get();
+ ev->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
}
}
if (v < 0) return EINA_TRUE;
_ecore_fb_ps2_event_byte_count += v;
if (v < num) return EINA_TRUE;
- t = ecore_time_get();
+ t = ecore_loop_time_get();
_ecore_fb_ps2_event_byte_count = 0;
if (_ecore_fb_ps2_event.button & 0x10)
x = prev_x + (0xffffff00 | _ecore_fb_ps2_event.x);
if (1)
{
/* MOVE: mouse is down and was */
- Ecore_Fb_Event_Mouse_Move *e;
+ Ecore_Event_Mouse_Move *e;
e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move));
if (!e) goto retry;
e->x = x;
e->y = y;
- ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL);
+ e->root.x = e->x;
+ e->root.y = e->y;
+ e->window = 1;
+ e->event_window = e->window;
+ e->root_window = e->window;
+ e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
+ ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
}
for (i = 1; i <= 3; i++)
{
if (((button & mask)) && (!(prev_button & mask)))
{
/* DOWN: mouse is down, but was not now */
- Ecore_Fb_Event_Mouse_Button_Down *e;
+ Ecore_Event_Mouse_Button *e;
- e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down));
+ e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
if (!e) goto retry;
e->x = x;
e->y = y;
+ e->root.x = e->x;
+ e->root.y = e->y;
e->button = i;
+ e->window = 1;
+ e->event_window = e->window;
+ e->root_window = e->window;
+ e->same_screen = 1;
if ((t - last_time) <= _ecore_fb_double_click_time)
{
e->double_click = 1;
{
did_triple = 0;
}
- ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
+ e->timestamp = ecore_loop_time_get() * 1000.0;
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
}
else if ((!(button & mask)) && ((prev_button & mask)))
{
/* UP: mouse was down, but is not now */
- Ecore_Fb_Event_Mouse_Button_Up *e;
+ Ecore_Event_Mouse_Button *e;
- e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up));
+ e = calloc(1, sizeof(Ecore_Event_Mouse_Button));
if (!e) goto retry;
e->x = x;
e->y = y;
+ e->root.x = e->x;
+ e->root.y = e->y;
e->button = i;
+ e->window = 1;
+ e->event_window = e->window;
+ e->root_window = e->window;
+ e->same_screen = 1;
if (did_double)
e->double_click = 1;
if (did_triple)
e->triple_click = 1;
- ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
+ e->timestamp = ecore_loop_time_get() * 1000.0;
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
}
}
if (did_triple)
y = _ecore_fb_tslib_event.y;
pressure = _ecore_fb_tslib_event.pressure;
v = 1; /* loop, there might be more samples */
- t = ecore_time_get();
#else
ptr = (char *)&(_ecore_fb_ts_event);
ptr += _ecore_fb_ts_event_byte_count;
}
pressure = _ecore_fb_ts_event.pressure;
#endif
+ t = ecore_loop_time_get();
/* add event to queue */
/* always add a move event */
if ((pressure) || (prev_pressure))
if (!e) goto retry;
e->x = x;
e->y = y;
- e->root.x = x;
- e->root.y = y;
- e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+ e->root.x = e->x;
+ e->root.y = e->y;
+ e->window = 1;
e->event_window = e->window;
e->root_window = e->window;
e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_MOVE, e, NULL, NULL);
}
if ((pressure) && (!prev_pressure))
if (!e) goto retry;
e->x = x;
e->y = y;
+ e->root.x = e->x;
+ e->root.y = e->y;
e->buttons = 1;
if ((t - last_time) <= _ecore_fb_double_click_time)
{
{
did_triple = 0;
}
- e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+ e->window = 1;
e->event_window = e->window;
e->root_window = e->window;
e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
}
else if ((!pressure) && (prev_pressure))
if (!e) goto retry;
e->x = prev_x;
e->y = prev_y;
+ e->root.x = e->x;
+ e->root.y = e->y;
e->buttons = 1;
if (did_double)
e->double_click = 1;
if (did_triple)
e->triple_click = 1;
- e->window = (Ecore_Window)_ecore_fb_ts_event_window;
+ e->window = 1;
e->event_window = e->window;
e->root_window = e->window;
e->same_screen = 1;
+ e->timestamp = ecore_loop_time_get() * 1000.0;
ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
}
if (did_triple)
Eina_List *list = NULL;
ls = eina_file_direct_ls(dir);
+ if (!ls) return NULL;
+
EINA_ITERATOR_FOREACH(ls, info)
{
char *f;
* @brief Return the executable from the given command.
*
* @param app The application command, with parameters.
- *
- * This function returns the executable from @p app as a newly
- * allocated string. Arguments are removed and escae characters are
- * handled. If @p app is @c NULL, or on failure, the function returns
- * @c NULL. When not needed anymore, the returned value must be freed.
+ * @return The executable from @p app as a newly allocated string. Arguments
+ * are removed and escape characters are handled. If @p app is @c NULL, or
+ * on failure, the function returns @c NULL. When not needed anymore, the
+ * returned value must be freed.
*/
EAPI char *
ecore_file_app_exe_get(const char *app)
static Ecore_Event_Handler *_url_progress_download = NULL;
static Eina_List *_job_list;
+static int download_init = 0;
+
#endif /* BUILD_ECORE_CON */
int
ecore_file_download_init(void)
{
#ifdef BUILD_ECORE_CON
- if (!ecore_con_url_init())
- return 0;
-
+ download_init++;
+ if (download_init > 1) return 1;
+ if (!ecore_con_init()) return 0;
+ if (!ecore_con_url_init())
+ {
+ ecore_con_shutdown();
+ return 0;
+ }
# ifdef HAVE_CURL
- _url_complete_handler = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _ecore_file_download_url_complete_cb, NULL);
- _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL);
+ _url_complete_handler = ecore_event_handler_add(ECORE_CON_EVENT_URL_COMPLETE, _ecore_file_download_url_complete_cb, NULL);
+ _url_progress_download = ecore_event_handler_add(ECORE_CON_EVENT_URL_PROGRESS, _ecore_file_download_url_progress_cb, NULL);
# endif
-
#endif /* BUILD_ECORE_CON */
-
return 1;
}
ecore_file_download_shutdown(void)
{
#ifdef BUILD_ECORE_CON
- if (_url_complete_handler)
- ecore_event_handler_del(_url_complete_handler);
- if (_url_progress_download)
- ecore_event_handler_del(_url_progress_download);
- _url_complete_handler = NULL;
- _url_progress_download = NULL;
- ecore_file_download_abort_all();
-
- ecore_con_url_shutdown();
+ download_init--;
+ if (download_init > 0) return;
+ if (_url_complete_handler)
+ ecore_event_handler_del(_url_complete_handler);
+ if (_url_progress_download)
+ ecore_event_handler_del(_url_progress_download);
+ _url_complete_handler = NULL;
+ _url_progress_download = NULL;
+ ecore_file_download_abort_all();
+ ecore_con_url_shutdown();
+ ecore_con_shutdown();
#endif /* BUILD_ECORE_CON */
}
}
if (headers) eina_hash_foreach(headers, _ecore_file_download_headers_foreach_cb, job);
- ecore_con_url_timeout_set(job->url_con, ECORE_FILE_DOWNLOAD_TIMEOUT);
ecore_con_url_fd_set(job->url_con, fileno(job->file));
ecore_con_url_data_set(job->url_con, data);
#define _ECORE_IMF_H
#include <Eina.h>
-#include <Ecore_IMF_Input_Panel_Key.h>
#ifdef EAPI
# undef EAPI
extern "C" {
#endif
+/**
+ * @addtogroup Ecore_IMF_Context_Group
+ *
+ * @{
+ */
/* ecore_imf_context_input_panel_event_callback_add() flag */
typedef enum
{
- ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< Input Panel STATE Event */
- ECORE_IMF_INPUT_PANEL_MODE_EVENT, /**< Input Panel MODE Event */
- ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< Input Panel LANGUAGE Event */
- ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< Input Panel SHIFT MODE */
- ECORE_IMF_INPUT_PANEL_PREEDIT_MODE_EVENT, /**< Input Panel PREEDIT MODE */
- ECORE_IMF_INPUT_PANEL_COMPLETION_MODE_EVENT, /**< Input Panel COMPLETION MODE */
- ECORE_IMF_INPUT_PANEL_CUSTOM_INPUT_MODE_EVENT /**< Input Panel CUSTOM INPUT MODE */
+ ECORE_IMF_INPUT_PANEL_STATE_EVENT, /**< called when the state of the input panel is changed. */
+ ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< called when the language of the input panel is changed. */
+ ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< called when the shift key state of the input panel is changed */
+ ECORE_IMF_INPUT_PANEL_GEOMETRY_EVENT, /**< called when the size of the input panel is changed. */
+ ECORE_IMF_CANDIDATE_PANEL_STATE_EVENT, /**< called when the state of the candidate word panel is changed. */
+ ECORE_IMF_CANDIDATE_PANEL_GEOMETRY_EVENT /**< called when the size of the candidate word panel is changed. */
} Ecore_IMF_Input_Panel_Event;
typedef enum
{
- ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Show Input panel */
- ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Hide Input panel */
- ECORE_IMF_INPUT_PANEL_STATE_INVALID
+ ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel */
+ ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel */
+ ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW /**< Notification prior to the display of the input panel */
} Ecore_IMF_Input_Panel_State;
-typedef struct
+typedef enum
{
- int layout_idx;
- int key_idx;
- Eina_Bool disabled;
-} Disable_Key_Item;
+ ECORE_IMF_INPUT_PANEL_SHIFT_MODE_OFF,
+ ECORE_IMF_INPUT_PANEL_SHIFT_MODE_ON
+} Ecore_IMF_Input_Panel_Shift_Mode;
-typedef struct
+typedef enum
{
- int layout_idx;
- int key_idx;
- int type;
- char data[128]; // label or image path
- int key_value;
- char key_string[32];
-} Private_Key_Item;
+ ECORE_IMF_CANDIDATE_PANEL_SHOW, /**< Notification after the display of the candidate word panel */
+ ECORE_IMF_CANDIDATE_PANEL_HIDE /**< Notification prior to the dismissal of the candidate word panel */
+} Ecore_IMF_Candidate_Panel_State;
/* Events sent by the Input Method */
typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
typedef void (*Ecore_IMF_Event_Cb) (void *data, Ecore_IMF_Context *ctx, void *event_info);
+/**
+ * @enum _Ecore_IMF_Callback_Type
+ * @typedef Ecore_IMF_Callback_Type
+ *
+ * Ecore IMF Event callback types.
+ *
+ * @see ecore_imf_context_event_callback_add()
+ */
typedef enum
{
- ECORE_IMF_CALLBACK_PREEDIT_START,
- ECORE_IMF_CALLBACK_PREEDIT_END,
- ECORE_IMF_CALLBACK_PREEDIT_CHANGED,
- ECORE_IMF_CALLBACK_COMMIT,
- ECORE_IMF_CALLBACK_DELETE_SURROUNDING
+ ECORE_IMF_CALLBACK_PREEDIT_START, /**< "PREEDIT_START" is called when a new preediting sequence starts. */
+ ECORE_IMF_CALLBACK_PREEDIT_END, /**< "PREEDIT_END" is called when a preediting sequence has been completed or canceled. */
+ ECORE_IMF_CALLBACK_PREEDIT_CHANGED, /**< "PREEDIT_CHANGED" is called whenever the preedit sequence currently being entered has changed. */
+ ECORE_IMF_CALLBACK_COMMIT, /**< "COMMIT" is called when a complete input sequence has been entered by the user */
+ ECORE_IMF_CALLBACK_DELETE_SURROUNDING /**< "DELETE_SURROUNDING" is called when the input method needs to delete all or part of the context surrounding the cursor */
} Ecore_IMF_Callback_Type;
+/**
+ * @enum _Ecore_IMF_Event_Type
+ * @typedef Ecore_IMF_Event_Type
+ *
+ * Ecore IMF event types.
+ *
+ * @see ecore_imf_context_filter_event()
+ */
typedef enum
{
- ECORE_IMF_EVENT_MOUSE_DOWN,
- ECORE_IMF_EVENT_MOUSE_UP,
- ECORE_IMF_EVENT_MOUSE_IN,
- ECORE_IMF_EVENT_MOUSE_OUT,
- ECORE_IMF_EVENT_MOUSE_MOVE,
- ECORE_IMF_EVENT_MOUSE_WHEEL,
- ECORE_IMF_EVENT_KEY_DOWN,
- ECORE_IMF_EVENT_KEY_UP
+ ECORE_IMF_EVENT_MOUSE_DOWN, /**< Mouse Down event */
+ ECORE_IMF_EVENT_MOUSE_UP, /**< Mouse Up event */
+ ECORE_IMF_EVENT_MOUSE_IN, /**< Mouse In event */
+ ECORE_IMF_EVENT_MOUSE_OUT, /**< Mouse Out event */
+ ECORE_IMF_EVENT_MOUSE_MOVE, /**< Mouse Move event */
+ ECORE_IMF_EVENT_MOUSE_WHEEL, /**< Mouse Wheel event */
+ ECORE_IMF_EVENT_KEY_DOWN, /**< Key Down event */
+ ECORE_IMF_EVENT_KEY_UP /**< Key Up event */
} Ecore_IMF_Event_Type;
typedef enum
ECORE_IMF_INPUT_MODE_AUTOCAP = 1 << 30
} Ecore_IMF_Input_Mode;
+/**
+ * @enum _Ecore_IMF_Preedit_Type
+ * @typedef Ecore_IMF_Preedit_Type
+ *
+ * Ecore IMF Preedit style types
+ *
+ * @see ecore_imf_context_preedit_string_with_attributes_get()
+ */
typedef enum
{
- ECORE_IMF_PREEDIT_TYPE_NONE,
- ECORE_IMF_PREEDIT_TYPE_SUB1,
- ECORE_IMF_PREEDIT_TYPE_SUB2,
- ECORE_IMF_PREEDIT_TYPE_SUB3
+ ECORE_IMF_PREEDIT_TYPE_NONE, /**< None style */
+ ECORE_IMF_PREEDIT_TYPE_SUB1, /**< Substring style 1 */
+ ECORE_IMF_PREEDIT_TYPE_SUB2, /**< Substring style 2 */
+ ECORE_IMF_PREEDIT_TYPE_SUB3 /**< Substring style 3 */
} Ecore_IMF_Preedit_Type;
+/**
+ * @enum _Ecore_IMF_Autocapital_Type
+ * @typedef Ecore_IMF_Autocapital_Type
+ *
+ * Autocapitalization Types.
+ *
+ * @see ecore_imf_context_autocapital_type_set()
+ */
typedef enum
{
- ECORE_IMF_AUTOCAPITAL_TYPE_NONE,
- ECORE_IMF_AUTOCAPITAL_TYPE_WORD,
- ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE,
- ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER
+ ECORE_IMF_AUTOCAPITAL_TYPE_NONE, /**< No auto-capitalization when typing */
+ ECORE_IMF_AUTOCAPITAL_TYPE_WORD, /**< Autocapitalize each word typed */
+ ECORE_IMF_AUTOCAPITAL_TYPE_SENTENCE, /**< Autocapitalize the start of each sentence */
+ ECORE_IMF_AUTOCAPITAL_TYPE_ALLCHARACTER, /**< Autocapitalize all letters */
} Ecore_IMF_Autocapital_Type;
+/**
+ * @enum _Ecore_IMF_Input_Panel_Layout
+ * @typedef Ecore_IMF_Input_Panel_Layout
+ *
+ * Input panel (virtual keyboard) layout types.
+ *
+ * @see ecore_imf_context_input_panel_layout_set()
+ */
typedef enum
{
ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
ECORE_IMF_INPUT_PANEL_LAYOUT_PASSWORD /**< Like normal, but no auto-correct, no auto-capitalization etc. @since 1.2 */
} Ecore_IMF_Input_Panel_Layout;
+/**
+ * @enum _Ecore_IMF_Input_Panel_Lang
+ * @typedef Ecore_IMF_Input_Panel_Lang
+ *
+ * Input panel (virtual keyboard) language modes.
+ *
+ * @see ecore_imf_context_input_panel_language_set()
+ */
typedef enum
{
- ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */
- ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */
+ ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet @since 1.2 */
} Ecore_IMF_Input_Panel_Lang;
+/**
+ * @enum _Ecore_IMF_Input_Panel_Return_Key_Type
+ * @typedef Ecore_IMF_Input_Panel_Return_Key_Type
+ *
+ * "Return" Key types on the input panel (virtual keyboard).
+ *
+ * @see ecore_imf_context_input_panel_return_key_type_set()
+ */
+typedef enum
+{
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search or magnifier icon @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND /**< Send @since 1.2 */
+} Ecore_IMF_Input_Panel_Return_Key_Type;
+
struct _Ecore_IMF_Event_Preedit_Start
{
Ecore_IMF_Context *ctx;
struct _Ecore_IMF_Preedit_Attr
{
- Ecore_IMF_Preedit_Type preedit_type;
- unsigned int start_index;
- unsigned int end_index;
+ Ecore_IMF_Preedit_Type preedit_type; /**< preedit style type */
+ unsigned int start_index; /**< start index of the range (in bytes) */
+ unsigned int end_index; /**< end index of the range (in bytes) */
};
struct _Ecore_IMF_Context_Class
void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
+ void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
+ void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
+ void (*input_panel_caps_lock_mode_set) (Ecore_IMF_Context *ctx, Eina_Bool mode);
void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
- void (*input_panel_private_key_set)(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, const char* value);
- void (*input_panel_key_disabled_set)(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
void (*input_panel_event_callback_add) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), void *data);
void (*input_panel_event_callback_del) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
+ void (*input_panel_language_locale_get) (Ecore_IMF_Context *ctx, char **lang);
+ void (*candidate_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
};
struct _Ecore_IMF_Context_Info
int canvas_required; /* Whether the canvas usage is required for this input method */
};
+/**
+ * @}
+ */
+
EAPI int ecore_imf_init(void);
EAPI int ecore_imf_shutdown(void);
EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
+EAPI void ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
+EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
+EAPI void ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
+EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
+EAPI void ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode);
+EAPI Eina_Bool ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data);
EAPI void ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value));
-
-EINA_DEPRECATED EAPI void ecore_imf_context_input_panel_private_key_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, int key_value, const char* key_string);
-EINA_DEPRECATED EAPI Eina_List *ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx);
-EINA_DEPRECATED EAPI void ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
-EINA_DEPRECATED EAPI Eina_List *ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx);
-EINA_DEPRECATED EAPI void ecore_imf_context_input_panel_move(Ecore_IMF_Context *ctx, int x, int y);
+EAPI void ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang);
+EAPI void ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
/* The following entry points must be exported by each input method module
*/
+++ /dev/null
-#ifndef _INPUT_PANEL_KEYDEFS_H_
-#define _INPUT_PANEL_KETDEFS_H_
-
-
-#define ECORE_IMF_INPUT_PANEL_KEY_RESERVED 0
-#define ECORE_IMF_INPUT_PANEL_KEY_ESC 1
-#define ECORE_IMF_INPUT_PANEL_KEY_1 2
-#define ECORE_IMF_INPUT_PANEL_KEY_2 3
-#define ECORE_IMF_INPUT_PANEL_KEY_3 4
-#define ECORE_IMF_INPUT_PANEL_KEY_4 5
-#define ECORE_IMF_INPUT_PANEL_KEY_5 6
-#define ECORE_IMF_INPUT_PANEL_KEY_6 7
-#define ECORE_IMF_INPUT_PANEL_KEY_7 8
-#define ECORE_IMF_INPUT_PANEL_KEY_8 9
-#define ECORE_IMF_INPUT_PANEL_KEY_9 10
-#define ECORE_IMF_INPUT_PANEL_KEY_0 11
-#define ECORE_IMF_INPUT_PANEL_KEY_MINUS 12
-#define ECORE_IMF_INPUT_PANEL_KEY_EQUAL 13
-#define ECORE_IMF_INPUT_PANEL_KEY_BACKSPACE 14
-#define ECORE_IMF_INPUT_PANEL_KEY_TAB 15
-#define ECORE_IMF_INPUT_PANEL_KEY_Q 16
-#define ECORE_IMF_INPUT_PANEL_KEY_W 17
-#define ECORE_IMF_INPUT_PANEL_KEY_E 18
-#define ECORE_IMF_INPUT_PANEL_KEY_R 19
-#define ECORE_IMF_INPUT_PANEL_KEY_T 20
-#define ECORE_IMF_INPUT_PANEL_KEY_Y 21
-#define ECORE_IMF_INPUT_PANEL_KEY_U 22
-#define ECORE_IMF_INPUT_PANEL_KEY_I 23
-#define ECORE_IMF_INPUT_PANEL_KEY_O 24
-#define ECORE_IMF_INPUT_PANEL_KEY_P 25
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFTBRACE 26
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHTBRACE 27
-#define ECORE_IMF_INPUT_PANEL_KEY_ENTER 28
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFTCTRL 29
-#define ECORE_IMF_INPUT_PANEL_KEY_A 30
-#define ECORE_IMF_INPUT_PANEL_KEY_S 31
-#define ECORE_IMF_INPUT_PANEL_KEY_D 32
-#define ECORE_IMF_INPUT_PANEL_KEY_F 33
-#define ECORE_IMF_INPUT_PANEL_KEY_G 34
-#define ECORE_IMF_INPUT_PANEL_KEY_H 35
-#define ECORE_IMF_INPUT_PANEL_KEY_J 36
-#define ECORE_IMF_INPUT_PANEL_KEY_K 37
-#define ECORE_IMF_INPUT_PANEL_KEY_L 38
-#define ECORE_IMF_INPUT_PANEL_KEY_SEMICOLON 39
-#define ECORE_IMF_INPUT_PANEL_KEY_APOSTROPHE 40
-#define ECORE_IMF_INPUT_PANEL_KEY_GRAVE 41
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFTSHIFT 42
-#define ECORE_IMF_INPUT_PANEL_KEY_BACKSLASH 43
-#define ECORE_IMF_INPUT_PANEL_KEY_Z 44
-#define ECORE_IMF_INPUT_PANEL_KEY_X 45
-#define ECORE_IMF_INPUT_PANEL_KEY_C 46
-#define ECORE_IMF_INPUT_PANEL_KEY_V 47
-#define ECORE_IMF_INPUT_PANEL_KEY_B 48
-#define ECORE_IMF_INPUT_PANEL_KEY_N 49
-#define ECORE_IMF_INPUT_PANEL_KEY_M 50
-#define ECORE_IMF_INPUT_PANEL_KEY_COMMA 51
-#define ECORE_IMF_INPUT_PANEL_KEY_DOT 52
-#define ECORE_IMF_INPUT_PANEL_KEY_SLASH 53
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHTSHIFT 54
-#define ECORE_IMF_INPUT_PANEL_KEY_KPASTERISK 55
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFTALT 56
-#define ECORE_IMF_INPUT_PANEL_KEY_SPACE 57
-#define ECORE_IMF_INPUT_PANEL_KEY_CAPSLOCK 58
-#define ECORE_IMF_INPUT_PANEL_KEY_F1 59
-#define ECORE_IMF_INPUT_PANEL_KEY_F2 60
-#define ECORE_IMF_INPUT_PANEL_KEY_F3 61
-#define ECORE_IMF_INPUT_PANEL_KEY_F4 62
-#define ECORE_IMF_INPUT_PANEL_KEY_F5 63
-#define ECORE_IMF_INPUT_PANEL_KEY_F6 64
-#define ECORE_IMF_INPUT_PANEL_KEY_F7 65
-#define ECORE_IMF_INPUT_PANEL_KEY_F8 66
-#define ECORE_IMF_INPUT_PANEL_KEY_F9 67
-#define ECORE_IMF_INPUT_PANEL_KEY_F10 68
-#define ECORE_IMF_INPUT_PANEL_KEY_NUMLOCK 69
-#define ECORE_IMF_INPUT_PANEL_KEY_SCROLLLOCK 70
-#define ECORE_IMF_INPUT_PANEL_KEY_KP7 71
-#define ECORE_IMF_INPUT_PANEL_KEY_KP8 72
-#define ECORE_IMF_INPUT_PANEL_KEY_KP9 73
-#define ECORE_IMF_INPUT_PANEL_KEY_KPMINUS 74
-#define ECORE_IMF_INPUT_PANEL_KEY_KP4 75
-#define ECORE_IMF_INPUT_PANEL_KEY_KP5 76
-#define ECORE_IMF_INPUT_PANEL_KEY_KP6 77
-#define ECORE_IMF_INPUT_PANEL_KEY_KPPLUS 78
-#define ECORE_IMF_INPUT_PANEL_KEY_KP1 79
-#define ECORE_IMF_INPUT_PANEL_KEY_KP2 80
-#define ECORE_IMF_INPUT_PANEL_KEY_KP3 81
-#define ECORE_IMF_INPUT_PANEL_KEY_KP0 82
-#define ECORE_IMF_INPUT_PANEL_KEY_KPDOT 83
-
-#define ECORE_IMF_INPUT_PANEL_KEY_ZENKAKUHANKAKU 85
-#define ECORE_IMF_INPUT_PANEL_KEY_102ND 86
-#define ECORE_IMF_INPUT_PANEL_KEY_F11 87
-#define ECORE_IMF_INPUT_PANEL_KEY_F12 88
-#define ECORE_IMF_INPUT_PANEL_KEY_RO 89
-#define ECORE_IMF_INPUT_PANEL_KEY_KATAKANA 90
-#define ECORE_IMF_INPUT_PANEL_KEY_HIRAGANA 91
-#define ECORE_IMF_INPUT_PANEL_KEY_HENKAN 92
-#define ECORE_IMF_INPUT_PANEL_KEY_KATAKANAHIRAGANA 93
-#define ECORE_IMF_INPUT_PANEL_KEY_MUHENKAN 94
-#define ECORE_IMF_INPUT_PANEL_KEY_KPJPCOMMA 95
-#define ECORE_IMF_INPUT_PANEL_KEY_KPENTER 96
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHTCTRL 97
-#define ECORE_IMF_INPUT_PANEL_KEY_KPSLASH 98
-#define ECORE_IMF_INPUT_PANEL_KEY_SYSRQ 99
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHTALT 100
-#define ECORE_IMF_INPUT_PANEL_KEY_LINEFEED 101
-#define ECORE_IMF_INPUT_PANEL_KEY_HOME 102
-#define ECORE_IMF_INPUT_PANEL_KEY_UP 103
-#define ECORE_IMF_INPUT_PANEL_KEY_PAGEUP 104
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFT 105
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHT 106
-#define ECORE_IMF_INPUT_PANEL_KEY_END 107
-#define ECORE_IMF_INPUT_PANEL_KEY_DOWN 108
-#define ECORE_IMF_INPUT_PANEL_KEY_PAGEDOWN 109
-#define ECORE_IMF_INPUT_PANEL_KEY_INSERT 110
-#define ECORE_IMF_INPUT_PANEL_KEY_DELETE 111
-#define ECORE_IMF_INPUT_PANEL_KEY_MACRO 112
-#define ECORE_IMF_INPUT_PANEL_KEY_MUTE 113
-#define ECORE_IMF_INPUT_PANEL_KEY_VOLUMEDOWN 114
-#define ECORE_IMF_INPUT_PANEL_KEY_VOLUMEUP 115
-#define ECORE_IMF_INPUT_PANEL_KEY_POWER 116 /* SC System Power Down */
-#define ECORE_IMF_INPUT_PANEL_KEY_KPEQUAL 117
-#define ECORE_IMF_INPUT_PANEL_KEY_KPPLUSMINUS 118
-#define ECORE_IMF_INPUT_PANEL_KEY_PAUSE 119
-
-#define ECORE_IMF_INPUT_PANEL_KEY_KPCOMMA 121
-#define ECORE_IMF_INPUT_PANEL_KEY_HANGEUL 122
-#define ECORE_IMF_INPUT_PANEL_KEY_HANGUEL ECORE_IMF_INPUT_PANEL_KEY_KEY_HANGEUL
-#define ECORE_IMF_INPUT_PANEL_KEY_HANJA 123
-#define ECORE_IMF_INPUT_PANEL_KEY_YEN 124
-#define ECORE_IMF_INPUT_PANEL_KEY_LEFTMETA 125
-#define ECORE_IMF_INPUT_PANEL_KEY_RIGHTMETA 126
-#define ECORE_IMF_INPUT_PANEL_KEY_COMPOSE 127
-
-#define ECORE_IMF_INPUT_PANEL_KEY_EXCLAM 129
-#define ECORE_IMF_INPUT_PANEL_KEY_AT 130
-#define ECORE_IMF_INPUT_PANEL_KEY_SHARP 131
-#define ECORE_IMF_INPUT_PANEL_KEY_DOLLAR 132
-#define ECORE_IMF_INPUT_PANEL_KEY_PERCENT 133
-#define ECORE_IMF_INPUT_PANEL_KEY_CARET 134
-#define ECORE_IMF_INPUT_PANEL_KEY_AMPERSAND 135
-#define ECORE_IMF_INPUT_PANEL_KEY_ASTERISK 136
-#define ECORE_IMF_INPUT_PANEL_KEY_LPAREN 137
-#define ECORE_IMF_INPUT_PANEL_KEY_RPAREN 138
-
-#define ECORE_IMF_INPUT_PANEL_KEY_MODECHANGE 247
-#define ECORE_IMF_INPUT_PANEL_KEY_SETTING 248
-
-#define ECORE_IMF_INPUT_PANEL_KEY_MAX 255
-
-#endif
AM_CFLAGS = @WIN32_CFLAGS@
lib_LTLIBRARIES = libecore_imf.la
-includes_HEADERS = Ecore_IMF.h Ecore_IMF_Input_Panel_Key.h
+includes_HEADERS = Ecore_IMF.h
includesdir = $(includedir)/ecore-@VMAJ@
libecore_imf_la_SOURCES = \
* @defgroup Ecore_IMF_Context_Group Ecore Input Method Context Functions
*
* Functions that operate on Ecore Input Method Context objects.
+
+ * Ecore Input Method Context Function defines the interface for EFL input methods.
+ * An input method is used by EFL text input widgets like elm_entry
+ * (based on edje_entry) to map from key events to Unicode character strings.
+ *
+ * The default input method can be set through setting the ECORE_IMF_MODULE environment variable.
+ *
+ * An input method may consume multiple key events in sequence and finally output the composed result.
+ * This is called preediting, and an input method may provide feedback about
+ * this process by displaying the intermediate composition states as preedit text.
+ *
+ * Immodule is plugin to connect your application and input method framework such as SCIM, ibus, and so on.@n
+ * ecore_imf_init() should be called to initialize and load immodule.@n
+ * ecore_imf_shutdown() is used for shutdowning and unloading immodule.
*/
/**
* @return Return a #Ecore_IMF_Context_Info for the Input Method Context with @p id;
* on failure it returns NULL.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ *
+ * const char *ctx_id;
+ * const Ecore_IMF_Context_Info *ctx_info;
+ * Ecore_IMF_Context *imf_context;
+ * ctx_id = ecore_imf_context_default_id_get();
+ * if (ctx_id)
+ * {
+ * ctx_info = ecore_imf_context_info_by_id_get(ctx_id);
+ * if (!ctx_info->canvas_type ||
+ * strcmp(ctx_info->canvas_type, "evas") == 0)
+ * {
+ * imf_context = ecore_imf_context_add(ctx_id);
+ * }
+ * else
+ * {
+ * ctx_id = ecore_imf_context_default_id_by_canvas_type_get("evas");
+ * if (ctx_id)
+ * {
+ * imf_context = ecore_imf_context_add(ctx_id);
+ * }
+ * }
+ * }
+ * @endcode
*/
EAPI const Ecore_IMF_Context_Info *
ecore_imf_context_info_by_id_get(const char *id)
* set on the immodule */
ecore_imf_context_input_panel_enabled_set(ctx, EINA_TRUE);
+ /* default input panel layout type is NORMAL type, so let's make sure it's
+ * set on the immodule */
+ ecore_imf_context_input_panel_layout_set(ctx, ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL);
+
/* default input_mode is ECORE_IMF_INPUT_MODE_FULL, so let's make sure it's
* set on the immodule */
ecore_imf_context_input_mode_set(ctx, ECORE_IMF_INPUT_MODE_FULL);
EAPI void
ecore_imf_context_del(Ecore_IMF_Context *ctx)
{
- void *data;
Ecore_IMF_Func_Node *fn;
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
}
ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
-
- EINA_LIST_FREE(ctx->private_key_list, data)
- free(data);
-
- EINA_LIST_FREE(ctx->disabled_key_list, data)
- free(data);
-
- ctx->private_key_list = NULL;
- ctx->disabled_key_list = NULL;
-
free(ctx);
}
}
/**
- * Retrieve the current preedit string, atrributes and
+ * Retrieve the current preedit string, attributes and
* cursor position for the Input Method Context.
*
* @param ctx An #Ecore_IMF_Context.
* @param cursor_pos Location to store position of cursor (in characters)
* within the preedit string.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ * char *preedit_string;
+ * int cursor_pos;
+ * Eina_List *attrs = NULL, *l = NULL;
+ * Ecore_IMF_Preedit_Attr *attr;
+ *
+ * ecore_imf_context_preedit_string_with_attributes_get(imf_context,
+ * &preedit_string,
+ * &attrs, &cursor_pos);
+ * if (!preedit_string) return;
+ *
+ * if (strlen(preedit_string) > 0)
+ * {
+ * if (attrs)
+ * {
+ * EINA_LIST_FOREACH(attrs, l, attr)
+ * {
+ * if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB1)
+ * {
+ * // Something to do
+ * }
+ * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB2)
+ * {
+ * // Something to do
+ * }
+ * else if (attr->preedit_type == ECORE_IMF_PREEDIT_TYPE_SUB3)
+ * {
+ * // Something to do
+ * }
+ * }
+ * }
+ * }
+ *
+ * // delete attribute list
+ * EINA_LIST_FREE(attrs, attr) free(attr);
+ *
+ * free(preedit_string);
+ * @endcode
* @since 1.1.0
*/
EAPI void
*
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _focus_in_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+ * {
+ * ecore_imf_context_reset(imf_context);
+ * ecore_imf_context_focus_in(imf_context);
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_IN, _focus_in_cb, ed);
+ * @endcode
*/
EAPI void
ecore_imf_context_focus_in(Ecore_IMF_Context *ctx)
*
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+ * {
+ * ecore_imf_context_reset(imf_context);
+ * ecore_imf_context_focus_out(imf_context);
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
+ * @endcode
*/
EAPI void
ecore_imf_context_focus_out(Ecore_IMF_Context *ctx)
*
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _focus_out_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+ * {
+ * ecore_imf_context_reset(imf_context);
+ * ecore_imf_context_focus_out(imf_context);
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_FOCUS_OUT, _focus_out_cb, ed);
+ * @endcode
*/
EAPI void
ecore_imf_context_reset(Ecore_IMF_Context *ctx)
*
* @param ctx An #Ecore_IMF_Context.
* @param x cursor x position.
- * @param x cursor y position.
+ * @param y cursor y position.
* @param w cursor width.
* @param h cursor height.
* @ingroup Ecore_IMF_Context_Group
}
/**
- * Set the autocapitalization type on the immodule.
+ * Set the autocapitalization type on the immodule.
*
* @param ctx An #Ecore_IMF_Context.
* @param autocapital_type the autocapitalization type.
}
/**
- * Set the callback to be used on get_surrounding request.
+ * Set the callback to be used on surrounding_get request.
*
* This callback will be called when the Input Method Context
* module requests the surrounding context.
* @param event The event itself.
* @return EINA_TRUE if the event was handled; otherwise EINA_FALSE.
* @ingroup Ecore_IMF_Context_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+ * {
+ * Evas_Event_Key_Down *ev = event_info;
+ * if (!ev->keyname) return;
+ *
+ * if (imf_context)
+ * {
+ * Ecore_IMF_Event_Key_Down ecore_ev;
+ * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
+ * if (ecore_imf_context_filter_event(imf_context,
+ * ECORE_IMF_EVENT_KEY_DOWN,
+ * (Ecore_IMF_Event *)&ecore_ev))
+ * return;
+ * }
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
+ * @endcode
*/
EAPI Eina_Bool
ecore_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
/**
* Retrieve context around insertion point.
+ * Input methods typically want context in order to constrain input text based on existing text;
+ * this is important for languages such as Thai where only some sequences of characters are allowed.
+ * In addition, the text around the insertion point can be used for supporting autocapital feature.
*
* This function is implemented by calling the
* Ecore_IMF_Context::retrieve_surrounding_func (
* If the function returns EINA_TRUE, then you must free
* the result stored in this location with free().
* @param cursor_pos Location to store the position in characters of
- * the insertion cursor within @text.
+ * the insertion cursor within @p text.
* @return EINA_TRUE if surrounding text was provided; otherwise EINA_FALSE.
* @ingroup Ecore_IMF_Context_Module_Group
*/
* Adds ECORE_IMF_EVENT_PREEDIT_START to the event queue.
*
* ECORE_IMF_EVENT_PREEDIT_START should be added when a new preedit sequence starts.
+ * It's asynchronous method to put event to the event queue.
+ * ecore_imf_context_event_callback_call() can be used as synchronous method.
*
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Module_Group
* Adds ECORE_IMF_EVENT_PREEDIT_END to the event queue.
*
* ECORE_IMF_EVENT_PREEDIT_END should be added when a new preedit sequence has been completed or canceled.
+ * It's asynchronous method to put event to the event queue.
+ * ecore_imf_context_event_callback_call() can be used as synchronous method.
*
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Module_Group
/**
* Adds ECORE_IMF_EVENT_PREEDIT_CHANGED to the event queue.
*
+ * It's asynchronous method to put event to the event queue.
+ * ecore_imf_context_event_callback_call() can be used as synchronous method.
+ *
* @param ctx An #Ecore_IMF_Context.
* @ingroup Ecore_IMF_Context_Module_Group
*/
/**
* Adds ECORE_IMF_EVENT_COMMIT to the event queue.
*
+ * It's asynchronous method to put event to the event queue.
+ * ecore_imf_context_event_callback_call() can be used as synchronous method.
+ *
* @param ctx An #Ecore_IMF_Context.
* @param str The committed string.
* @ingroup Ecore_IMF_Context_Module_Group
* by adding the ECORE_IMF_EVENT_DELETE_SURROUNDING to the event queue.
* Note that offset and n_chars are in characters not in bytes.
*
+ * It's asynchronous method to put ECORE_IMF_EVENT_DELETE_SURROUNDING event to the event queue.
+ * ecore_imf_context_event_callback_call() can be used as synchronous method.
+ *
* @param ctx An #Ecore_IMF_Context.
* @param offset The start offset of surrounding to be deleted.
* @param n_chars The number of characters to be deleted.
* @param data The data pointer to be passed to @p func
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
+ *
+ * Example
+ * @code
+ * static void
+ * _imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
+ * {
+ * char *commit_str = event_info;
+ * // something to do
+ * }
+ *
+ * ecore_imf_context_event_callback_add(en->imf_context, ECORE_IMF_CALLBACK_COMMIT, _imf_event_commit_cb, data);
+ * @endcode
*/
EAPI void
ecore_imf_context_event_callback_add(Ecore_IMF_Context *ctx, Ecore_IMF_Callback_Type type, Ecore_IMF_Event_Cb func, const void *data)
* @see ecore_imf_context_event_callback_add() for more details
*
* @param ctx Ecore_IMF_Context to remove a callback from.
- * @param type The type of event that was trigerring the callback
+ * @param type The type of event that was triggering the callback
* @param func The (callback) function that was to be called when the event was triggered
* @return the data pointer
* @ingroup Ecore_IMF_Context_Group
/**
* Call a given callback on the context @p ctx.
*
- * ecore_imf_context_preedit_start_event_add, ecore_imf_context_preedit_end_event_add,
- * ecore_imf_context_preedit_changed_event_add, ecore_imf_context_commit_event_add and
- * ecore_imf_context_delete_surrounding_event_add APIs are asynchronous
+ * ecore_imf_context_preedit_start_event_add(), ecore_imf_context_preedit_end_event_add(),
+ * ecore_imf_context_preedit_changed_event_add(), ecore_imf_context_commit_event_add() and
+ * ecore_imf_context_delete_surrounding_event_add() APIs are asynchronous
* because those API adds each event to the event queue.
*
* This API provides the way to call each callback function immediately.
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
+ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx)
+ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* Set the layout of the input panel.
*
* @param ctx An #Ecore_IMF_Context.
- * @param layout see #ECORE_IMF_INPUT_PANEL_LAYOUT
+ * @param layout see #Ecore_IMF_Input_Panel_Layout
* @ingroup Ecore_IMF_Context_Group
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
+ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI Ecore_IMF_Input_Panel_Layout
-ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
}
if (ctx->klass->input_panel_layout_get)
- {
- return ctx->input_panel_layout;
- }
+ return ctx->input_panel_layout;
else
return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
}
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
+ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI Ecore_IMF_Input_Panel_Lang
-ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_enabled_set (Ecore_IMF_Context *ctx,
+ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx,
Eina_Bool enabled)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
* @since 1.1.0
*/
EAPI Eina_Bool
-ecore_imf_context_input_panel_enabled_get (Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
/**
* Set the input panel-specific data to deliver to the input panel.
- * this API is used by applications to deliver specific data to the input panel.
- * the data format MUST be negotiated by both application and the input panel.
+ * This API is used by applications to deliver specific data to the input panel.
+ * The data format MUST be negotiated by both application and the input panel.
* The size and format of data are defined by the input panel.
*
* @param ctx An #Ecore_IMF_Context.
}
/**
- * Get the position of the current active input panel.
+ * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
+ *
+ * An input panel displays the string or icon associated with this type
*
* @param ctx An #Ecore_IMF_Context.
- * @param x top-left x co-ordinate of the input panel
- * @param y top-left y co-ordinate of the input panel
- * @param w width of the input panel
- * @param h height of the input panel
+ * @param return_key_type The type of "return" key on the input panel
* @ingroup Ecore_IMF_Context_Group
* @since 1.2.0
*/
EAPI void
-ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
+ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_geometry_get");
+ "ecore_imf_context_input_panel_return_key_type_set");
return;
}
- if (ctx->klass->input_panel_geometry_get)
- ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
+ ctx->input_panel_return_key_type = return_key_type;
+ if (ctx->klass->input_panel_return_key_type_set) ctx->klass->input_panel_return_key_type_set(ctx, return_key_type);
}
/**
- * Set the private key of input panel.
- * Since the second parameter of this API requires a layout index, so before using this API
- * application has to set a specific layout and that layout index should
- * be passed in the 2nd argument of this API.
+ * Get the "return" key type.
+ *
+ * @see ecore_imf_context_input_panel_return_key_type_set() for more details
*
* @param ctx An #Ecore_IMF_Context.
- * @param layout_index index of layout page to be set
- * @param img_path the path of image file to be set
- * @param key_index index of key to be set
- * @param label text label to be appeared on private key
- * @param value value of key, If NULL it will use original value of key
+ * @return The type of "return" key on the input panel
* @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
*/
-EINA_DEPRECATED EAPI void
-ecore_imf_context_input_panel_private_key_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char *label, int key_value, const char *key_string)
+EAPI Ecore_IMF_Input_Panel_Return_Key_Type
+ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx)
{
- Private_Key_Item *key_item;
- Eina_List *l;
- Eina_Bool exist = EINA_FALSE;
-
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_private_key_set");
- return;
+ "ecore_imf_context_input_panel_return_key_type_get");
+ return EINA_FALSE;
}
- if ((!label) && (!img_path)) return;
-
- EINA_LIST_FOREACH(ctx->private_key_list, l, key_item)
- {
- if (key_item && (key_item->layout_idx == layout_index) &&
- (key_item->key_idx == key_index))
- {
- // if exist in the list
- exist = EINA_TRUE;
- if (label)
- {
- key_item->type = 0;
- strcpy(key_item->data, label);
- }
- else
- {
- key_item->type = 1;
- strcpy(key_item->data, img_path);
- }
- key_item->key_value = key_value;
- strcpy(key_item->key_string, key_string);
- }
- }
+ return ctx->input_panel_return_key_type;
+}
- if (!exist)
+/**
+ * Set the return key on the input panel to be disabled.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param disabled The state
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI void
+ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- key_item = calloc(1, sizeof(Private_Key_Item));
- if (!key_item) return;
-
- key_item->layout_idx = layout_index;
- key_item->key_idx = key_index;;
- if (label)
- {
- key_item->type = 0;
- strcpy(key_item->data, label);
- }
- else
- {
- key_item->type = 1;
- strcpy(key_item->data, img_path);
- }
- key_item->key_value = key_value;
-
- if (key_string)
- strcpy(key_item->key_string, key_string);
-
- ctx->private_key_list = eina_list_append(ctx->private_key_list, key_item);
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_return_key_disabled_set");
+ return;
}
-// if (ctx->klass->input_panel_private_key_set) ctx->klass->input_panel_private_key_set(ctx, layout_index, key_index, img_path, label, value);
+ ctx->input_panel_return_key_disabled = disabled;
+ if (ctx->klass->input_panel_return_key_disabled_set) ctx->klass->input_panel_return_key_disabled_set(ctx, disabled);
}
/**
- * Get the list of private key.
+ * Get whether the return key on the input panel should be disabled or not.
*
* @param ctx An #Ecore_IMF_Context.
- * @return Return the list of private key
+ * @return EINA_TRUE if it should be disabled
* @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
*/
-EINA_DEPRECATED EAPI Eina_List *
-ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx)
+EAPI Eina_Bool
+ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_private_key_list_get");
- return NULL;
+ "ecore_imf_context_input_panel_return_key_disabled_get");
+ return EINA_FALSE;
}
- return ctx->private_key_list;
+ return ctx->input_panel_return_key_disabled;
}
/**
- * Set the key to be disabled.
- * Since the second parameter of this API requires a layout index, so before using this API application has to set a specific layout and that layout index
- * should be passed in the 2nd argument of this API.
+ * Set the caps lock mode on the input panel.
*
* @param ctx An #Ecore_IMF_Context.
- * @param layout_index index of layout page to be set
- * @param key_index index of key to be set
- * @param disabled The state
+ * @param mode Turn on caps lock on the input panel if EINA_TRUE
* @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
*/
-EINA_DEPRECATED EAPI void
-ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled)
+EAPI void
+ecore_imf_context_input_panel_caps_lock_mode_set(Ecore_IMF_Context *ctx, Eina_Bool mode)
{
- Disable_Key_Item *key_item;
- Eina_List *l;
- Eina_Bool exist = EINA_FALSE;
-
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_key_disabled_set");
+ "ecore_imf_context_input_panel_caps_lock_mode_set");
return;
}
- EINA_LIST_FOREACH(ctx->disabled_key_list, l, key_item)
- {
- if (key_item && (key_item->layout_idx == layout_index) &&
- (key_item->key_idx == key_index))
- {
- key_item->disabled = disabled;
- exist = EINA_TRUE;
- }
- }
-
- if (!exist)
- {
- key_item = calloc(1, sizeof(Disable_Key_Item));
- if (!key_item) return;
+ if (ctx->klass->input_panel_caps_lock_mode_set)
+ ctx->klass->input_panel_caps_lock_mode_set(ctx, mode);
- key_item->layout_idx = layout_index;
- key_item->key_idx = key_index;;
- key_item->disabled = disabled;
+ ctx->input_panel_caps_lock_mode = mode;
+}
- ctx->disabled_key_list = eina_list_append(ctx->disabled_key_list, key_item);
+/**
+ * Get the caps lock mode on the input panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @return EINA_TRUE if the caps lock is turned on.
+ * @ingroup Ecore_IMF_Context_Group
+ * @since 1.2.0
+ */
+EAPI Eina_Bool
+ecore_imf_context_input_panel_caps_lock_mode_get(Ecore_IMF_Context *ctx)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_caps_lock_mode_get");
+ return EINA_FALSE;
}
-// if (ctx->klass->input_panel_key_disabled_set) ctx->klass->input_panel_key_disabled_set(ctx, layout_index, key_index, disabled);
+ return ctx->input_panel_caps_lock_mode;
}
/**
- * Get the list of disabled keys.
+ * Get the position of the current active input panel.
*
* @param ctx An #Ecore_IMF_Context.
- * @return Return the list of private key
+ * @param x top-left x co-ordinate of the input panel
+ * @param y top-left y co-ordinate of the input panel
+ * @param w width of the input panel
+ * @param h height of the input panel
* @ingroup Ecore_IMF_Context_Group
- * @since 1.1.0
+ * @since 1.2.0
*/
-EINA_DEPRECATED EAPI Eina_List *
-ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx)
+EAPI void
+ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
{
- return ctx->disabled_key_list;
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_geometry_get");
+ return;
+ }
+
+ if (ctx->klass->input_panel_geometry_get)
+ ctx->klass->input_panel_geometry_get(ctx, x, y, w, h);
}
/**
* @param func the callback function
* @param data application-input panel specific data.
* @ingroup Ecore_IMF_Context_Group
- * @since 1.1.0
+ * @since 1.2.0
*/
EAPI void
ecore_imf_context_input_panel_event_callback_add(Ecore_IMF_Context *ctx,
* @param func the callback function
* @param data application-input panel specific data.
* @ingroup Ecore_IMF_Context_Group
- * @since 1.1.0
+ * @since 1.2.0
*/
EAPI void
ecore_imf_context_input_panel_event_callback_del(Ecore_IMF_Context *ctx,
}
/**
- * Move the soft keyboard to the new position.
+ * Get the current language locale of the input panel.
+ *
+ * ex) fr_FR
*
* @param ctx An #Ecore_IMF_Context.
- * @param x X position to move the input panel to
- * @param y Y position to move the input panel to
+ * @param lang Location to store the retrieved language string. The
+ * string retrieved must be freed with free().
+ * @ingroup Ecore_IMF_Context_Group
+ */
+EAPI void
+ecore_imf_context_input_panel_language_locale_get(Ecore_IMF_Context *ctx, char **lang)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_language_locale_get");
+ return;
+ }
+
+ if (ctx->klass->input_panel_language_locale_get)
+ ctx->klass->input_panel_language_locale_get(ctx, lang);
+ else
+ {
+ if (lang) *lang = strdup("");
+ }
+}
+
+/**
+ * Get the geometry information of the candidate panel.
+ *
+ * @param ctx An #Ecore_IMF_Context.
+ * @param x top-left x co-ordinate of the candidate panel
+ * @param y top-left y co-ordinate of the candidate panel
+ * @param w width of the candidate panel
+ * @param h height of the candidate panel
* @ingroup Ecore_IMF_Context_Group
- * @since 1.1.0
*/
-EINA_DEPRECATED EAPI void
-ecore_imf_context_input_panel_move(Ecore_IMF_Context *ctx __UNUSED__, int x __UNUSED__, int y __UNUSED__)
+EAPI void
+ecore_imf_context_candidate_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h)
{
- // will be deprecated
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_candidate_panel_geometry_get");
+ return;
+ }
+
+ if (ctx->klass->candidate_panel_geometry_get)
+ ctx->klass->candidate_panel_geometry_get(ctx, x, y, w, h);
}
+
Ecore_IMF_Autocapital_Type autocapital_type;
Ecore_IMF_Input_Panel_Layout input_panel_layout;
Ecore_IMF_Input_Panel_Lang input_panel_lang;
- Eina_List *disabled_key_list;
- Eina_List *private_key_list;
+ Ecore_IMF_Input_Panel_Return_Key_Type input_panel_return_key_type;
Eina_Bool allow_prediction : 1;
Eina_Bool input_panel_enabled : 1;
+ Eina_Bool input_panel_return_key_disabled : 1;
+ Eina_Bool input_panel_caps_lock_mode : 1;
};
struct _Ecore_IMF_Module
* @param evas_event The received Evas event.
* @param imf_event The location to store the converted Ecore_IMF event.
* @ingroup Ecore_IMF_Evas_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+ * {
+ * Evas_Event_Key_Down *ev = event_info;
+ * if (!ev->keyname) return;
+ *
+ * if (imf_context)
+ * {
+ * Ecore_IMF_Event_Key_Down ecore_ev;
+ * ecore_imf_evas_event_key_down_wrap(ev, &ecore_ev);
+ * if (ecore_imf_context_filter_event(imf_context,
+ * ECORE_IMF_EVENT_KEY_DOWN,
+ * (Ecore_IMF_Event *)&ecore_ev))
+ * return;
+ * }
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN, _key_down_cb, data);
+ * @endcode
*/
EAPI void
ecore_imf_evas_event_key_down_wrap(Evas_Event_Key_Down *evas_event,
* @param evas_event The received Evas event.
* @param imf_event The location to store the converted Ecore_IMF event.
* @ingroup Ecore_IMF_Evas_Group
+ *
+ * Example
+ * @code
+ * static void
+ * _key_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+ * {
+ * Evas_Event_Key_Up *ev = event_info;
+ * if (!ev->keyname) return;
+ *
+ * if (imf_context)
+ * {
+ * Ecore_IMF_Event_Key_Up ecore_ev;
+ * ecore_imf_evas_event_key_up_wrap(ev, &ecore_ev);
+ * if (ecore_imf_context_filter_event(imf_context,
+ * ECORE_IMF_EVENT_KEY_UP,
+ * (Ecore_IMF_Event *)&ecore_ev))
+ * return;
+ * }
+ * }
+ *
+ * evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_UP, _key_up_cb, data);
+ * @endcode
*/
EAPI void
ecore_imf_evas_event_key_up_wrap(Evas_Event_Key_Up *evas_event,
}
/**
- * Sets the max data payload size for an Ipc message in bytes
+ * Gets the max data payload size for an Ipc message in bytes
*
* @param cl The given client.
+ * @return The maximum data payload size in bytes on success, @c -1 on failure.
* @ingroup Ecore_Ipc_Client_Group
*/
EAPI int
# define EAPI
# endif
+typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
+typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
+
+typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
+typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
+typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
+# ifndef _ECORE_WAYLAND_WINDOW_PREDEF
+typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
+# endif
+typedef struct _Ecore_Wl_Dnd_Source Ecore_Wl_Dnd_Source;
+typedef struct _Ecore_Wl_Dnd_Target Ecore_Wl_Dnd_Target;
+
typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In;
typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out;
typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In;
typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out;
+typedef struct _Ecore_Wl_Event_Window_Configure Ecore_Wl_Event_Window_Configure;
+typedef struct _Ecore_Wl_Event_Dnd_Enter Ecore_Wl_Event_Dnd_Enter;
+typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position;
+typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave;
+typedef struct _Ecore_Wl_Event_Dnd_Drop Ecore_Wl_Event_Dnd_Drop;
+typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound;
-typedef struct _Ecore_Wl_Drag_Source Ecore_Wl_Drag_Source;
+enum _Ecore_Wl_Window_Type
+{
+ ECORE_WL_WINDOW_TYPE_TOPLEVEL,
+ ECORE_WL_WINDOW_TYPE_FULLSCREEN,
+ ECORE_WL_WINDOW_TYPE_MAXIMIZED,
+ ECORE_WL_WINDOW_TYPE_TRANSIENT,
+ ECORE_WL_WINDOW_TYPE_MENU,
+ ECORE_WL_WINDOW_TYPE_CUSTOM
+};
-typedef struct _Ecore_Wl_Event_Drag_Start Ecore_Wl_Event_Drag_Start;
-typedef struct _Ecore_Wl_Event_Drag_Stop Ecore_Wl_Event_Drag_Stop;
+enum _Ecore_Wl_Window_Buffer_Type
+{
+ ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW,
+ ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE,
+ ECORE_WL_WINDOW_BUFFER_TYPE_SHM
+};
-struct _Ecore_Wl_Event_Mouse_In
+struct _Ecore_Wl_Display
{
- int modifiers;
- int x, y;
+ struct
+ {
+ struct wl_display *display;
+ struct wl_compositor *compositor;
+ struct wl_shell *shell;
+ struct wl_shm *shm;
+ struct wl_data_device_manager *data_device_manager;
+ } wl;
+
+ int fd;
+ unsigned int mask;
+ Ecore_Fd_Handler *fd_hdl;
+
+ struct wl_list inputs;
+ struct wl_list outputs;
+
+ struct xkb_desc *xkb;
+
+ Ecore_Wl_Output *output;
+ Ecore_Wl_Input *input;
+
+ void (*output_configure)(Ecore_Wl_Output *output, void *data);
+ void *data;
+};
+
+struct _Ecore_Wl_Output
+{
+ Ecore_Wl_Display *display;
+ struct wl_output *output;
+ Eina_Rectangle allocation;
+ int mw, mh;
+ struct wl_list link;
+
+ void (*destroy) (Ecore_Wl_Output *output, void *data);
+ void *data;
+};
+
+struct _Ecore_Wl_Input
+{
+ Ecore_Wl_Display *display;
+ struct wl_input_device *input_device;
+ struct wl_data_device *data_device;
+
+ Ecore_Wl_Window *pointer_focus;
+ Ecore_Wl_Window *keyboard_focus;
+
+ unsigned int button;
+ unsigned int timestamp;
+ unsigned int modifiers;
+ int sx, sy;
+
+ struct wl_list link;
+
+ Ecore_Wl_Window *grab;
+ unsigned int grab_button;
+
+ Ecore_Wl_Dnd_Source *drag_source;
+ Ecore_Wl_Dnd_Source *selection_source;
+};
+
+struct _Ecore_Wl_Window
+{
+ Ecore_Wl_Display *display;
+ Ecore_Wl_Window *parent;
+
+ struct wl_surface *surface;
+ struct wl_shell_surface *shell_surface;
struct
{
- int x, y;
- } root;
+ struct wl_region *input, *opaque;
+ } region;
+
+ int id;
+ int x, y;
+ int edges;
- unsigned int window;
+ Eina_Rectangle allocation, pending_allocation;
+ Eina_Rectangle saved_allocation, server_allocation;
- unsigned int time;
+ /* Eina_Bool redraw_scheduled : 1; */
+ /* Eina_Bool resize_scheduled : 1; */
+ Eina_Bool transparent : 1;
+
+ Ecore_Wl_Window_Type type;
+ Ecore_Wl_Window_Buffer_Type buffer_type;
+
+ Ecore_Wl_Input *pointer_device;
+ Ecore_Wl_Input *keyboard_device;
+
+ void *data;
};
-struct _Ecore_Wl_Event_Mouse_Out
+struct _Ecore_Wl_Event_Mouse_In
{
int modifiers;
int x, y;
+ struct
+ {
+ int x, y;
+ } root;
+ unsigned int win;
+ unsigned int event_win;
+ unsigned int root_win;
+ unsigned int timestamp;
+};
+struct _Ecore_Wl_Event_Mouse_Out
+{
+ int modifiers;
+ int x, y;
struct
{
int x, y;
} root;
+ unsigned int win;
+ unsigned int event_win;
+ unsigned int root_win;
+ unsigned int timestamp;
+};
- unsigned int window;
+struct _Ecore_Wl_Event_Focus_In
+{
+ unsigned int win;
+ unsigned int timestamp;
+};
- unsigned int time;
+struct _Ecore_Wl_Event_Focus_Out
+{
+ unsigned int win;
+ unsigned int timestamp;
};
-struct _Ecore_Wl_Event_Focus_In
+struct _Ecore_Wl_Event_Window_Configure
{
- unsigned int window;
- /* TODO: mode & detail */
- unsigned int time;
+ unsigned int win;
+ unsigned int event_win;
+ int x, y, w, h;
+ unsigned int timestamp;
};
-struct _Ecore_Wl_Event_Focus_Out
+struct _Ecore_Wl_Event_Dnd_Enter
{
- unsigned int window;
- /* TODO: mode & detail */
- unsigned int time;
+ unsigned int win, source;
+ char **types;
+ int num_types;
+ struct
+ {
+ int x, y;
+ } position;
};
-struct _Ecore_Wl_Event_Drag_Start
+struct _Ecore_Wl_Event_Dnd_Position
{
- struct wl_data_device *device;
- struct wl_surface *surface;
- const char *mime_type;
- uint32_t timestamp;
+ unsigned int win, source;
+ struct
+ {
+ int x, y;
+ } position;
};
-struct _Ecore_Wl_Event_Drag_Stop
+struct _Ecore_Wl_Event_Dnd_Leave
{
+ unsigned int win, source;
+};
+
+struct _Ecore_Wl_Event_Dnd_Drop
+{
+ unsigned int win, source;
+ struct
+ {
+ int x, y;
+ } position;
+};
+struct _Ecore_Wl_Event_Interfaces_Bound
+{
+ Eina_Bool compositor : 1;
+ Eina_Bool shm : 1;
+ Eina_Bool shell : 1;
};
/**
* Ecore_Wl provides a wrapper and convenience functions for using the
* Wayland window system. Function groups for this part of the library
* include the following:
+ *
* @li @ref Ecore_Wl_Init_Group
+ * @li @ref Ecore_Wl_Display_Group
+ * @li @ref Ecore_Wl_Flush_Group
+ * @li @ref Ecore_Wl_Window_Group
*/
+EAPI extern int ECORE_WL_EVENT_MOUSE_IN;
+EAPI extern int ECORE_WL_EVENT_MOUSE_OUT;
+EAPI extern int ECORE_WL_EVENT_FOCUS_IN;
+EAPI extern int ECORE_WL_EVENT_FOCUS_OUT;
+EAPI extern int ECORE_WL_EVENT_WINDOW_CONFIGURE;
+EAPI extern int ECORE_WL_EVENT_DND_ENTER;
+EAPI extern int ECORE_WL_EVENT_DND_POSITION;
+EAPI extern int ECORE_WL_EVENT_DND_LEAVE;
+EAPI extern int ECORE_WL_EVENT_DND_DROP;
+EAPI extern int ECORE_WL_EVENT_INTERFACES_BOUND;
+
EAPI int ecore_wl_init(const char *name);
EAPI int ecore_wl_shutdown(void);
-
-EAPI struct wl_display *ecore_wl_display_get(void);
-EAPI struct wl_shm *ecore_wl_shm_get(void);
-EAPI struct wl_compositor *ecore_wl_compositor_get(void);
-EAPI struct wl_shell *ecore_wl_shell_get(void);
-EAPI struct wl_input_device *ecore_wl_input_device_get(void);
-EAPI void ecore_wl_screen_size_get(int *w, int *h);
-EAPI unsigned int ecore_wl_format_get(void);
EAPI void ecore_wl_flush(void);
EAPI void ecore_wl_sync(void);
+EAPI struct wl_shm *ecore_wl_shm_get(void);
+EAPI struct wl_display *ecore_wl_display_get(void);
+EAPI void ecore_wl_screen_size_get(int *w, int *h);
EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
+EAPI int ecore_wl_dpi_get(void);
+EAPI void ecore_wl_display_iterate(void);
-EAPI 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);
-EAPI void ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer);
-EAPI void ecore_wl_drag_stop(void);
+EAPI void ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button);
+EAPI void ecore_wl_input_ungrab(Ecore_Wl_Input *input, unsigned int timestamp);
-EAPI extern int ECORE_WL_EVENT_MOUSE_IN;
-EAPI extern int ECORE_WL_EVENT_MOUSE_OUT;
-EAPI extern int ECORE_WL_EVENT_FOCUS_IN;
-EAPI extern int ECORE_WL_EVENT_FOCUS_OUT;
-EAPI extern int ECORE_WL_EVENT_DRAG_START;
-EAPI extern int ECORE_WL_EVENT_DRAG_STOP;
+EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type);
+EAPI void ecore_wl_window_free(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y);
+EAPI void ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location);
+EAPI void ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h);
+EAPI void ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y);
+EAPI void ecore_wl_window_show(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_raise(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized);
+EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen);
+EAPI void ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent);
+EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h);
+EAPI struct wl_surface *ecore_wl_window_surface_get(Ecore_Wl_Window *win);
+EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id);
+EAPI void ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type);
+EAPI void ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_buffer *buffer, int hot_x, int hot_y, unsigned int timestamp);
#endif
includesdir = $(includedir)/ecore-@VMAJ@
libecore_wayland_la_SOURCES = \
-ecore_wl.c
-
-## ecore_wl_window.c
+ecore_wl.c \
+ecore_wl_output.c \
+ecore_wl_input.c \
+ecore_wl_window.c \
+ecore_wl_dnd.c
libecore_wayland_la_LIBADD = \
$(top_builddir)/src/lib/ecore/libecore.la \
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif
-#include "Ecore.h"
-#include "ecore_private.h"
-#include "Ecore_Input.h"
-#include "ecore_wl_private.h"
-#include "Ecore_Wayland.h"
+#include <fcntl.h>
/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ...
* What about other OSs ?? */
-#include <fcntl.h>
#ifdef __linux__
# include <linux/input.h>
#else
# define BTN_BACK 0x116
#endif
-#include <X11/extensions/XKBcommon.h>
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "Ecore_Input.h"
+#include "ecore_wl_private.h"
+#include "Ecore_Wayland.h"
/* local function prototypes */
-static Eina_Bool _ecore_wl_shutdown(Eina_Bool close_display);
-static void _ecore_wl_cb_disp_handle_global(struct wl_display *disp, uint32_t id, const char *interface, uint32_t version __UNUSED__, void *data __UNUSED__);
-static int _ecore_wl_cb_disp_event_mask_update(uint32_t mask, void *data __UNUSED__);
-static 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__);
-static 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__);
-static Eina_Bool _ecore_wl_cb_fd_handle(void *data, Ecore_Fd_Handler *hdl __UNUSED__);
-static 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);
-static void _ecore_wl_cb_handle_button(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, uint32_t btn, uint32_t state);
-static void _ecore_wl_cb_handle_key(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t __UNUSED__, uint32_t key, uint32_t state);
-static 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);
-static 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);
-static 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);
-static void _ecore_wl_cb_handle_touch_up(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id);
-static 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);
-static void _ecore_wl_cb_handle_touch_frame(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__);
-static void _ecore_wl_cb_handle_touch_cancel(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__);
-static void _ecore_wl_cb_source_target(void *data, struct wl_data_source *source __UNUSED__, const char *mime_type __UNUSED__);
-static void _ecore_wl_cb_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd);
-static void _ecore_wl_cb_source_cancelled(void *data, struct wl_data_source *source __UNUSED__);
-static void _ecore_wl_cb_source_offer(void *data, struct wl_data_offer *offer __UNUSED__, const char *type);
-static void _ecore_wl_cb_data_offer(void *data, struct wl_data_device *data_dev, uint32_t id);
-static 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);
-static void _ecore_wl_cb_data_leave(void *data __UNUSED__, struct wl_data_device *data_dev);
-static void _ecore_wl_cb_data_motion(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, int32_t x, int32_t y);
-static void _ecore_wl_cb_data_drop(void *data __UNUSED__, struct wl_data_device *data_dev);
-static void _ecore_wl_cb_data_selection(void *data, struct wl_data_device *data_dev, struct wl_data_offer *offer);
-
-static void _ecore_wl_mouse_move_send(uint32_t timestamp);
-static void _ecore_wl_mouse_out_send(struct wl_surface *surface, uint32_t timestamp);
-static void _ecore_wl_mouse_in_send(struct wl_surface *surface, uint32_t timestamp);
-static void _ecore_wl_mouse_up_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp);
-static void _ecore_wl_mouse_down_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp);
-static void _ecore_wl_focus_out_send(struct wl_surface *surface, uint32_t timestamp);
-static void _ecore_wl_focus_in_send(struct wl_surface *surface, uint32_t timestamp);
+static Eina_Bool _ecore_wl_shutdown(Eina_Bool close);
+static int _ecore_wl_cb_event_mask_update(unsigned int mask, void *data);
+static Eina_Bool _ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl __UNUSED__);
+static void _ecore_wl_cb_handle_global(struct wl_display *disp, unsigned int id, const char *interface, unsigned int version __UNUSED__, void *data);
+static Eina_Bool _ecore_wl_xkb_init(Ecore_Wl_Display *ewd);
+static Eina_Bool _ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd);
/* local variables */
static int _ecore_wl_init_count = 0;
-static struct wl_display *_ecore_wl_disp = NULL;
-static uint32_t _ecore_wl_disp_mask = 0;
-static uint32_t _ecore_wl_disp_format = WL_SHM_FORMAT_ARGB8888;
-static Eina_Rectangle _ecore_wl_screen;
-static Ecore_Fd_Handler *_ecore_wl_fd_hdl = NULL;
-static int _ecore_wl_screen_x = 0;
-static int _ecore_wl_screen_y = 0;
-static int _ecore_wl_surface_x = 0;
-static int _ecore_wl_surface_y = 0;
-static int _ecore_wl_touch_x = 0;
-static int _ecore_wl_touch_y = 0;
-static int _ecore_wl_input_modifiers = 0;
-static struct xkb_desc *_ecore_wl_xkb = NULL;
-static uint32_t _ecore_wl_input_button = 0;
-
-static struct wl_compositor *_ecore_wl_comp = NULL;
-static struct wl_shm *_ecore_wl_shm = NULL;
-static struct wl_shell *_ecore_wl_shell = NULL;
-static struct wl_output *_ecore_wl_output = NULL;
-static struct wl_input_device *_ecore_wl_input_dev = NULL;
-static struct wl_surface *_ecore_wl_input_surface = NULL;
-static struct wl_surface *_ecore_wl_touch_surface = NULL;
-static struct wl_data_device_manager *_ecore_wl_data_manager = NULL;
-static struct wl_data_device *_ecore_wl_data_dev = NULL;
-
-static const struct wl_output_listener _ecore_wl_output_listener =
-{
- _ecore_wl_cb_disp_handle_geometry,
- _ecore_wl_cb_disp_handle_mode
-};
-static const struct wl_input_device_listener _ecore_wl_input_listener =
-{
- _ecore_wl_cb_handle_motion,
- _ecore_wl_cb_handle_button,
- _ecore_wl_cb_handle_key,
- _ecore_wl_cb_handle_pointer_focus,
- _ecore_wl_cb_handle_keyboard_focus,
- _ecore_wl_cb_handle_touch_down,
- _ecore_wl_cb_handle_touch_up,
- _ecore_wl_cb_handle_touch_motion,
- _ecore_wl_cb_handle_touch_frame,
- _ecore_wl_cb_handle_touch_cancel,
-};
-static const struct wl_data_source_listener _ecore_wl_source_listener =
-{
- _ecore_wl_cb_source_target,
- _ecore_wl_cb_source_send,
- _ecore_wl_cb_source_cancelled
-};
-static const struct wl_data_device_listener _ecore_wl_data_listener =
-{
- _ecore_wl_cb_data_offer,
- _ecore_wl_cb_data_enter,
- _ecore_wl_cb_data_leave,
- _ecore_wl_cb_data_motion,
- _ecore_wl_cb_data_drop,
- _ecore_wl_cb_data_selection
-};
-static const struct wl_data_offer_listener _ecore_wl_offer_listener =
-{
- _ecore_wl_cb_source_offer,
-};
/* external variables */
int _ecore_wl_log_dom = -1;
+Ecore_Wl_Display *_ecore_wl_disp = NULL;
+
EAPI int ECORE_WL_EVENT_MOUSE_IN = 0;
EAPI int ECORE_WL_EVENT_MOUSE_OUT = 0;
EAPI int ECORE_WL_EVENT_FOCUS_IN = 0;
EAPI int ECORE_WL_EVENT_FOCUS_OUT = 0;
-EAPI int ECORE_WL_EVENT_DRAG_START = 0;
-EAPI int ECORE_WL_EVENT_DRAG_STOP = 0;
-
+EAPI int ECORE_WL_EVENT_WINDOW_CONFIGURE = 0;
+EAPI int ECORE_WL_EVENT_DND_ENTER = 0;
+EAPI int ECORE_WL_EVENT_DND_POSITION = 0;
+EAPI int ECORE_WL_EVENT_DND_LEAVE = 0;
+EAPI int ECORE_WL_EVENT_DND_DROP = 0;
+EAPI int ECORE_WL_EVENT_INTERFACES_BOUND = 0;
+
+/**
+ * @defgroup Ecore_Wl_Init_Group Wayland Library Init and Shutdown Functions
+ *
+ * Functions that start and shutdown the Ecore Wayland Library.
+ */
+
+/**
+ * Initialize the Wayland display connection to the given display.
+ *
+ * @param name Display target name. if @c NULL, the default display is
+ * assumed.
+ * @return The number of times the library has been initialized without being
+ * shut down. 0 is returned if an error occurs.
+ *
+ * @ingroup Ecore_Wl_Init_Group
+ */
EAPI int
-ecore_wl_init(const char *name)
+ecore_wl_init(const char *name)
{
- struct xkb_rule_names xkb_names;
- int fd = 0;
-
- if (++_ecore_wl_init_count != 1)
- return _ecore_wl_init_count;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (++_ecore_wl_init_count != 1) return _ecore_wl_init_count;
+
if (!eina_init()) return --_ecore_wl_init_count;
_ecore_wl_log_dom =
eina_log_domain_register("ecore_wl", ECORE_WL_DEFAULT_LOG_COLOR);
- if (_ecore_wl_log_dom < 0)
+ if (_ecore_wl_log_dom < 0)
{
- EINA_LOG_ERR("Cannot create a log domain for Ecore Wayland.");
+ EINA_LOG_ERR("Cannot create a log domain for Ecore Wayland");
eina_shutdown();
return --_ecore_wl_init_count;
}
- if (!ecore_init())
+ if (!ecore_init())
{
+ ERR("Could not initialize ecore");
eina_log_domain_unregister(_ecore_wl_log_dom);
_ecore_wl_log_dom = -1;
eina_shutdown();
return --_ecore_wl_init_count;
}
- if (!ecore_event_init())
+ if (!ecore_event_init())
{
+ ERR("Could not initialize ecore_event");
eina_log_domain_unregister(_ecore_wl_log_dom);
_ecore_wl_log_dom = -1;
ecore_shutdown();
return --_ecore_wl_init_count;
}
- if (!ECORE_WL_EVENT_MOUSE_IN)
+ if (!ECORE_WL_EVENT_MOUSE_IN)
{
ECORE_WL_EVENT_MOUSE_IN = ecore_event_type_new();
ECORE_WL_EVENT_MOUSE_OUT = ecore_event_type_new();
ECORE_WL_EVENT_FOCUS_IN = ecore_event_type_new();
ECORE_WL_EVENT_FOCUS_OUT = ecore_event_type_new();
- ECORE_WL_EVENT_DRAG_START = ecore_event_type_new();
- ECORE_WL_EVENT_DRAG_STOP = ecore_event_type_new();
+ ECORE_WL_EVENT_WINDOW_CONFIGURE = ecore_event_type_new();
+ ECORE_WL_EVENT_DND_ENTER = ecore_event_type_new();
+ ECORE_WL_EVENT_DND_POSITION = ecore_event_type_new();
+ ECORE_WL_EVENT_DND_LEAVE = ecore_event_type_new();
+ ECORE_WL_EVENT_DND_DROP = ecore_event_type_new();
+ ECORE_WL_EVENT_INTERFACES_BOUND = ecore_event_type_new();
}
- /* init xkb */
- /* FIXME: Somehow make this portable to other languages/countries */
- xkb_names.rules = "evdev";
- xkb_names.model = "evdev";
- xkb_names.layout = "us";
- xkb_names.variant = "";
- xkb_names.options = "";
- if (!(_ecore_wl_xkb = xkb_compile_keymap_from_rules(&xkb_names)))
+ if (!(_ecore_wl_disp = malloc(sizeof(Ecore_Wl_Display))))
{
- ERR("Could not compile keymap");
+ ERR("Could not allocate memory for Ecore_Wl_Display structure");
eina_log_domain_unregister(_ecore_wl_log_dom);
_ecore_wl_log_dom = -1;
ecore_event_shutdown();
return --_ecore_wl_init_count;
}
- /* connect to the wayland display */
- if (!(_ecore_wl_disp = wl_display_connect(name)))
+ memset(_ecore_wl_disp, 0, sizeof(Ecore_Wl_Display));
+
+ if (!(_ecore_wl_disp->wl.display = wl_display_connect(name)))
{
+ ERR("Could not connect to Wayland display");
eina_log_domain_unregister(_ecore_wl_log_dom);
_ecore_wl_log_dom = -1;
ecore_event_shutdown();
return --_ecore_wl_init_count;
}
- /* setup handler for wayland interfaces */
- wl_display_add_global_listener(_ecore_wl_disp,
- _ecore_wl_cb_disp_handle_global, NULL);
+ _ecore_wl_disp->fd =
+ wl_display_get_fd(_ecore_wl_disp->wl.display,
+ _ecore_wl_cb_event_mask_update, _ecore_wl_disp);
- /* process connection events */
- wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
+ _ecore_wl_disp->fd_hdl =
+ ecore_main_fd_handler_add(_ecore_wl_disp->fd, ECORE_FD_READ,
+ _ecore_wl_cb_handle_data, _ecore_wl_disp,
+ NULL, NULL);
- fd = wl_display_get_fd(_ecore_wl_disp,
- _ecore_wl_cb_disp_event_mask_update, NULL);
+ wl_list_init(&_ecore_wl_disp->inputs);
+ wl_list_init(&_ecore_wl_disp->outputs);
- _ecore_wl_fd_hdl =
- ecore_main_fd_handler_add(fd, ECORE_FD_READ, _ecore_wl_cb_fd_handle,
- _ecore_wl_disp, NULL, NULL);
- if (!_ecore_wl_fd_hdl)
+ wl_display_add_global_listener(_ecore_wl_disp->wl.display,
+ _ecore_wl_cb_handle_global, _ecore_wl_disp);
+
+ /* FIXME: Process connection events ?? */
+ /* wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE); */
+
+ /* TODO: create pointer surfaces */
+
+ if (!_ecore_wl_xkb_init(_ecore_wl_disp))
{
- wl_display_destroy(_ecore_wl_disp);
- _ecore_wl_disp = NULL;
+ ERR("Could not initialize XKB");
+ free(_ecore_wl_disp);
eina_log_domain_unregister(_ecore_wl_log_dom);
_ecore_wl_log_dom = -1;
ecore_event_shutdown();
return --_ecore_wl_init_count;
}
+ _ecore_wl_window_init();
+
return _ecore_wl_init_count;
}
+/**
+ * Shuts down the Ecore Wayland Library
+ *
+ * In shutting down the library, the Wayland display connection is terminated
+ * and any event handlers for it are removed.
+ *
+ * @return The number of times the library has been initialized without
+ * being shut down.
+ *
+ * @ingroup Ecore_Wl_Init_Group
+ */
EAPI int
-ecore_wl_shutdown(void)
+ecore_wl_shutdown(void)
{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
return _ecore_wl_shutdown(EINA_TRUE);
}
-EAPI struct wl_display *
-ecore_wl_display_get(void)
-{
- return _ecore_wl_disp;
-}
+/**
+ * @defgroup Ecore_Wl_Flush_Group Wayland Synchronization Functions
+ *
+ * Functions that ensure that all commands which have been issued by the
+ * Ecore Wayland library have been sent to the server.
+ */
-EAPI struct wl_shm *
-ecore_wl_shm_get(void)
+/**
+ * Sends all Wayland commands to the Wayland Display.
+ *
+ * @ingroup Ecore_Wl_Flush_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_flush(void)
{
- return _ecore_wl_shm;
-}
+// LOGFN(__FILE__, __LINE__, __FUNCTION__);
-EAPI struct wl_compositor *
-ecore_wl_compositor_get(void)
-{
- return _ecore_wl_comp;
+ while (_ecore_wl_disp->mask & WL_DISPLAY_WRITABLE)
+ wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_WRITABLE);
}
-EAPI struct wl_shell *
-ecore_wl_shell_get(void)
+/**
+ * Flushes the command buffer and waits until all requests have been
+ * processed by the server.
+ *
+ * @ingroup Ecore_Wl_Flush_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_sync(void)
{
- return _ecore_wl_shell;
-}
+// LOGFN(__FILE__, __LINE__, __FUNCTION__);
-EAPI struct wl_input_device *
-ecore_wl_input_device_get(void)
-{
- return _ecore_wl_input_dev;
+ wl_display_sync(_ecore_wl_disp->wl.display);
}
-EAPI void
-ecore_wl_screen_size_get(int *w, int *h)
-{
- if (w) *w = _ecore_wl_screen.w;
- if (h) *h = _ecore_wl_screen.h;
-}
+/**
+ * @defgroup Ecore_Wl_Display_Group Wayland Display Functions
+ *
+ * Functions that set and retrieve various information about the Wayland Display.
+ */
-EAPI unsigned int
-ecore_wl_format_get(void)
+/**
+ * Retrieves the Wayland Shm Interface used for the current Wayland connection.
+ *
+ * @return The current wayland shm interface
+ *
+ * @ingroup Ecore_Wl_Display_Group
+ * @since 1.2
+ */
+EAPI struct wl_shm *
+ecore_wl_shm_get(void)
{
- return _ecore_wl_disp_format;
+ return _ecore_wl_disp->wl.shm;
}
-EAPI void
-ecore_wl_flush(void)
+/**
+ * Retrieves the Wayland Display Interface used for the current Wayland connection.
+ *
+ * @return The current wayland display interface
+ *
+ * @ingroup Ecore_Wl_Display_Group
+ * @since 1.2
+ */
+EAPI struct wl_display *
+ecore_wl_display_get(void)
{
- wl_display_flush(_ecore_wl_disp);
+ return _ecore_wl_disp->wl.display;
}
+/**
+ * Retrieves the size of the current screen.
+ *
+ * @param w where to return the width. May be NULL. Returns 0 on error.
+ * @param h where to return the height. May be NULL. Returns 0 on error.
+ *
+ * @ingroup Ecore_Wl_Display_Group
+ * @since 1.2
+ */
EAPI void
-ecore_wl_sync(void)
+ecore_wl_screen_size_get(int *w, int *h)
{
- wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (w) *w = _ecore_wl_disp->output->allocation.w;
+ if (h) *h = _ecore_wl_disp->output->allocation.h;
}
+/* @since 1.2 */
EAPI void
-ecore_wl_pointer_xy_get(int *x, int *y)
+ecore_wl_pointer_xy_get(int *x, int *y)
{
- if (x) *x = _ecore_wl_screen_x;
- if (y) *y = _ecore_wl_screen_y;
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_input_pointer_xy_get(x, y);
}
-EAPI 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)
+/**
+ * Return the screen DPI
+ *
+ * This is a simplistic call to get DPI. It does not account for differing
+ * DPI in the x amd y axes nor does it accoutn for multihead or xinerama and
+ * xrander where different parts of the screen may have differen DPI etc.
+ *
+ * @return the general screen DPI (dots/pixels per inch).
+ *
+ * @since 1.2
+ */
+EAPI int
+ecore_wl_dpi_get(void)
{
- Ecore_Wl_Drag_Source *source;
-
- if (!(source = calloc(1, sizeof(Ecore_Wl_Drag_Source)))) return NULL;
-
- source->data_dev = _ecore_wl_data_dev;
- source->hotspot_x = hotspot_x;
- source->hotspot_y = hotspot_y;
- source->offset_x = offset_x;
- source->offset_y = offset_y;
- source->mimetype = mimetype;
- source->timestamp = timestamp;
- source->data = data;
-
- source->data_source =
- wl_data_device_manager_create_data_source(_ecore_wl_data_manager);
-
- wl_data_source_add_listener(source->data_source,
- &_ecore_wl_source_listener, source);
-
- wl_data_source_offer(source->data_source, source->mimetype);
+ int w, mw;
- /* NB: Do we add some default mimetypes here ?? */
- /* text/plain, etc */
-
- return source;
-}
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
-EAPI void
-ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer)
-{
- source->buffer = buffer;
+ mw = _ecore_wl_disp->output->mw;
+ if (mw <= 0) return 75;
- wl_data_device_start_drag(source->data_dev, source->data_source,
- surface, source->timestamp);
+ w = _ecore_wl_disp->output->allocation.w;
+ return (((w * 254) / mw) + 5) / 10;
}
EAPI void
-ecore_wl_drag_stop(void)
+ecore_wl_display_iterate(void)
{
-
+ wl_display_iterate(_ecore_wl_disp->wl.display, WL_DISPLAY_READABLE);
}
/* local functions */
static Eina_Bool
-_ecore_wl_shutdown(Eina_Bool close_display)
+_ecore_wl_shutdown(Eina_Bool close)
{
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (--_ecore_wl_init_count != 0)
- return _ecore_wl_init_count;
-
+ if (--_ecore_wl_init_count != 0) return _ecore_wl_init_count;
if (!_ecore_wl_disp) return _ecore_wl_init_count;
- if (_ecore_wl_xkb) free(_ecore_wl_xkb);
+ _ecore_wl_window_shutdown();
- if (_ecore_wl_fd_hdl) ecore_main_fd_handler_del(_ecore_wl_fd_hdl);
- _ecore_wl_fd_hdl = NULL;
+ if (_ecore_wl_disp->fd_hdl)
+ ecore_main_fd_handler_del(_ecore_wl_disp->fd_hdl);
- if (close_display)
+ if (close)
{
- if (_ecore_wl_data_dev) wl_data_device_destroy(_ecore_wl_data_dev);
- if (_ecore_wl_input_dev) wl_input_device_destroy(_ecore_wl_input_dev);
- if (_ecore_wl_data_manager)
- wl_data_device_manager_destroy(_ecore_wl_data_manager);
- if (_ecore_wl_shell) wl_shell_destroy(_ecore_wl_shell);
- if (_ecore_wl_shm) wl_shm_destroy(_ecore_wl_shm);
- if (_ecore_wl_comp) wl_compositor_destroy(_ecore_wl_comp);
- if (_ecore_wl_disp)
+ Ecore_Wl_Output *out, *tout;
+ Ecore_Wl_Input *in, *tin;
+
+ wl_list_for_each_safe(out, tout, &_ecore_wl_disp->outputs, link)
+ _ecore_wl_output_del(out);
+
+ wl_list_for_each_safe(in, tin, &_ecore_wl_disp->inputs, link)
+ _ecore_wl_input_del(in);
+
+ _ecore_wl_xkb_shutdown(_ecore_wl_disp);
+
+ if (_ecore_wl_disp->wl.shell)
+ wl_shell_destroy(_ecore_wl_disp->wl.shell);
+ if (_ecore_wl_disp->wl.shm) wl_shm_destroy(_ecore_wl_disp->wl.shm);
+ if (_ecore_wl_disp->wl.data_device_manager)
+ wl_data_device_manager_destroy(_ecore_wl_disp->wl.data_device_manager);
+ if (_ecore_wl_disp->wl.compositor)
+ wl_compositor_destroy(_ecore_wl_disp->wl.compositor);
+ if (_ecore_wl_disp->wl.display)
{
- wl_display_flush(_ecore_wl_disp);
- wl_display_destroy(_ecore_wl_disp);
+ wl_display_flush(_ecore_wl_disp->wl.display);
+ wl_display_disconnect(_ecore_wl_disp->wl.display);
}
- _ecore_wl_disp = NULL;
+ free(_ecore_wl_disp);
}
- eina_log_domain_unregister(_ecore_wl_log_dom);
- _ecore_wl_log_dom = -1;
-
ecore_event_shutdown();
ecore_shutdown();
+
+ eina_log_domain_unregister(_ecore_wl_log_dom);
+ _ecore_wl_log_dom = -1;
eina_shutdown();
return _ecore_wl_init_count;
}
-static void
-_ecore_wl_cb_disp_handle_global(struct wl_display *disp, uint32_t id, const char *interface, uint32_t version __UNUSED__, void *data __UNUSED__)
-{
-// LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (disp != _ecore_wl_disp) return;
- if (!strcmp(interface, "wl_compositor"))
- {
- _ecore_wl_comp =
- wl_display_bind(_ecore_wl_disp, id, &wl_compositor_interface);
- }
- else if (!strcmp(interface, "wl_shm"))
- {
- _ecore_wl_shm =
- wl_display_bind(_ecore_wl_disp, id, &wl_shm_interface);
- }
- else if (!strcmp(interface, "wl_output"))
- {
- _ecore_wl_output =
- wl_display_bind(_ecore_wl_disp, id, &wl_output_interface);
- wl_output_add_listener(_ecore_wl_output,
- &_ecore_wl_output_listener, NULL);
- }
- else if (!strcmp(interface, "wl_shell"))
- {
- _ecore_wl_shell =
- wl_display_bind(_ecore_wl_disp, id, &wl_shell_interface);
- }
- else if (!strcmp(interface, "wl_input_device"))
- {
- _ecore_wl_input_dev =
- wl_display_bind(_ecore_wl_disp, id, &wl_input_device_interface);
- wl_input_device_add_listener(_ecore_wl_input_dev,
- &_ecore_wl_input_listener, NULL);
- }
- else if (!strcmp(interface, "wl_data_device_manager"))
- {
- _ecore_wl_data_manager =
- wl_display_bind(_ecore_wl_disp, id,
- &wl_data_device_manager_interface);
- }
-
- if ((_ecore_wl_input_dev) && (_ecore_wl_data_manager) && (!_ecore_wl_data_dev))
- {
- _ecore_wl_data_dev =
- wl_data_device_manager_get_data_device(_ecore_wl_data_manager,
- _ecore_wl_input_dev);
- wl_data_device_add_listener(_ecore_wl_data_dev,
- &_ecore_wl_data_listener, NULL);
- }
-}
-
static int
-_ecore_wl_cb_disp_event_mask_update(uint32_t mask, void *data __UNUSED__)
+_ecore_wl_cb_event_mask_update(unsigned int mask, void *data)
{
-// LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ Ecore_Wl_Display *ewd;
- _ecore_wl_disp_mask = mask;
+// LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ewd = data;
+ ewd->mask = mask;
return 0;
}
-static 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__)
-{
- _ecore_wl_screen.x = x;
- _ecore_wl_screen.y = y;
-}
-
-static 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__)
-{
- if (flags & WL_OUTPUT_MODE_CURRENT)
- {
- _ecore_wl_screen.w = w;
- _ecore_wl_screen.h = h;
- }
-}
-
static Eina_Bool
-_ecore_wl_cb_fd_handle(void *data, Ecore_Fd_Handler *hdl __UNUSED__)
+_ecore_wl_cb_handle_data(void *data, Ecore_Fd_Handler *hdl __UNUSED__)
{
- struct wl_display *disp;
+ Ecore_Wl_Display *ewd;
-// LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (!(disp = data)) return ECORE_CALLBACK_RENEW;
- if (disp != _ecore_wl_disp) return ECORE_CALLBACK_RENEW;
-
- if (_ecore_wl_disp_mask & WL_DISPLAY_WRITABLE)
- wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_WRITABLE);
-
- if (_ecore_wl_disp_mask & WL_DISPLAY_READABLE)
- wl_display_iterate(_ecore_wl_disp, WL_DISPLAY_READABLE);
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!(ewd = data)) return ECORE_CALLBACK_RENEW;
+ wl_display_iterate(ewd->wl.display, ewd->mask);
return ECORE_CALLBACK_RENEW;
}
static 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)
+_ecore_wl_cb_handle_global(struct wl_display *disp, unsigned int id, const char *interface, unsigned int version __UNUSED__, void *data)
{
- if (dev != _ecore_wl_input_dev) return;
-
- _ecore_wl_screen_x = x;
- _ecore_wl_screen_y = y;
- _ecore_wl_surface_x = sx;
- _ecore_wl_surface_y = sy;
+ Ecore_Wl_Display *ewd;
- _ecore_wl_mouse_move_send(t);
-}
-
-static void
-_ecore_wl_cb_handle_button(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t, uint32_t btn, uint32_t state)
-{
- if (dev != _ecore_wl_input_dev) return;
-
- if ((btn >= BTN_SIDE) && (btn <= BTN_BACK))
- {
- Ecore_Event_Mouse_Wheel *ev;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return;
-
- ev->timestamp = t;
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
- ev->direction = 0;
-
- if (_ecore_wl_input_surface)
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_input_surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
- }
-
- /* NB: (FIXME) Currently Wayland provides no measure of how much the
- * wheel has scrolled (read: delta of movement). So for now, we will
- * just assume that the amount scrolled is 1 */
- if ((btn == BTN_EXTRA) || (btn == BTN_FORWARD)) // down
- ev->z = 1;
- else if ((btn == BTN_SIDE) || (btn == BTN_BACK)) // up
- ev->z = -1;
-
- ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
- }
- else
- {
- if (state)
- {
- _ecore_wl_input_button = btn;
- if (_ecore_wl_input_surface)
- _ecore_wl_mouse_down_send(_ecore_wl_input_surface, btn, t);
- /* NB: Ideally, this is not the place to check for drags.
- * IMO, drags should be handled by the client. EG: we raise the
- * mouse_down to the client, and the client can 'request' a
- * drag_start from ecore_wl */
- if ((_ecore_wl_input_surface) || (_ecore_wl_touch_surface))
- {
- /* record item which was grabbed.
- * create drag source. start drag */
- }
- }
- else
- {
- if ((_ecore_wl_input_surface) || (_ecore_wl_touch_surface))
- {
- /* release grabbed button and finish drag */
- if ((_ecore_wl_input_button) &&
- (_ecore_wl_input_button == btn))
- {
-
- }
- }
- _ecore_wl_input_button = 0;
- if (_ecore_wl_input_surface)
- _ecore_wl_mouse_up_send(_ecore_wl_input_surface, btn, t);
- }
- }
-}
-
-static void
-_ecore_wl_cb_handle_key(void *data __UNUSED__, struct wl_input_device *dev, uint32_t t __UNUSED__, uint32_t key, uint32_t state)
-{
- unsigned int keycode = 0;
-
- if (dev != _ecore_wl_input_dev) return;
-
- keycode = key + _ecore_wl_xkb->min_key_code;
-
- if (state)
- _ecore_wl_input_modifiers |= _ecore_wl_xkb->map->modmap[keycode];
- else
- _ecore_wl_input_modifiers &= ~_ecore_wl_xkb->map->modmap[keycode];
-}
+// LOGFN(__FILE__, __LINE__, __FUNCTION__);
-static 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)
-{
- if (dev != _ecore_wl_input_dev) return;
-
- /* NB: Wayland pointer focus is weird. It's not pointer focus in the normal
- * sense...Wayland 'moving/resizing' (and maybe other stuff) has a habit
- * of stealing the pointer focus and thus this cannot be used to control
- * normal pointer focus. On mouse down, the 'active' surface is stolen
- * by Wayland for the grab, so 'surface' here ends up being NULL. When a
- * move or resize is finished, we get this event again, but this time
- * with an active surface */
- _ecore_wl_screen_x = x;
- _ecore_wl_screen_y = y;
- _ecore_wl_surface_x = sx;
- _ecore_wl_surface_y = sy;
-
- if ((_ecore_wl_input_surface) && (_ecore_wl_input_surface != surface))
- {
- if (!_ecore_wl_input_button)
- _ecore_wl_mouse_out_send(_ecore_wl_input_surface, t);
- }
+ ewd = data;
- if (surface)
+ if (!strcmp(interface, "wl_compositor"))
+ ewd->wl.compositor = wl_display_bind(disp, id, &wl_compositor_interface);
+ else if (!strcmp(interface, "wl_output"))
+ _ecore_wl_output_add(ewd, id);
+ else if (!strcmp(interface, "wl_input_device"))
+ _ecore_wl_input_add(ewd, id);
+ else if (!strcmp(interface, "wl_shell"))
+ ewd->wl.shell = wl_display_bind(disp, id, &wl_shell_interface);
+ else if (!strcmp(interface, "wl_shm"))
+ ewd->wl.shm = wl_display_bind(disp, id, &wl_shm_interface);
+ else if (!strcmp(interface, "wl_data_device_manager"))
{
- if (_ecore_wl_input_button)
- {
- _ecore_wl_mouse_up_send(surface, _ecore_wl_input_button, t);
- _ecore_wl_input_button = 0;
- }
- else
- _ecore_wl_mouse_in_send(surface, t);
+ ewd->wl.data_device_manager =
+ wl_display_bind(disp, id, &wl_data_device_manager_interface);
}
-}
-
-static void
-_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)
-{
- unsigned int *keyend = 0, *i = 0;
-
- if (dev != _ecore_wl_input_dev) return;
-
- /* NB: Remove old keyboard focus */
- if ((_ecore_wl_input_surface) && (_ecore_wl_input_surface != surface))
- _ecore_wl_focus_out_send(_ecore_wl_input_surface, t);
-
- _ecore_wl_input_surface = NULL;
-
- keyend = keys->data + keys->size;
- _ecore_wl_input_modifiers = 0;
- for (i = keys->data; i < keyend; i++)
- _ecore_wl_input_modifiers |= _ecore_wl_xkb->map->modmap[*i];
- if (surface)
+ if ((ewd->wl.compositor) && (ewd->wl.shm) && (ewd->wl.shell))
{
- /* set new input surface */
- _ecore_wl_input_surface = surface;
+ Ecore_Wl_Event_Interfaces_Bound *ev;
- /* send mouse in to new surface */
- /* _ecore_wl_mouse_in_send(surface, t); */
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Interfaces_Bound))))
+ return;
- /* send focus to new surface */
- _ecore_wl_focus_in_send(surface, t);
- }
-}
-
-static 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)
-{
- Ecore_Event_Mouse_Button *ev;
+ ev->compositor = (ewd->wl.compositor != NULL);
+ ev->shm = (ewd->wl.shm != NULL);
+ ev->shell = (ewd->wl.shell != NULL);
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- _ecore_wl_touch_surface = surface;
- _ecore_wl_touch_x = x;
- _ecore_wl_touch_y = y;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
-
- ev->timestamp = timestamp;
-
- /* NB: Need to verify using x,y for these */
- ev->x = x;
- ev->y = y;
- ev->root.x = x;
- ev->root.y = y;
- ev->modifiers = 0;
- ev->buttons = 0;
- ev->same_screen = 1;
-
- /* FIXME: Need to get these from Wayland somehow */
- ev->double_click = 0;
- ev->triple_click = 0;
-
- ev->multi.device = id;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
- /* NB: Need to verify using x,y for these */
- ev->multi.x = x;
- ev->multi.y = y;
- ev->multi.root.x = x;
- ev->multi.root.y = y;
-
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
+ ecore_event_add(ECORE_WL_EVENT_INTERFACES_BOUND, ev, NULL, NULL);
}
-
- ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
}
-static void
-_ecore_wl_cb_handle_touch_up(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__, uint32_t timestamp, int32_t id)
-{
- Ecore_Event_Mouse_Button *ev;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
-
- ev->timestamp = timestamp;
-
- /* TODO: Need to verify using x,y for these */
- ev->x = _ecore_wl_touch_x;
- ev->y = _ecore_wl_touch_y;
- ev->root.x = _ecore_wl_touch_x;
- ev->root.y = _ecore_wl_touch_y;
- ev->modifiers = 0;
- ev->buttons = 0;
- ev->same_screen = 1;
-
- /* FIXME: Need to get these from Wayland somehow */
- ev->double_click = 0;
- ev->triple_click = 0;
-
- ev->multi.device = id;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
-
- /* TODO: Need to verify using x,y for these */
- ev->multi.x = _ecore_wl_touch_x;
- ev->multi.y = _ecore_wl_touch_y;
- ev->multi.root.x = _ecore_wl_touch_x;
- ev->multi.root.y = _ecore_wl_touch_y;
-
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_touch_surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
- }
-
- _ecore_wl_touch_surface = NULL;
-
- ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
-}
-
-static 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)
+static Eina_Bool
+_ecore_wl_xkb_init(Ecore_Wl_Display *ewd)
{
- Ecore_Event_Mouse_Move *ev;
+ struct xkb_rule_names names;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!_ecore_wl_touch_surface) return;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Move)))) return;
-
- ev->timestamp = timestamp;
- /* TODO: Need to verify using x,y for these */
- ev->x = x;
- ev->y = y;
- ev->root.x = x;
- ev->root.y = y;
- ev->modifiers = 0; //_ecore_wl_input_modifiers;
- ev->same_screen = 1;
-
- ev->multi.device = id;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
-
- /* TODO: Need to verify using x,y for these */
- ev->multi.x = x;
- ev->multi.y = y;
- ev->multi.root.x = x;
- ev->multi.root.y = y;
+ names.rules = "evdev";
+ names.model = "evdev";
+ names.layout = "us";
+ names.variant = "";
+ names.options = "";
+ if (!(ewd->xkb = xkb_compile_keymap_from_rules(&names)))
{
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_touch_surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
+ ERR("Failed to compile keymap");
+ return EINA_FALSE;
}
- ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+ return EINA_TRUE;
}
-static void
-_ecore_wl_cb_handle_touch_frame(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- /* FIXME: Need to get a device and actually test what happens here */
-}
-
-static void
-_ecore_wl_cb_handle_touch_cancel(void *data __UNUSED__, struct wl_input_device *dev __UNUSED__)
-{
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- /* FIXME: Need to get a device and actually test what happens here */
- _ecore_wl_touch_surface = NULL;
-}
-
-static void
-_ecore_wl_cb_source_target(void *data, struct wl_data_source *source __UNUSED__, const char *mime_type __UNUSED__)
-{
- Ecore_Wl_Drag_Source *s;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- printf("Ecore_Wl Source Target\n");
- if (!(s = data)) return;
- printf("\tHave Drag Source\n");
-
- /* FIXME: buffer here should really be the mouse cursor buffer */
- wl_data_device_attach(s->data_dev, s->timestamp, s->buffer,
- s->hotspot_x, s->hotspot_y);
-}
-
-static void
-_ecore_wl_cb_source_send(void *data, struct wl_data_source *source, const char *mime_type, int32_t fd)
-{
- Ecore_Wl_Drag_Source *s;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
-
- printf("Ecore_Wl Source Send\n");
- if (!(s = data)) return;
- printf("\tHave Drag Source\n");
-
- /* FIXME: write message to fd */
-
- /* NB: Wayland really sucks in this regard. Why should selection stuff
- * require an 'fd' ?? */
-}
-
-static void
-_ecore_wl_cb_source_cancelled(void *data, struct wl_data_source *source __UNUSED__)
+static Eina_Bool
+_ecore_wl_xkb_shutdown(Ecore_Wl_Display *ewd)
{
- Ecore_Wl_Drag_Source *s;
-
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- /* The cancelled event usually means source is no longer in use by
- * the drag (or selection). */
-
- printf("Ecore_Wl Source Cancel\n");
- if (!(s = data)) return;
- printf("\tHave Drag Source\n");
-
- /* FIXME: raise this to ecore_evas so the surface/buffer
- * of the drag can be destroyed */
-
- if (s->data_source) wl_data_source_destroy(s->data_source);
- s->data_source = NULL;
-
- free(s);
-}
-
-static void
-_ecore_wl_cb_source_offer(void *data, struct wl_data_offer *offer __UNUSED__, const char *type)
-{
- Ecore_Wl_Dnd_Source *s;
-
- if (!(s = data)) return;
- eina_array_push(s->types, strdup(type));
-}
-
-static void
-_ecore_wl_cb_data_offer(void *data, struct wl_data_device *data_dev, uint32_t id)
-{
- Ecore_Wl_Dnd_Source *source;
-
- /* create a new 'data offer' structure and setup a listener for it */
- if (!(source = calloc(1, sizeof(Ecore_Wl_Dnd_Source)))) return;
-
- source->types = eina_array_new(1);
- source->data = data;
- source->refs = 1;
-
- /* FIXME: This will need to change when Wayland has typesafe wrappers for this */
- source->offer = (struct wl_data_offer *)
- wl_proxy_create_for_id((struct wl_proxy *)data_dev,
- id, &wl_data_offer_interface);
-
- wl_data_device_set_user_data(data_dev, source);
- wl_data_offer_add_listener(source->offer, &_ecore_wl_offer_listener, source);
-}
-
-static 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)
-{
- Ecore_Wl_Dnd_Source *source;
-
- if (!(source = wl_data_device_get_user_data(data_dev))) return;
-
- /* TODO: maybe set pointer focus here ?? */
-
- source->timestamp = timestamp;
-}
-
-static void
-_ecore_wl_cb_data_leave(void *data __UNUSED__, struct wl_data_device *data_dev)
-{
- Ecore_Wl_Dnd_Source *source;
-
- if (!(source = wl_data_device_get_user_data(data_dev))) return;
-
- /* destroy drag offer */
- wl_data_offer_destroy(source->offer);
-
- while (eina_array_count(source->types))
- free(eina_array_pop(source->types));
-
- eina_array_free(source->types);
- free(source);
-
- wl_data_device_set_user_data(data_dev, NULL);
-}
-
-static void
-_ecore_wl_cb_data_motion(void *data __UNUSED__, struct wl_data_device *data_dev, uint32_t timestamp, int32_t x, int32_t y)
-{
- Ecore_Wl_Dnd_Source *source;
-
- if (!(source = wl_data_device_get_user_data(data_dev))) return;
- /* TODO: Here we should raise motion events for dragging */
-}
-
-static void
-_ecore_wl_cb_data_drop(void *data __UNUSED__, struct wl_data_device *data_dev)
-{
- Ecore_Wl_Dnd_Source *source;
-
- if (!(source = wl_data_device_get_user_data(data_dev))) return;
-
- /* TODO: Raise event for drop */
-
- wl_data_offer_accept(source->offer, source->timestamp, NULL);
-// eina_array_data_get(source->types, 0));
-}
-
-static void
-_ecore_wl_cb_data_selection(void *data, struct wl_data_device *data_dev, struct wl_data_offer *offer)
-{
- Ecore_Wl_Dnd_Source *source;
-
- printf("Ecore_Wl Data Selection\n");
- if ((source = wl_data_device_get_user_data(data_dev)))
- {
- /* destroy old source */
- wl_data_offer_destroy(source->offer);
-
- while (eina_array_count(source->types))
- free(eina_array_pop(source->types));
-
- eina_array_free(source->types);
- free(source);
-
- wl_data_device_set_user_data(data_dev, NULL);
- }
-}
-
-static void
-_ecore_wl_mouse_move_send(uint32_t timestamp)
-{
- Ecore_Event_Mouse_Move *ev;
-
-// if (!_ecore_wl_input_surface) return;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Move)))) return;
-
- ev->timestamp = timestamp;
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
-
- ev->multi.device = 0;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
- ev->multi.x = _ecore_wl_surface_x;
- ev->multi.y = _ecore_wl_surface_y;
- ev->multi.root.x = _ecore_wl_screen_x;
- ev->multi.root.y = _ecore_wl_screen_y;
-
- {
- unsigned int id = 0;
-
- if (_ecore_wl_input_surface)
- {
- if ((id = (unsigned int)wl_surface_get_user_data(_ecore_wl_input_surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
- }
- }
-
- ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_mouse_out_send(struct wl_surface *surface, uint32_t timestamp)
-{
- Ecore_Wl_Event_Mouse_Out *ev;
-
- if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_Out)))) return;
-
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
- ev->time = timestamp;
-
- if (surface)
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- ev->window = id;
- }
-
- ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_mouse_in_send(struct wl_surface *surface, uint32_t timestamp)
-{
- Ecore_Wl_Event_Mouse_In *ev;
-
- if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_In)))) return;
-
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
- ev->time = timestamp;
-
- if (surface)
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- ev->window = id;
- }
-
- ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_mouse_up_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp)
-{
- Ecore_Event_Mouse_Button *ev;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
-
- if (button == BTN_LEFT)
- ev->buttons = 1;
- else if (button == BTN_MIDDLE)
- ev->buttons = 2;
- else if (button == BTN_RIGHT)
- ev->buttons = 3;
-
- ev->timestamp = timestamp;
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
-
- /* FIXME: Need to get these from Wayland somehow */
- ev->double_click = 0;
- ev->triple_click = 0;
-
- ev->multi.device = 0;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
- ev->multi.x = _ecore_wl_surface_x;
- ev->multi.y = _ecore_wl_surface_y;
- ev->multi.root.x = _ecore_wl_screen_x;
- ev->multi.root.y = _ecore_wl_screen_y;
-
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
- }
-
- ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_mouse_down_send(struct wl_surface *surface, uint32_t button, uint32_t timestamp)
-{
- Ecore_Event_Mouse_Button *ev;
-
- if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
-
- if (button == BTN_LEFT)
- ev->buttons = 1;
- else if (button == BTN_MIDDLE)
- ev->buttons = 2;
- else if (button == BTN_RIGHT)
- ev->buttons = 3;
-
- ev->timestamp = timestamp;
- ev->x = _ecore_wl_surface_x;
- ev->y = _ecore_wl_surface_y;
- ev->root.x = _ecore_wl_screen_x;
- ev->root.y = _ecore_wl_screen_y;
- ev->modifiers = _ecore_wl_input_modifiers;
-
- /* FIXME: Need to get these from Wayland somehow */
- ev->double_click = 0;
- ev->triple_click = 0;
-
- ev->multi.device = 0;
- ev->multi.radius = 1;
- ev->multi.radius_x = 1;
- ev->multi.radius_y = 1;
- ev->multi.pressure = 1.0;
- ev->multi.angle = 0.0;
- ev->multi.x = _ecore_wl_surface_x;
- ev->multi.y = _ecore_wl_surface_y;
- ev->multi.root.x = _ecore_wl_screen_x;
- ev->multi.root.y = _ecore_wl_screen_y;
-
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- {
- ev->window = id;
- ev->event_window = id;
- }
- }
-
- ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_focus_out_send(struct wl_surface *surface, uint32_t timestamp)
-{
- Ecore_Wl_Event_Focus_Out *ev;
-
- if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_Out)))) return;
- ev->time = timestamp;
- if (surface)
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- ev->window = id;
- }
- ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
-}
-
-static void
-_ecore_wl_focus_in_send(struct wl_surface *surface, uint32_t timestamp)
-{
- Ecore_Wl_Event_Focus_In *ev;
-
- if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_In)))) return;
- ev->time = timestamp;
- if (surface)
- {
- unsigned int id = 0;
-
- if ((id = (unsigned int)wl_surface_get_user_data(surface)))
- ev->window = id;
- }
- ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
+ if (ewd->xkb) xkb_free_keymap(ewd->xkb);
+ return EINA_TRUE;
}
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "ecore_wl_private.h"
+#include "Ecore_Wayland.h"
+
+/* local function prototypes */
+static void _ecore_wl_dnd_offer(void *data, struct wl_data_offer *wl_data_offer __UNUSED__, const char *type);
+static void _ecore_wl_dnd_cb_enter_free(void *data __UNUSED__, void *event);
+
+/* wayland listeners */
+static const struct wl_data_offer_listener _ecore_wl_data_offer_listener =
+{
+ _ecore_wl_dnd_offer,
+};
+
+void
+_ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device, unsigned int id)
+{
+ Ecore_Wl_Dnd_Source *source;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(source = malloc(sizeof(Ecore_Wl_Dnd_Source)))) return;
+ wl_array_init(&source->types);
+ source->refcount = 1;
+ source->input = input;
+ /* FIXME: Change this when wayland has typesafe wrapper for it */
+ source->offer = (struct wl_data_offer *)
+ wl_proxy_create_for_id((struct wl_proxy *)data_device,
+ id, &wl_data_offer_interface);
+ wl_data_offer_add_listener(source->offer,
+ &_ecore_wl_data_offer_listener, source);
+}
+
+void
+_ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer)
+{
+ Ecore_Wl_Event_Dnd_Enter *event;
+ Ecore_Wl_Input *input;
+ Ecore_Wl_Window *win;
+ char **p;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ input->drag_source = wl_data_offer_get_user_data(offer);
+
+ win = wl_surface_get_user_data(surface);
+// input->pointer_focus = win;
+
+ p = wl_array_add(&input->drag_source->types, sizeof(*p));
+ *p = NULL;
+
+ if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Enter)))) return;
+
+ event->win = win->id;
+ event->source = input->drag_source->input->keyboard_focus->id;
+ event->position.x = x;
+ event->position.y = y;
+ event->num_types = input->drag_source->types.size;
+ event->types = input->drag_source->types.data;
+
+ ecore_event_add(ECORE_WL_EVENT_DND_ENTER, event,
+ _ecore_wl_dnd_cb_enter_free, NULL);
+}
+
+void
+_ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device __UNUSED__)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+ _ecore_wl_dnd_del(input->drag_source);
+ input->drag_source = NULL;
+}
+
+void
+_ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, int x, int y)
+{
+ Ecore_Wl_Event_Dnd_Position *event;
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ input->sx = x;
+ input->sy = y;
+
+ if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Position)))) return;
+
+ event->win = input->drag_source->input->pointer_focus->id;
+ event->source = input->drag_source->input->keyboard_focus->id;
+ event->position.x = x;
+ event->position.y = y;
+
+ ecore_event_add(ECORE_WL_EVENT_DND_POSITION, event, NULL, NULL);
+}
+
+void
+_ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device __UNUSED__)
+{
+ Ecore_Wl_Event_Dnd_Drop *event;
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Dnd_Drop)))) return;
+
+ event->win = input->drag_source->input->pointer_focus->id;
+ event->source = input->drag_source->input->keyboard_focus->id;
+ event->position.x = input->sx;
+ event->position.y = input->sy;
+
+ ecore_event_add(ECORE_WL_EVENT_DND_DROP, event, NULL, NULL);
+}
+
+void
+_ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device __UNUSED__, struct wl_data_offer *offer)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+ if (input->selection_source) _ecore_wl_dnd_del(input->selection_source);
+ input->selection_source = NULL;
+ if (offer)
+ {
+ char **p;
+
+ input->selection_source = wl_data_offer_get_user_data(offer);
+ p = wl_array_add(&input->selection_source->types, sizeof(*p));
+ *p = NULL;
+ }
+}
+
+void
+_ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!source) return;
+ source->refcount--;
+ if (source->refcount == 0)
+ {
+ char **p;
+
+ wl_data_offer_destroy(source->offer);
+ for (p = source->types.data; *p; p++)
+ free(*p);
+ wl_array_release(&source->types);
+ free(source);
+ }
+}
+
+/* local functions */
+static void
+_ecore_wl_dnd_offer(void *data, struct wl_data_offer *wl_data_offer __UNUSED__, const char *type)
+{
+ Ecore_Wl_Dnd_Source *source;
+ char **p;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(source = data)) return;
+ p = wl_array_add(&source->types, sizeof(*p));
+ *p = strdup(type);
+}
+
+static void
+_ecore_wl_dnd_cb_enter_free(void *data __UNUSED__, void *event)
+{
+ Ecore_Wl_Event_Dnd_Enter *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = event)) return;
+ free(ev);
+}
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "Ecore_Input.h"
+#include "ecore_wl_private.h"
+#include "Ecore_Wayland.h"
+
+/* FIXME: This gives BTN_LEFT/RIGHT/MIDDLE for linux systems ...
+ * What about other OSs ?? */
+#ifdef __linux__
+# include <linux/input.h>
+#else
+# define BTN_LEFT 0x110
+# define BTN_RIGHT 0x111
+# define BTN_MIDDLE 0x112
+# define BTN_SIDE 0x113
+# define BTN_EXTRA 0x114
+# define BTN_FORWARD 0x115
+# define BTN_BACK 0x116
+#endif
+
+/* local function prototypes */
+static void _ecore_wl_input_cb_motion(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int sx, int sy);
+static void _ecore_wl_input_cb_button(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, unsigned int button, unsigned int state);
+static void _ecore_wl_input_cb_axis(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, unsigned int axis, int value);
+static void _ecore_wl_input_cb_key(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp __UNUSED__, unsigned int key, unsigned int state);
+static void _ecore_wl_input_cb_pointer_enter(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface, int sx, int sy);
+static void _ecore_wl_input_cb_pointer_leave(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__);
+static void _ecore_wl_input_cb_keyboard_enter(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface, struct wl_array *keys);
+static void _ecore_wl_input_cb_keyboard_leave(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__);
+static void _ecore_wl_input_cb_touch_down(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__, int id __UNUSED__, int x, int y);
+static void _ecore_wl_input_cb_touch_up(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int id __UNUSED__);
+static void _ecore_wl_input_cb_touch_motion(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int id __UNUSED__, int x, int y);
+static void _ecore_wl_input_cb_touch_frame(void *data __UNUSED__, struct wl_input_device *input_device __UNUSED__);
+static void _ecore_wl_input_cb_touch_cancel(void *data __UNUSED__, struct wl_input_device *input_device __UNUSED__);
+static void _ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, unsigned int id);
+static void _ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer);
+static void _ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device);
+static void _ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, int x, int y);
+static void _ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device);
+static void _ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer);
+
+static void _ecore_wl_input_keyboard_focus_remove(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_pointer_focus_remove(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_focus_in_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_focus_out_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, unsigned int timestamp);
+static void _ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp);
+
+/* wayland interfaces */
+static const struct wl_input_device_listener _ecore_wl_input_listener =
+{
+ _ecore_wl_input_cb_motion,
+ _ecore_wl_input_cb_button,
+ _ecore_wl_input_cb_axis,
+ _ecore_wl_input_cb_key,
+ _ecore_wl_input_cb_pointer_enter,
+ _ecore_wl_input_cb_pointer_leave,
+ _ecore_wl_input_cb_keyboard_enter,
+ _ecore_wl_input_cb_keyboard_leave,
+ _ecore_wl_input_cb_touch_down,
+ _ecore_wl_input_cb_touch_up,
+ _ecore_wl_input_cb_touch_motion,
+ _ecore_wl_input_cb_touch_frame,
+ _ecore_wl_input_cb_touch_cancel
+};
+
+static const struct wl_data_device_listener _ecore_wl_data_listener =
+{
+ _ecore_wl_input_cb_data_offer,
+ _ecore_wl_input_cb_data_enter,
+ _ecore_wl_input_cb_data_leave,
+ _ecore_wl_input_cb_data_motion,
+ _ecore_wl_input_cb_data_drop,
+ _ecore_wl_input_cb_data_selection
+};
+
+/* local variables */
+static int _pointer_x, _pointer_y;
+
+EAPI void
+ecore_wl_input_grab(Ecore_Wl_Input *input, Ecore_Wl_Window *win, unsigned int button)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ input->grab = win;
+ input->grab_button = button;
+}
+
+EAPI void
+ecore_wl_input_ungrab(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ input->grab = NULL;
+ if (input->pointer_focus)
+ {
+ printf("Ungrab: %d\n", timestamp);
+ }
+}
+
+void
+_ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = malloc(sizeof(Ecore_Wl_Input)))) return;
+
+ memset(input, 0, sizeof(Ecore_Wl_Input));
+
+ input->display = ewd;
+ input->pointer_focus = NULL;
+ input->keyboard_focus = NULL;
+
+ input->input_device =
+ wl_display_bind(ewd->wl.display, id, &wl_input_device_interface);
+ wl_list_insert(ewd->inputs.prev, &input->link);
+ wl_input_device_add_listener(input->input_device,
+ &_ecore_wl_input_listener, input);
+ wl_input_device_set_user_data(input->input_device, input);
+
+ input->data_device =
+ wl_data_device_manager_get_data_device(ewd->wl.data_device_manager,
+ input->input_device);
+ wl_data_device_add_listener(input->data_device,
+ &_ecore_wl_data_listener, input);
+ ewd->input = input;
+}
+
+void
+_ecore_wl_input_del(Ecore_Wl_Input *input)
+{
+ if (!input) return;
+
+ _ecore_wl_input_keyboard_focus_remove(input, 0);
+ _ecore_wl_input_pointer_focus_remove(input, 0);
+
+ if (input->drag_source) _ecore_wl_dnd_del(input->drag_source);
+ input->drag_source = NULL;
+
+ if (input->selection_source) _ecore_wl_dnd_del(input->selection_source);
+ input->selection_source = NULL;
+
+ if (input->data_device) wl_data_device_destroy(input->data_device);
+ if (input->input_device) wl_input_device_destroy(input->input_device);
+ wl_list_remove(&input->link);
+ free(input);
+}
+
+void
+_ecore_wl_input_pointer_xy_get(int *x, int *y)
+{
+ if (x) *x = _pointer_x;
+ if (y) *y = _pointer_y;
+}
+
+/* local functions */
+static void
+_ecore_wl_input_cb_motion(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int sx, int sy)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ _pointer_x = sx;
+ _pointer_y = sy;
+
+ input->sx = sx;
+ input->sy = sy;
+
+ /* TODO: FIXME: NB: Weston window code has set pointer image here also */
+ _ecore_wl_input_mouse_move_send(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_button(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, unsigned int button, unsigned int state)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ input->timestamp = timestamp;
+
+ if ((input->pointer_focus) && (!input->grab) && (state))
+ ecore_wl_input_grab(input, input->pointer_focus, button);
+
+// _ecore_wl_input_mouse_move_send(input, timestamp);
+
+ if ((button >= BTN_SIDE) && (button <= BTN_BACK))
+ {
+ /* TODO: raise mouse wheel */
+ printf("Raise Mouse Wheel Event\n");
+ }
+ else
+ {
+ if (state)
+ {
+ input->button = button;
+ _ecore_wl_input_mouse_down_send(input, timestamp);
+ }
+ else
+ {
+ _ecore_wl_input_mouse_up_send(input, timestamp);
+ input->button = 0;
+
+ if ((input->grab) && (input->grab_button == button))
+ ecore_wl_input_ungrab(input, timestamp);
+ }
+ }
+}
+
+static void
+_ecore_wl_input_cb_axis(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, unsigned int axis, int value)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+ _ecore_wl_input_mouse_wheel_send(input, axis, value, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_key(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp __UNUSED__, unsigned int key, unsigned int state)
+{
+ Ecore_Wl_Input *input;
+ Ecore_Wl_Window *win;
+ unsigned int keycode = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ win = input->keyboard_focus;
+ if ((!win) || (win->keyboard_device != input)) return;
+
+ /* FIXME: NB: I believe this should be min_key_code rather than 8,
+ * but weston code has it like this */
+ keycode = key + 8;
+
+ /* if ((input->modifiers & XKB_COMMON_SHIFT_MASK) && */
+ /* (XkbKeyGroupWidth(_ecore_wl_disp->xkb, keycode, 0) > 1)) */
+ /* level = 1; */
+ /* keysym = XkbKeySymEntry(_ecore_wl_disp->xkb, keycode, level, 0); */
+
+ if (state)
+ input->modifiers |= _ecore_wl_disp->xkb->map->modmap[keycode];
+ else
+ input->modifiers &= ~_ecore_wl_disp->xkb->map->modmap[keycode];
+}
+
+static void
+_ecore_wl_input_cb_pointer_enter(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface, int sx, int sy)
+{
+ Ecore_Wl_Input *input;
+ Ecore_Wl_Window *win = NULL;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ /* _pointer_x = sx; */
+ /* _pointer_y = sy; */
+
+ /* input->sx = sx; */
+ /* input->sy = sy; */
+
+// _ecore_wl_input_mouse_move_send(input, timestamp);
+
+ win = input->pointer_focus;
+ if ((win) && (win->surface != surface))
+ {
+ if (!input->button)
+ _ecore_wl_input_pointer_focus_remove(input, timestamp);
+ }
+
+ if (surface)
+ {
+ if ((win = wl_surface_get_user_data(surface)))
+ {
+ input->pointer_focus = win;
+ win->pointer_device = input;
+ }
+ /* if (input->button) */
+ /* { */
+ /* _ecore_wl_input_mouse_up_send(input, timestamp); */
+ /* input->button = 0; */
+ /* } */
+ /* else */
+ _ecore_wl_input_mouse_in_send(input, timestamp);
+ }
+}
+
+static void
+_ecore_wl_input_cb_pointer_leave(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+ _ecore_wl_input_pointer_focus_remove(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_keyboard_enter(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface, struct wl_array *keys)
+{
+ Ecore_Wl_Input *input;
+ Ecore_Wl_Window *win = NULL;
+ unsigned int *k, *end;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ end = keys->data + keys->size;
+ input->modifiers = 0;
+ for (k = keys->data; k < end; k++)
+ input->modifiers |= _ecore_wl_disp->xkb->map->modmap[*k];
+
+ if (surface)
+ {
+ if ((win = wl_surface_get_user_data(surface)))
+ {
+ input->keyboard_focus = win;
+ win->keyboard_device = input;
+ }
+ else
+ input->keyboard_focus = NULL;
+ _ecore_wl_input_focus_in_send(input, timestamp);
+ }
+}
+
+static void
+_ecore_wl_input_cb_keyboard_leave(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+ _ecore_wl_input_keyboard_focus_remove(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_touch_down(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, struct wl_surface *surface __UNUSED__, int id __UNUSED__, int x, int y)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ /* FIXME: NB: Not sure yet if input->timestamp should be set here.
+ * This needs to be tested with an actual touch device */
+ /* input->timestamp = timestamp; */
+ input->button = 0;
+ input->sx = x;
+ input->sy = y;
+ _ecore_wl_input_mouse_down_send(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_touch_up(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int id __UNUSED__)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ /* FIXME: NB: Not sure yet if input->timestamp should be set here.
+ * This needs to be tested with an actual touch device */
+ /* input->timestamp = timestamp; */
+ input->button = 0;
+ _ecore_wl_input_mouse_up_send(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_touch_motion(void *data, struct wl_input_device *input_device __UNUSED__, unsigned int timestamp, int id __UNUSED__, int x, int y)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(input = data)) return;
+
+ /* FIXME: NB: Not sure yet if input->timestamp should be set here.
+ * This needs to be tested with an actual touch device */
+ /* input->timestamp = timestamp; */
+ input->sx = x;
+ input->sy = y;
+
+ _ecore_wl_input_mouse_move_send(input, timestamp);
+}
+
+static void
+_ecore_wl_input_cb_touch_frame(void *data __UNUSED__, struct wl_input_device *input_device __UNUSED__)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+}
+
+static void
+_ecore_wl_input_cb_touch_cancel(void *data __UNUSED__, struct wl_input_device *input_device __UNUSED__)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+}
+
+static void
+_ecore_wl_input_cb_data_offer(void *data, struct wl_data_device *data_device, unsigned int id)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_add(data, data_device, id);
+}
+
+static void
+_ecore_wl_input_cb_data_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_enter(data, data_device, timestamp, surface, x, y, offer);
+}
+
+static void
+_ecore_wl_input_cb_data_leave(void *data, struct wl_data_device *data_device)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_leave(data, data_device);
+}
+
+static void
+_ecore_wl_input_cb_data_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, int x, int y)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_motion(data, data_device, timestamp, x, y);
+}
+
+static void
+_ecore_wl_input_cb_data_drop(void *data, struct wl_data_device *data_device)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_drop(data, data_device);
+}
+
+static void
+_ecore_wl_input_cb_data_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_dnd_selection(data, data_device, offer);
+}
+
+static void
+_ecore_wl_input_keyboard_focus_remove(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Window *win;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ _ecore_wl_input_focus_out_send(input, timestamp);
+ if ((win = input->keyboard_focus))
+ win->keyboard_device = NULL;
+ input->keyboard_focus = NULL;
+}
+
+static void
+_ecore_wl_input_pointer_focus_remove(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Window *win;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!input->button)
+ _ecore_wl_input_mouse_out_send(input, timestamp);
+
+ if ((win = input->pointer_focus))
+ win->pointer_device = NULL;
+
+ input->pointer_focus = NULL;
+}
+
+static void
+_ecore_wl_input_mouse_move_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Event_Mouse_Move *ev;
+// Ecore_Event *event;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Move)))) return;
+
+ ev->timestamp = timestamp;
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+ ev->modifiers = input->modifiers;
+ ev->multi.device = 0;
+ ev->multi.radius = 1;
+ ev->multi.radius_x = 1;
+ ev->multi.radius_y = 1;
+ ev->multi.pressure = 1.0;
+ ev->multi.angle = 0.0;
+ ev->multi.x = input->sx;
+ ev->multi.y = input->sy;
+
+ if (input->grab)
+ {
+ ev->window = input->grab->id;
+ ev->event_window = input->grab->id;
+ }
+ else if (input->pointer_focus)
+ {
+ ev->window = input->pointer_focus->id;
+ ev->event_window = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_EVENT_MOUSE_MOVE, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_mouse_in_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Event_Mouse_In *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_In)))) return;
+
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+ ev->modifiers = input->modifiers;
+ ev->timestamp = timestamp;
+
+ if (input->pointer_focus)
+ {
+ ev->win = input->pointer_focus->id;
+ ev->event_win = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_WL_EVENT_MOUSE_IN, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_mouse_out_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Event_Mouse_Out *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Mouse_Out)))) return;
+
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+ ev->modifiers = input->modifiers;
+ ev->timestamp = timestamp;
+
+ if (input->pointer_focus)
+ {
+ ev->win = input->pointer_focus->id;
+ ev->event_win = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_WL_EVENT_MOUSE_OUT, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_focus_in_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Event_Focus_In *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_In)))) return;
+ ev->timestamp = timestamp;
+ if (input->keyboard_focus)
+ ev->win = input->keyboard_focus->id;
+ ecore_event_add(ECORE_WL_EVENT_FOCUS_IN, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_focus_out_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Wl_Event_Focus_Out *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Focus_Out)))) return;
+ ev->timestamp = timestamp;
+ if (input->keyboard_focus)
+ ev->win = input->keyboard_focus->id;
+ ecore_event_add(ECORE_WL_EVENT_FOCUS_OUT, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_mouse_down_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Event_Mouse_Button *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
+
+ if (input->button == BTN_LEFT)
+ ev->buttons = 1;
+ else if (input->button == BTN_MIDDLE)
+ ev->buttons = 2;
+ else if (input->button == BTN_RIGHT)
+ ev->buttons = 3;
+ else
+ ev->buttons = input->button;
+
+ ev->timestamp = timestamp;
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+ ev->modifiers = input->modifiers;
+
+ /* FIXME: Need to get these from wayland somehow */
+ ev->double_click = 0;
+ ev->triple_click = 0;
+
+ ev->multi.device = 0;
+ ev->multi.radius = 1;
+ ev->multi.radius_x = 1;
+ ev->multi.radius_y = 1;
+ ev->multi.pressure = 1.0;
+ ev->multi.angle = 0.0;
+ ev->multi.x = input->sx;
+ ev->multi.y = input->sy;
+
+ if (input->pointer_focus)
+ {
+ ev->window = input->pointer_focus->id;
+ ev->event_window = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_mouse_up_send(Ecore_Wl_Input *input, unsigned int timestamp)
+{
+ Ecore_Event_Mouse_Button *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Button)))) return;
+
+ if (input->button == BTN_LEFT)
+ ev->buttons = 1;
+ else if (input->button == BTN_MIDDLE)
+ ev->buttons = 2;
+ else if (input->button == BTN_RIGHT)
+ ev->buttons = 3;
+ else
+ ev->buttons = input->button;
+
+ ev->timestamp = timestamp;
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+ ev->modifiers = input->modifiers;
+
+ /* FIXME: Need to get these from wayland somehow */
+ ev->double_click = 0;
+ ev->triple_click = 0;
+
+ ev->multi.device = 0;
+ ev->multi.radius = 1;
+ ev->multi.radius_x = 1;
+ ev->multi.radius_y = 1;
+ ev->multi.pressure = 1.0;
+ ev->multi.angle = 0.0;
+ ev->multi.x = input->sx;
+ ev->multi.y = input->sy;
+
+ if (input->pointer_focus)
+ {
+ ev->window = input->pointer_focus->id;
+ ev->event_window = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_EVENT_MOUSE_BUTTON_UP, ev, NULL, NULL);
+}
+
+static void
+_ecore_wl_input_mouse_wheel_send(Ecore_Wl_Input *input, unsigned int axis, int value, unsigned int timestamp)
+{
+ Ecore_Event_Mouse_Wheel *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = malloc(sizeof(Ecore_Event_Mouse_Wheel)))) return;
+
+ ev->timestamp = timestamp;
+ ev->modifiers = input->modifiers;
+ ev->x = input->sx;
+ ev->y = input->sy;
+ ev->root.x = input->sx;
+ ev->root.y = input->sy;
+
+ if (axis == WL_INPUT_DEVICE_AXIS_VERTICAL_SCROLL)
+ {
+ ev->direction = value;
+ ev->z = 1;
+ }
+ else if (axis == WL_INPUT_DEVICE_AXIS_HORIZONTAL_SCROLL)
+ {
+ /* TODO: handle horizontal scroll */
+ }
+
+ if (input->pointer_focus)
+ {
+ ev->window = input->pointer_focus->id;
+ ev->event_window = input->pointer_focus->id;
+ }
+
+ ecore_event_add(ECORE_EVENT_MOUSE_WHEEL, ev, NULL, NULL);
+}
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "ecore_wl_private.h"
+#include "Ecore_Wayland.h"
+
+/* local function prototypes */
+static void _ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output __UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__);
+static void _ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output __UNUSED__, unsigned int flags, int w, int h, int refresh __UNUSED__);
+
+/* wayland listeners */
+static const struct wl_output_listener _ecore_wl_output_listener =
+{
+ _ecore_wl_output_cb_geometry,
+ _ecore_wl_output_cb_mode
+};
+
+void
+_ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id)
+{
+ Ecore_Wl_Output *output;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(output = malloc(sizeof(Ecore_Wl_Output)))) return;
+
+ memset(output, 0, sizeof(Ecore_Wl_Output));
+
+ output->display = ewd;
+
+ output->output = wl_display_bind(ewd->wl.display, id, &wl_output_interface);
+ wl_list_insert(ewd->outputs.prev, &output->link);
+ wl_output_add_listener(output->output, &_ecore_wl_output_listener, output);
+}
+
+void
+_ecore_wl_output_del(Ecore_Wl_Output *output)
+{
+ if (!output) return;
+ if (output->destroy) (*output->destroy)(output, output->data);
+ if (output->output) wl_output_destroy(output->output);
+ wl_list_remove(&output->link);
+ free(output);
+}
+
+/* local functions */
+static void
+_ecore_wl_output_cb_geometry(void *data, struct wl_output *wl_output __UNUSED__, int x, int y, int w, int h, int subpixel __UNUSED__, const char *make __UNUSED__, const char *model __UNUSED__)
+{
+ Ecore_Wl_Output *output;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ output = data;
+ output->allocation.x = x;
+ output->allocation.y = y;
+ output->mw = w;
+ output->mh = h;
+}
+
+static void
+_ecore_wl_output_cb_mode(void *data, struct wl_output *wl_output __UNUSED__, unsigned int flags, int w, int h, int refresh __UNUSED__)
+{
+ Ecore_Wl_Output *output;
+ Ecore_Wl_Display *ewd;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ output = data;
+ ewd = output->display;
+ if (flags & WL_OUTPUT_MODE_CURRENT)
+ {
+ output->allocation.w = w;
+ output->allocation.h = h;
+ _ecore_wl_disp->output = output;
+ if (ewd->output_configure) (*ewd->output_configure)(output, ewd->data);
+ }
+}
# define _ECORE_WAYLAND_PRIVATE_H
# include <limits.h>
+# include <xkbcommon/xkbcommon.h>
+
+# include "Ecore_Wayland.h"
//# define LOGFNS 1
# endif
extern int _ecore_wl_log_dom;
+extern Ecore_Wl_Display *_ecore_wl_disp;
# ifdef ECORE_WL_DEFAULT_LOG_COLOR
# undef ECORE_WL_DEFAULT_LOG_COLOR
# endif
# define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
-typedef struct _Ecore_Wl_Dnd_Source
+struct _Ecore_Wl_Dnd_Source
{
struct wl_data_offer *offer;
- int refs;
-
- Eina_Array *types;
+ Ecore_Wl_Input *input;
+ struct wl_array types;
+ int refcount;
+ int fd;
+ int x, y;
- uint32_t timestamp;
+ /* TODO: task & data_func */
void *data;
-} Ecore_Wl_Dnd_Source;
+};
-typedef struct _Ecore_Wl_Dnd_Target
+struct _Ecore_Wl_Dnd_Target
{
- /* NB: These are not the real fields for this structure,
- * and it is Bound to change....soon */
- struct wl_data_offer *offer;
- int refs;
-
- Eina_Array *types;
+ Ecore_Wl_Dnd_Source *source;
+};
- uint32_t timestamp;
- void *data;
-} Ecore_Wl_Dnd_Target;
+void _ecore_wl_window_init(void);
+void _ecore_wl_window_shutdown(void);
-struct _Ecore_Wl_Drag_Source
-{
- struct wl_data_device *data_dev;
- struct wl_buffer *buffer;
+void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id);
+void _ecore_wl_output_del(Ecore_Wl_Output *output);
- int32_t hotspot_x, hotspot_y;
- int32_t offset_x, offset_y;
- const char *mimetype;
- uint32_t timestamp;
- void *data;
+void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id);
+void _ecore_wl_input_del(Ecore_Wl_Input *input);
+void _ecore_wl_input_pointer_xy_get(int *x, int *y);
- struct wl_data_source *data_source;
-};
+void _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device, unsigned int id);
+void _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer);
+void _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device __UNUSED__);
+void _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device __UNUSED__, unsigned int timestamp __UNUSED__, int x, int y);
+void _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device __UNUSED__);
+void _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device __UNUSED__, struct wl_data_offer *offer);
+void _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source);
#endif
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "Ecore.h"
+#include "ecore_private.h"
+#include "ecore_wl_private.h"
+#include "Ecore_Wayland.h"
+
+/* local function prototypes */
+static void _ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, unsigned int timestamp, unsigned int edges, int w, int h);
+static void _ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface __UNUSED__);
+static void _ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, unsigned int timestamp);
+
+/* local variables */
+static Eina_Hash *_windows = NULL;
+
+/* wayland listeners */
+static const struct wl_shell_surface_listener _ecore_wl_shell_surface_listener =
+{
+ _ecore_wl_window_cb_configure,
+ _ecore_wl_window_cb_popup_done
+};
+
+/* internal functions */
+void
+_ecore_wl_window_init(void)
+{
+ if (!_windows) _windows = eina_hash_pointer_new(free);
+}
+
+void
+_ecore_wl_window_shutdown(void)
+{
+ eina_hash_free(_windows);
+ _windows = NULL;
+}
+
+/**
+ * @defgroup Ecore_Wl_Window_Group Wayland Library Init and Shutdown Functions
+ *
+ * Functions that can be used to create a Wayland window.
+ */
+
+/**
+ * Creates a new window
+ *
+ * @param parent The parent window to use. If @p parent is @c 0, the root window
+ * of the default display is used.
+ * @param x X Position
+ * @param y Y position
+ * @param w Width
+ * @param h Height
+ *
+ * @return The new window
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI Ecore_Wl_Window *
+ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type)
+{
+ Ecore_Wl_Window *win;
+ static int _win_id = 1;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(win = malloc(sizeof(Ecore_Wl_Window))))
+ {
+ ERR("Failed to allocate an Ecore Wayland Window");
+ return NULL;
+ }
+
+ memset(win, 0, sizeof(Ecore_Wl_Window));
+
+ win->display = _ecore_wl_disp;
+ win->parent = parent;
+ win->allocation.x = x;
+ win->allocation.y = y;
+ win->allocation.w = w;
+ win->allocation.h = h;
+ win->saved_allocation = win->allocation;
+ win->transparent = EINA_FALSE;
+ win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->buffer_type = buffer_type;
+ win->id = _win_id++;
+
+ eina_hash_add(_windows, &win->id, win);
+ return win;
+}
+
+/**
+ * Deletes the given window
+ *
+ * @param win The given window
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_free(Ecore_Wl_Window *win)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+
+ eina_hash_del(_windows, &win->id, NULL);
+
+ wl_list_for_each(input, &_ecore_wl_disp->inputs, link)
+ {
+ if ((input->pointer_focus) && (input->pointer_focus == win))
+ input->pointer_focus = NULL;
+ if ((input->keyboard_focus) && (input->keyboard_focus == win))
+ input->keyboard_focus = NULL;
+ }
+
+ if (win->region.input) wl_region_destroy(win->region.input);
+ if (win->region.opaque) wl_region_destroy(win->region.opaque);
+
+ if (win->shell_surface) wl_shell_surface_destroy(win->shell_surface);
+ win->shell_surface = NULL;
+
+ if (win->surface) wl_surface_destroy(win->surface);
+ win->surface = NULL;
+
+// free(win);
+}
+
+/**
+ * Signals for Wayland to initiate a window move.
+ *
+ * The position requested (@p x, @p y) is not honored by Wayland because
+ * Wayland does not allow specific window placement to be set.
+ *
+ * @param win The window to move.
+ * @param x X Position
+ * @param y Y Position
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ win->allocation.x = x;
+ win->allocation.y = y;
+ if (win->shell_surface)
+ {
+ Ecore_Wl_Input *input;
+
+ if (!(input = win->keyboard_device))
+ {
+ if (win->parent)
+ input = win->parent->keyboard_device;
+ }
+
+ wl_shell_surface_move(win->shell_surface, input->input_device,
+ input->timestamp);
+ }
+}
+
+/**
+ * Signals for Wayland to initiate a window resize.
+ *
+ * The size requested (@p w, @p h) is not honored by Wayland because
+ * Wayland does not allow specific window sizes to be set.
+ *
+ * @param win The window to resize.
+ * @param w Width
+ * @param h Height
+ * @param location The edge of the window from where the resize should start.
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ win->allocation.w = w;
+ win->allocation.h = h;
+ if (win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN)
+ {
+ win->region.input =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(win->region.input, win->allocation.x, win->allocation.y,
+ win->allocation.w, win->allocation.h);
+ }
+ if (!win->transparent)
+ {
+ win->region.opaque =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(win->region.opaque, win->allocation.x, win->allocation.y,
+ win->allocation.w, win->allocation.h);
+ }
+
+ if (win->shell_surface)
+ {
+ Ecore_Wl_Input *input;
+
+ input = win->keyboard_device;
+ wl_shell_surface_resize(win->shell_surface, input->input_device,
+ input->timestamp, location);
+ }
+}
+
+EAPI void
+ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if (win->surface)
+ wl_surface_damage(win->surface, x, y, w, h);
+}
+
+EAPI void
+ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+
+ switch (win->buffer_type)
+ {
+ case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW:
+ /* FIXME: weston has wl_egl_window_get_attached_size */
+ break;
+ case ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE:
+ case ECORE_WL_WINDOW_BUFFER_TYPE_SHM:
+ if (win->surface)
+ {
+ int dx = 0, dy = 0;
+
+ if ((win->server_allocation.w != win->allocation.w) ||
+ (win->server_allocation.h != win->allocation.h))
+ {
+ dx = win->allocation.w - win->server_allocation.w;
+ dy = win->allocation.h - win->server_allocation.h;
+ if (buffer)
+ wl_surface_attach(win->surface, buffer, dx, dy);
+ }
+ else
+ {
+ if (buffer)
+ wl_surface_attach(win->surface, buffer, x, y);
+ }
+
+ win->server_allocation = win->allocation;
+ }
+ break;
+ default:
+ return;
+ }
+
+ if (win->region.input)
+ {
+ wl_surface_set_input_region(win->surface, win->region.input);
+ wl_region_destroy(win->region.input);
+ win->region.input = NULL;
+ }
+
+ if (win->region.opaque)
+ {
+ wl_surface_set_opaque_region(win->surface, win->region.opaque);
+ wl_region_destroy(win->region.opaque);
+ win->region.opaque = NULL;
+ }
+
+ if (win->surface)
+ wl_surface_damage(win->surface, 0, 0,
+ win->allocation.w, win->allocation.h);
+}
+
+/**
+ * Shows a window
+ *
+ * Synonymous to "mapping" a window in Wayland System terminology.
+ *
+ * @param win The window to show.
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_show(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if (win->surface) return;
+
+ win->surface = wl_compositor_create_surface(_ecore_wl_disp->wl.compositor);
+
+ wl_surface_set_user_data(win->surface, win);
+
+ win->shell_surface =
+ wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell, win->surface);
+ wl_shell_surface_add_listener(win->shell_surface,
+ &_ecore_wl_shell_surface_listener, win);
+
+ switch (win->type)
+ {
+ case ECORE_WL_WINDOW_TYPE_FULLSCREEN:
+ wl_shell_surface_set_fullscreen(win->shell_surface,
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
+ 0, NULL);
+ break;
+ case ECORE_WL_WINDOW_TYPE_MAXIMIZED:
+ wl_shell_surface_set_maximized(win->shell_surface, NULL);
+ break;
+ case ECORE_WL_WINDOW_TYPE_TRANSIENT:
+ wl_shell_surface_set_transient(win->shell_surface,
+ win->parent->shell_surface,
+ win->allocation.x, win->allocation.y, 0);
+ break;
+ case ECORE_WL_WINDOW_TYPE_MENU:
+ wl_shell_surface_set_popup(win->shell_surface,
+ win->parent->pointer_device->input_device,
+ win->parent->pointer_device->timestamp,
+ win->parent->shell_surface,
+ win->allocation.x, win->allocation.y, 0);
+ break;
+ case ECORE_WL_WINDOW_TYPE_TOPLEVEL:
+ default:
+ wl_shell_surface_set_toplevel(win->shell_surface);
+ break;
+ }
+
+ if (win->type != ECORE_WL_WINDOW_TYPE_FULLSCREEN)
+ {
+ win->region.input =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(win->region.input, win->allocation.x, win->allocation.y,
+ win->allocation.w, win->allocation.h);
+ }
+ if (!win->transparent)
+ {
+ win->region.opaque =
+ wl_compositor_create_region(_ecore_wl_disp->wl.compositor);
+ wl_region_add(win->region.opaque, win->allocation.x, win->allocation.y,
+ win->allocation.w, win->allocation.h);
+ }
+}
+
+/**
+ * Hides a window
+ *
+ * Synonymous to "unmapping" a window in Wayland System terminology.
+ *
+ * @param win The window to hide.
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_hide(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if (win->shell_surface) wl_shell_surface_destroy(win->shell_surface);
+ win->shell_surface = NULL;
+ if (win->surface) wl_surface_destroy(win->surface);
+ win->surface = NULL;
+}
+
+/**
+ * Raises a window
+ *
+ * @param win The window to raise.
+ *
+ * @ingroup Ecore_Wl_Window_Group
+ * @since 1.2
+ */
+EAPI void
+ecore_wl_window_raise(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if (win->shell_surface)
+ wl_shell_surface_set_toplevel(win->shell_surface);
+}
+
+EAPI void
+ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if ((win->type == ECORE_WL_WINDOW_TYPE_MAXIMIZED) == maximized) return;
+ if (win->type == ECORE_WL_WINDOW_TYPE_TOPLEVEL)
+ {
+ win->saved_allocation = win->allocation;
+ if (win->shell_surface)
+ wl_shell_surface_set_maximized(win->shell_surface, NULL);
+ win->type = ECORE_WL_WINDOW_TYPE_MAXIMIZED;
+ }
+ else
+ {
+ Ecore_Wl_Input *input;
+
+ input = win->keyboard_device;
+
+ if (win->shell_surface)
+ wl_shell_surface_set_toplevel(win->shell_surface);
+ win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->allocation = win->saved_allocation;
+ _ecore_wl_window_configure_send(win, win->allocation.w,
+ win->allocation.h, input->timestamp);
+ }
+}
+
+EAPI void
+ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ if ((win->type == ECORE_WL_WINDOW_TYPE_FULLSCREEN) == fullscreen) return;
+ if (fullscreen)
+ {
+ win->type = ECORE_WL_WINDOW_TYPE_FULLSCREEN;
+ win->saved_allocation = win->allocation;
+ if (win->shell_surface)
+ wl_shell_surface_set_fullscreen(win->shell_surface,
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
+ 0, NULL);
+ }
+ else
+ {
+ Ecore_Wl_Input *input;
+
+ input = win->keyboard_device;
+
+ if (win->shell_surface)
+ wl_shell_surface_set_toplevel(win->shell_surface);
+ win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
+ win->allocation = win->saved_allocation;
+ _ecore_wl_window_configure_send(win, win->allocation.w,
+ win->allocation.h, input->timestamp);
+ }
+}
+
+EAPI void
+ecore_wl_window_transparent_set(Ecore_Wl_Window *win, Eina_Bool transparent)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ win->transparent = transparent;
+}
+
+EAPI void
+ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ win->allocation.w = w;
+ win->allocation.h = h;
+}
+
+EAPI struct wl_surface *
+ecore_wl_window_surface_get(Ecore_Wl_Window *win)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return NULL;
+ return win->surface;
+}
+
+EAPI Ecore_Wl_Window *
+ecore_wl_window_find(unsigned int id)
+{
+ Ecore_Wl_Window *win;
+
+ if (!id) return NULL;
+ win = eina_hash_find(_windows, &id);
+ if (win) return win;
+ return NULL;
+}
+
+EAPI void
+ecore_wl_window_type_set(Ecore_Wl_Window *win, Ecore_Wl_Window_Type type)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ win->type = type;
+}
+
+EAPI void
+ecore_wl_window_pointer_set(Ecore_Wl_Window *win, struct wl_buffer *buffer, int hot_x, int hot_y, unsigned int timestamp)
+{
+ Ecore_Wl_Input *input;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+
+ input = _ecore_wl_disp->input;
+ wl_input_device_attach(input->input_device, timestamp,
+ buffer, hot_x, hot_y);
+}
+
+/* local functions */
+static void
+_ecore_wl_window_cb_configure(void *data, struct wl_shell_surface *shell_surface __UNUSED__, unsigned int timestamp, unsigned int edges, int w, int h)
+{
+ Ecore_Wl_Window *win;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(win = data)) return;
+ if ((w <= 0) || (h <= 0)) return;
+
+ win->edges = edges;
+ win->allocation.w = w;
+ win->allocation.h = h;
+ if (win->region.input) wl_region_destroy(win->region.input);
+ win->region.input = NULL;
+ if (win->region.opaque) wl_region_destroy(win->region.opaque);
+ win->region.opaque = NULL;
+ _ecore_wl_window_configure_send(win, w, h, timestamp);
+}
+
+static void
+_ecore_wl_window_cb_popup_done(void *data, struct wl_shell_surface *shell_surface __UNUSED__)
+{
+ Ecore_Wl_Window *win;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(win = data)) return;
+ ecore_wl_input_ungrab(win->pointer_device, 0);
+}
+
+static void
+_ecore_wl_window_configure_send(Ecore_Wl_Window *win, int w, int h, unsigned int timestamp)
+{
+ Ecore_Wl_Event_Window_Configure *ev;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!(ev = calloc(1, sizeof(Ecore_Wl_Event_Window_Configure)))) return;
+ ev->win = win->id;
+ ev->event_win = win->id;
+ ev->x = win->allocation.x;
+ ev->y = win->allocation.y;
+ ev->w = w;
+ ev->h = h;
+ ev->timestamp = timestamp;
+ ecore_event_add(ECORE_WL_EVENT_WINDOW_CONFIGURE, ev, NULL, NULL);
+}
EAPI void ecore_win32_window_title_set(Ecore_Win32_Window *window,
const char *title);
-EAPI void ecore_win32_window_focus_set(Ecore_Win32_Window *window);
+EAPI void ecore_win32_window_focus(Ecore_Win32_Window *window);
+
+EAPI void *ecore_win32_window_focus_get(void);
EAPI void ecore_win32_window_iconified_set(Ecore_Win32_Window *window,
Eina_Bool on);
EAPI void ecore_win32_window_fullscreen_set(Ecore_Win32_Window *window,
Eina_Bool on);
-EINA_DEPRECATED EAPI void ecore_win32_window_shape_set(Ecore_Win32_Window *window,
- unsigned short width,
- unsigned short height,
- unsigned char *mask);
-
EAPI void ecore_win32_window_cursor_set(Ecore_Win32_Window *window,
Ecore_Win32_Cursor *cursor);
char *kc = NULL;
int key;
int is_extended;
+ int previous_key_state;
key = msg->window_param;
is_extended = msg->data_param & 0x01000000;
+ previous_key_state = msg->data_param & 0x40000000;
*keyname = NULL;
*keysymbol = NULL;
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LSHIFT);
if (res & 0x8000)
{
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LCONTROL);
if (res & 0x8000)
{
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LMENU);
if (res & 0x8000)
{
{
if (is_down)
{
+ if (previous_key_state) return 0;
kn = "Super_L";
ks = "Super_L";
kc = "";
{
if (is_down)
{
+ if (previous_key_state) return 0;
kn = "Super_R";
ks = "Super_R";
kc = "";
unsigned int min_height;
unsigned int max_width;
unsigned int max_height;
- unsigned int base_width;
- unsigned int base_height;
+ int base_width;
+ int base_height;
unsigned int step_width;
unsigned int step_height;
w->min_height = 0;
w->max_width = 32767;
w->max_height = 32767;
- w->base_width = 0;
- w->base_height = 0;
+ w->base_width = -1;
+ w->base_height = -1;
w->step_width = 1;
w->step_height = 1;
*
* This function returns the window HANDLE associated to @p window. If
* @p window is @c NULL, this function returns @c NULL.
+ *
+ * @note The returned value is of type HWND.
*/
EAPI void *
ecore_win32_window_hwnd_get(Ecore_Win32_Window *window)
if (step_height) *step_height = window->step_height;
}
-EAPI void
-ecore_win32_window_shape_set(Ecore_Win32_Window *window,
- unsigned short width,
- unsigned short height,
- unsigned char *mask)
-{
- HRGN rgn;
- int x;
- int y;
- OSVERSIONINFO version_info;
-
- if (!window)
- return;
-
- if (!mask)
- {
- window->shape.enabled = 0;
- if (window->shape.layered != 0)
- {
- window->shape.layered = 0;
-#if defined(WS_EX_LAYERED)
- SetLastError(0);
- if (!SetWindowLongPtr(window->window, GWL_EXSTYLE,
- GetWindowLong(window->window, GWL_EXSTYLE) & (~WS_EX_LAYERED)) &&
- (GetLastError() != 0))
- {
- ERR("SetWindowLongPtr() failed");
- return;
- }
- if (!RedrawWindow(window->window, NULL, NULL,
- RDW_ERASE | RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN))
- {
- ERR("RedrawWindow() failed");
- return;
- }
-#endif
- }
- else
- if (!SetWindowRgn(window->window, NULL, TRUE))
- {
- ERR("SetWindowRgn() failed");
- }
- return;
- }
-
- if (width == 0 || height == 0)
- return;
-
- window->shape.enabled = 1;
-
- if (width != window->shape.width || height != window->shape.height)
- {
- window->shape.width = width;
- window->shape.height = height;
- if (window->shape.mask)
- {
- free(window->shape.mask);
- window->shape.mask = NULL;
- }
- window->shape.mask = malloc(width * height);
- }
- memcpy(window->shape.mask, mask, width * height);
-
- window->shape.layered = 0;
-
-#if defined(WS_EX_LAYERED)
- version_info.dwOSVersionInfoSize = sizeof(version_info);
- if (GetVersionEx(&version_info) == TRUE && version_info.dwMajorVersion == 5)
- {
- SetLastError(0);
- if (!SetWindowLongPtr(window->window, GWL_EXSTYLE,
- GetWindowLong(window->window, GWL_EXSTYLE) | WS_EX_LAYERED) &&
- (GetLastError() != 0))
- {
- ERR("SetWindowLongPtr() failed");
- return;
- }
- window->shape.layered = 1;
- return;
- }
-#endif
-
- if (!(rgn = CreateRectRgn(0, 0, 0, 0)))
- {
- ERR("CreateRectRgn() failed");
- return;
- }
- for (y = 0; y < height; y++)
- {
- HRGN rgnLine;
-
- if (!(rgnLine = CreateRectRgn(0, 0, 0, 0)))
- {
- ERR("CreateRectRgn() failed");
- return;
- }
- for (x = 0; x < width; x++)
- {
- if (mask[y * width + x] > 0)
- {
- HRGN rgnDot;
-
- if (!(rgnDot = CreateRectRgn(x, y, x + 1, y + 1)))
- {
- ERR("CreateRectRgn() failed");
- return;
- }
- if (CombineRgn(rgnLine, rgnLine, rgnDot, RGN_OR) == ERROR)
- {
- ERR("CombineRgn() has not created a new region");
- }
- if (!DeleteObject(rgnDot))
- {
- ERR("DeleteObject() failed");
- return;
- }
- }
- }
- if (CombineRgn(rgn, rgn, rgnLine, RGN_OR) == ERROR)
- {
- ERR("CombineRgn() has not created a new region");
- }
- if (!DeleteObject(rgnLine))
- {
- ERR("DeleteObject() failed");
- return;
- }
- }
- if (!SetWindowRgn(window->window, rgn, TRUE))
- {
- ERR("SetWindowRgn() failed");
- }
-}
-
/**
* @brief Show the given window.
*
* @c NULL, this function does nothing.
*/
EAPI void
-ecore_win32_window_focus_set(Ecore_Win32_Window *window)
+ecore_win32_window_focus(Ecore_Win32_Window *window)
{
if (!window) return;
}
/**
+ * @brief Get the current focused window.
+ *
+ * @return The window that has focus.
+ *
+ * This function returns the window that has focus. If the calling
+ * thread's message queue does not have an associated window with the
+ * keyboard focus, the return value is @c NULL.
+ *
+ * @note Even if the returned value is @c NULL, another thread's queue
+ * may be associated with a window that has the keyboard focus.
+ *
+ * @note The returned value is of type HWND.
+ */
+EAPI void *
+ecore_win32_window_focus_get(void)
+{
+ HWND focused;
+
+ INF("getting focused window");
+
+ focused = GetFocus();
+ if (!focused)
+ {
+ ERR("GetFocus() failed");
+ return NULL;
+ }
+
+ return focused;
+}
+
+/**
* @brief Iconify or restore the given window.
*
* @param window The window.
EAPI void ecore_wince_window_title_set(Ecore_WinCE_Window *window,
const char *title);
+EAPI void ecore_wince_window_focus(Ecore_WinCE_Window *window);
+
+EAPI void *ecore_wince_window_focus_get(void);
+
EAPI void ecore_wince_window_backend_set(Ecore_WinCE_Window *window, int backend);
EAPI void ecore_wince_window_suspend_cb_set(Ecore_WinCE_Window *window, int (*suspend_cb)(int));
char *kn;
char *ks;
char *kc;
+ int previous_key_state;
+
+ previous_key_state = msg->data_param & 0x40000000;
*keyname = NULL;
*keysymbol = NULL;
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LSHIFT);
if (res & 0x8000)
{
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LCONTROL);
if (res & 0x8000)
{
if (is_down)
{
+ if (previous_key_state) return 0;
res = GetKeyState(VK_LMENU);
if (res & 0x8000)
{
}
break;
}
+ case VK_LWIN:
+ {
+ if (is_down)
+ {
+ if (previous_key_state) return 0;
+ kn = "Super_L";
+ ks = "Super_L";
+ kc = "";
+ *modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ }
+ else /* is_up */
+ {
+ kn = "Super_L";
+ ks = "Super_L";
+ kc = "";
+ *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
+ }
+ break;
+ }
+ case VK_RWIN:
+ {
+ if (is_down)
+ {
+ if (previous_key_state) return 0;
+ kn = "Super_R";
+ ks = "Super_R";
+ kc = "";
+ *modifiers |= ECORE_EVENT_MODIFIER_WIN;
+ }
+ else /* is_up */
+ {
+ kn = "Super_R";
+ ks = "Super_R";
+ kc = "";
+ *modifiers &= ~ECORE_EVENT_MODIFIER_WIN;
+ }
+ break;
+ }
default:
/* other non keystroke characters */
return 0;
}
/**
+ * @brief Set the focus to the given window.
+ *
+ * @param window The window to give focus to.
+ *
+ * This function gives the focus to @p window. If @p window is
+ * @c NULL, this function does nothing.
+ */
+EAPI void
+ecore_wince_window_focus(Ecore_WinCE_Window *window)
+{
+ if (!window) return;
+
+ INF("focusing window");
+
+ if (!SetFocus(window->window))
+ {
+ ERR("SetFocus() failed");
+ }
+}
+
+/**
+ * @brief Get the current focused window.
+ *
+ * @return The window that has focus.
+ *
+ * This function returns the window that has focus. If the calling
+ * thread's message queue does not have an associated window with the
+ * keyboard focus, the return value is @c NULL.
+ *
+ * @note Even if the returned value is @c NULL, another thread's queue
+ * may be associated with a window that has the keyboard focus.
+ *
+ * @note The returned value is of type HWND.
+ */
+EAPI void *
+ecore_wince_window_focus_get(void)
+{
+ HWND focused;
+
+ INF("getting focused window");
+
+ focused = GetFocus();
+ if (!focused)
+ {
+ ERR("GetFocus() failed");
+ return NULL;
+ }
+
+ return focused;
+}
+
+/**
* @brief Set the graphic backend used for the given window.
*
* @param window The window.
ECORE_X_ILLUME_QUICKPANEL_STATE_ON
} Ecore_X_Illume_Quickpanel_State;
+typedef enum _Ecore_X_Illume_Indicator_State
+{
+ ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN = 0,
+ ECORE_X_ILLUME_INDICATOR_STATE_OFF,
+ ECORE_X_ILLUME_INDICATOR_STATE_ON
+} Ecore_X_Illume_Indicator_State;
+
+typedef enum _Ecore_X_Illume_Clipboard_State
+{
+ ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN = 0,
+ ECORE_X_ILLUME_CLIPBOARD_STATE_OFF,
+ ECORE_X_ILLUME_CLIPBOARD_STATE_ON
+} Ecore_X_Illume_Clipboard_State;
+
+typedef enum _Ecore_X_Illume_Indicator_Opacity_Mode
+{
+ ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN = 0,
+ ECORE_X_ILLUME_INDICATOR_OPAQUE,
+ ECORE_X_ILLUME_INDICATOR_TRANSLUCENT,
+ ECORE_X_ILLUME_INDICATOR_TRANSPARENT
+} Ecore_X_Illume_Indicator_Opacity_Mode;
+
/* Window layer constants */
#define ECORE_X_WINDOW_LAYER_BELOW 2
#define ECORE_X_WINDOW_LAYER_NORMAL 4
int *bottom_start_x,
int *bottom_end_x);
+EAPI void
+ecore_x_netwm_icons_set(Ecore_X_Window win,
+ Ecore_X_Icon *icon,
+ int num);
+
EAPI Eina_Bool
ecore_x_netwm_icons_get(Ecore_X_Window win,
Ecore_X_Icon **icon,
int *h);
EAPI void
+ecore_x_e_illume_clipboard_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Clipboard_State state);
+
+EAPI Ecore_X_Illume_Clipboard_State
+ecore_x_e_illume_clipboard_state_get(Ecore_X_Window win);
+
+EAPI void
+ecore_x_e_illume_clipboard_geometry_set(Ecore_X_Window win,
+ int x,
+ int y,
+ int w,
+ int h);
+EAPI Eina_Bool
+ecore_x_e_illume_clipboard_geometry_get(Ecore_X_Window win,
+ int *x,
+ int *y,
+ int *w,
+ int *h);
+EAPI void
ecore_x_e_comp_sync_counter_set(Ecore_X_Window win,
Ecore_X_Sync_Counter counter);
EAPI Ecore_X_Sync_Counter
/* The usage of 'Ecore_X_Randr_None' or 'Ecore_X_Randr_Unset'
* depends on the context. In most cases 'Ecore_X_Randr_Unset'
* can be used, but in some cases -1 is a special value to
- * functions, thus 'Ecore_X_Randr_None' (=0) musst be used.
+ * functions, thus 'Ecore_X_Randr_None' (=0) must be used.
*/
typedef short Ecore_X_Randr_Refresh_Rate;
EAPI Ecore_X_Randr_Mode_Info **
ecore_x_randr_modes_info_get(Ecore_X_Window root,
int *num);
+EAPI Ecore_X_Randr_Mode
+ecore_x_randr_mode_info_add(Ecore_X_Window root,
+ Ecore_X_Randr_Mode_Info *mode_info);
+EAPI void
+ecore_x_randr_mode_del(Ecore_X_Randr_Mode mode);
EAPI Ecore_X_Randr_Mode_Info *
ecore_x_randr_mode_info_get(Ecore_X_Window root,
Ecore_X_Randr_Mode mode);
EAPI Ecore_X_Randr_Output *
ecore_x_randr_window_outputs_get(Ecore_X_Window window,
int *num);
-EINA_DEPRECATED EAPI Ecore_X_Randr_Output *
+EAPI Ecore_X_Randr_Output *
ecore_x_randr_current_output_get(Ecore_X_Window window,
int *num);
EAPI Ecore_X_Randr_Crtc *
+ecore_x_randr_window_crtcs_get(Ecore_X_Window window,
+ int *num);
+EAPI Ecore_X_Randr_Crtc *
ecore_x_randr_current_crtc_get(Ecore_X_Window window,
int *num);
EAPI Ecore_X_Randr_Output *
Ecore_X_Randr_Crtc crtc_r2,
Ecore_X_Randr_Output_Policy policy,
Ecore_X_Randr_Relative_Alignment alignment);
+EAPI Eina_Bool
+ecore_x_randr_output_mode_add(Ecore_X_Randr_Output output,
+ Ecore_X_Randr_Mode mode);
+EAPI void
+ecore_x_randr_output_mode_del(Ecore_X_Randr_Output output,
+ Ecore_X_Randr_Mode mode);
EAPI Ecore_X_Randr_Mode *
ecore_x_randr_output_modes_get(Ecore_X_Window root,
Ecore_X_Randr_Output output,
/**
* Given a keyname, return the keycode representing that key
+ * @return The keycode of the key.
*
* @since 1.2.0
*/
Ecore_X_Gesture_Event_Type type,
int num_fingers);
-/* Illume window states */
-typedef enum _Ecore_X_Illume_Window_State
-{
- ECORE_X_ILLUME_WINDOW_STATE_NORMAL = 0,
- ECORE_X_ILLUME_WINDOW_STATE_INSET
-} Ecore_X_Illume_Window_State;
+EAPI void
+ecore_x_e_illume_indicator_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state);
+EAPI Ecore_X_Illume_Indicator_State
+ecore_x_e_illume_indicator_state_get(Ecore_X_Window win);
+EAPI void
+ecore_x_e_illume_indicator_state_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state);
EAPI void
-ecore_x_e_illume_window_state_set(Ecore_X_Window win,
- Ecore_X_Illume_Window_State state);
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode);
-EAPI Ecore_X_Illume_Window_State
-ecore_x_e_illume_window_state_get(Ecore_X_Window win);
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win);
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode);
#ifdef __cplusplus
}
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_ON;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF;
+EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_COUNTER;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_PARENT;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_POSITION;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_USER_CREATED_WINDOW;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_PARENT_BORDER_WINDOW;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_OPERATOR;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE;
-
-/* for user created window */
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_USER_CREATED_WINDOW;
-
-/* XID that points to the parent border window */
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_PARENT_BORDER_WINDOW;
-
-/* for indicator's state */
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE;
-
/* for sliding window */
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_GEOMETRY;
-/* for illume window state */
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL;
-EAPI extern Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_INSET;
-
/* for SDB(Samsung Debug Bridge) */
EAPI extern Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_CONNECT;
EAPI extern Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_DISCONNECT;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_PRIORITY_MINOR = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_ON = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE= 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON = 0;
+EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_COUNTER = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_DUMP = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_PIXMAP = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_USER_CREATED_WINDOW = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_PARENT_BORDER_WINDOW = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_OPERATOR = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE = 0;
-
/* currently Emotion and E17 specific extension */
EAPI Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_PARENT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_VIDEO_POSITION = 0;
-/* for user created window */
-EAPI Ecore_X_Atom ECORE_X_ATOM_USER_CREATED_WINDOW = 0;
-
-/* XID that points to the parent border window */
-EAPI Ecore_X_Atom ECORE_X_ATOM_PARENT_BORDER_WINDOW = 0;
-
/* for sliding window */
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_GEOMETRY = 0;
-/* for illume window state */
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL = 0;
-EAPI Ecore_X_Atom ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_INSET = 0;
-
/* for SDB(Samsung Debug Bridge) */
EAPI Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_CONNECT = 0;
EAPI Ecore_X_Atom ECORE_X_ATOM_SDB_SERVER_DISCONNECT = 0;
{ "_E_ILLUME_QUICKPANEL_ZONE", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE },
{ "_E_ILLUME_QUICKPANEL_POSITION_UPDATE",
&ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE },
-
+ { "_E_ILLUME_INDICATOR_STATE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE },
+ { "_E_ILLUME_INDICATOR_ON", &ECORE_X_ATOM_E_ILLUME_INDICATOR_ON },
+ { "_E_ILLUME_INDICATOR_OFF", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF },
+ { "_E_ILLUME_INDICATOR_OPACITY_MODE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE },
+ { "_E_ILLUME_INDICATOR_OPAQUE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE },
+ { "_E_ILLUME_INDICATOR_TRANSLUCENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT },
+ { "_E_ILLUME_INDICATOR_TRANSPARENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT },
+ { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
+ { "_E_ILLUME_ROTATE_WINDOW_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
+ { "_E_ILLUME_ROTATE_ROOT_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE },
+ { "_E_ILLUME_CLIPBOARD_STATE", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE },
+ { "_E_ILLUME_CLIPBOARD_ON", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON },
+ { "_E_ILLUME_CLIPBOARD_OFF", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF },
+ { "_E_ILLUME_CLIPBOARD_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY },
{ "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER },
{ "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE },
{ "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED },
* Synchronously modifies the regions in the following manner:
* If @p repair is @c XCB_NONE:
* 1) parts = damage
- * 2) damage = <empty>
+ * 2) damage = \<empty\>
* Otherwise:
* 1) parts = damage INTERSECT repair
* 2) damage = damage - parts
* @param standby Amount of time of inactivity before standby mode will be invoked.
* @param suspend Amount of time of inactivity before the screen is placed into suspend mode.
* @param off Amount of time of inactivity before the monitor is shut off.
+ * @return EINA_TRUE on success, EINA_FALSE on failure.
* @ingroup Ecore_X_DPMS_Group
*/
EAPI Eina_Bool
static Ecore_X_Illume_Quickpanel_State _ecore_xcb_e_quickpanel_state_get(Ecore_X_Atom atom);
static Ecore_X_Atom _ecore_xcb_e_illume_atom_get(Ecore_X_Illume_Mode mode);
static Ecore_X_Illume_Mode _ecore_xcb_e_illume_mode_get(Ecore_X_Atom atom);
+static Ecore_X_Atom _ecore_xcb_e_indicator_atom_get(Ecore_X_Illume_Indicator_State state);
+static Ecore_X_Illume_Indicator_State _ecore_xcb_e_indicator_state_get(Ecore_X_Atom atom);
EAPI void
ecore_x_e_init(void)
0, 0, 0, 0, 0);
}
+static Ecore_X_Atom
+_ecore_xcb_e_clipboard_atom_get(Ecore_X_Illume_Clipboard_State state)
+{
+ switch (state)
+ {
+ case ECORE_X_ILLUME_CLIPBOARD_STATE_ON:
+ return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON;
+ case ECORE_X_ILLUME_CLIPBOARD_STATE_OFF:
+ return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static Ecore_X_Illume_Clipboard_State
+_ecore_xcb_e_clipboard_state_get(Ecore_X_Atom atom)
+{
+ if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON)
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_ON;
+
+ if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF)
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_OFF;
+
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_clipboard_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Clipboard_State state)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ atom = _ecore_xcb_e_clipboard_atom_get(state);
+
+ ecore_x_window_prop_atom_set(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
+ &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Clipboard_State
+ecore_x_e_illume_clipboard_state_get(Ecore_X_Window win)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!ecore_x_window_prop_atom_get(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
+ &atom, 1))
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN;
+ return _ecore_xcb_e_clipboard_state_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_clipboard_geometry_set(Ecore_X_Window win,
+ int x, int y, int w, int h)
+{
+ unsigned int geom[4];
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ geom[0] = x;
+ geom[1] = y;
+ geom[2] = w;
+ geom[3] = h;
+ ecore_x_window_prop_card32_set(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
+ geom, 4);
+}
+
+EAPI Eina_Bool
+ecore_x_e_illume_clipboard_geometry_get(Ecore_X_Window win,
+ int *x, int *y, int *w, int *h)
+{
+ int ret = 0;
+ unsigned int geom[4];
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ret =
+ ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
+ geom, 4);
+ if (ret != 4) return EINA_FALSE;
+
+ if (x) *x = geom[0];
+ if (y) *y = geom[1];
+ if (w) *w = geom[2];
+ if (h) *h = geom[3];
+
+ return EINA_TRUE;
+}
+
EAPI void
ecore_x_e_illume_mode_set(Ecore_X_Window win,
Ecore_X_Illume_Mode mode)
return ECORE_X_ILLUME_MODE_UNKNOWN;
}
+static Ecore_X_Atom
+_ecore_xcb_e_indicator_atom_get(Ecore_X_Illume_Indicator_State state)
+{
+ switch (state)
+ {
+ case ECORE_X_ILLUME_INDICATOR_STATE_ON:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_ON;
+
+ case ECORE_X_ILLUME_INDICATOR_STATE_OFF:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF;
+
+ default:
+ break;
+ }
+ return 0;
+}
+
+static Ecore_X_Illume_Indicator_State
+_ecore_xcb_e_indicator_state_get(Ecore_X_Atom atom)
+{
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_ON)
+ return ECORE_X_ILLUME_INDICATOR_STATE_ON;
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF)
+ return ECORE_X_ILLUME_INDICATOR_STATE_OFF;
+
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_indicator_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ atom = _ecore_xcb_e_indicator_atom_get(state);
+ ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Indicator_State
+ecore_x_e_illume_indicator_state_get(Ecore_X_Window win)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!ecore_x_window_prop_atom_get(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ &atom, 1))
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+
+ return _ecore_xcb_e_indicator_state_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_indicator_state_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+ _ecore_xcb_e_indicator_atom_get(state),
+ 0, 0, 0, 0);
+}
+
+static Ecore_X_Atom
+_ecore_x_e_indicator_opacity_atom_get(Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+ switch (mode)
+ {
+ case ECORE_X_ILLUME_INDICATOR_OPAQUE:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
+
+ case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
+
+ case ECORE_X_ILLUME_INDICATOR_TRANSPARENT:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
+
+ default:
+ break;
+ }
+ return 0;
+}
+
+static Ecore_X_Illume_Indicator_Opacity_Mode
+_ecore_x_e_indicator_opacity_get(Ecore_X_Atom atom)
+{
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE)
+ return ECORE_X_ILLUME_INDICATOR_OPAQUE;
+
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT)
+ return ECORE_X_ILLUME_INDICATOR_TRANSLUCENT;
+
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT)
+ return ECORE_X_ILLUME_INDICATOR_TRANSPARENT;
+
+ return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ atom = _ecore_x_e_indicator_opacity_atom_get(mode);
+ ecore_x_window_prop_atom_set(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+ &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win)
+{
+ Ecore_X_Atom atom;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!ecore_x_window_prop_atom_get(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+ &atom, 1))
+ return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+
+ return _ecore_x_e_indicator_opacity_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ecore_x_client_message32_send(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+ ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+ _ecore_x_e_indicator_opacity_atom_get(mode),
+ 0, 0, 0, 0);
+}
+
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_NET_WM_ICON_NAME, name);
}
+EAPI void
+ecore_x_netwm_icons_set(Ecore_X_Window win,
+ Ecore_X_Icon *icon,
+ int num)
+{
+ unsigned int *data, *p, *p2;
+ unsigned int i, size, x, y;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ size = 0;
+ for (i = 0; i < (unsigned int)num; i++)
+ {
+ size += 2 + (icon[i].width * icon[i].height);
+ }
+ data = malloc(size * sizeof(unsigned int));
+ if (!data) return;
+ p = data;
+ for (i = 0; i < (unsigned int)num; i++)
+ {
+ p[0] = icon[i].width;
+ p[1] = icon[i].height;
+ p += 2;
+ p2 = icon[i].data;
+ for (y = 0; y < icon[i].height; y++)
+ {
+ for (x = 0; x < icon[i].width; x++)
+ {
+ unsigned int r, g, b, a;
+
+ a = (*p2 >> 24) & 0xff;
+ r = (*p2 >> 16) & 0xff;
+ g = (*p2 >> 8 ) & 0xff;
+ b = (*p2 ) & 0xff;
+ if ((a > 0) && (a < 255))
+ {
+ r = (r * 255) / a;
+ g = (g * 255) / a;
+ b = (b * 255) / a;
+ }
+ *p = (a << 24) | (r << 16) | (g << 8) | b;
+ p++;
+ p2++;
+ }
+ }
+ }
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON,
+ data, size);
+ free(data);
+}
+
EAPI Eina_Bool
ecore_x_netwm_icons_get(Ecore_X_Window win,
Ecore_X_Icon **icon,
/* TODO: List of missing functions
*
* ecore_x_randr_crtc_clone_set
- * ecore_x_randr_output_size_mm_get
* ecore_x_randr_output_crtc_set
* ecore_x_randr_edid_version_get
* ecore_x_randr_edid_info_has_valid_checksum
return modes;
}
+EAPI Eina_Bool
+ecore_x_randr_output_mode_add(Ecore_X_Randr_Output output, Ecore_X_Randr_Mode mode)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ CHECK_XCB_CONN;
+
+#ifdef ECORE_XCB_RANDR
+ RANDR_CHECK_1_2_RET(EINA_FALSE);
+
+ if ((output == Ecore_X_Randr_None) || (mode == Ecore_X_Randr_None))
+ return EINA_FALSE;
+
+ xcb_randr_add_output_mode(_ecore_xcb_conn, output, mode);
+ return EINA_TRUE;
+#endif
+ return EINA_FALSE;
+}
+
/*
* @brief get detailed information for a given mode id
* @param root window which's screen's ressources are queried
}
/*
+ * @brief add a mode to a display
+ * @param root window to which's screen's ressources are added
+ * @param mode_info
+ * @return Ecore_X_Randr_Mode of the added mode. Ecore_X_Randr_None if mode
+ * adding failed.
+ * @since 1.2.0
+ */
+EAPI Ecore_X_Randr_Mode
+ecore_x_randr_mode_info_add(Ecore_X_Window root, Ecore_X_Randr_Mode_Info *mode_info)
+{
+#ifdef ECORE_XCB_RANDR
+ Ecore_X_Randr_Mode mode = Ecore_X_Randr_None;
+ xcb_randr_create_mode_cookie_t cookie;
+ xcb_randr_create_mode_reply_t *reply;
+ xcb_randr_mode_info_t info;
+ int namelen = 0;
+#endif
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ CHECK_XCB_CONN;
+
+#ifdef ECORE_XCB_RANDR
+ RANDR_CHECK_1_2_RET(EINA_FALSE);
+
+ if (!mode_info) return Ecore_X_Randr_None;
+ if (!_ecore_xcb_randr_root_validate(root)) return Ecore_X_Randr_None;
+
+ namelen = strlen(mode_info->name);
+
+ memset(&info, 0, sizeof(info));
+ info.width = mode_info->width;
+ info.height = mode_info->height;
+ info.dot_clock = mode_info->dotClock;
+ info.hsync_start = mode_info->hSyncStart;
+ info.hsync_end = mode_info->hSyncEnd;
+ info.htotal = mode_info->hTotal;
+ info.hskew = mode_info->hSkew;
+ info.vsync_start = mode_info->vSyncStart;
+ info.vsync_end = mode_info->vSyncEnd;
+ info.vtotal = mode_info->vTotal;
+ info.mode_flags = mode_info->modeFlags;
+ info.name_len = namelen;
+
+ cookie =
+ xcb_randr_create_mode_unchecked(_ecore_xcb_conn, root, info,
+ namelen, mode_info->name);
+ reply = xcb_randr_create_mode_reply(_ecore_xcb_conn, cookie, NULL);
+ if (reply)
+ {
+ mode = mode_info->xid;
+ free(reply);
+ }
+#endif
+ return mode;
+}
+
+/*
* @brief get detailed information for all modes related to a root window's screen
* @param root window which's screen's ressources are queried
* @param num number of modes returned
* comparison functions, since it includes 0-bytes.
* @param root window this information should be queried from
* @param output the XID of the output
- * @param length length of the byte-array. If NULL, request will fail.
+ * @param length length of the byte-array. If @c NULL, request will fail.
+ * @return EDID information of the output.
*/
EAPI unsigned char *
ecore_x_randr_output_edid_get(Ecore_X_Window root,
}
/**
- * @brief gets the the outputs which might be used simultenously on the same
- * CRTC.
+ * @brief gets the outputs which might be used simultaneously on the same CRTC.
* @param root window that this information should be queried for.
* @param output the output which's clones we concern
* @param num number of possible clones
+ * @return The existing outputs, @c NULL otherwise.
*/
EAPI Ecore_X_Randr_Output *
ecore_x_randr_output_clones_get(Ecore_X_Window root,
return Ecore_X_Randr_None;
}
+EAPI void
+ecore_x_randr_output_size_mm_get(Ecore_X_Window root, Ecore_X_Randr_Output output, int *w_mm, int *h_mm)
+{
+#ifdef ECORE_XCB_RANDR
+ xcb_randr_get_output_info_cookie_t ocookie;
+ xcb_randr_get_output_info_reply_t *oreply;
+ xcb_timestamp_t timestamp = 0;
+#endif
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ CHECK_XCB_CONN;
+
+ if (w_mm) *w_mm = 0;
+ if (h_mm) *h_mm = 0;
+
+#ifdef ECORE_XCB_RANDR
+ RANDR_CHECK_1_2_RET();
+
+ if ((output != Ecore_X_Randr_None) && (_randr_version >= RANDR_1_3))
+ {
+ xcb_randr_get_screen_resources_current_reply_t *reply;
+
+ reply = _ecore_xcb_randr_13_get_resources(root);
+ timestamp = reply->config_timestamp;
+ free(reply);
+ }
+ else if ((output != Ecore_X_Randr_None) && (_randr_version == RANDR_1_2))
+ {
+ xcb_randr_get_screen_resources_reply_t *reply;
+
+ reply = _ecore_xcb_randr_12_get_resources(root);
+ timestamp = reply->config_timestamp;
+ free(reply);
+ }
+
+ ocookie =
+ xcb_randr_get_output_info_unchecked(_ecore_xcb_conn, output, timestamp);
+ oreply = xcb_randr_get_output_info_reply(_ecore_xcb_conn, ocookie, NULL);
+ if (oreply)
+ {
+ if (w_mm) *w_mm = oreply->mm_width;
+ if (h_mm) *h_mm = oreply->mm_height;
+ free(oreply);
+ }
+#endif
+}
+
/**
* @brief sets the demanded parameters for a given CRTC. Note that the CRTC is
* auto enabled in it's preferred mode, when it was disabled before.
}
/*
+ * @deprecated bad naming. Use ecore_x_randr_window_crtcs_get instead.
+ * @brief get the CRTCs, which display a certain window
+ * @param window window the displaying CRTCs shall be found for
+ * @param num the number of CRTCs displaying the window
+ * @return array of CRTCs that display a certain window. NULL if no CRTCs
+ * was found that displays the specified window.
+ */
+EAPI Ecore_X_Randr_Crtc *
+ecore_x_randr_current_crtc_get(Ecore_X_Window window,
+ int *num)
+{
+ return ecore_x_randr_window_crtcs_get(window, num);
+}
+
+/*
+ * @brief get the CRTCs, which display a certain window
+ * @param window window the displaying crtcs shall be found for
+ * @param num the number of crtcs displaying the window
+ * @return array of crtcs that display a certain window. NULL if no crtcs
+ * was found that displays the specified window.
+ * @since 1.2.0
+ */
+EAPI Ecore_X_Randr_Crtc *
+ecore_x_randr_window_crtcs_get(Ecore_X_Window window,
+ int *num)
+{
+#ifdef ECORE_XCB_RANDR
+ Ecore_X_Window root;
+ Eina_Rectangle w_geo, c_geo;
+ Ecore_X_Randr_Crtc *crtcs, *ret = NULL;
+ Ecore_X_Randr_Mode mode;
+ int ncrtcs, i, nret = 0;
+ xcb_translate_coordinates_cookie_t cookie;
+ xcb_translate_coordinates_reply_t *trans;
+#endif
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ CHECK_XCB_CONN;
+
+#ifdef ECORE_XCB_RANDR
+ RANDR_CHECK_1_2_RET(NULL);
+
+ ecore_x_window_geometry_get(window, &w_geo.x, &w_geo.y, &w_geo.w, &w_geo.h);
+
+ root = ecore_x_window_root_get(window);
+ crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs);
+ if (!crtcs) return NULL;
+
+ /* now get window RELATIVE to root window - thats what matters. */
+ cookie = xcb_translate_coordinates(_ecore_xcb_conn, window, root, 0, 0);
+ trans = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
+ w_geo.x = trans->dst_x;
+ w_geo.y = trans->dst_y;
+ free(trans);
+
+ for (i = 0, nret = 0; i < ncrtcs; i++)
+ {
+ /* if crtc is not enabled, don't bother about it any further */
+ mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
+ if (mode == Ecore_X_Randr_None) continue;
+
+ ecore_x_randr_crtc_geometry_get(root, crtcs[i], &c_geo.x, &c_geo.y,
+ &c_geo.w, &c_geo.h);
+ if (eina_rectangles_intersect(&w_geo, &c_geo))
+ {
+ ret = realloc(ret, (++nret *
+ sizeof(Ecore_X_Randr_Output)));
+ ret[nret] = crtcs[i];
+ }
+ }
+ free(crtcs);
+
+ if (num) *num = nret;
+ return ret;
+
+#endif
+ if (num) *num = 0;
+ return NULL;
+}
+
+/*
* @brief get a CRTC's outputs.
* @param root the root window which's screen will be queried
* @param num number of outputs referenced by given CRTC
}
/*
+ * @deprecated bad naming. Use ecore_x_randr_window_outputs_get instead.
+ * @brief get the outputs, which display a certain window
+ * @param window window the displaying outputs shall be found for
+ * @param num the number of outputs displaying the window
+ * @return array of outputs that display a certain window. NULL if no outputs
+ * was found that displays the specified window.
+ */
+
+Ecore_X_Randr_Output *
+ecore_x_randr_current_output_get(Ecore_X_Window window,
+ int *num)
+{
+ return ecore_x_randr_window_outputs_get(window, num);
+}
+
+/*
* @brief get the outputs, which display a certain window
* @param window window the displaying outputs shall be found for
* @param num the number of outputs displaying the window
{
#ifdef ECORE_XCB_RANDR
Ecore_X_Window root;
- Eina_Rectangle w_geo, c_geo;
Ecore_X_Randr_Crtc *crtcs;
- Ecore_X_Randr_Mode mode;
- Ecore_X_Randr_Output *outputs, *ret = NULL, *tret;
+ Ecore_X_Randr_Output *outputs, *ret = NULL;
int ncrtcs, noutputs, i, nret = 0;
- xcb_translate_coordinates_cookie_t cookie;
- xcb_translate_coordinates_reply_t *trans;
#endif
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (num) *num = 0;
#ifdef ECORE_XCB_RANDR
- RANDR_CHECK_1_2_RET(NULL);
-
- ecore_x_window_geometry_get(window, &w_geo.x, &w_geo.y, &w_geo.w, &w_geo.h);
+ if (_randr_version < RANDR_1_2) goto _ecore_x_randr_current_output_get_fail;
root = ecore_x_window_root_get(window);
- crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs);
- if (!crtcs) return NULL;
+ if (!(crtcs = ecore_x_randr_window_crtcs_get(window, &ncrtcs)))
+ goto _ecore_x_randr_current_output_get_fail;
- /* now get window RELATIVE to root window - thats what matters. */
- cookie = xcb_translate_coordinates(_ecore_xcb_conn, window, root, 0, 0);
- trans = xcb_translate_coordinates_reply(_ecore_xcb_conn, cookie, NULL);
- w_geo.x = trans->dst_x;
- w_geo.y = trans->dst_y;
- free(trans);
-
- for (i = 0; i < ncrtcs; i++)
+ for (i = 0, nret = 0; i < ncrtcs; i++)
{
- /* if crtc is not enabled, don't bother about it any further */
- mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
- if (mode == Ecore_X_Randr_None) continue;
- ecore_x_randr_crtc_geometry_get(root, crtcs[i], &c_geo.x, &c_geo.y,
- &c_geo.w, &c_geo.h);
- if (eina_rectangles_intersect(&w_geo, &c_geo))
- {
- outputs =
- ecore_x_randr_crtc_outputs_get(root, crtcs[i], &noutputs);
- /* The case below should be impossible, but for safety reasons
- * remains */
- if (!outputs)
- {
- if (num) *num = 0;
- free(ret);
- free(crtcs);
- return NULL;
- }
- tret = realloc(ret, ((nret + noutputs) *
- sizeof(Ecore_X_Randr_Output)));
- if (!tret)
- {
- if (num) *num = 0;
- free(outputs);
- free(ret);
- free(crtcs);
- return NULL;
- }
- ret = tret;
- memcpy(&ret[nret], outputs,
- (noutputs * sizeof(Ecore_X_Randr_Output)));
- nret += noutputs;
- free(outputs);
- }
+ outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
+ &noutputs);
+ if (!outputs)
+ goto _ecore_x_randr_current_output_get_fail_free;
+ nret += noutputs;
+ ret = realloc(ret, (nret * sizeof(Ecore_X_Randr_Output)));
+ memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
+ free(outputs);
}
free(crtcs);
- if (num) *num = nret;
+ if (num)
+ *num = nret;
+
return ret;
+_ecore_x_randr_current_output_get_fail_free:
+ free(outputs);
+ free(crtcs);
+ free(ret);
+_ecore_x_randr_current_output_get_fail:
#endif
if (num) *num = 0;
return NULL;
* @c _NET_WM_PID.
*
* @param win The given window.
- * @ingroup Ecore_X_Window_Properties_Groups
+ * @ingroup Ecore_X_Window_Properties_Group
*/
EAPI void
ecore_x_window_defaults_set(Ecore_X_Window win)
}
/**
- * gets the focus to the window @p win.
+ * gets the window that has focus.
* @return The window that has focus.
* @ingroup Ecore_X_Window_Focus_Functions
*/
* Return the screen DPI
*
* This is a simplistic call to get DPI. It does not account for differing
- * DPI in the x amd y axes nor does it accoutn for multihead or xinerama and
- * xrander where different parts of the screen may have differen DPI etc.
+ * DPI in the x amd y axes nor does it account for multihead or xinerama and
+ * xrander where different parts of the screen may have different DPI etc.
*
* @return the general screen DPI (dots/pixels per inch).
*/
{ "_E_ILLUME_QUICKPANEL_ZONE", &ECORE_X_ATOM_E_ILLUME_QUICKPANEL_ZONE },
{ "_E_ILLUME_QUICKPANEL_POSITION_UPDATE",
&ECORE_X_ATOM_E_ILLUME_QUICKPANEL_POSITION_UPDATE },
-
+ { "_E_ILLUME_INDICATOR_STATE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE },
+ { "_E_ILLUME_INDICATOR_ON", &ECORE_X_ATOM_E_ILLUME_INDICATOR_ON },
+ { "_E_ILLUME_INDICATOR_OFF", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF },
+ { "_E_ILLUME_INDICATOR_OPACITY_MODE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE },
+ { "_E_ILLUME_INDICATOR_OPAQUE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE },
+ { "_E_ILLUME_INDICATOR_TRANSLUCENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT },
+ { "_E_ILLUME_INDICATOR_TRANSPARENT", &ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT },
+ { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
+ { "_E_ILLUME_ROTATE_WINDOW_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
+ { "_E_ILLUME_ROTATE_ROOT_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE },
+ { "_E_ILLUME_CLIPBOARD_STATE", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE },
+ { "_E_ILLUME_CLIPBOARD_ON", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON },
+ { "_E_ILLUME_CLIPBOARD_OFF", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF },
+ { "_E_ILLUME_CLIPBOARD_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY },
{ "_E_COMP_SYNC_COUNTER", &ECORE_X_ATOM_E_COMP_SYNC_COUNTER },
{ "_E_COMP_SYNC_DRAW_DONE", &ECORE_X_ATOM_E_COMP_SYNC_DRAW_DONE },
{ "_E_COMP_SYNC_SUPPORTED", &ECORE_X_ATOM_E_COMP_SYNC_SUPPORTED },
{ "_E_VIDEO_POSITION", &ECORE_X_ATOM_E_VIDEO_POSITION }
/* SLP additions after the comma */ ,
- { "_E_USER_CREATED_WINDOW", &ECORE_X_ATOM_E_USER_CREATED_WINDOW },
- { "_E_PARENT_BORDER_WINDOW", &ECORE_X_ATOM_E_PARENT_BORDER_WINDOW },
- { "_E_COMP_DRI_BUFF_FLIP_SUPPORTED", &ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED },
-
- /* for rotation */
- { "_E_ILLUME_ROTATE_WINDOW_ANGLE", & ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
- { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", & ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
- { "_E_ILLUME_ROTATE_OPERATOR", & ECORE_X_ATOM_E_ILLUME_ROTATE_OPERATOR },
- { "_E_ILLUME_ROTATE_ROOT_ANGLE", & ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE },
-
- /* for user created window */
- { "_ECORE_X_USER_CREATED_WINDOW", & ECORE_X_ATOM_USER_CREATED_WINDOW },
-
- /* XID that points to the parent border window */
- { "_ECORE_X_PARENT_BORDER_WINDOW", &ECORE_X_ATOM_PARENT_BORDER_WINDOW },
-
- /* for indicator's state */
- { "_E_ILLUME_INDICATOR_STATE", &ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE },
- { "_E_ILLUME_ROTATE_WINDOW_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_ANGLE },
- { "_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLES", &ECORE_X_ATOM_E_ILLUME_ROTATE_WINDOW_AVAILABLE_ANGLE },
- { "_E_ILLUME_ROTATE_OPERATOR", &ECORE_X_ATOM_E_ILLUME_ROTATE_OPERATOR },
- { "_E_ILLUME_ROTATE_ROOT_ANGLE", &ECORE_X_ATOM_E_ILLUME_ROTATE_ROOT_ANGLE },
/* for sliding window */
{ "_E_ILLUME_SLIDING_WIN_STATE", &ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_STATE },
{ "_E_ILLUME_SLIDING_WIN_GEOMETRY", &ECORE_X_ATOM_E_ILLUME_SLIDING_WIN_GEOMETRY },
- /* for illume window state */
- { "_E_ILLUME_WINDOW_STATE", &ECORE_X_ATOM_E_ILLUME_WINDOW_STATE },
- { "_E_ILLUME_WINDOW_STATE_NORMAL", &ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL },
- { "_E_ILLUME_WINDOW_STATE_INSET", &ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_INSET },
-
/* for SDB(Samsung Debug Bridge) */
{ "_SDB_SERVER_CONNECT", &ECORE_X_ATOM_SDB_SERVER_CONNECT },
{ "_SDB_SERVER_DISCONNECT", &ECORE_X_ATOM_SDB_SERVER_DISCONNECT }
1, 0, 0, 0, 0);
}
+static Ecore_X_Atom
+_ecore_x_e_clipboard_atom_get(Ecore_X_Illume_Clipboard_State state)
+{
+ switch (state)
+ {
+ case ECORE_X_ILLUME_CLIPBOARD_STATE_ON:
+ return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON;
+ case ECORE_X_ILLUME_CLIPBOARD_STATE_OFF:
+ return ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF;
+ default:
+ break;
+ }
+ return 0;
+}
+
+static Ecore_X_Illume_Clipboard_State
+_ecore_x_e_clipboard_state_get(Ecore_X_Atom atom)
+{
+ if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_ON)
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_ON;
+
+ if (atom == ECORE_X_ATOM_E_ILLUME_CLIPBOARD_OFF)
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_OFF;
+
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+}
+
+EAPI void
+ecore_x_e_illume_clipboard_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Clipboard_State state)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ atom = _ecore_x_e_clipboard_atom_get(state);
+
+ ecore_x_window_prop_atom_set(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
+ &atom, 1);
+}
+
+EAPI Ecore_X_Illume_Clipboard_State
+ecore_x_e_illume_clipboard_state_get(Ecore_X_Window win)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!ecore_x_window_prop_atom_get(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_STATE,
+ &atom, 1))
+ return ECORE_X_ILLUME_CLIPBOARD_STATE_UNKNOWN;
+ return _ecore_x_e_clipboard_state_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_clipboard_geometry_set(Ecore_X_Window win,
+ int x, int y, int w, int h)
+{
+ unsigned int geom[4];
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ geom[0] = x;
+ geom[1] = y;
+ geom[2] = w;
+ geom[3] = h;
+ ecore_x_window_prop_card32_set(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
+ geom, 4);
+}
+
+EAPI Eina_Bool
+ecore_x_e_illume_clipboard_geometry_get(Ecore_X_Window win,
+ int *x, int *y, int *w, int *h)
+{
+ int ret = 0;
+ unsigned int geom[4];
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ret =
+ ecore_x_window_prop_card32_get(win,
+ ECORE_X_ATOM_E_ILLUME_CLIPBOARD_GEOMETRY,
+ geom, 4);
+ if (ret != 4) return EINA_FALSE;
+
+ if (x) *x = geom[0];
+ if (y) *y = geom[1];
+ if (w) *w = geom[2];
+ if (h) *h = geom[3];
+
+ return EINA_TRUE;
+}
+
/* for sliding window */
EAPI void
ecore_x_e_illume_sliding_win_state_set(Ecore_X_Window win,
return pixmap;
}
+static Ecore_X_Atom
+_ecore_x_e_indicator_atom_get(Ecore_X_Illume_Indicator_State state)
+{
+ switch (state)
+ {
+ case ECORE_X_ILLUME_INDICATOR_STATE_ON:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_ON;
+
+ case ECORE_X_ILLUME_INDICATOR_STATE_OFF:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF;
+
+ default:
+ break;
+ }
+ return 0;
+}
+
+static Ecore_X_Illume_Indicator_State
+_ecore_x_e_indicator_state_get(Ecore_X_Atom atom)
+{
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_ON)
+ return ECORE_X_ILLUME_INDICATOR_STATE_ON;
+
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OFF)
+ return ECORE_X_ILLUME_INDICATOR_STATE_OFF;
+
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+}
+
EAPI void
-ecore_x_e_comp_dri_buff_flip_supported_set(Ecore_X_Window root, Eina_Bool enabled)
-{
- Ecore_X_Window win;
-
- if (!root) root = DefaultRootWindow(_ecore_x_disp);
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (enabled)
- {
- win = ecore_x_window_new(root, 1, 2, 3, 4);
- ecore_x_window_prop_xid_set(win, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
- ECORE_X_ATOM_WINDOW, &win, 1);
- ecore_x_window_prop_xid_set(root, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
- ECORE_X_ATOM_WINDOW, &win, 1);
- }
- else
- {
- int ret =
- ecore_x_window_prop_xid_get(root,
- ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win, 1);
- if ((ret == 1) && (win))
- {
- ecore_x_window_prop_property_del(root, ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED);
- ecore_x_window_free(win);
- }
- }
+ecore_x_e_illume_indicator_state_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state)
+{
+ Ecore_X_Atom atom = 0;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ atom = _ecore_x_e_indicator_atom_get(state);
+ ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ &atom, 1);
}
-EAPI Eina_Bool
-ecore_x_e_comp_dri_buff_flip_supported_get(Ecore_X_Window root)
-{
- Ecore_X_Window win, win2;
- int ret;
-
- LOGFN(__FILE__, __LINE__, __FUNCTION__);
- if (!root) root = DefaultRootWindow(_ecore_x_disp);
- ret =
- ecore_x_window_prop_xid_get(root,
- ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win, 1);
- if ((ret == 1) && (win))
- {
- ret =
- ecore_x_window_prop_xid_get(win,
- ECORE_X_ATOM_E_COMP_DRI_BUFF_FLIP_SUPPORTED,
- ECORE_X_ATOM_WINDOW,
- &win2, 1);
- if ((ret == 1) && (win2 == win)) return EINA_TRUE;
- }
- return EINA_FALSE;
+EAPI Ecore_X_Illume_Indicator_State
+ecore_x_e_illume_indicator_state_get(Ecore_X_Window win)
+{
+ Ecore_X_Atom atom;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ if (!ecore_x_window_prop_atom_get(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ &atom, 1))
+ return ECORE_X_ILLUME_INDICATOR_STATE_UNKNOWN;
+
+ return _ecore_x_e_indicator_state_get(atom);
+}
+
+EAPI void
+ecore_x_e_illume_indicator_state_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_State state)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ecore_x_client_message32_send(win, ECORE_X_ATOM_E_ILLUME_INDICATOR_STATE,
+ ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+ _ecore_x_e_indicator_atom_get(state),
+ 0, 0, 0, 0);
}
static Ecore_X_Atom
-_ecore_x_e_illume_window_state_atom_get(Ecore_X_Illume_Window_State state)
+_ecore_x_e_indicator_opacity_atom_get(Ecore_X_Illume_Indicator_Opacity_Mode mode)
{
- switch (state)
+ switch (mode)
{
- case ECORE_X_ILLUME_WINDOW_STATE_NORMAL:
- return ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL;
+ case ECORE_X_ILLUME_INDICATOR_OPAQUE:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE;
+
+ case ECORE_X_ILLUME_INDICATOR_TRANSLUCENT:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT;
- case ECORE_X_ILLUME_WINDOW_STATE_INSET:
- return ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_INSET;
+ case ECORE_X_ILLUME_INDICATOR_TRANSPARENT:
+ return ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT;
default:
break;
return 0;
}
-static Ecore_X_Illume_Window_State
-_ecore_x_e_illume_window_state_get(Ecore_X_Atom atom)
+static Ecore_X_Illume_Indicator_Opacity_Mode
+_ecore_x_e_indicator_opacity_get(Ecore_X_Atom atom)
{
- if (atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_NORMAL)
- return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_OPAQUE)
+ return ECORE_X_ILLUME_INDICATOR_OPAQUE;
- if (atom == ECORE_X_ATOM_E_ILLUME_WINDOW_STATE_INSET)
- return ECORE_X_ILLUME_WINDOW_STATE_INSET;
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSLUCENT)
+ return ECORE_X_ILLUME_INDICATOR_TRANSLUCENT;
- return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
+ if (atom == ECORE_X_ATOM_E_ILLUME_INDICATOR_TRANSPARENT)
+ return ECORE_X_ILLUME_INDICATOR_TRANSPARENT;
+
+ return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
}
EAPI void
-ecore_x_e_illume_window_state_set(Ecore_X_Window win,
- Ecore_X_Illume_Window_State state)
+ecore_x_e_illume_indicator_opacity_set(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode)
{
Ecore_X_Atom atom = 0;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
- atom = _ecore_x_e_illume_window_state_atom_get(state);
- ecore_x_window_prop_atom_set(win, ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
+ atom = _ecore_x_e_indicator_opacity_atom_get(mode);
+ ecore_x_window_prop_atom_set(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
&atom, 1);
}
-EAPI Ecore_X_Illume_Window_State
-ecore_x_e_illume_window_state_get(Ecore_X_Window win)
+EAPI Ecore_X_Illume_Indicator_Opacity_Mode
+ecore_x_e_illume_indicator_opacity_get(Ecore_X_Window win)
{
Ecore_X_Atom atom;
LOGFN(__FILE__, __LINE__, __FUNCTION__);
if (!ecore_x_window_prop_atom_get(win,
- ECORE_X_ATOM_E_ILLUME_WINDOW_STATE,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
&atom, 1))
- return ECORE_X_ILLUME_WINDOW_STATE_NORMAL;
+ return ECORE_X_ILLUME_INDICATOR_OPACITY_UNKNOWN;
+
+ return _ecore_x_e_indicator_opacity_get(atom);
+}
- return _ecore_x_e_illume_window_state_get(atom);
+EAPI void
+ecore_x_e_illume_indicator_opacity_send(Ecore_X_Window win,
+ Ecore_X_Illume_Indicator_Opacity_Mode mode)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ ecore_x_client_message32_send(win,
+ ECORE_X_ATOM_E_ILLUME_INDICATOR_OPACITY_MODE,
+ ECORE_X_EVENT_MASK_WINDOW_CONFIGURE,
+ _ecore_x_e_indicator_opacity_atom_get(mode),
+ 0, 0, 0, 0);
}
return EINA_TRUE;
}
+EAPI void
+ecore_x_netwm_icons_set(Ecore_X_Window win,
+ Ecore_X_Icon *icon,
+ int num)
+{
+ unsigned int *data, *p, *p2;
+ unsigned int i, size, x, y;
+
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+ size = 0;
+ for (i = 0; i < (unsigned int)num; i++)
+ {
+ size += 2 + (icon[i].width * icon[i].height);
+ }
+ data = malloc(size * sizeof(unsigned int));
+ if (!data) return;
+ p = data;
+ for (i = 0; i < (unsigned int)num; i++)
+ {
+ p[0] = icon[i].width;
+ p[1] = icon[i].height;
+ p += 2;
+ p2 = icon[i].data;
+ for (y = 0; y < icon[i].height; y++)
+ {
+ for (x = 0; x < icon[i].width; x++)
+ {
+ unsigned int r, g, b, a;
+
+ a = (*p2 >> 24) & 0xff;
+ r = (*p2 >> 16) & 0xff;
+ g = (*p2 >> 8 ) & 0xff;
+ b = (*p2 ) & 0xff;
+ if ((a > 0) && (a < 255))
+ {
+ // unpremul
+ r = (r * 255) / a;
+ g = (g * 255) / a;
+ b = (b * 255) / a;
+ }
+ *p = (a << 24) | (r << 16) | (g << 8) | b;
+ p++;
+ p2++;
+ }
+ }
+ }
+ ecore_x_window_prop_card32_set(win, ECORE_X_ATOM_NET_WM_ICON,
+ data, size);
+ free(data);
+}
+
EAPI Eina_Bool
ecore_x_netwm_icons_get(Ecore_X_Window win,
Ecore_X_Icon **icon,
ret[i]->vSyncStart = res->modes[i].vSyncStart;
ret[i]->vSyncEnd = res->modes[i].vSyncEnd;
ret[i]->vTotal = res->modes[i].vTotal;
- if ((ret[i]->name = (malloc(res->modes[i].nameLength))))
+ if ((ret[i]->name = (malloc(res->modes[i].nameLength + 1))))
strncpy(ret[i]->name, res->modes[i].name,
- res->modes[i].nameLength);
+ (res->modes[i].nameLength + 1));
else
ret[i]->name = NULL;
}
/*
+ * @brief add a mode to a display
+ * @param root window to which's screen's ressources are added
+ * @param mode_info
+ * @return Ecore_X_Randr_Mode of the added mode. Ecore_X_Randr_None if mode
+ * adding failed.
+ * @since 1.2.0
+ */
+EAPI Ecore_X_Randr_Mode
+ecore_x_randr_mode_info_add(Ecore_X_Window root,
+ Ecore_X_Randr_Mode_Info *mode_info)
+{
+#ifdef ECORE_XRANDR
+ RANDR_CHECK_1_2_RET(EINA_FALSE);
+ Ecore_X_Randr_Mode mode = Ecore_X_Randr_None;
+
+ if (_ecore_x_randr_root_validate(root) && mode_info)
+ mode = XRRCreateMode(_ecore_x_disp, root, (XRRModeInfo*)mode_info);
+
+ return mode;
+#else
+ return Ecore_X_Randr_None;
+#endif
+}
+
+/*
+ * @brief delete a mode from the display
+ * @param mode_info
+ * @since 1.2.0
+ */
+EAPI void
+ecore_x_randr_mode_del(Ecore_X_Randr_Mode mode)
+{
+#ifdef ECORE_XRANDR
+ RANDR_CHECK_1_2_RET();
+
+ XRRDestroyMode(_ecore_x_disp, mode);
+#else
+ return;
+#endif
+}
+
+/*
* @brief get detailed information for a given mode id
* @param root window which's screen's ressources are queried
* @param mode the XID which identifies the mode of interest
#endif
}
+/*
+ * @deprecated bad naming. Use ecore_x_randr_window_crtcs_get instead.
+ * @brief get the CRTCs, which display a certain window
+ * @param window window the displaying crtcs shall be found for
+ * @param num the number of crtcs displaying the window
+ * @return array of crtcs that display a certain window. NULL if no crtcs
+ * was found that displays the specified window.
+ */
+EAPI Ecore_X_Randr_Crtc *
+ecore_x_randr_current_crtc_get(Ecore_X_Window window,
+ int *num)
+{
+ return ecore_x_randr_window_crtcs_get(window, num);
+}
+
+/*
+ * @brief get the CRTCs, which display a certain window
+ * @param window window the displaying crtcs shall be found for
+ * @param num the number of crtcs displaying the window
+ * @return array of crtcs that display a certain window. NULL if no crtcs
+ * was found that displays the specified window.
+ * @since 1.2.0
+ */
+EAPI Ecore_X_Randr_Crtc *
+ecore_x_randr_window_crtcs_get(Ecore_X_Window window,
+ int *num)
+{
+#ifdef ECORE_XRANDR
+ Ecore_X_Window root;
+ Eina_Rectangle w_geo, c_geo;
+ Ecore_X_Randr_Crtc *crtcs;
+ Ecore_X_Randr_Mode mode;
+ Ecore_X_Randr_Output *ret = NULL;
+ Window tw;
+ int ncrtcs, i, nret = 0, rx = 0, ry = 0;
+
+ if (_randr_version < RANDR_1_2) goto _ecore_x_randr_window_crtcs_get_fail;
+
+ ecore_x_window_geometry_get(window,
+ &w_geo.x, &w_geo.y,
+ &w_geo.w, &w_geo.h);
+
+ root = ecore_x_window_root_get(window);
+ crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs);
+ if (!crtcs) goto _ecore_x_randr_window_crtcs_get_fail;
+
+ /* now get window RELATIVE to root window - thats what matters. */
+ XTranslateCoordinates(_ecore_x_disp, window, root, 0, 0, &rx, &ry, &tw);
+ w_geo.x = rx;
+ w_geo.y = ry;
+
+ for (i = 0, nret = 0; i < ncrtcs; i++)
+ {
+ /* if crtc is not enabled, don't bother about it any further */
+ mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
+ if (mode == Ecore_X_Randr_None) continue;
+
+ ecore_x_randr_crtc_geometry_get(root, crtcs[i],
+ &c_geo.x, &c_geo.y,
+ &c_geo.w, &c_geo.h);
+ if (eina_rectangles_intersect(&w_geo, &c_geo))
+ {
+ ret = realloc(ret, (sizeof(Ecore_X_Randr_Crtc) * ++nret));
+ ret[nret] = crtcs[i];
+ }
+ }
+ free(crtcs);
+
+ if (num) *num = nret;
+ return ret;
+
+_ecore_x_randr_window_crtcs_get_fail:
+#endif
+ if (num) *num = 0;
+ return NULL;
+}
+
EAPI Ecore_X_Randr_Output *
ecore_x_randr_outputs_get(Ecore_X_Window root,
int *num)
#endif
}
+/*
+ * @brief add given mode to given output
+ * @param output the output the mode is added to
+ * @param mode the mode added to the output
+ * @return EINA_FALSE if output or mode equal Ecore_X_Randr_None, else EINA_TRUE
+ * Additionally, if xcb backend is used, the success of the addition is reported
+ * back directly.
+ * @since 1.2.0
+ */
+EAPI Eina_Bool
+ecore_x_randr_output_mode_add(Ecore_X_Randr_Output output,
+ Ecore_X_Randr_Mode mode)
+{
+#ifdef ECORE_XRANDR
+ RANDR_CHECK_1_2_RET(EINA_FALSE);
+
+ if ((output == Ecore_X_Randr_None) || (mode == Ecore_X_Randr_None))
+ return EINA_FALSE;
+
+ XRRAddOutputMode(_ecore_x_disp, output, mode);
+ return EINA_TRUE;
+#else
+ return EINA_FALSE;
+#endif
+}
+
+/*
+ * @brief delete given mode from given output
+ * @param output the output the mode is removed from
+ * @param mode the mode removed from the output
+ * @since 1.2.0
+ */
+EAPI void
+ecore_x_randr_output_mode_del(Ecore_X_Randr_Output output,
+ Ecore_X_Randr_Mode mode)
+{
+#ifdef ECORE_XRANDR
+ RANDR_CHECK_1_2_RET();
+
+ if ((output == Ecore_X_Randr_None) || (mode == Ecore_X_Randr_None))
+ return;
+
+ XRRDeleteOutputMode(_ecore_x_disp, output, mode);
+#else
+ return;
+#endif
+}
+
EAPI Ecore_X_Randr_Mode *
ecore_x_randr_output_modes_get(Ecore_X_Window root,
Ecore_X_Randr_Output output,
{
#ifdef ECORE_XRANDR
Ecore_X_Window root;
- Eina_Rectangle w_geo, c_geo;
Ecore_X_Randr_Crtc *crtcs;
- Ecore_X_Randr_Mode mode;
- Ecore_X_Randr_Output *outputs, *ret = NULL, *tret;
- Window tw;
- int ncrtcs, noutputs, i, nret = 0, rx = 0, ry = 0;
+ Ecore_X_Randr_Output *outputs, *ret = NULL;
+ int ncrtcs, noutputs, i, nret = 0;
if (_randr_version < RANDR_1_2) goto _ecore_x_randr_current_output_get_fail;
- ecore_x_window_geometry_get(window,
- &w_geo.x, &w_geo.y,
- &w_geo.w, &w_geo.h);
-
root = ecore_x_window_root_get(window);
- crtcs = ecore_x_randr_crtcs_get(root, &ncrtcs);
- if (!crtcs) goto _ecore_x_randr_current_output_get_fail;
-
- /* now get window RELATIVE to root window - thats what matters. */
- XTranslateCoordinates(_ecore_x_disp, window, root, 0, 0, &rx, &ry, &tw);
- w_geo.x = rx;
- w_geo.y = ry;
+ if (!(crtcs = ecore_x_randr_window_crtcs_get(window, &ncrtcs)))
+ goto _ecore_x_randr_current_output_get_fail;
- for (i = 0; i < ncrtcs; i++)
+ for (i = 0, nret = 0; i < ncrtcs; i++)
{
- /* if crtc is not enabled, don't bother about it any further */
- mode = ecore_x_randr_crtc_mode_get(root, crtcs[i]);
- if (mode == Ecore_X_Randr_None) continue;
- ecore_x_randr_crtc_geometry_get(root, crtcs[i],
- &c_geo.x, &c_geo.y,
- &c_geo.w, &c_geo.h);
- if (eina_rectangles_intersect(&w_geo, &c_geo))
- {
- outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
- &noutputs);
- /* The case below should be impossible, but for safety reasons
- * remains */
- if (!outputs)
- {
- if (num) *num = 0;
- free(ret);
- free(crtcs);
- return NULL;
- }
- tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output)));
- if (!tret)
- {
- if (num) *num = 0;
- free(outputs);
- free(ret);
- free(crtcs);
- return NULL;
- }
- ret = tret;
- memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
- nret += noutputs;
- free(outputs);
- }
+ outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
+ &noutputs);
+ if (!outputs)
+ goto _ecore_x_randr_current_output_get_fail_free;
+ nret += noutputs;
+ ret = realloc(ret, (nret * sizeof(Ecore_X_Randr_Output)));
+ memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
+ free(outputs);
}
free(crtcs);
- if (num) *num = nret;
+ if (num)
+ *num = nret;
+
return ret;
+_ecore_x_randr_current_output_get_fail_free:
+ free(outputs);
+ free(crtcs);
+ free(ret);
_ecore_x_randr_current_output_get_fail:
#endif
if (num) *num = 0;
}
/*
- * @depricated bad naming. Use ecore_x_randr_window_outputs_get instead.
+ * @deprecated bad naming. Use ecore_x_randr_window_outputs_get instead.
* @brief get the outputs, which display a certain window
* @param window window the displaying outputs shall be found for
* @param num the number of outputs displaying the window
* was found that displays the specified window.
*/
-EINA_DEPRECATED EAPI Ecore_X_Randr_Output *
+EAPI Ecore_X_Randr_Output *
ecore_x_randr_current_output_get(Ecore_X_Window window,
int *num)
{
* @c _NET_WM_PID.
*
* @param win The given window.
- * @ingroup Ecore_X_Window_Properties_Groups
+ * @ingroup Ecore_X_Window_Properties_Group
*/
EAPI void
ecore_x_window_defaults_set(Ecore_X_Window win)
}
/**
- * gets the focus to the window @p win.
+ * gets the window that has focus.
* @return The window that has focus.
* @ingroup Ecore_X_Window_Focus_Functions
*/
/**
* Retrieves the geometry of the given window.
*
- * Note that the x & y coordingates are relative to your parent. In
+ * Note that the x & y coordinates are relative to your parent. In
* particular for reparenting window managers - relative to you window border.
* If you want screen coordinates either walk the window tree to the root,
* else for ecore_evas applications see ecore_evas_geometry_get(). Elementary
* Get a window string property.
* @param win The window
* @param type The property
- *
- * Return window string property of a window. String must be free'd when done.
+ * @return Window string property of a window. String must be free'd when done.
*/
EAPI char *
ecore_x_window_prop_string_get(Ecore_X_Window win,
{
char *plain_str = NULL;
char *markup_str = NULL;
- const char *puncs[3] = {". ", "! ", "? "};
+ const char *puncs[] = {". ", "! ", "? "};
Eina_Bool ret = EINA_FALSE;
int cursor_pos = 0;
int i = 0;
Eina_Unicode *tail = NULL;
Eina_Unicode *ustr = NULL;
- Eina_Unicode *uni_puncs[3];
+ const int punc_num = sizeof(puncs) / sizeof(puncs[0]);
+ Eina_Unicode *uni_puncs[punc_num];
EcoreIMFContextISF *context_scim;
if (!ctx) return EINA_FALSE;
break;
}
- for (i = 0; i < 3; i++)
+ for (i = 0; i < punc_num; i++)
uni_puncs[i] = eina_unicode_utf8_to_unicode(puncs[i], NULL);
ecore_imf_context_surrounding_get(ctx, &markup_str, &cursor_pos);
if (tail)
{
- for (i = 0; i < 3; i++)
+ for (i = 0; i < punc_num; i++)
{
if (!eina_unicode_strcmp(tail, uni_puncs[i]))
{
if (markup_str) free(markup_str);
if (plain_str) free(plain_str);
- for (i = 0; i < 3; i++)
+ for (i = 0; i < punc_num; i++)
if (uni_puncs[i]) free(uni_puncs[i]);
return ret;
}
}
+static void
+window_to_screen_geometry_get(Ecore_X_Window client_win, int *x, int *y)
+{
+ Ecore_X_Window root_window, win;
+ int win_x, win_y;
+ int sum_x = 0, sum_y = 0;
+
+ root_window = ecore_x_window_root_get(client_win);
+ win = client_win;
+
+ while (root_window != win)
+ {
+ ecore_x_window_geometry_get(win, &win_x, &win_y, NULL, NULL);
+ sum_x += win_x;
+ sum_y += win_y;
+ win = ecore_x_window_parent_get(win);
+ }
+
+ if (x)
+ *x = sum_x;
+ if (y)
+ *y = sum_y;
+}
+
/* Public functions */
/**
* isf_imf_context_new
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
char *env;
- Ecore_X_Display *display = ecore_x_display_get();
- if (!display)
- {
- std::cerr << "ecore_x_display_get() failed !!!";
- return NULL;
- }
-
EcoreIMFContextISF *context_scim = new EcoreIMFContextISF;
if (context_scim == NULL)
{
_panel_client.send();
}
+
+ if (ecore_imf_context_input_panel_enabled_get(ctx))
+ ecore_imf_context_input_panel_show(ctx);
}
/**
_panel_client.send();
_focused_ic = 0;
}
+
+ if (ecore_imf_context_input_panel_enabled_get(ctx))
+ ecore_imf_context_input_panel_hide(ctx);
}
/**
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
Ecore_Evas *ee;
int canvas_x, canvas_y;
+ int new_cursor_x, new_cursor_y;
if (cw == 0 && ch == 0)
return;
if (context_scim && context_scim->impl && context_scim == _focused_ic)
{
- // Don't update spot location while updating preedit string.
- if (context_scim->impl->preedit_updating)
- return;
+ if (context_scim->impl->client_canvas)
+ {
+ ee = ecore_evas_ecore_evas_get(context_scim->impl->client_canvas);
+ if (!ee) return;
- if (!context_scim->impl->client_canvas)
- return;
+ ecore_evas_geometry_get(ee, &canvas_x, &canvas_y, NULL, NULL);
+ }
+ else
+ {
+ if (context_scim->impl->client_window)
+ window_to_screen_geometry_get(context_scim->impl->client_window, &canvas_x, &canvas_y);
+ else
+ return;
+ }
- ee = ecore_evas_ecore_evas_get(context_scim->impl->client_canvas);
- if (!ee) return;
+ new_cursor_x = canvas_x + cx;
+ new_cursor_y = canvas_y + cy + ch;
- ecore_evas_geometry_get(ee, &canvas_x, &canvas_y, NULL, NULL);
+ // Don't update spot location while updating preedit string.
+ if (context_scim->impl->preedit_updating && (context_scim->impl->cursor_y == new_cursor_y))
+ return;
- if (context_scim->impl->cursor_x != canvas_x + cx || context_scim->impl->cursor_y != canvas_y + cy + ch)
+ if (context_scim->impl->cursor_x != new_cursor_x || context_scim->impl->cursor_y != new_cursor_y)
{
- context_scim->impl->cursor_x = canvas_x + cx;
- context_scim->impl->cursor_y = canvas_y + cy + ch;
+ context_scim->impl->cursor_x = new_cursor_x;
+ context_scim->impl->cursor_y = new_cursor_y;
_panel_client.prepare(context_scim->id);
panel_req_update_spot_location(context_scim);
_panel_client.send();
* the event was not handled), but there is no obligation of any events to be
* submitted to this function.
*/
-
EAPI Eina_Bool
isf_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type, Ecore_IMF_Event *event)
{
return ret;
}
+EAPI void
+isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
+{
+ SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+ EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
+ if (ic == NULL || ic->impl == NULL)
+ return;
+
+ ecore_x_e_virtual_keyboard_state_set
+ (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
+}
+
+EAPI void
+isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
+{
+ SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+ EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
+ if (ic == NULL || ic->impl == NULL)
+ return;
+
+ ecore_x_e_virtual_keyboard_state_set
+ (ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
+}
+
/* Panel Slot functions */
static void
panel_slot_reload_config(int context __UNUSED__)
EcoreIMFContextISF *ic = find_ic(context);
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " key=" << key.get_key_string() << " ic=" << ic << "\n";
- if (ic && ic->impl && ic->impl->client_canvas)
- feed_key_event(ic->impl->client_canvas, key.get_key_string().c_str(), EINA_FALSE);
+ if (key.is_key_press())
+ ecore_x_test_fake_key_press(key.get_key_string().c_str());
}
static void
void isf_imf_context_prediction_allow_set (Ecore_IMF_Context* ctx, Eina_Bool prediction);
void isf_imf_context_autocapital_type_set (Ecore_IMF_Context* ctx, Ecore_IMF_Autocapital_Type autocapital_type);
void isf_imf_context_input_panel_layout_set (Ecore_IMF_Context* ctx, Ecore_IMF_Input_Panel_Layout layout);
+void isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx);
+void isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx);
EcoreIMFContextISF* isf_imf_context_new (void);
void isf_imf_context_shutdown (void);
isf_imf_context_del, /* del */
isf_imf_context_client_window_set, /* client_window_set */
isf_imf_context_client_canvas_set, /* client_canvas_set */
- NULL, /* isf_imf_context_input_panel_show, - show */
- NULL, /* isf_imf_context_input_panel_hide, - hide */
+ isf_imf_context_input_panel_show, /* input_panel_show, - show */
+ isf_imf_context_input_panel_hide, /* input_panel_hide, - hide */
isf_imf_context_preedit_string_get, /* get_preedit_string */
isf_imf_context_focus_in, /* focus_in */
isf_imf_context_focus_out, /* focus_out */
isf_imf_context_cursor_location_set, /* cursor_location_set */
NULL, /* input_panel_imdata_set */
NULL, /* input_panel_imdata_get */
+ NULL, /* input_panel_return_key_type_set */
+ NULL, /* input_panel_return_key_disabled_set */
+ NULL /* input_panel_caps_lock_mode_set */
};
static Ecore_IMF_Context *imf_module_create (void);
imf_context_data = ecore_imf_context_data_get(ctx);
ic = imf_context_data->ic;
imf_context_data->has_focus = EINA_TRUE;
+
+ if (ecore_imf_context_input_panel_enabled_get(ctx))
+ ecore_imf_context_input_panel_show(ctx);
+
if (ic)
{
char *str;
ic = imf_context_data->ic;
if (ic)
XUnsetICFocus(ic);
+
+ if (ecore_imf_context_input_panel_enabled_get(ctx))
+ ecore_imf_context_input_panel_hide(ctx);
}
#else
(void)ctx;
(void)(w); // yes w is unused, but only a bi-product of the algorithm
}
+static void
+_ecore_imf_context_xim_input_panel_show(Ecore_IMF_Context *ctx)
+{
+ EINA_LOG_DBG("%s in", __FUNCTION__);
+
+#ifdef ENABLE_XIM
+ Ecore_IMF_Context_Data *imf_context_data;
+ imf_context_data = ecore_imf_context_data_get(ctx);
+
+ ecore_x_e_virtual_keyboard_state_set
+ (imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
+#else
+ (void)ctx;
+#endif
+}
+
+static void
+_ecore_imf_context_xim_input_panel_hide(Ecore_IMF_Context *ctx)
+{
+ EINA_LOG_DBG("%s in", __FUNCTION__);
+
+#ifdef ENABLE_XIM
+ Ecore_IMF_Context_Data *imf_context_data;
+ imf_context_data = ecore_imf_context_data_get(ctx);
+
+ ecore_x_e_virtual_keyboard_state_set
+ (imf_context_data->win, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
+#else
+ (void)ctx;
+#endif
+}
+
#ifdef ENABLE_XIM
static unsigned int
_ecore_x_event_reverse_modifiers(unsigned int state)
.del = _ecore_imf_context_xim_del,
.client_window_set = _ecore_imf_context_xim_client_window_set,
.client_canvas_set = NULL,
- .show = NULL,
- .hide = NULL,
+ .show = _ecore_imf_context_xim_input_panel_show,
+ .hide = _ecore_imf_context_xim_input_panel_hide,
.preedit_string_get = _ecore_imf_context_xim_preedit_string_get,
.focus_in = _ecore_imf_context_xim_focus_in,
.focus_out = _ecore_imf_context_xim_focus_out,
.cursor_location_set = _ecore_imf_context_xim_cursor_location_set,
.input_panel_imdata_set = NULL,
.input_panel_imdata_get = NULL,
+ .input_panel_return_key_type_set = NULL,
+ .input_panel_return_key_disabled_set = NULL,
+ .input_panel_caps_lock_mode_set = NULL
};
static Ecore_IMF_Context *
#include "ecore_suite.h"
+/* FIXME: Currently disable these tests. They are useless ATM and they just
+ * make buildbot complain. Once we add useful tests here we'll also bother
+ * with getting X on the server. */
+#undef HAVE_ECORE_X_XLIB
/* TODO: change to HAVE_ECORE_X when xcb implementation is done */
#ifdef HAVE_ECORE_X_XLIB