From cddaadb4477f3cc1b36d4f4fe68ba1f6abfa8a3d Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 23 Sep 2003 07:54:34 +0000 Subject: [PATCH] DELETED! SVN revision: 7474 --- legacy/ecore/.cvsignore | 30 - legacy/ecore/AUTHORS | 5 - legacy/ecore/COPYING | 20 - legacy/ecore/ChangeLog | 0 legacy/ecore/INSTALL | 0 legacy/ecore/Makefile.am | 37 - legacy/ecore/NEWS | 0 legacy/ecore/README | 26 - legacy/ecore/acconfig.h | 4 - legacy/ecore/autogen.sh | 153 - legacy/ecore/configure.ac | 111 - legacy/ecore/configure.in | 108 - legacy/ecore/debian/.cvsignore | 2 - legacy/ecore/debian/Makefile.am | 7 - legacy/ecore/debian/changelog | 5 - legacy/ecore/debian/control | 21 - legacy/ecore/debian/copyright | 32 - legacy/ecore/debian/libecore0-dev.files | 7 - legacy/ecore/debian/libecore0.files | 1 - legacy/ecore/debian/rules | 88 - legacy/ecore/doc/Makefile.am | 41 - legacy/ecore/doc/figures/background.gif | Bin 6432 -> 0 bytes legacy/ecore/doc/figures/caution.gif | Bin 1039 -> 0 bytes legacy/ecore/doc/figures/note.gif | Bin 1070 -> 0 bytes legacy/ecore/doc/figures/warning.gif | Bin 1052 -> 0 bytes legacy/ecore/doc/html-customizations.dsl.in | 61 - legacy/ecore/doc/kernel-doc.in | 1001 ----- legacy/ecore/doc/manual.raw | 283 -- legacy/ecore/doc/stylesheet.css | 20 - legacy/ecore/ecore-config.in | 59 - legacy/ecore/ecore.m4 | 198 - legacy/ecore/ecore.pc.in | 11 - legacy/ecore/ecore.spec | 63 - legacy/ecore/src/.cvsignore | 29 - legacy/ecore/src/Ecore.h | 919 ----- legacy/ecore/src/Makefile.am | 19 - legacy/ecore/src/e_ev_filter.c | 132 - legacy/ecore/src/e_ev_signal.c | 320 -- legacy/ecore/src/e_ev_x.c | 1238 ------- legacy/ecore/src/e_events.c | 430 --- legacy/ecore/src/e_ipc.c | 187 - legacy/ecore/src/e_util.c | 10 - legacy/ecore/src/e_x.c | 3621 ------------------- 43 files changed, 9299 deletions(-) delete mode 100644 legacy/ecore/.cvsignore delete mode 100644 legacy/ecore/AUTHORS delete mode 100644 legacy/ecore/COPYING delete mode 100644 legacy/ecore/ChangeLog delete mode 100644 legacy/ecore/INSTALL delete mode 100644 legacy/ecore/Makefile.am delete mode 100644 legacy/ecore/NEWS delete mode 100644 legacy/ecore/README delete mode 100644 legacy/ecore/acconfig.h delete mode 100755 legacy/ecore/autogen.sh delete mode 100644 legacy/ecore/configure.ac delete mode 100644 legacy/ecore/configure.in delete mode 100644 legacy/ecore/debian/.cvsignore delete mode 100644 legacy/ecore/debian/Makefile.am delete mode 100644 legacy/ecore/debian/changelog delete mode 100644 legacy/ecore/debian/control delete mode 100644 legacy/ecore/debian/copyright delete mode 100644 legacy/ecore/debian/libecore0-dev.files delete mode 100644 legacy/ecore/debian/libecore0.files delete mode 100644 legacy/ecore/debian/rules delete mode 100644 legacy/ecore/doc/Makefile.am delete mode 100644 legacy/ecore/doc/figures/background.gif delete mode 100644 legacy/ecore/doc/figures/caution.gif delete mode 100644 legacy/ecore/doc/figures/note.gif delete mode 100644 legacy/ecore/doc/figures/warning.gif delete mode 100644 legacy/ecore/doc/html-customizations.dsl.in delete mode 100644 legacy/ecore/doc/kernel-doc.in delete mode 100644 legacy/ecore/doc/manual.raw delete mode 100644 legacy/ecore/doc/stylesheet.css delete mode 100644 legacy/ecore/ecore-config.in delete mode 100644 legacy/ecore/ecore.m4 delete mode 100644 legacy/ecore/ecore.pc.in delete mode 100644 legacy/ecore/ecore.spec delete mode 100644 legacy/ecore/src/.cvsignore delete mode 100644 legacy/ecore/src/Ecore.h delete mode 100644 legacy/ecore/src/Makefile.am delete mode 100644 legacy/ecore/src/e_ev_filter.c delete mode 100644 legacy/ecore/src/e_ev_signal.c delete mode 100644 legacy/ecore/src/e_ev_x.c delete mode 100644 legacy/ecore/src/e_events.c delete mode 100644 legacy/ecore/src/e_ipc.c delete mode 100644 legacy/ecore/src/e_util.c delete mode 100644 legacy/ecore/src/e_x.c diff --git a/legacy/ecore/.cvsignore b/legacy/ecore/.cvsignore deleted file mode 100644 index fe5e033462..0000000000 --- a/legacy/ecore/.cvsignore +++ /dev/null @@ -1,30 +0,0 @@ -ecore-config -*.lo -*.la -.deps -.libs -Makefile -Makefile.in -aclocal.m4 -confdefs.h -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -install-sh -libtool -ltconfig -ltmain.sh -missing -mkinstalldirs -stamp-h -stamp-h.in -*.tar.gz -macros -*~ -*.spec -.icons diff --git a/legacy/ecore/AUTHORS b/legacy/ecore/AUTHORS deleted file mode 100644 index 69afa43acf..0000000000 --- a/legacy/ecore/AUTHORS +++ /dev/null @@ -1,5 +0,0 @@ -The Rasterman -Tom Gilbert -Burra -Chris Ross -Term diff --git a/legacy/ecore/COPYING b/legacy/ecore/COPYING deleted file mode 100644 index dee3047c34..0000000000 --- a/legacy/ecore/COPYING +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies of the Software, its documentation and marketing & publicity -materials, and acknowledgment shall be given in the documentation, materials -and software packages that this Software was used. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy/ecore/ChangeLog b/legacy/ecore/ChangeLog deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/legacy/ecore/INSTALL b/legacy/ecore/INSTALL deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/legacy/ecore/Makefile.am b/legacy/ecore/Makefile.am deleted file mode 100644 index 5614f70fb2..0000000000 --- a/legacy/ecore/Makefile.am +++ /dev/null @@ -1,37 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = src debian doc - -MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \ - config.h.in config.sub configure install-sh \ - ltconfig ltmain.sh missing mkinstalldirs \ - stamp-h.in - -dist-hook: - if test -d data; then \ - mkdir $(distdir)/data; \ - for file in data/*; do \ - if test -f $$file; then \ - cp -p $$file $(distdir)/data; \ - fi \ - done \ - fi - -bin_SCRIPTS = ecore-config - -EXTRA_DIST = README AUTHORS COPYING ecore.m4 ecore.spec ecore.pc - -m4datadir = $(datadir)/aclocal -m4data_DATA = ecore.m4 - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = ecore.pc - -docs: - $(MAKE) -C $(top_srcdir)/doc docs - -if HAVE_JADE -html-docs: - $(MAKE) -C $(top_srcdir)/doc html-docs -endif - diff --git a/legacy/ecore/NEWS b/legacy/ecore/NEWS deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/legacy/ecore/README b/legacy/ecore/README deleted file mode 100644 index 753a1be375..0000000000 --- a/legacy/ecore/README +++ /dev/null @@ -1,26 +0,0 @@ -------------------------------------------------------------------------------- - E C O R E - 0 . 0 . 1 -------------------------------------------------------------------------------- - -Fast: -How ot build and install Ecore from this tarball? -./configure -make -su - -make install - -from CVS: -./autogen.sh -make -su - -make install - -------------------------------------------------------------------------------- - -What is Ecore? It is the core event abstraction layer and X abstraction -layer that makes doing selections, Xdnd, general X stuff, and event loops, -timeouts and idle handlers fast, optimised, and convenient. it's a separate -librayr so anyone can make use of the work put into Ecore to make this job -easy for applications. diff --git a/legacy/ecore/acconfig.h b/legacy/ecore/acconfig.h deleted file mode 100644 index f98e50928a..0000000000 --- a/legacy/ecore/acconfig.h +++ /dev/null @@ -1,4 +0,0 @@ -#undef PACKAGE_LOCALE_DIR -#undef PACKAGE_DATA_DIR -#undef PACKAGE_SOURCE_DIR -#undef HAVE_RENDER diff --git a/legacy/ecore/autogen.sh b/legacy/ecore/autogen.sh deleted file mode 100755 index 417ad102e2..0000000000 --- a/legacy/ecore/autogen.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -abort () { - echo "$1 not found or command failed. Aborting!" - exit 1 -} - -srcdir=`dirname $0` -PKG_NAME="libecore" - -DIE=0 - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`autoconf' installed to." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && { - (libtool --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`libtool' installed." - echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } -} - -grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && { - grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ - (gettext --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`gettext' installed." - echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } -} - -grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && { - grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \ - (gettext --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`gettext' installed." - echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - } -} - -(automake --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: You must have \`automake' installed." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 - NO_AUTOMAKE=yes -} - - -# if no automake, don't bother testing for aclocal -test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "**Error**: Missing \`aclocal'. The version of \`automake'" - echo "installed doesn't appear recent enough." - echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz" - echo "(or a newer version if it is available)" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "**Warning**: I am going to run \`configure' with no arguments." - echo "If you wish to pass any to it, please specify them on the" - echo \`$0\'" command line." - echo -fi - -case $CC in -xlc ) - am_opt=--include-deps;; -esac - -for coin in `find $srcdir -name configure.in -print` -do - dr=`dirname $coin` - if test -f $dr/NO-AUTO-GEN; then - echo skipping $dr -- flagged as no auto-gen - else - echo processing $dr - macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` - ( cd $dr - aclocalinclude="$ACLOCAL_FLAGS" - for k in $macrodirs; do - if test -d $k; then - aclocalinclude="$aclocalinclude -I $k" - ##else - ## echo "**Warning**: No such directory \`$k'. Ignored." - fi - done - if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then - if grep "sed.*POTFILES" configure.in >/dev/null; then - : do nothing -- we still have an old unmodified configure.in - else - echo "Creating $dr/aclocal.m4 ..." - test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 - echo "Running gettextize... Ignore non-fatal messages." - echo "no" | gettextize --force --copy || abort "gettextize" - echo "Making $dr/aclocal.m4 writable ..." - test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 - fi - fi - if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then - echo "Creating $dr/aclocal.m4 ..." - test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 - echo "Running gettextize... Ignore non-fatal messages." - echo "no" | gettextize --force --copy || abort "gettextize" - echo "Making $dr/aclocal.m4 writable ..." - test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 - fi - if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then - echo "Running libtoolize..." - libtoolize --force --copy || abort "libtoolize" - fi - echo "Running aclocal $aclocalinclude ..." - aclocal $aclocalinclude || abort "aclocal" - if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then - echo "Running autoheader..." - autoheader || abort "autoheader" - fi - echo "Running automake --gnu $am_opt ..." - automake --add-missing --gnu $am_opt || abort "automake" - echo "Running autoconf ..." - autoconf || abort "autoconf" - ) - fi -done - -#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c - -if test x$NOCONFIGURE = x; then - echo Running $srcdir/configure $conf_flags "$@" ... - $srcdir/configure $conf_flags "$@" \ - && echo Now type \`make\' to compile $PKG_NAME || abort "configure" -else - echo Skipping configure process. -fi diff --git a/legacy/ecore/configure.ac b/legacy/ecore/configure.ac deleted file mode 100644 index 396505002b..0000000000 --- a/legacy/ecore/configure.ac +++ /dev/null @@ -1,111 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT -AC_CONFIG_SRCDIR([configure.in]) -AM_INIT_AUTOMAKE(ecore, 0.0.2) -AM_CONFIG_HEADER(config.h) - -AC_ISC_POSIX -AC_PROG_CC -AM_PROG_CC_STDC -AC_HEADER_STDC -AM_PROG_LIBTOOL - -AM_WITH_DMALLOC - -dnl Set PACKAGE_LOCALE_DIR in config.h. -if test "x${prefix}" = "xNONE"; then - AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") -else - AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") -fi - -dnl Set PACKAGE_DATA_DIR in config.h. -if test "x${datadir}" = 'x${prefix}/share'; then - if test "x${prefix}" = "xNONE"; then - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}") - else - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}") - fi -else - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}") -fi - -dnl Set PACKAGE_SOURCE_DIR in config.h. -packagesrcdir=`cd $srcdir && pwd` -AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") - -dnl Use -Wall if we have gcc. -changequote(,)dnl -if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[\ \ ]-Wall[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; - esac -fi -changequote([,])dnl - -AC_PATH_XTRA - -if test "x$x_includes" = "x"; then - x_includes="/usr/include" -fi - -x_cflags="$X_CFLAGS" -x_ldflags="$X_LDFLAGS" -x_libs="$X_LIBS $X_EXTRA_LIBS" - -AC_CHECK_LIB(X11, XOpenDisplay, x_libs="$x_libs", - AC_MSG_ERROR([ERROR: libX11 not found.]); exit, - $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) -AC_CHECK_LIB(Xext, XShmAttach, x_libs="-lXext $x_libs", - AC_CHECK_LIB(XextSam, XShmAttach, - x_libs="-lXextSam -lXext $x_libs", - AC_MSG_ERROR([ERROR: XShm not found.]); exit, - $x_libs), - $x_libs) -AC_CHECK_LIB(Xext, XShapeCombineMask, x_libs="-lXext $x_libs", - AC_MSG_ERROR([ERROR: XShape not found.]); exit, - $x_libs) -AC_CHECK_LIB(Xrender, XRenderCreatePicture, - [ x_libs=" -lXrender -lXext $x_libs"; - AC_DEFINE(HAVE_RENDER) - ], - [], - $x_libs) - -AC_SUBST(x_cflags) -AC_SUBST(x_includes) -AC_SUBST(x_ldflags) -AC_SUBST(x_libs) - -dnl Checking for Perl: -AC_PATH_PROG(PERL,perl,0) -AC_SUBST(PERL) - - -dnl Look for jade for sgml translations. -AC_ARG_WITH(dbsheets, - [ --with-dbsheets=DIR use DIR to specify your DocBook stylesheets installation path.], - DB_STYLESHEETS="$withval", DB_STYLESHEETS="/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh") -AC_SUBST(DB_STYLESHEETS) -AC_PATH_PROG(JADE, jade) -AM_CONDITIONAL(HAVE_JADE, test "x$JADE" != "x" && test -d "$DB_STYLESHEETS") - - -AC_CONFIG_FILES([ -Makefile -ecore.pc -ecore-config -src/Makefile -debian/Makefile -doc/Makefile -doc/kernel-doc -doc/html-customizations.dsl -]) -AC_CONFIG_COMMANDS([default],[[ -chmod +x ecore-config -chmod +x doc/kernel-doc - -]],[[]]) -AC_OUTPUT diff --git a/legacy/ecore/configure.in b/legacy/ecore/configure.in deleted file mode 100644 index 5cd6553900..0000000000 --- a/legacy/ecore/configure.in +++ /dev/null @@ -1,108 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. - -AC_INIT(configure.in) -AM_INIT_AUTOMAKE(ecore, 0.0.2) -AM_CONFIG_HEADER(config.h) - -AC_ISC_POSIX -AC_PROG_CC -AM_PROG_CC_STDC -AC_HEADER_STDC -AM_PROG_LIBTOOL - -AM_WITH_DMALLOC - -dnl Set PACKAGE_LOCALE_DIR in config.h. -if test "x${prefix}" = "xNONE"; then - AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") -else - AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") -fi - -dnl Set PACKAGE_DATA_DIR in config.h. -if test "x${datadir}" = 'x${prefix}/share'; then - if test "x${prefix}" = "xNONE"; then - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}") - else - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}") - fi -else - AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}") -fi - -dnl Set PACKAGE_SOURCE_DIR in config.h. -packagesrcdir=`cd $srcdir && pwd` -AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}") - -dnl Use -Wall if we have gcc. -changequote(,)dnl -if test "x$GCC" = "xyes"; then - case " $CFLAGS " in - *[\ \ ]-Wall[\ \ ]*) ;; - *) CFLAGS="$CFLAGS -Wall" ;; - esac -fi -changequote([,])dnl - -AC_PATH_XTRA - -if test "x$x_includes" = "x"; then - x_includes="/usr/include" -fi - -x_cflags="$X_CFLAGS" -x_ldflags="$X_LDFLAGS" -x_libs="$X_LIBS $X_EXTRA_LIBS" - -AC_CHECK_LIB(X11, XOpenDisplay, x_libs="$x_libs", - AC_MSG_ERROR([ERROR: libX11 not found.]); exit, - $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) -AC_CHECK_LIB(Xext, XShmAttach, x_libs="-lXext $x_libs", - AC_CHECK_LIB(XextSam, XShmAttach, - x_libs="-lXextSam -lXext $x_libs", - AC_MSG_ERROR([ERROR: XShm not found.]); exit, - $x_libs), - $x_libs) -AC_CHECK_LIB(Xext, XShapeCombineMask, x_libs="-lXext $x_libs", - AC_MSG_ERROR([ERROR: XShape not found.]); exit, - $x_libs) -AC_CHECK_LIB(Xrender, XRenderCreatePicture, - [ x_libs=" -lXrender -lXext $x_libs"; - AC_DEFINE(HAVE_RENDER) - ], - [], - $x_libs) - -AC_SUBST(x_cflags) -AC_SUBST(x_includes) -AC_SUBST(x_ldflags) -AC_SUBST(x_libs) - -dnl Checking for Perl: -AC_PATH_PROG(PERL,perl,0) -AC_SUBST(PERL) - - -dnl Look for jade for sgml translations. -AC_ARG_WITH(dbsheets, - [ --with-dbsheets=DIR use DIR to specify your DocBook stylesheets installation path.], - DB_STYLESHEETS="$withval", DB_STYLESHEETS="/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh") -AC_SUBST(DB_STYLESHEETS) -AC_PATH_PROG(JADE, jade) -AM_CONDITIONAL(HAVE_JADE, test "x$JADE" != "x" && test -d "$DB_STYLESHEETS") - - -AC_OUTPUT([ -Makefile -ecore-config -ecore.pc -src/Makefile -debian/Makefile -doc/Makefile -doc/kernel-doc -doc/html-customizations.dsl -], [ -chmod +x ecore-config -chmod +x doc/kernel-doc -] -) diff --git a/legacy/ecore/debian/.cvsignore b/legacy/ecore/debian/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/legacy/ecore/debian/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/legacy/ecore/debian/Makefile.am b/legacy/ecore/debian/Makefile.am deleted file mode 100644 index 5133d5ac17..0000000000 --- a/legacy/ecore/debian/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -EXTRA_DIST = \ -changelog \ -control \ -copyright \ -libecore0.files \ -libecore0-dev.files \ -rules diff --git a/legacy/ecore/debian/changelog b/legacy/ecore/debian/changelog deleted file mode 100644 index ac2db59c56..0000000000 --- a/legacy/ecore/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -ecore (0.0.2-0cvs20030904) unstable; urgency=low - - * a CVS release - - -- Sytse Wielinga Thu, 4 Sep 2003 21:35:12 +0200 diff --git a/legacy/ecore/debian/control b/legacy/ecore/debian/control deleted file mode 100644 index 8f41ed0b0b..0000000000 --- a/legacy/ecore/debian/control +++ /dev/null @@ -1,21 +0,0 @@ -Source: ecore -Section: libs -Priority: optional -Maintainer: Sytse Wielinga -Build-Depends: debhelper (>> 3.0.0) -Standards-Version: 3.6.1.0 - -Package: libecore0 -Architecture: any -Section: libs -Depends: ${shlibs:Depends} -Description: libecore0 description - libecore0 extended description - -Package: libecore0-dev -Architecture: any -Section: devel -Architecture: any -Depends: libecore0 (= ${Source-Version}), libc6-dev -Description: libecore0 headers, static libraries and documentation - Headers, static libraries and documentation for Imlib2. diff --git a/legacy/ecore/debian/copyright b/legacy/ecore/debian/copyright deleted file mode 100644 index 71899fdb8b..0000000000 --- a/legacy/ecore/debian/copyright +++ /dev/null @@ -1,32 +0,0 @@ -This package was debianized by Laurence J. Lane on -Sat, 28 Oct 2000 17:56:46 -0400. - -The source code is from the e17/libs/ecore module of the enlightenment CVS -tree. For more information, see: - - http://www.enlightenment.org/cvs.html - -Upstream Author: Carsten Haitzler - -Copyright: - -Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies of the Software, its documentation and marketing & publicity -materials, and acknowledgment shall be given in the documentation, materials -and software packages that this Software was used. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy/ecore/debian/libecore0-dev.files b/legacy/ecore/debian/libecore0-dev.files deleted file mode 100644 index 7147730dd6..0000000000 --- a/legacy/ecore/debian/libecore0-dev.files +++ /dev/null @@ -1,7 +0,0 @@ -usr/include/* -usr/lib/lib*.a -usr/lib/lib*.so -usr/lib/pkgconfig/* -usr/lib/*.la -usr/share/aclocal/* -usr/bin/*-config diff --git a/legacy/ecore/debian/libecore0.files b/legacy/ecore/debian/libecore0.files deleted file mode 100644 index d0dbfd18ac..0000000000 --- a/legacy/ecore/debian/libecore0.files +++ /dev/null @@ -1 +0,0 @@ -usr/lib/lib*.so.* diff --git a/legacy/ecore/debian/rules b/legacy/ecore/debian/rules deleted file mode 100644 index 74d8516218..0000000000 --- a/legacy/ecore/debian/rules +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/make -f -# Sample debian/rules that uses debhelper. -# GNU copyright 1997 to 1999 by Joey Hess. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - - -# This is the debhelper compatability version to use. -export DH_COMPAT=4 - - -CFLAGS ?= -Wall -g - -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s -endif - -# These are used for cross-compiling and for saving the configure script -# from having to guess our platform (since we know it already) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) - -INSTALL=/usr/bin/install -p -CONFIGUREOPTS = --prefix=/usr --enable-ecore-x --enable-ecore-job --enable-ecore-evas --enable-ecore-con --enable-ecore-ipc --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -package=libecore1 - -configure: configure-stamp -configure-stamp: - dh_testdir - - test -x autogen.sh && ./autogen.sh $(CONFIGUREOPTS) || ./configure $(CONFIGUREOPTS) - - touch configure-stamp - -build: configure build-stamp -build-stamp: - dh_testdir - - $(MAKE) - - touch build-stamp - -clean: - dh_testdir - rm -f build-stamp configure-stamp - - -$(MAKE) distclean - -rm -f configure-stamp build-stamp - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp/ - -# Build architecture-independent files here. -binary-indep: build install -# We have nothing to do by default. - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - dh_installdocs AUTHORS README - dh_installchangelogs - dh_movefiles - dh_strip - dh_compress - dh_fixperms - dh_installdeb - dh_makeshlibs - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install configure diff --git a/legacy/ecore/doc/Makefile.am b/legacy/ecore/doc/Makefile.am deleted file mode 100644 index 55017eb257..0000000000 --- a/legacy/ecore/doc/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## Process this file with automake to produce Makefile.in - -MAINTAINERCLEANFILES = Makefile.in - -EXTRA_DIST = \ -manual.raw \ -kernel-doc.in \ -stylesheet.css \ -figures/*.gif # Add any images you create here - - -## Fill in all source files that you documented -## with extractable comments here: -## -SOURCEDOC = $(top_srcdir)/src/Ecore.h - -## For details on what can be specified in the -## comments, see the beginning of kernel-doc -## in this directory! -- cK. - - -SGMLFILE = $(PACKAGE)-manual.sgml - -docs: manual.raw $(SOURCEDOC) - ./kernel-doc -docbook $(SGMLFILE) - -if HAVE_JADE - -FULLNAME = $(PACKAGE)-manual-$(VERSION) - -html-docs: docs html-customizations.dsl - $(mkinstalldirs) ./$(FULLNAME)/figures - cd $(FULLNAME) && @JADE@ -t sgml -d ../html-customizations.dsl ../$(SGMLFILE) - - cd figures && cp -f *.gif ../$(FULLNAME)/figures - - cd figures && cp -f *.png ../$(FULLNAME)/figures - - cd figures && cp -f *.jpg ../$(FULLNAME)/figures - cp -f stylesheet.css $(FULLNAME)/stylesheet.css - tar cfvz $(FULLNAME).tar.gz $(FULLNAME) - -endif - diff --git a/legacy/ecore/doc/figures/background.gif b/legacy/ecore/doc/figures/background.gif deleted file mode 100644 index 1dc11ce83a7d0e6f12de6cbaed746c0e5deb47d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6432 zcmb7?XIE2;)5Xs@>4Aj_H54%v0RaIEh+a!*QpF(BQGzJags7;9C@1tLgx)pMq!R(9 ziU$RiYCx%?7o=RQAic)F&qsLn%io&WGkew;o1WA?>^cZ2f`tI^=g*&|rL~QX&DGV7 z&CM-7pTD@czP`S>xVW~mvc9ymxwN#gwY9ylu(rIswz&A0Z!9mbFD$HYZ}T@cw$|4- zwzs!eSJ&6p{+4YmFK;d{Z!ImYFE4MbtZc2U{59EJTU%dU-CAAUTv^#zTie>){7bgi z*Z=lzudQuvY;14*9l!aPtp8o+|0}t5G)M$a0P4VB{a+>k%csFi6LqPCw*}Wae2zTi z75kf2I93gp-|YGs_+p$JV4;!yZnieC$G7R<`T8Kss*iJP&G+8TZT^8-A)#U65s^{R zF|l#?;}h74Ny#axY3Ui6S=l+c4<2$J<>eO?7CkO5DJ?6nsI1~XsjjJg`mCHw_4U91FfceYJTm%m?9=Ce#|t3T8T5n;28*-8&-{0e zK>TG13JA_wfOISta~dKFk2`$Z(K`Bwgplhw4b+AO4gRaGhYch&>FeoTQ?>~MuL43bzJ+BQkMIDgv;L(-{WH09fxe44wGls z?(5n&o`v5w%Gj!g&eN_6KO?4y!eh1_jF$p=8Vz(i)NA)Rq9y@wAh;l=8X_}D0WE~c zMQJuu8*N#*9hLHrES};$I~yYfsTOOMNdWhd2XCu@7LMN~(_g6Sqps% zr362QZx|3cb@Q_p@>{k6?>HwgCSYpZT)8khy^hPquF_g*Xjwy=>>f}w zV}}!-fdil=NgU#`M6+mzvj|ap^Og)H#CIOI)I$ftr*5*RNa)(H zAl|-I{}YO+c(^qUOX5vKU|3Wt5n$n}mG`vcaAt*v( z>tXpg3pxwHkhtF}4D5N|YKC+=`p5$z%nH|Uid)+#wHAh0 zseA$iWAO9f+o7AhJXJ}ixiDH>1RTlHw-`q}o%)>@%XeKHR~8np{V??o5M{Swj`?*z zQ8C^{27M9jz4C42GhG^=nLaukHivU#m(1OZxIAv%li9Wfsw`MBYn*U?k-lYrVV+9t}*Iqwo zReN$RNP?MYYlsSeEl-|0QovQdtb?x!)o8=uv#xmWsn_N#k{t8~Ey?8a^FiNJly}|v zue-*{?R0&1Kj16uyaVoR-m&k?>VZhjmc(4+G8U>8#boq(eh)*{W59du9-dGQ@@00F zJNaox@VbB`R>lCH)$V``>xqaI0<;gC92#}y+>%+NO&c-YsB7?|YE;pk#5^Dl%z(}t z{)43fHw7nJmY??gocNA}9&g$yRTX)>K#Y`rs8v2l9bFtH z@=?VN;F0|z6_+MNPvb)b%DFK`!=iV`&L}G%-xqYt{4<5m%6R#P%wcBQbD&Da6QvFN zl*y9-v}OpSWDp1j%JA!G!iC!d67yWj8XL;MJA5VQs-nAT$w!LOS)+Z7KoKh&7(?E1lyy=Gm z)zc!tfPpNl1AN1we`YI25HV{&E@mSg%2MO*X41 z>ufx@(`s6?BeecJ>fB3~nG8MUObDw(Oh5F}=7>c0sn(o=-$$&>33H|zh&~)0nLq31 zWp)syNV-Naq_dtudCg0D3n5P3Q%cztSrYF0kcV@~{u*sz&F6h~ud1g;0v&R}bNk46 zn(KPnNH;~i?XJCqj9gAl&#`+4a!{izB|`>sOJfm#EhvgW$+S1&m!q*oa_-EJ^;5>EmJXmt0&Xk1UuQh!&>}nugDR8L7-PUalx*W^$bTt^ zuYB(7^@)J@BHRA@yn=gsN~(H31uc}>UH^)qv<^1Nem*wKGjBHy!KB6b7G$48&u77- zLzS}*tFE8nt&0HyJdxpZO{TY8ltu8|)u#`Eu`qT3DjGEvAbB@P;&hO9CY$y8&^9_D zSVu`1rPW0X)@Q!EoSh!Ib$GSu zL{x`UkCGidF}-IOPZ$}~7IFz*6!VRA#eDXC`XBo4q+N+&@bcwgbKappMZqnRe8^rD z|Ka3ea|w*kf(y3Z^41FcVLveU8s?-!DkSC&suvv{>_k`k>d$htbC)NbL35zbGc08` zM8yX&NwUt*Ku{N>U;|4G`&e*;T9iT$nuMw{Lj6cAyJW|+G(%cJh+4p9t<~cOvn(T% zP!u)LhjHjaUib~8GcGHkErXuKdQZcE@I6SdKhO24&R#dVmFFe68++Rf32^ra_sED~ zk(`8{h1!!2-ou1{)(LO6bHAJssiMX5*OGjSmA1&h3|#P3UGvS22#$z~yqy85&POpB ze%MtxlK{-Ij5|ZCehPr5IKtY^jLO8{2}bPG^1&;J^My5EYkmNrN)0`b5p9IOdY9(R zos5vTx%_tMYMX@4Xk>J=NvPB;4o*3mYK#>@n9=`T|NKT{I8y{w#QOv zai(=Q-ld{(+?b8JI1gRmOC%1Or=73I9JqNS=yLGpl+^dP@gB3WL9oo11B%xHmm{|l z&J+WquMF{C8crbufg;)iX`#0U$(K^uC#JHY1wns7a8;ds*X3x!H6(c;vGd+~) z5Q-rrf!viDNf5e?%@a?2_XgXva!xrqsl^VGYKYZz2qO~k2lg0C(UY&x!Sb}^^tbSd zk;Hwsu_*ejt|vH%d-YdQig`oAsgc;zo>(zP0N+EOdY1|Qya}6i#5fT`HfL}^^r0d7 zw7c|F_snFE%rplTywG^s^8VCdHt@hWeKaF&4>jZ_3}o18eww{cV5Z&3Op`r~PhT~V zPR{UNOMfnr5mFM#Cg_FcN8F?Vu^qSW@5xZ%rCz23brO0L8929_nHHIuw`UWANl7%t zxWJRpx5!LxW>h#+)>;%iS%P~s!fGUBS0B!HLqjoiu)f15zacxt0atw3_(2EmRY`Ic zAv-f5CzxZcEP5Y?!Jd-%k&@io#n8Jk*NjaxIv~f$!#6^jQuz0`AIUr7 z-9kA7UvZ$B>7pdQ>+%Cth6`rcGM%Tr-z=-|D^3#0b5((CwF@ao{)q-ijhz?C(AzCW zAMzkbkc!mCV-nZ}SL-dQw2W9zK90-25C|kgWZh1zN9qYLBWTl*05L(Etmq5h-~;Bv#h2JMn;c8nTak{JkYi$HSYCBgHL zlZKsB`5$mod6={;D6Ro&fNM?#woB{$rEnq~weKGa4G|^x%Q2y9fFQd{oYW`+h(6kEfI~nzHh|*X zyy2ZQ+llTet;-yRY8PXQ#OW&f0V~7)3R)0~T1y}`zievMs!x$FeQZYu)JYA2AE688 z&m0+#qHbAT_d?q`xY}o?5^v|NIAVIQ0@Z3oz2BQD6Xdw%^w1*Tww zM_WX>t^TyjM+d+neSo$P{9R}dd$-0lJX8)0S3|N-F~H}gWkHTWQCBIB{YqdA@uxS~ zEI$-SEISHc9&LX)-_Ta9TGW$)eiHlo>iZ{XI;b7j-s@Cx9eDw!Qk9*OohQ|REAH^Ar8 zI(Zq4BX$Z|G~FnM`j(DI~`$mcIbWAuV+2}gkI zIl-0P54X3P=Hk1$uHlz1b#0K>(F*YlU1ZYVS8jWwnoay@~6Vo9#FWwAYR` z3wFOvSbR6*4Dyv|&jw!F2|VgQdV^c$?q*B}Kg)#f+xz|$k=&V%=#D|6%&J~;=iYJ1 zVY`+YoAUUkF)@H^8uG5a`NQu9NR=iHiXL?78l(nQpW!qU?hhRPHt;uHSdx`>MizTqo1=u4LWH56S16cS1Rnfn*2_^VlYV#D9KJ`#X%^V z^sjzRNf^}5Dcc;>uu^~Hd$({hq+Wyb!hx3fUle+B-Me(7O_DY!Gu+rD86rV93aITZ z%;i76(mghNh4-$Y>M9eE2Q56E>7SCpfGP!;CHR=`B=vEj~`0sL_h$@!16 zIW@(nl){Dv1qA!qoPL8cG&Ig6%y*knyQ4mo?=LIYeK6T61$|EfgQPIBP5I#Y>X_#Y zG3pT20$lirFKf0WDu-!V0>7F&tevNK$klBh`x0mls*~!B?~V3WU?HuG@@xHbC!tRQ zxSg?|{JRGEF=zFzx4%C+9gKL#4r(rL`Q6R)+EbFG{S><}YJwsS_-t2QW`R_7;KnEX zZd0g48=Q+sJe>se*g=%94ZCEql3EiKtuHvvw9mOFOSqmoHm!nnxA2&8=g&+U@RBr2 zl2AP5xg!Z`WU_hxOlIk0G3uz#xi2|y-cQDkg=>LUCnHJQ*Qb7ek-i-+RSAWj0-*7d zolP^*{*#@fUm2U$|8BOn9M^!Wk)lex+sv#LDIDjCe5+^M1Ww3kI1XA)plDSTp>K?j z(m6ga?4%AV9BWba#haKy)|GcFuoJUFk19MMr_H3u&OuT3-uJ|3*DWwEznVo!GpEg= zDIo_-Y6se4F!>2^*}i?SJ*{_s5JGKnpmr zZr%I<`6R1je4Z!w<2k|~jHIV(C7{;@uWPo%3B8r^?o2$WU&trKL307Uua7O+B9P#C zvj)jucLzpX>tD|!gBv|@)2!O38Y%=CX4HdMC;p&iy?diY{m)Vt&#VOrGFQ}!7Jo!R z^8Kw7YCjBM9@DQvX}saW_s@54U;Z_W-Z>UiBfi`<{0O53RDW+vnkaw&BfM8`I{rRE z^WNo{dd1A)rzWI@gI(QA56Y%LqF>|=`}?8=xua;_=XC1F2d3+GCTjo^ALm}mP@9a6 znd;rFEZN%=mA2##SGaznBgPNTv48p36%a-L53VG1`=vCAW}sd6X4+H>Eo+L z#SoG;f3P0%7~0?yxikJR#HujjFz>AkVZ#AR@Zf_wr$cFQDG+7kW|ewI)lO}IY}S0R zv<0!edRU;?$zlwU_hj#LgMbV zzBcYOVxRM3S62wS!dQ&1V&!USfuRk4xQNiF0RtnAMiP5whucX3g@~hpD;hnTsw$&v zrPV@7gbRB$-2M0bg3O%uU`;IY*~GW}gHV>g=j)=7cj*SL1X^(s0_>KHkC3AmDr7@y zlIrmurn_iN{k6HoNKxys@Nv8# zTW_6$XvWsaI~u`62_Mocn+i0C@zjJ^f>a0^1$i2Deu#=MA=@aLRjb ziq>VmmPsDTYbM>;vN}Eo%Ot&(zkgJ?LowAksY59@NVrp_Fej-~wW3+LOZ{oLJRbPx Ee>uaYC;$Ke diff --git a/legacy/ecore/doc/figures/caution.gif b/legacy/ecore/doc/figures/caution.gif deleted file mode 100644 index 54223291154fed2f9639ce2707976ec58f44169b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1039 zcmZ?wbh9u|lwgox_|5Sh{s9!`7`) zTel`}-MV$}UWUDUlh2)FICt*cwQCI5t^vtw_wF&=yJvXsp5?uJPS2k+Jb!NZ{JG`x z=g;52XL$eq{rB$--@gld|1RgdJ(|D$SrA+HAyGpqN^7x16zrMq{!ibMp=6~-(4c99<%wR z=lEzgH#IP+?pT$g`C;jexlBBNo_IO0=v$GV+9Oerpc~DlP;%tKgT`Z#V$4EkL{=v; zaW)#7)%@r_aPX#>5Fh`Y-v{$g32`gkn0k?^DW$2?_JPMq28Kof%}^J&9pNUYcvyH^ zranA$=y~&6-RTjl4}Cj!q6ciK{6%`g178e&67#J8C85tTH8XFrM z92^`S9UUGX9v>ecARr(iAt53nA|oRsBqSsyB_$>%CMPE+C@3f?DJd!{Dl021EG#T7 zEiEoCE-x=HFfcGNF)=bSGBYzXG&D3dH8nOiHa9mnI5;>tIXOByIy*Z%JUl!-Jv}}? zK0iM{KtMo2K|w-7LPJACL_|bIMMXwNMn^|SNJvOYNl8jdN=r*iOiWBoO-)WtPESuy zP*6}&QBhJ-Qd3h?R8&+|RaI72R##V7SXfwDSy@_IT3cINTwGjTU0q&YUSD5dU|?Wj zVPRroVq;@tWMpJzWo2e&W@l$-XlQ6@X=!R|YHMq2Y;0_8ZEbFDZf|dIaBy&OadC2T za&vQYbaZreb#-=jc6WDoczAeud3kzzdV70&e0+R;eSLm@et&;|fPjF3fq{a8f`fyD zgoK2Jg@uNOhKGlTh=_=ZiHVAeii?YjjEszpjg5|uj*pLzkdTm(k&%*;l9Q8@l$4Z} zm6ev3mY0{8n3$NEnVFiJnwy)OoSdAUot>VZo}ZteprD|kp`oIpqNAguq@<*!rKP5( zrl+T;sHmu^si~@}s;jH3tgNi9t*x%EuCK4Ju&}VPv9YqUva_?Zw6wIfwY9dkwzs#p zxVX5vxw*Q!y1To(yu7@dCU$jHda z$;ryf%FD~k%*@Qq&CSlv&d<-!(9qD)(b3Y<($mw^)YR0~)z#M4*4Nk9*x1lt)=I7_<=;-L_>FMg~>g((4 z?Ck9A?d|UF?(gsK@bK{Q@$vHV^7Hfa^z`)g_4W4l_V@Sq`1ttw`T6?#`uqF){QUg= z{r&#_{{R2~EC2ui02lxm000R70RIUbNbsCNg9H;Q6xgd2rBVHES(3_Ku{tyHgqN;d+?Tzju!Z);;TuQDVJwRQAHSkR)YFdrEO!v&XBk zJwOwl{a4GHz*-^KY@Rd5rovJavBo?tB{Lyo6k9@$D)OJx<0pIB#+rEO&f%|l4*kcd o_`qJ2pi}&6ogi$&oxc>r#EMbwId40)HiwBGBuL!a2L=QHJ03R*g8%>k diff --git a/legacy/ecore/doc/figures/warning.gif b/legacy/ecore/doc/figures/warning.gif deleted file mode 100644 index 9c1104c2b15445dd0824fd6515659ee0fe18bfd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1052 zcmeHG&1=(e0DVo%7HbcgOo>=$KTg3N?8@v)L4uu*Wm2|w7mJ7m-NYeQ<`fNst{-gH zFn0)2C7>b!DFnRyWC)cilI^esda&T7hYgk~Lh8jLf;0XP9`|@W-t9deyphrKLy-&% z79D^F7}yqmfCECnSwH}iKpL00umtG6h$SORMKfh6jeZtMpZ#ji$ztIRaMmh zEfmsZnE-_2h$In3A*xCUsR1=js}Z6DI>YEJtLwS}7z|^utif?jplNHf*#cUvmI;`C zziFBlV9~T?S$5k_r?Us_?PGs||Fl3qZ2bEI=s&nmd)MP#Qi1N-@~vmDl{m)~TAi))WhOkCPn3Z5%1`%*jnZAb7!@1gPPg@=K{SYIGf{obyZgePn&I~mRM zIoCk^vfShUy4LNWnD(!*OLB*2uQN=Ym!3v^_4dl=Pj;;Gz#|UMNR;Eq)oWvScO<97 zyK(r@;K@9Ce=cu6i!Z>P|8001xvKE);`Av#$M(C9mQy#DzRgV?^bGMYDqk{u&KaJ3 zU-1=2b{nx{ugB+K65i`gFp1Iaf%x&j9n1JZecW7F%}mcv#I|oXB2&Z9&%7$#GO4+h QO1&1l=Xra8>T)6W7esUR#{d8T diff --git a/legacy/ecore/doc/html-customizations.dsl.in b/legacy/ecore/doc/html-customizations.dsl.in deleted file mode 100644 index 4bf0404d0f..0000000000 --- a/legacy/ecore/doc/html-customizations.dsl.in +++ /dev/null @@ -1,61 +0,0 @@ - -]> - - - - - -;; my own customizations for HTML output: - -(define %admon-graphics-path% - ;; Path to admonition graphics - "figures/") - -(define %admon-graphics% - ;; Use graphics in admonitions? - #t) - -(define %indent-programlisting-lines% - ;; Indent lines in a 'ProgramListing'? - " ") - -(define %shade-verbatim% - ;; Should verbatim environments be shaded? - #t) - -(define ($shade-verbatim-attr$) - ;; Attributes used to create a shaded verbatim environment. - (list - (list "BORDER" "0") - (list "BGCOLOR" "#f0f0f0"))) - -(define %root-filename% - ;; Name for the root HTML document - "index") - -(define %body-attr% - ;; What attributes should be hung off of BODY? - (list - (list "BGCOLOR" "#FFFFFF") - (list "TEXT" "#0000A0") - (list "LINK" "#2020D0") - (list "VLINK" "#000060") - (list "ALINK" "#5050F0"))) - -(define %css-decoration% - ;; Enable CSS decoration of elements - #t) - -(define %stylesheet% - ;; Name of the stylesheet to use - "stylesheet.css") - -(define biblio-number - ;; Enumerate bibliography entries - #t) - - - - - diff --git a/legacy/ecore/doc/kernel-doc.in b/legacy/ecore/doc/kernel-doc.in deleted file mode 100644 index 5127523486..0000000000 --- a/legacy/ecore/doc/kernel-doc.in +++ /dev/null @@ -1,1001 +0,0 @@ -#!@PERL@ - -## This script is based on the script shipped with ## -## 2.4 Linux kernel sources. All copyright notices etc ## -## remain unchanged. --cK. ## - -## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ## -## Copyright (C) 2000 Tim Waugh ## -## ## -## #define enhancements by Armin Kuster ## -## Copyright (c) 2000 MontaVista Software, Inc. ## -## ## -## This software falls under the GNU General Public License. ## -## Please read the COPYING file for more information ## - -# w.o. 03-11-2000: added the '-filelist' option. - -# -# This will read a 'c' file and scan for embedded comments in the -# style of gnome comments (+minor extensions - see below). -# - -# Note: This only supports 'c'. - -# usage: -# kerneldoc [ -docbook | -html | -text | -man ] -# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile -# or -# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile -# -# Set output format using one of -docbook -html -text or -man. Default is man. -# -# -function funcname -# If set, then only generate documentation for the given function(s). All -# other functions are ignored. -# -# -nofunction funcname -# If set, then only generate documentation for the other function(s). All -# other functions are ignored. Cannot be used with -function together -# (yes thats a bug - perl hackers can fix it 8)) -# -# c files - list of 'c' files to process -# -# All output goes to stdout, with errors to stderr. - -# -# format of comments. -# In the following table, (...)? signifies optional structure. -# (...)* signifies 0 or more structure elements -# /** -# * function_name(:)? (- short description)? -# (* @parameterx: (description of parameter x)?)* -# (* a blank line)? -# * (Description:)? (Description of function)? -# * (section header: (section description)? )* -# (*)?*/ -# -# So .. the trivial example would be: -# -# /** -# * my_function -# **/ -# -# If the Description: header tag is ommitted, then there must be a blank line -# after the last parameter specification. -# e.g. -# /** -# * my_function - does my stuff -# * @my_arg: its mine damnit -# * -# * Does my stuff explained. -# */ -# -# or, could also use: -# /** -# * my_function - does my stuff -# * @my_arg: its mine damnit -# * Description: Does my stuff explained. -# */ -# etc. -# -# All descriptions can be multiline, apart from the short function description. -# -# All descriptive text is further processed, scanning for the following special -# patterns, which are highlighted appropriately. -# -# 'funcname()' - function -# '$ENVVAR' - environmental variable -# '&struct_name' - name of a structure (up to two words including 'struct') -# '@parameter' - name of a parameter -# '%CONST' - name of a constant. - -# match expressions used to find embedded type information -$type_constant = "\\\%([-_\\w]+)"; -$type_func = "(\\w+)\\(\\)"; -$type_param = "\\\@(\\w+)"; -$type_struct = "\\\&((struct\\s*)?[_\\w]+)"; -$type_env = "(\\\$\\w+)"; - - -# Output conversion substitutions. -# One for each output format - -# these work fairly well -%highlights_html = ( $type_constant, "\$1", - $type_func, "\$1", - $type_struct, "\$1", - $type_param, "\$1" ); -$blankline_html = "

"; - -# sgml, docbook format -%highlights_sgml = ( "([^=])\\\"([^\\\"<]+)\\\"", "\$1\$2", - $type_constant, "\$1", - $type_func, "\$1", - $type_struct, "\$1", - $type_env, "\$1", - $type_param, "\$1" ); -$blankline_sgml = "\n"; - -# gnome, docbook format -%highlights_gnome = ( $type_constant, "\$1", - $type_func, "\$1", - $type_struct, "\$1", - $type_env, "\$1", - $type_param, "\$1" ); -$blankline_gnome = "\n"; - -# these are pretty rough -%highlights_man = ( $type_constant, "\$1", - $type_func, "\\\\fB\$1\\\\fP", - $type_struct, "\\\\fI\$1\\\\fP", - $type_param, "\\\\fI\$1\\\\fP" ); -$blankline_man = ""; - -# text-mode -%highlights_text = ( $type_constant, "\$1", - $type_func, "\$1", - $type_struct, "\$1", - $type_param, "\$1" ); -$blankline_text = ""; - - -sub usage { - print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n"; - print " [ -function funcname [ -function funcname ...] ]\n"; - print " [ -nofunction funcname [ -nofunction funcname ...] ]\n"; - print " < inputfile > outputfile\n"; - exit 1; -} - -# read arguments -if ($#ARGV==-1) { - usage(); -} - -$verbose = 0; -$output_mode = "man"; -%highlights = %highlights_man; -$blankline = $blankline_man; -$modulename = "API Documentation"; -$function_only = 0; -$filelist = ''; - -while ($ARGV[0] =~ m/^-(.*)/) { - $cmd = shift @ARGV; - if ($cmd eq "-html") { - $output_mode = "html"; - %highlights = %highlights_html; - $blankline = $blankline_html; - } elsif ($cmd eq "-man") { - $output_mode = "man"; - %highlights = %highlights_man; - $blankline = $blankline_man; - } elsif ($cmd eq "-text") { - $output_mode = "text"; - %highlights = %highlights_text; - $blankline = $blankline_text; - } elsif ($cmd eq "-docbook") { - $output_mode = "sgml"; - %highlights = %highlights_sgml; - $blankline = $blankline_sgml; - } elsif ($cmd eq "-gnome") { - $output_mode = "gnome"; - %highlights = %highlights_gnome; - $blankline = $blankline_gnome; - } elsif ($cmd eq "-module") { # not needed for sgml, inherits from calling document - $modulename = shift @ARGV; - } elsif ($cmd eq "-function") { # to only output specific functions - $function_only = 1; - $function = shift @ARGV; - $function_table{$function} = 1; - } elsif ($cmd eq "-nofunction") { # to only output specific functions - $function_only = 2; - $function = shift @ARGV; - $function_table{$function} = 1; - } elsif ($cmd eq "-v") { - $verbose = 1; - } elsif (($cmd eq "-h") || ($cmd eq "--help")) { - usage(); - } -} - - -# generate a sequence of code that will splice in highlighting information -# using the s// operator. -$dohighlight = ""; -foreach $pattern (keys %highlights) { -# print "scanning pattern $pattern ($highlights{$pattern})\n"; - $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n"; -} - -## -# dumps section contents to arrays/hashes intended for that purpose. -# -sub dump_section { - my $name = shift @_; - my $contents = join "\n", @_; - - if ($name =~ m/$type_constant/) { - $name = $1; -# print STDERR "constant section '$1' = '$contents'\n"; - $constants{$name} = $contents; - } elsif ($name =~ m/$type_param/) { -# print STDERR "parameter def '$1' = '$contents'\n"; - $name = $1; - $parameters{$name} = $contents; - } else { -# print STDERR "other section '$name' = '$contents'\n"; - $sections{$name} = $contents; - push @sectionlist, $name; - } -} - -## -# output function -# -# parameters, a hash. -# function => "function name" -# parameterlist => @list of parameters -# parameters => %parameter descriptions -# sectionlist => @list of sections -# sections => %descriont descriptions -# - -sub output_highlight { - my $contents = join "\n", @_; - my $line; - - eval $dohighlight; - foreach $line (split "\n", $contents) { - if ($line eq ""){ - print $lineprefix, $blankline; - } else { - $line =~ s/\\\\\\/\&/g; - print $lineprefix, $line; - } - print "\n"; - } -} - - -# output in html -sub output_html { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - print "

Function

\n"; - - print "".$args{'functiontype'}."\n"; - print "".$args{'function'}."\n"; - print "("; - $count = 0; - foreach $parameter (@{$args{'parameterlist'}}) { - $type = $args{'parametertypes'}{$parameter}; - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { - # pointer-to-function - print "$1$parameter) ($2)"; - } else { - print "".$type." ".$parameter.""; - } - if ($count != $#{$args{'parameterlist'}}) { - $count++; - print ",\n"; - } - } - print ")\n"; - - print "

Arguments

\n"; - print "
\n"; - foreach $parameter (@{$args{'parameterlist'}}) { - print "
".$parameter."\n"; - print "
"; - output_highlight($args{'parameters'}{$parameter}); - } - print "
\n"; - foreach $section (@{$args{'sectionlist'}}) { - print "

$section

\n"; - print "
\n"; - output_highlight($args{'sections'}{$section}); - print "
\n"; - } - print "
\n"; -} - - -# output in html -sub output_intro_html { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - - foreach $section (@{$args{'sectionlist'}}) { - print "

$section

\n"; - print "
    \n"; - output_highlight($args{'sections'}{$section}); - print "
\n"; - } - print "
\n"; -} - - - -# output in sgml DocBook -sub output_sgml { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - my $id; - - $id = "API-".$args{'function'}; - $id =~ s/[^A-Za-z0-9]/-/g; - - print "\n"; - print "\n"; - print "".$args{'function'}."\n"; - print "\n"; - print "\n"; - print " ".$args{'function'}."\n"; - print " \n"; - print " "; - output_highlight ($args{'purpose'}); - print " \n"; - print "\n"; - - print "\n"; - print " Synopsis\n"; - print " \n"; - print " ".$args{'functiontype'}." "; - print "".$args{'function'}." "; - print "\n"; - -# print "\n"; -# print " Synopsis\n"; -# print " \n"; -# print " ".$args{'functiontype'}." "; -# print "".$args{'function'}." "; -# print "\n"; - - $count = 0; - if ($#{$args{'parameterlist'}} >= 0) { - foreach $parameter (@{$args{'parameterlist'}}) { - $type = $args{'parametertypes'}{$parameter}; - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { - # pointer-to-function - print " $1$parameter)\n"; - print " $2\n"; - } else { - print " ".$type; - print " $parameter\n"; - } - } - } else { - print " \n"; - } - print " \n"; - print "\n"; -# print "\n"; - - # print parameters - print "\n Arguments\n"; -# print "\nArguments\n"; - if ($#{$args{'parameterlist'}} >= 0) { - print " \n"; - foreach $parameter (@{$args{'parameterlist'}}) { - print " \n $parameter\n"; - print " \n \n"; - $lineprefix=" "; - output_highlight($args{'parameters'}{$parameter}); - print " \n \n \n"; - } - print " \n"; - } else { - print " \n None\n \n"; - } - print "\n"; - - # print out each section - $lineprefix=" "; - foreach $section (@{$args{'sectionlist'}}) { - print "\n $section\n \n"; -# print "\n$section\n"; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } - output_highlight($args{'sections'}{$section}); -# print ""; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } - print " \n\n"; - } - - print "\n\n"; -} - -# output in sgml DocBook -sub output_intro_sgml { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - my $id; - - $id = $args{'module'}; - $id =~ s/[^A-Za-z0-9]/-/g; - - # print out each section - $lineprefix=" "; - foreach $section (@{$args{'sectionlist'}}) { - print "\n $section\n \n"; -# print "\n$section\n"; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } - output_highlight($args{'sections'}{$section}); -# print ""; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } - print " \n\n"; - } - - print "\n\n"; -} - -# output in sgml DocBook -sub output_gnome { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - my $id; - - $id = $args{'module'}."-".$args{'function'}; - $id =~ s/[^A-Za-z0-9]/-/g; - - print "\n"; - print " ".$args{'function'}."\n"; - -# print "\n"; -# print " Synopsis\n"; - print " \n"; - print " ".$args{'functiontype'}." "; - print "".$args{'function'}." "; - print "\n"; - - $count = 0; - if ($#{$args{'parameterlist'}} >= 0) { - foreach $parameter (@{$args{'parameterlist'}}) { - $type = $args{'parametertypes'}{$parameter}; - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { - # pointer-to-function - print " $1 $parameter)\n"; - print " $2\n"; - } else { - print " ".$type; - print " $parameter\n"; - } - } - } else { - print " \n"; - } - print " \n"; -# print "\n"; -# print "\n"; - - # print parameters -# print "\n Arguments\n"; -# if ($#{$args{'parameterlist'}} >= 0) { -# print " \n"; -# foreach $parameter (@{$args{'parameterlist'}}) { -# print " \n $parameter\n"; -# print " \n \n"; -# $lineprefix=" "; -# output_highlight($args{'parameters'}{$parameter}); -# print " \n \n \n"; -# } -# print " \n"; -# } else { -# print " \n None\n \n"; -# } -# print "\n"; - -# print "\n Arguments\n"; - if ($#{$args{'parameterlist'}} >= 0) { - print " \n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - foreach $parameter (@{$args{'parameterlist'}}) { - print " $parameter\n"; - print " \n"; - $lineprefix=" "; - output_highlight($args{'parameters'}{$parameter}); - print " \n"; - } - print " \n"; - } else { - print " \n None\n \n"; - } -# print "\n"; - - # print out each section - $lineprefix=" "; - foreach $section (@{$args{'sectionlist'}}) { - print "\n $section\n"; -# print "\n$section\n"; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } else { - } - print "\n"; - output_highlight($args{'sections'}{$section}); -# print ""; - print "\n"; - if ($section =~ m/EXAMPLE/i) { - print "\n"; - } else { - } - print " \n"; - } - - print "\n\n"; -} - -## -# output in man -sub output_man { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - - print ".TH \"$args{'module'}\" 4 \"$args{'function'}\" \"25 May 1998\" \"API Manual\" LINUX\n"; - - print ".SH NAME\n"; - print $args{'function'}." \\- ".$args{'purpose'}."\n"; - - print ".SH SYNOPSIS\n"; - print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n"; - $count = 0; - $parenth = "("; - $post = ","; - foreach $parameter (@{$args{'parameterlist'}}) { - if ($count == $#{$args{'parameterlist'}}) { - $post = ");"; - } - $type = $args{'parametertypes'}{$parameter}; - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { - # pointer-to-function - print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n"; - } else { - $type =~ s/([^\*])$/\1 /; - print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n"; - } - $count++; - $parenth = ""; - } - - print ".SH Arguments\n"; - foreach $parameter (@{$args{'parameterlist'}}) { - print ".IP \"".$parameter."\" 12\n"; - output_highlight($args{'parameters'}{$parameter}); - } - foreach $section (@{$args{'sectionlist'}}) { - print ".SH \"$section\"\n"; - output_highlight($args{'sections'}{$section}); - } -} - -sub output_intro_man { - my %args = %{$_[0]}; - my ($parameter, $section); - my $count; - - print ".TH \"$args{'module'}\" 4 \"$args{'module'}\" \"25 May 1998\" \"API Manual\" LINUX\n"; - - foreach $section (@{$args{'sectionlist'}}) { - print ".SH \"$section\"\n"; - output_highlight($args{'sections'}{$section}); - } -} - -## -# output in text -sub output_text { - my %args = %{$_[0]}; - my ($parameter, $section); - - print "Function:\n\n"; - $start=$args{'functiontype'}." ".$args{'function'}." ("; - print $start; - $count = 0; - foreach $parameter (@{$args{'parameterlist'}}) { - if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { - # pointer-to-function - print $1.$parameter.") (".$2; - } else { - print $type." ".$parameter; - } - if ($count != $#{$args{'parameterlist'}}) { - $count++; - print ",\n"; - print " " x length($start); - } else { - print ");\n\n"; - } - } - - print "Arguments:\n\n"; - foreach $parameter (@{$args{'parameterlist'}}) { - print $parameter."\n\t".$args{'parameters'}{$parameter}."\n"; - } - foreach $section (@{$args{'sectionlist'}}) { - print "$section:\n\n"; - output_highlight($args{'sections'}{$section}); - } - print "\n\n"; -} - -sub output_intro_text { - my %args = %{$_[0]}; - my ($parameter, $section); - - foreach $section (@{$args{'sectionlist'}}) { - print " $section:\n"; - print " -> "; - output_highlight($args{'sections'}{$section}); - } -} - -## -# generic output function - calls the right one based -# on current output mode. -sub output_function { -# output_html(@_); - eval "output_".$output_mode."(\@_);"; -} - -## -# generic output function - calls the right one based -# on current output mode. -sub output_intro { -# output_html(@_); - eval "output_intro_".$output_mode."(\@_);"; -} - - -## -# takes a function prototype and spits out all the details -# stored in the global arrays/hashes. -sub dump_function { - my $prototype = shift @_; - - $prototype =~ s/^static +//; - $prototype =~ s/^extern +//; - $prototype =~ s/^inline +//; - $prototype =~ s/^__inline__ +//; - $prototype =~ s/^#define +//; #ak added - - # Yes, this truly is vile. We are looking for: - # 1. Return type (may be nothing if we're looking at a macro) - # 2. Function name - # 3. Function parameters. - # - # All the while we have to watch out for function pointer parameters - # (which IIRC is what the two sections are for), C types (these - # regexps don't even start to express all the possibilities), and - # so on. - # - # If you mess with these regexps, it's a good idea to check that - # the following functions' documentation still comes out right: - # - parport_register_device (function pointer parameters) - # - atomic_set (macro) - # - pci_match_device (long return type) - - if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ || - $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ || - $prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/) { - $return_type = $1; - $function_name = $2; - $args = $3; - - # allow for up to fours args to function pointers - $args =~ s/(\([^\),]+),/\1#/g; - $args =~ s/(\([^\),]+),/\1#/g; - $args =~ s/(\([^\),]+),/\1#/g; -# print STDERR "ARGS = '$args'\n"; - - foreach $arg (split ',', $args) { - # strip leading/trailing spaces - $arg =~ s/^\s*//; - $arg =~ s/\s*$//; - - if ($arg =~ m/\(/) { - # pointer-to-function - $arg =~ tr/#/,/; - $arg =~ m/[^\(]+\(\*([^\)]+)\)/; - $param = $1; - $type = $arg; - $type =~ s/([^\(]+\(\*)$param/\1/; - } else { - # evil magic to get fixed array parameters to work - $arg =~ s/(.+\s+)(.+)\[.*/\1* \2/; -# print STDERR "SCAN ARG: '$arg'\n"; - @args = split('\s', $arg); - -# print STDERR " -> @args\n"; - $param = pop @args; -# print STDERR " -> @args\n"; - if ($param =~ m/^(\*+)(.*)/) { - $param = $2; - push @args, $1; - } - $type = join " ", @args; - } - - if ($type eq "" && $param eq "...") - { - $type="..."; - $param="..."; - $parameters{"..."} = "variable arguments"; - } - elsif ($type eq "" && $param eq "") - { - $type=""; - $param="void"; - $parameters{void} = "no arguments"; - } - if ($type ne "" && $parameters{$param} eq "") { - $parameters{$param} = "-- undescribed --"; - print STDERR "Warning($file:$lineno): Function parameter '$param' not described in '$function_name'\n"; - } - - push @parameterlist, $param; - $parametertypes{$param} = $type; -# print STDERR "param = '$param', type = '$type'\n"; - } - } else { - print STDERR "Error($lineno): cannot understand prototype: '$prototype'\n"; - return; - } - - if ($function_only==0 || - ( $function_only == 1 && defined($function_table{$function_name})) || - ( $function_only == 2 && !defined($function_table{$function_name}))) - { - output_function({'function' => $function_name, - 'module' => $modulename, - 'functiontype' => $return_type, - 'parameterlist' => \@parameterlist, - 'parameters' => \%parameters, - 'parametertypes' => \%parametertypes, - 'sectionlist' => \@sectionlist, - 'sections' => \%sections, - 'purpose' => $function_purpose - }); - } -} - -###################################################################### -# main -# states -# 0 - normal code -# 1 - looking for function name -# 2 - scanning field start. -# 3 - scanning prototype. -$state = 0; -$section = ""; - -$doc_special = "\@\%\$\&"; - -$doc_start = "^/\\*\\*\\s*\$"; -$doc_end = "\\*/"; -$doc_com = "\\s*\\*\\s*"; -$doc_func = $doc_com."(\\w+):?"; -$doc_sect = $doc_com."([".$doc_special."]?[\\w ]+):(.*)"; -$doc_content = $doc_com."(.*)"; -$doc_block = $doc_com."DOC:\\s*(.*)?"; - -%constants = (); -%parameters = (); -@parameterlist = (); -%sections = (); -@sectionlist = (); - -$contents = ""; -$section_default = "Description"; # default section -$section_intro = "Introduction"; -$section = $section_default; - -while () - { - if (/^!I(.*)/) - { - process_file("@top_srcdir@" . "/" . $1); - } - else - { - print; - } - } - -exit; - -sub process_file($) { - my ($file) = @_; - - if (!open(IN,"<$file")) { - print STDERR "Error: Cannot open file $file\n"; - return; - } - - $lineno = 0; - while () { - $lineno++; - - if ($state == 0) { - if (/$doc_start/o) { - $state = 1; # next line is always the function name - } - } elsif ($state == 1) { # this line is the function name (always) - if (/$doc_block/o) { - $state = 4; - $contents = ""; - if ( $1 eq "" ) { - $section = $section_intro; - } else { - $section = $1; - } - } - elsif (/$doc_func/o) { - $function = $1; - $state = 2; - if (/-(.*)/) { - $function_purpose = $1; - } else { - $function_purpose = ""; - } - if ($verbose) { - print STDERR "Info($lineno): Scanning doc for $function\n"; - } - } else { - print STDERR "WARN($lineno): Cannot understand $_ on line $lineno", - " - I thought it was a doc line\n"; - $state = 0; - } - } elsif ($state == 2) { # look for head: lines, and include content - if (/$doc_sect/o) { - $newsection = $1; - $newcontents = $2; - - if ($contents ne "") { - $contents =~ s/\&/\\\\\\amp;/g; - $contents =~ s/\/\\\\\\gt;/g; - dump_section($section, $contents); - $section = $section_default; - } - - $contents = $newcontents; - if ($contents ne "") { - $contents .= "\n"; - } - $section = $newsection; - } elsif (/$doc_end/) { - - if ($contents ne "") { - $contents =~ s/\&/\\\\\\amp;/g; - $contents =~ s/\/\\\\\\gt;/g; - dump_section($section, $contents); - $section = $section_default; - $contents = ""; - } - -# print STDERR "end of doc comment, looking for prototype\n"; - $prototype = ""; - $state = 3; - } elsif (/$doc_content/) { - # miguel-style comment kludge, look for blank lines after - # @parameter line to signify start of description - if ($1 eq "" && $section =~ m/^@/) { - $contents =~ s/\&/\\\\\\amp;/g; - $contents =~ s/\/\\\\\\gt;/g; - dump_section($section, $contents); - $section = $section_default; - $contents = ""; - } else { - $contents .= $1."\n"; - } - } else { - # i dont know - bad line? ignore. - print STDERR "WARNING($lineno): bad line: $_"; - } - } elsif ($state == 3) { # scanning for function { (end of prototype) - if (m#\s*/\*\s+MACDOC\s*#io) { - # do nothing - } - elsif (/([^\{]*)/) { - $prototype .= $1; - } - if (/\{/ || /\#/ || /;/) { # added for #define AK - $prototype =~ s@/\*.*?\*/@@gos; # strip comments. - $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's. - $prototype =~ s@^ +@@gos; # strip leading spaces - dump_function($prototype); - - $function = ""; - %constants = (); - %parameters = (); - %parametertypes = (); - @parameterlist = (); - %sections = (); - @sectionlist = (); - $prototype = ""; - - $state = 0; - } - } elsif ($state == 4) { - # Documentation block - if (/$doc_block/) { - dump_section($section, $contents); - output_intro({'sectionlist' => \@sectionlist, - 'sections' => \%sections }); - $contents = ""; - $function = ""; - %constants = (); - %parameters = (); - %parametertypes = (); - @parameterlist = (); - %sections = (); - @sectionlist = (); - $prototype = ""; - if ( $1 eq "" ) { - $section = $section_intro; - } else { - $section = $1; - } - } - elsif (/$doc_end/) - { - dump_section($section, $contents); - output_intro({'sectionlist' => \@sectionlist, - 'sections' => \%sections }); - $contents = ""; - $function = ""; - %constants = (); - %parameters = (); - %parametertypes = (); - @parameterlist = (); - %sections = (); - @sectionlist = (); - $prototype = ""; - $state = 0; - } - elsif (/$doc_content/) - { - if ( $1 eq "" ) - { - $contents .= $blankline; - } - else - { - $contents .= $1 . "\n"; - } - } - } - } -} - diff --git a/legacy/ecore/doc/manual.raw b/legacy/ecore/doc/manual.raw deleted file mode 100644 index 65d9325a25..0000000000 --- a/legacy/ecore/doc/manual.raw +++ /dev/null @@ -1,283 +0,0 @@ -efsd"> -]> - - - - - Enlightenment Documentation Howto - - - - FIRSTNAME - OTHER - LASTNAME - -
- EMAIL -
-
-
-
- - - 2001 - Christian Kreibich - - - - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - - The above copyright notice and this permission notice shall be included in - all copies of the Software and its documentation and acknowledgment shall be - given in the documentation and software packages that this Software was - used. - - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - - - - This is document is nowhere near being finished. Be patient. - - -
- - - - - Introduction - - This is some sample documentation for you project. You'll need to be - familiar with DocBook - to make best use of Enlightenment's documentation scheme. - - - See - for an explanation of the documentation setup in you project. - - - explains - the way you have to structure your comments so that they can be - extracted. - - - contains a few - layout and markup examples to get you up to speed quickly. - - - - - Documentation File Structure - - The entire documentation setup lives in the doc - directory. The file you need to edit is called manual.raw. - When you enter make docs in the toplevel directory, - it gets translated into a standard SGML file using a Perl script. - The script scans the file for any lines starting directly with the - string !I<filename>. Here, - filename is the name of a code - file in which you have put extractable comments. The Perl script will - then analyze the file and generate SGML DocBook statements for those - comments right into the output file. - - - The resulting file of that step is called $PACKAGE-manual-$VERSION.sgml - where PACKAGE and VERSION are automatically set during the build process. - This sgml file can be postprocessed with any SGML processor to generate - for example HTML, TeX or PDF output. - - - Suppport for HTML generation is included already through the - make html-docs target. In order to be able to use - that, you'll need to have jade installed, and appropriate - DocBook stylesheets. If the configure script doesn't automatically find - you stylesheets (on a Debian system it should), you can specify them when - calling configure or autogen.sh using - the --with-dbsheets=DIR option. - - - If everything worked out fine, you'll get a tarball of the HTML version - of your documentation and the extracted version in the docs directory, - named similarly to the SGML file. - - - - - - Writing Extractable Comments - - I'll simply give an example of a commented function here: - - - -/** - * efsd_wait_event - blocking wait for next Efsd event. - * @ec: The Efsd connection - * @ev: Pointer to an allocated EfsdEvent. - * - * Blocks until an efsd event arrives, then returns it by filling - * in the @ev structure. Returns -1 when there was an error, - * >= 0 otherwise. - */ -int efsd_wait_event(EfsdConnection *ec, EfsdEvent *ev); - - As you can see, it's not hard -- just use two asterisks - to signal the start of an extractable comment. In the first - line, begin with the function name and a one-liner description. - Then, put each parameter in the following lines. Add an empty - line, and then a more verbose description. That's basically - it, you can also markup items differently as follows: - - - - funcname() for function names - - - $ENVVAR for environment variables - - - &struct_name for structures - - - %CONST for constants/para> - - - - - - - DocBook Examples -
- Lists - - - - This - - - is - - - a - - - list - - - -
-
- Code - - - -EfsdConnection *ec; - -if ( (ec = efsd_open()) == NULL) - { - /* Oops. Couldn't establish connection. - * Is Efsd really running ? - */ - } - -/* ... various efsd commands ... */ - -if (efsd_close(ec) < 0) - { - /* Ouch. Error when closing connection. */ - } - - -
-
- Images - - - - - - - - - - - Sample image - - - This is how you display images. - - - - -
-
- Warnings, Notes - - - This is an example of a note. - - It's really simple to use. - - - - - This is a warning. - - It's used just like a note. - - - -
-
- - - - - - - W. R. - Stevens - - UNIX Network Programming - Second Edition - Volume 1 - - Prentice-Hall - - 1998 - - - - - - - W. R. - Stevens - - Advanced Programming in the UNIX Environment - - Addison-Wesley - - 1992 - - - - - -
- diff --git a/legacy/ecore/doc/stylesheet.css b/legacy/ecore/doc/stylesheet.css deleted file mode 100644 index 6609650750..0000000000 --- a/legacy/ecore/doc/stylesheet.css +++ /dev/null @@ -1,20 +0,0 @@ -body { margin-left:10px; - margin-right:10px; - margin-top:10px; - margin-bottom:10px; - color:#0000a0; - font-size:12pt; - background-image:url(figures/background.gif); - background-repeat:no-repeat; - } - -th { - font-size:14pt; - } - -td { - font-size:12pt; - } - -div.mediaobject { align:center; } -div.caption { align:center; } diff --git a/legacy/ecore/ecore-config.in b/legacy/ecore/ecore-config.in deleted file mode 100644 index 710269e48b..0000000000 --- a/legacy/ecore/ecore-config.in +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -exec_prefix_set=no - -usage="\ -Usage: ecore-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]" - -if test $# -eq 0; then - echo "${usage}" 1>&2 - exit 1 -fi - -while test $# -gt 0; do - case "$1" in - -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - case $1 in - --prefix=*) - prefix=$optarg - if test $exec_prefix_set = no ; then - exec_prefix=$optarg - fi - ;; - --prefix) - echo $prefix - ;; - --exec-prefix=*) - exec_prefix=$optarg - exec_prefix_set=yes - ;; - --exec-prefix) - echo $exec_prefix - ;; - --version) - echo @VERSION@ - ;; - --cflags) - if test @includedir@ != /usr/include ; then - includes=-I@includedir@ - fi - echo $includes @x_cflags@ - ;; - --libs) - libdirs=-L@libdir@ - echo $libdirs -lecore @x_libs@ -lm - ;; - *) - echo "${usage}" 1>&2 - exit 1 - ;; - esac - shift -done - -exit 0 diff --git a/legacy/ecore/ecore.m4 b/legacy/ecore/ecore.m4 deleted file mode 100644 index b687e410d7..0000000000 --- a/legacy/ecore/ecore.m4 +++ /dev/null @@ -1,198 +0,0 @@ -# Configure paths for Ecore -# Conrad Parker 2001-01-24 -# blatantly ripped from gtk.m4, Owen Taylor 97-11-3 - -dnl AM_PATH_ECORE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) -dnl Test for Ecore, and define ECORE_CFLAGS and ECORE_LIBS -dnl -AC_DEFUN(AM_PATH_ECORE, -[dnl -dnl Get the cflags and libraries from the ecore-config script -dnl -AC_ARG_WITH(ecore-prefix,[ --with-ecore-prefix=PFX Prefix where Ecore is installed (optional)], - ecore_config_prefix="$withval", ecore_config_prefix="") -AC_ARG_WITH(ecore-exec-prefix,[ --with-ecore-exec-prefix=PFX Exec prefix where Ecore is installed (optional)], - ecore_config_exec_prefix="$withval", ecore_config_exec_prefix="") -AC_ARG_ENABLE(ecoretest, [ --disable-ecoretest Do not try to compile and run a test Ecore program], - , enable_ecoretest=yes) - - if test x$ecore_config_exec_prefix != x ; then - ecore_config_args="$ecore_config_args --exec-prefix=$ecore_config_exec_prefix" - if test x${ECORE_CONFIG+set} != xset ; then - ECORE_CONFIG=$ecore_config_exec_prefix/bin/ecore-config - fi - fi - if test x$ecore_config_prefix != x ; then - ecore_config_args="$ecore_config_args --prefix=$ecore_config_prefix" - if test x${ECORE_CONFIG+set} != xset ; then - ECORE_CONFIG=$ecore_config_prefix/bin/ecore-config - fi - fi - - AC_PATH_PROG(ECORE_CONFIG, ecore-config, no) - min_ecore_version=ifelse([$1], ,0.0.0,$1) - AC_MSG_CHECKING(for Ecore - version >= $min_ecore_version) - no_ecore="" - if test "$ECORE_CONFIG" = "no" ; then - no_ecore=yes - else - ECORE_CFLAGS=`$ECORE_CONFIG $ecore_config_args --cflags` - ECORE_LIBS=`$ECORE_CONFIG $ecore_config_args --libs` - ecore_config_major_version=`$ECORE_CONFIG $ecore_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` - ecore_config_minor_version=`$ECORE_CONFIG $ecore_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` - ecore_config_micro_version=`$ECORE_CONFIG $ecore_config_args --version | \ - sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` - -dnl ********************************************************************** -dnl Ecore cannot currently report its own version ; version info is not -dnl given in Ecore.h -dnl Thus, the "enable_ecoretest" stuff is currently disabled, enable once -dnl you can determine the currently installed version by querying Ecore[.h] -dnl -dnl K. 2001-01-24 -dnl ********************************************************************** - -dnl if test "x$enable_ecoretest" = "xyes" ; then -dnl ac_save_CFLAGS="$CFLAGS" -dnl ac_save_LIBS="$LIBS" -dnl CFLAGS="$CFLAGS $ECORE_CFLAGS" -dnl LIBS="$ECORE_LIBS $LIBS" -dnl dnl -dnl dnl Now check if the installed Ecore is sufficiently new. (Also sanity -dnl dnl checks the results of ecore-config to some extent -dnl dnl -dnl rm -f conf.ecoretest -dnl AC_TRY_RUN([ -dnl #include -dnl #include -dnl #include -dnl -dnl int -dnl main () -dnl { -dnl int major, minor, micro; -dnl char *tmp_version; -dnl -dnl system ("touch conf.ecoretest"); -dnl -dnl /* HP/UX 9 (%@#!) writes to sscanf strings */ -dnl tmp_version = g_strdup("$min_ecore_version"); -dnl if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { -dnl printf("%s, bad version string\n", "$min_ecore_version"); -dnl exit(1); -dnl } -dnl -dnl if ((ecore_major_version != $ecore_config_major_version) || -dnl (ecore_minor_version != $ecore_config_minor_version) || -dnl (ecore_micro_version != $ecore_config_micro_version)) -dnl { -dnl printf("\n*** 'ecore-config --version' returned %d.%d.%d, but Ecore (%d.%d.%d)\n", -dnl $ecore_config_major_version, $ecore_config_minor_version, $ecore_config_micro_version, -dnl ecore_major_version, ecore_minor_version, ecore_micro_version); -dnl printf ("*** was found! If ecore-config was correct, then it is best\n"); -dnl printf ("*** to remove the old version of Ecore. You may also be able to fix the error\n"); -dnl printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); -dnl printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); -dnl printf("*** required on your system.\n"); -dnl printf("*** If ecore-config was wrong, set the environment variable ECORE_CONFIG\n"); -dnl printf("*** to point to the correct copy of ecore-config, and remove the file config.cache\n"); -dnl printf("*** before re-running configure\n"); -dnl } -dnl #if defined (ECORE_MAJOR_VERSION) && defined (ECORE_MINOR_VERSION) && defined (ECORE_MICRO_VERSION) -dnl else if ((ecore_major_version != ECORE_MAJOR_VERSION) || -dnl (ecore_minor_version != ECORE_MINOR_VERSION) || -dnl (ecore_micro_version != ECORE_MICRO_VERSION)) -dnl { -dnl printf("*** Ecore header files (version %d.%d.%d) do not match\n", -dnl ECORE_MAJOR_VERSION, ECORE_MINOR_VERSION, ECORE_MICRO_VERSION); -dnl printf("*** library (version %d.%d.%d)\n", -dnl ecore_major_version, ecore_minor_version, ecore_micro_version); -dnl } -dnl #endif /* defined (ECORE_MAJOR_VERSION) ... */ -dnl else -dnl { -dnl if ((ecore_major_version > major) || -dnl ((ecore_major_version == major) && (ecore_minor_version > minor)) || -dnl ((ecore_major_version == major) && (ecore_minor_version == minor) && (ecore_micro_version >= micro))) -dnl { -dnl return 0; -dnl } -dnl else -dnl { -dnl printf("\n*** An old version of Ecore (%d.%d.%d) was found.\n", -dnl ecore_major_version, ecore_minor_version, ecore_micro_version); -dnl printf("*** You need a version of Ecore newer than %d.%d.%d. The latest version of\n", -dnl major, minor, micro); -dnl printf("*** Ecore is always available from ftp://ftp.enlightenment.org.\n"); -dnl printf("***\n"); -dnl printf("*** If you have already installed a sufficiently new version, this error\n"); -dnl printf("*** probably means that the wrong copy of the ecore-config shell script is\n"); -dnl printf("*** being found. The easiest way to fix this is to remove the old version\n"); -dnl printf("*** of Ecore, but you can also set the ECORE_CONFIG environment to point to the\n"); -dnl printf("*** correct copy of ecore-config. (In this case, you will have to\n"); -dnl printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); -dnl printf("*** so that the correct libraries are found at run-time))\n"); -dnl } -dnl } -dnl return 1; -dnl } -dnl ],, no_ecore=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) -dnl CFLAGS="$ac_save_CFLAGS" -dnl LIBS="$ac_save_LIBS" -dnl fi -dnl ********************************************************************** - - fi - if test "x$no_ecore" = x ; then - AC_MSG_RESULT(yes) - ifelse([$2], , :, [$2]) - else - AC_MSG_RESULT(no) - if test "$ECORE_CONFIG" = "no" ; then - echo "*** The ecore-config script installed by Ecore could not be found" - echo "*** If Ecore was installed in PREFIX, make sure PREFIX/bin is in" - echo "*** your path, or set the ECORE_CONFIG environment variable to the" - echo "*** full path to ecore-config." - else - if test -f conf.ecoretest ; then - : - else - echo "*** Could not run Ecore test program, checking why..." - CFLAGS="$CFLAGS $ECORE_CFLAGS" - LIBS="$LIBS $ECORE_LIBS" - AC_TRY_LINK([ -#include -#include -], [ return ((ecore_major_version) || (ecore_minor_version) || (ecore_micro_version)); ], - [ echo "*** The test program compiled, but did not run. This usually means" - echo "*** that the run-time linker is not finding Ecore or finding the wrong" - echo "*** version of Ecore. If it is not finding Ecore, you'll need to set your" - echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" - echo "*** to the installed location Also, make sure you have run ldconfig if that" - echo "*** is required on your system" - echo "***" - echo "*** If you have an old version installed, it is best to remove it, although" - echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" - echo "***" - echo "*** If you have a RedHat 5.0 system, you should remove the Ecore package that" - echo "*** came with the system with the command" - echo "***" - echo "*** rpm --erase --nodeps ecore ecore-devel" ], - [ echo "*** The test program failed to compile or link. See the file config.log for the" - echo "*** exact error that occured. This usually means Ecore was incorrectly installed" - echo "*** or that you have moved Ecore since it was installed. In the latter case, you" - echo "*** may want to edit the ecore-config script: $ECORE_CONFIG" ]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - fi - fi - ECORE_CFLAGS="" - ECORE_LIBS="" - ifelse([$3], , :, [$3]) - fi - AC_SUBST(ECORE_CFLAGS) - AC_SUBST(ECORE_LIBS) - rm -f conf.ecoretest -]) diff --git a/legacy/ecore/ecore.pc.in b/legacy/ecore/ecore.pc.in deleted file mode 100644 index 4dbb978630..0000000000 --- a/legacy/ecore/ecore.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: ecore -Description: Enlightened Core X interface library -Version: @VERSION@ -Libs: -L${libdir} -lecore @x_libs@ -lm -Cflags: -I${includedir} -I@x_includes@ - diff --git a/legacy/ecore/ecore.spec b/legacy/ecore/ecore.spec deleted file mode 100644 index 5d6801c592..0000000000 --- a/legacy/ecore/ecore.spec +++ /dev/null @@ -1,63 +0,0 @@ -# this is NOT relocatable, unless you alter the patch! -%define name ecore -%define ver 0.0.2 -%define rel 1 -%define prefix /usr - -Summary: Enlightened Core X interface library -Name: %{name} -Version: %{ver} -Release: %{rel} -Copyright: BSD -Group: User Interface/X -URL: http://www.enlightenment.org/efm.html -Packager: The Rasterman Term -Vendor: The Enlightenment Development Team -Source: ftp://ftp.enlightenment.org/enlightenment/%{name}-%{ver}.tar.gz -BuildRoot: /var/tmp/%{name}-root - -%description -Ecore is brub. - -%package devel -Summary: Ecore headers and development libraries. -Group: Development/Libraries -Requires: %{name} = %{ver} - -%description devel -Ecore development files - -%prep -%setup -q - -%build -if [ -e ./configure ] -then - ./configure --prefix=%{prefix} -else - ./autogen.sh --prefix=%{prefix} -fi -make - -%install -make prefix=$RPM_BUILD_ROOT%{prefix} install - -%post -/sbin/ldconfig - -%postun -/sbin/ldconfig - -%clean -rm -rf $RPM_BUILD_ROOT - -%files -%defattr(-,root,root) -%{prefix}/lib/libecore.so.* - -%files devel -%defattr(-,root,root) -%{prefix}/lib/libecore.so -%{prefix}/lib/libecore.*a -%{prefix}/include/Ecore.h -%{prefix}/bin/ecore-config diff --git a/legacy/ecore/src/.cvsignore b/legacy/ecore/src/.cvsignore deleted file mode 100644 index dd4706c923..0000000000 --- a/legacy/ecore/src/.cvsignore +++ /dev/null @@ -1,29 +0,0 @@ -*.lo -*.la -.deps -.libs -Makefile -Makefile.in -aclocal.m4 -confdefs.h -config.cache -config.guess -config.h -config.h.in -config.log -config.status -config.sub -configure -install-sh -libtool -ltconfig -ltmain.sh -missing -mkinstalldirs -stamp-h -stamp-h.in -*.tar.gz -macros -*~ -*.spec -.icons diff --git a/legacy/ecore/src/Ecore.h b/legacy/ecore/src/Ecore.h deleted file mode 100644 index 1e6cd7e8ce..0000000000 --- a/legacy/ecore/src/Ecore.h +++ /dev/null @@ -1,919 +0,0 @@ -#ifndef E_CORE_H -#define E_CORE_H 1 - -#include -#include -#include -#include -#include - -#define XK_MISCELLANY 1 - -#include -#include -#include -#include -#include -#include -#include -#ifdef WITH_DMALLOC -#include -#endif - -#define XEV_NONE NoEventMask -#define XEV_KEY KeyPressMask | KeyReleaseMask -#define XEV_BUTTON ButtonPressMask | ButtonReleaseMask -#define XEV_KEY_PRESS KeyPressMask -#define XEV_KEY_RELEASE KeyReleaseMask -#define XEV_BUTTON_PRESS ButtonPressMask -#define XEV_BUTTON_RELEASE ButtonReleaseMask -#define XEV_IN_OUT EnterWindowMask | LeaveWindowMask -#define XEV_MOUSE_MOVE PointerMotionMask | ButtonMotionMask -#define XEV_EXPOSE ExposureMask -#define XEV_VISIBILITY VisibilityChangeMask -#define XEV_CONFIGURE StructureNotifyMask -#define XEV_CHILD_CHANGE SubstructureNotifyMask -#define XEV_CHILD_REDIRECT SubstructureRedirectMask | ResizeRedirectMask -#define XEV_FOCUS FocusChangeMask -#define XEV_PROPERTY PropertyChangeMask -#define XEV_COLORMAP ColormapChangeMask - - -#define ECORE_ATOM(atom, name) \ - if (!atom) (atom) = ecore_atom_get(name); -#define MEMCPY(src, dst, type, num) \ - memcpy(dst, src, sizeof(type) * (num)) -#define NEW(type, num) \ - malloc(sizeof(type) * (num)) -#define ZERO(ptr, type, num) \ - memset((ptr), 0, sizeof(type) * (num)) -#define NEW_PTR(num) \ - malloc(sizeof(void *) * (num)) -#define FREE(ptr) \ - { \ - free(ptr); \ - (ptr) = NULL; \ - } -#define IF_FREE(ptr) \ - {if (ptr) FREE(ptr);} -#define REALLOC(ptr, type, num) \ - { \ - if ((ptr) && (num == 0)) {free(ptr); ptr = NULL;} \ - else if (ptr) ptr = realloc((ptr), sizeof(type) * (num)); \ - else ptr = malloc(sizeof(type) * (num)); \ - } -#define REALLOC_PTR(ptr, num) \ - { \ - if ((ptr) && (num == 0)) {free(ptr); ptr = NULL;} \ - else if (ptr) ptr = realloc(ptr, sizeof(void *) * (num)); \ - else ptr = malloc(sizeof(void *) * (num)); \ - } - -#define START_LIST_DEL(type, base, cmp) \ - type *_p, *_pp; _pp = NULL; \ - _p = (base); \ - while(_p) \ - { \ - if (cmp) \ - { \ - if (_pp) _pp->next = _p->next; \ - else (base) = _p->next; -#define END_LIST_DEL \ - return; \ - } \ - _pp = _p; \ - _p = _p->next; \ - } - -#define DND_TYPE_URI_LIST 0 -#define DND_TYPE_PLAIN_TEXT 1 -#define DND_TYPE_MOZ_URL 2 -#define DND_TYPE_NETSCAPE_URL 3 - -#ifdef __cplusplus -extern "C" -{ -#endif - - extern XContext xid_context; - - typedef void (*Ecore_Error_Function) (Display * d, XErrorEvent * ev); - - typedef struct _ecore_keygrab Ecore_KeyGrab; - - typedef enum _ecore_ev_modifiers - { - ECORE_EVENT_KEY_MODIFIER_NONE = 0, - ECORE_EVENT_KEY_MODIFIER_SHIFT = (1 << 0), - ECORE_EVENT_KEY_MODIFIER_CTRL = (1 << 1), - ECORE_EVENT_KEY_MODIFIER_ALT = (1 << 2), - ECORE_EVENT_KEY_MODIFIER_WIN = (1 << 3) - } Ecore_Event_Key_Modifiers; - - typedef enum _ecore_event_stack_detail - { - ECORE_EVENT_STACK_ABOVE = Above, - ECORE_EVENT_STACK_BELOW = Below, - ECORE_EVENT_STACK_TOP_IF = TopIf, - ECORE_EVENT_STACK_BOTTOM_IF = BottomIf, - ECORE_EVENT_STACK_OPPOSITE = Opposite - } Ecore_Event_Stack_Detail; - - typedef enum _ecore_event_value_mask - { - ECORE_EVENT_VALUE_X = CWX, - ECORE_EVENT_VALUE_Y = CWY, - ECORE_EVENT_VALUE_W = CWWidth, - ECORE_EVENT_VALUE_H = CWHeight, - ECORE_EVENT_VALUE_BORDER = CWBorderWidth, - ECORE_EVENT_VALUE_SIBLING = CWSibling, - ECORE_EVENT_VALUE_STACKING = CWStackMode - } Ecore_Event_Value_Mask; - - typedef enum _ecore_event_type - { - ECORE_EVENT_MOUSE_MOVE, - ECORE_EVENT_MOUSE_DOWN, - ECORE_EVENT_MOUSE_UP, - ECORE_EVENT_MOUSE_IN, - ECORE_EVENT_MOUSE_OUT, - ECORE_EVENT_MOUSE_WHEEL, - ECORE_EVENT_KEY_DOWN, - ECORE_EVENT_KEY_UP, - ECORE_EVENT_WINDOW_MAP, - ECORE_EVENT_WINDOW_UNMAP, - ECORE_EVENT_WINDOW_CREATE, - ECORE_EVENT_WINDOW_DESTROY, - ECORE_EVENT_WINDOW_CONFIGURE, - ECORE_EVENT_WINDOW_CONFIGURE_REQUEST, - ECORE_EVENT_WINDOW_MAP_REQUEST, - ECORE_EVENT_WINDOW_PROPERTY, - ECORE_EVENT_WINDOW_CIRCULATE, - ECORE_EVENT_WINDOW_CIRCULATE_REQUEST, - ECORE_EVENT_WINDOW_REPARENT, - ECORE_EVENT_WINDOW_EXPOSE, - ECORE_EVENT_WINDOW_VISIBILITY, - ECORE_EVENT_WINDOW_SHAPE, - ECORE_EVENT_WINDOW_FOCUS_IN, - ECORE_EVENT_WINDOW_FOCUS_OUT, - ECORE_EVENT_MESSAGE, - ECORE_EVENT_WINDOW_DELETE, - ECORE_EVENT_COLORMAP, - - ECORE_EVENT_DND_DROP_REQUEST, - ECORE_EVENT_DND_DROP_END, - ECORE_EVENT_DND_DROP_POSITION, - ECORE_EVENT_DND_DROP, - ECORE_EVENT_DND_DROP_STATUS, - ECORE_EVENT_DND_DATA_REQUEST, - ECORE_EVENT_PASTE_REQUEST, - ECORE_EVENT_CLEAR_SELECTION, - - ECORE_EVENT_CHILD, - ECORE_EVENT_USER, - - ECORE_EVENT_MAX - } Ecore_Event_Type; - - typedef struct _ecore_event - { - Ecore_Event_Type type; - char ignore; - void *event; - void (*ev_free) (void *evnt); - struct _ecore_event *next; - } Ecore_Event; - - typedef struct _ecore_event_fd_handler - { - int fd; - void (*func) (int fd); - struct _ecore_event_fd_handler *next; - } Ecore_Event_Fd_Handler; - - typedef struct _ecore_event_pid_handler - { - pid_t pid; - void (*func) (pid_t pid); - struct _ecore_event_pid_handler *next; - } Ecore_Event_Pid_Handler; - - typedef struct _ecore_event_ipc_handler - { - int ipc; - void (*func) (int ipc); - struct _ecore_event_ipc_handler *next; - } Ecore_Event_Ipc_Handler; - - typedef struct _ecore_event_timer - { - char *name; - void (*func) (int val, void *data); - int val; - void *data; - double in; - char just_added; - struct _ecore_event_timer *next; - } Ecore_Event_Timer; - - typedef struct _ecore_event_key_down - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - char *key; - char *symbol; - char *compose; - Time time; - } Ecore_Event_Key_Down; - - typedef struct _ecore_event_key_up - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - char *key; - char *symbol; - char *compose; - Time time; - } Ecore_Event_Key_Up; - - typedef struct _ecore_event_mouse_down - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - int button; - int x, y; - int rx, ry; - int double_click, triple_click; - Time time; - } Ecore_Event_Mouse_Down; - - typedef struct _ecore_event_mouse_up - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - int button; - int x, y; - int rx, ry; - Time time; - } Ecore_Event_Mouse_Up; - - typedef struct _ecore_event_wheel - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - int x, y, z; - int rx, ry; - Time time; - } Ecore_Event_Wheel; - - typedef struct _ecore_event_mouse_move - { - Window win, root; - Ecore_Event_Key_Modifiers mods; - int x, y; - int rx, ry; - Time time; - } Ecore_Event_Mouse_Move; - - typedef struct _ecore_event_window_enter - { - Window win, root; - int x, y; - int rx, ry; - Ecore_Event_Key_Modifiers mods; - Time time; - } Ecore_Event_Window_Enter; - - typedef struct _ecore_event_window_leave - { - Window win, root; - int x, y; - int rx, ry; - Ecore_Event_Key_Modifiers mods; - Time time; - } Ecore_Event_Window_Leave; - - typedef struct _ecore_event_window_focus_in - { - Window win, root; - int key_grab; - Time time; - } Ecore_Event_Window_Focus_In; - - typedef struct _ecore_event_window_focus_out - { - Window win, root; - int key_grab; - Time time; - } Ecore_Event_Window_Focus_Out; - - typedef struct _ecore_event_window_expose - { - Window win, root; - int x, y, w, h; - } Ecore_Event_Window_Expose; - - typedef struct _ecore_event_window_visibility - { - Window win, root; - int fully_obscured; - } Ecore_Event_Window_Visibility; - - typedef struct _ecore_event_window_create - { - Window win, root; - int override; - } Ecore_Event_Window_Create; - - typedef struct _ecore_event_window_destroy - { - Window win, root; - } Ecore_Event_Window_Destroy; - - typedef struct _ecore_event_window_map - { - Window win, root; - } Ecore_Event_Window_Map; - - typedef struct _ecore_event_window_unmap - { - Window win, root; - } Ecore_Event_Window_Unmap; - - typedef struct _ecore_event_window_map_request - { - Window win, root; - } Ecore_Event_Window_Map_Request; - - typedef struct _ecore_event_window_reparent - { - Window win, root; - Window parent_from, parent; - } Ecore_Event_Window_Reparent; - - typedef struct _ecore_event_window_configure - { - Window win, root; - int x, y, w, h; - int wm_generated; - } Ecore_Event_Window_Configure; - - typedef struct _ecore_event_window_configure_request - { - Window win, root; - int x, y, w, h; - int border; - Window stack_win; - Ecore_Event_Stack_Detail detail; - Ecore_Event_Value_Mask mask; - } Ecore_Event_Window_Configure_Request; - - typedef struct _ecore_event_window_circulate - { - Window win, root; - int lower; - } Ecore_Event_Window_Circulate; - - typedef struct _ecore_event_window_circulate_request - { - Window win, root; - int lower; - } Ecore_Event_Window_Circulate_Request; - - typedef struct _ecore_event_window_property - { - Window win, root; - Atom atom; - Time time; - } Ecore_Event_Window_Property; - - typedef struct _ecore_event_window_shape - { - Window win, root; - Time time; - } Ecore_Event_Window_Shape; - - typedef struct _ecore_event_message - { - Window win; - int format; - Atom atom; - union - { - char b[20]; - short s[10]; - long l[5]; - } - data; - } Ecore_Event_Message; - - typedef struct _ecore_event_colormap - { - Window win, root; - Colormap cmap; - int installed; - } Ecore_Event_Colormap; - - typedef struct _ecore_event_window_delete - { - Window win, root; - } Ecore_Event_Window_Delete; - - typedef struct _ecore_event_paste_request - { - Window win, root, source_win; - char *string; - } Ecore_Event_Paste_Request; - - typedef struct _ecore_event_clear_selection - { - Window win, root; - Atom selection; - } Ecore_Event_Clear_Selection; - - typedef struct _ecore_event_dnd_drop_request - { - Window win, root, source_win; - int num_files; - char **files; - int copy, link, move; - } Ecore_Event_Dnd_Drop_Request; - - typedef struct _ecore_event_dnd_drop_end - { - Window win, root, source_win; - } Ecore_Event_Dnd_Drop_End; - - typedef struct _ecore_event_dnd_drop_position - { - Window win, root, source_win; - int x, y; - } Ecore_Event_Dnd_Drop_Position; - - typedef struct _ecore_event_dnd_drop - { - Window win, root, source_win; - } Ecore_Event_Dnd_Drop; - - typedef struct _ecore_event_dnd_drop_status - { - Window win, root, source_win; - int x, y, w, h; - int copy, link, move, e_private; - int all_position_msgs; - int ok; - } Ecore_Event_Dnd_Drop_Status; - - typedef struct _ecore_event_dnd_data_request - { - Window win, root, source_win; - Atom destination_atom; - int plain_text; - int uri_list; - int moz_url; - int netscape_url; - } Ecore_Event_Dnd_Data_Request; - - typedef struct _ecore_event_child - { - pid_t pid; - int exit_code; - } Ecore_Event_Child; - - typedef struct _ecore_event_user - { - int num; - int hup; - } Ecore_Event_User; - - typedef struct _ecore_event_ipc_service - { - int service; - void (*func) (int fd); - struct _ecore_event_ipc_service *next; - } Ecore_Event_Ipc_Service; - - - typedef struct _ecore_xid - { - Window win; - Window parent; - Window root; - int children_num; - Window *children; - int x, y, w, h; - int mapped; - int mouse_in; - int depth; - int gravity; - int coords_invalid; - int bw; - int (*grab_button_auto_replay) (Ecore_Event_Mouse_Down *ev); - } Ecore_XID; - - - /* ---------------- API CALLS BELOW --------------------*/ - - /* ---------------- X WRAPPER CALLS */ - - int ecore_x_get_fd(void); - void ecore_set_error_handler(Ecore_Error_Function func); - void ecore_reset_error_handler(void); - - /** - * ecore_display_init - Establishes a connection to the X server - * @display: The name of the display to connect to - * - * This function creates a connection to the X server. If - * @display is NULL, the name is taken from the $DISPLAY - * environment variable. - */ - int ecore_display_init(char *display); - - int ecore_events_pending(void); - void ecore_get_next_event(XEvent * event); - int ecore_event_shape_get_id(void); - void ecore_sync(void); - void ecore_flush(void); - - /* ---------------- WINDOW CHILD HANDLING */ - - void ecore_del_child(Window win, Window child); - void ecore_add_child(Window win, Window child); - void ecore_raise_child(Window win, Window child); - void ecore_lower_child(Window win, Window child); - Ecore_XID *ecore_add_xid(Window win, int x, int y, int w, int h, - int depth, Window parent); - Ecore_XID *ecore_validate_xid(Window win); - void ecore_unvalidate_xid(Window win); - - /* ---------------- WINDOWS-RELATED CALLS */ - - Window ecore_window_new(Window parent, int x, int y, int w, - int h); - Window ecore_window_override_new(Window parent, int x, int y, - int w, int h); - Window ecore_window_input_new(Window parent, int x, int y, int w, - int h); - void ecore_window_set_events_propagate(Window win, - int propagate); - void ecore_window_show(Window win); - void ecore_window_hide(Window win); - void ecore_window_set_background_pixmap(Window win, - Pixmap pmap); - void ecore_window_set_shape_mask(Window win, Pixmap mask); - void ecore_window_add_shape_mask(Window win, Pixmap mask); - void ecore_window_set_shape_window(Window win, Window src, - int x, int y); - void ecore_window_add_shape_window(Window win, Window src, - int x, int y); - void ecore_window_set_shape_rectangle(Window win, int x, int y, - int w, int h); - void ecore_window_add_shape_rectangle(Window win, int x, int y, - int w, int h); - void ecore_window_set_shape_rectangles(Window win, - XRectangle * rect, - int num); - void ecore_window_add_shape_rectangles(Window win, - XRectangle * rect, - int num); - void ecore_window_clip_shape_by_rectangle(Window win, int x, - int y, int w, int h); - XRectangle *ecore_window_get_shape_rectangles(Window win, int *num); - void ecore_window_select_shape_events(Window win); - void ecore_window_unselect_shape_events(Window win); - void ecore_window_clear(Window win); - void ecore_window_clear_area(Window win, int x, int y, int w, - int h); - void ecore_window_set_events(Window win, long mask); - void ecore_window_remove_events(Window win, long mask); - void ecore_window_add_events(Window win, long mask); - void ecore_window_move(Window win, int x, int y); - void ecore_window_resize(Window win, int w, int h); - void ecore_window_move_resize(Window win, int x, int y, int w, - int h); - void ecore_window_destroy(Window win); - void ecore_window_reparent(Window win, Window parent, int x, - int y); - void ecore_window_raise(Window win); - void ecore_window_lower(Window win); - void ecore_window_get_geometry(Window win, int *x, int *y, - int *w, int *h); - int ecore_window_get_depth(Window win); - int ecore_window_exists(Window win); - Window ecore_window_get_parent(Window win); - Window *ecore_window_get_children(Window win, int *num); - int ecore_window_mouse_in(Window win); - void ecore_window_mouse_set_in(Window win, int in); - Window ecore_window_get_root(Window win); - void ecore_window_set_delete_inform(Window win); - void ecore_window_property_set(Window win, Atom type, - Atom format, int size, - void *data, int number); - void *ecore_window_property_get(Window win, Atom type, - Atom format, int *size); - void ecore_window_dnd_advertise(Window win); - void ecore_window_ignore(Window win); - void ecore_window_no_ignore(Window win); - int ecore_window_is_ignored(Window win); - Window ecore_window_get_at_xy(int x, int y); - - int ecore_window_dnd_capable(Window win); - void ecore_window_dnd_handle_motion(Window source_win, int x, - int y, int dragging); - void ecore_window_dnd_ok(int ok); - void ecore_window_dnd_finished(void); - void ecore_window_dnd_send_status_ok(Window source_win, - Window win, int x, int y, - int w, int h); - void ecore_window_dnd_send_finished(Window source_win, - Window win); - void ecore_window_set_title(Window win, char *title); - void ecore_window_set_name_class(Window win, char *name, - char *); - void ecore_window_get_name_class(Window win, char **name, - char **name_class); - char *ecore_window_get_machine(Window win); - char *ecore_window_get_command(Window win); - char *ecore_window_get_icon_name(Window win); - void ecore_window_get_hints(Window win, int *accepts_focus, - int *initial_state, - Pixmap * icon_pixmap, - Pixmap * icon_mask, - Window * icon_window, - Window * window_group); - void ecore_window_set_min_size(Window win, int w, int h); - void ecore_window_set_max_size(Window win, int w, int h); - void ecore_window_set_xy_hints(Window win, int x, int y); - void ecore_window_get_frame_size(Window win, int *l, int *r, - int *t, int *b); - int ecore_window_save_under(Window win); - void ecore_window_hint_set_layer(Window win, int layer); - void ecore_window_hint_set_sticky(Window win, int sticky); - void ecore_window_hint_set_borderless(Window win); - int ecore_window_get_gravity(Window win); - void ecore_window_gravity_reset(Window win); - void ecore_window_gravity_set(Window win, int gravity); - void ecore_window_bit_gravity_set(Window win, int gravity); - void ecore_window_get_root_relative_location(Window win, - int *x, int *y); - void ecore_window_send_event_move_resize(Window win, int x, - int y, int w, int h); - void ecore_window_send_client_message(Window win, Atom type, - int format, void *data); - void ecore_window_add_to_save_set(Window win); - void ecore_window_del_from_save_set(Window win); - void ecore_window_kill_client(Window win); - void ecore_window_set_border_width(Window win, int bw); - int ecore_window_get_border_width(Window win); - int ecore_window_get_wm_size_hints(Window win, - XSizeHints * hints, - int *mask); - int ecore_window_is_visible(Window win); - int ecore_window_is_normal(Window win); - - /** - * ecore_window_is_manageable - Returns 1 if a window can be managed by the wm. - * @win: the window for which to query. - * - * This function returns 0 if the window is unmapped, should be ignored - * by the window manager or is of the InputOnly class, 1 otherwise. - */ - int ecore_window_is_manageable(Window win); - - void ecore_windows_restack(Window * wins, int num); - void ecore_window_stack_above(Window win, Window above); - void ecore_window_stack_below(Window win, Window below); - char *ecore_window_get_title(Window win); - void ecore_window_button_grab_auto_replay_set(Window win, - int (*func) (Ecore_Event_Mouse_Down *ev)); - void *ecore_window_button_grab_auto_replay_get(Window win); - Window ecore_window_root(void); - void ecore_window_get_virtual_area(Window win, int *area_x, - int *area_y); - - /* ---------------- PIXMAP CALLS */ - - Pixmap ecore_pixmap_new(Window win, int w, int h, int dep); - void ecore_pixmap_free(Pixmap pmap); - - /* ---------------- POINTER CALLS */ - - void ecore_pointer_xy(Window win, int *x, int *y); - void ecore_pointer_xy_set(int x, int y); - void ecore_pointer_xy_get(int *x, int *y); - void ecore_pointer_warp_by(int dx, int dy); - void ecore_pointer_warp_to(int x, int y); - void ecore_pointer_replay(Time t); - void ecore_pointer_grab(Window win, Time t); - void ecore_pointer_ungrab(Time t); - - /* ---------------- KEYBOARD-RELATED CALLS */ - - KeySym ecore_key_get_keysym_from_keycode(KeyCode keycode); - char *ecore_key_get_string_from_keycode(KeyCode keycode); - char *ecore_key_get_string_from_keysym(KeySym keysym); - void ecore_key_grab(char *key, Ecore_Event_Key_Modifiers mods, - int anymod, int sync); - void ecore_key_ungrab(char *key, - Ecore_Event_Key_Modifiers mods, - int anymod); - KeyCode ecore_key_get_keycode(char *key); - char *ecore_keypress_translate_into_typeable(Ecore_Event_Key_Down * e); - - void ecore_event_allow(int mode, Time t); - - /* ---------------- LOCKS AND MODIFIER CALLS */ - - int ecore_lock_mask_scroll_get(void); - int ecore_lock_mask_num_get(void); - int ecore_lock_mask_caps_get(void); - void ecore_lock_scroll_set(int onoff); - int ecore_lock_scroll_get(void); - void ecore_lock_num_set(int onoff); - int ecore_lock_num_get(void); - void ecore_lock_caps_set(int onoff); - int ecore_lock_caps_get(void); - - int ecore_mod_mask_shift_get(void); - int ecore_mod_mask_ctrl_get(void); - int ecore_mod_mask_alt_get(void); - int ecore_mod_mask_win_get(void); - void ecore_mod_shift_set(int onoff); - int ecore_mod_shift_get(void); - void ecore_mod_ctrl_set(int onoff); - int ecore_mod_ctrl_get(void); - void ecore_mod_alt_set(int onoff); - int ecore_mod_alt_get(void); - void ecore_mod_win_set(int onoff); - int ecore_mod_win_get(void); - - int ecore_lock_mask_get(void); - int ecore_modifier_mask_get(void); - Window ecore_get_key_grab_win(void); - Display *ecore_display_get(void); - void ecore_focus_window_set(Window win); - Window ecore_focus_window_get(void); - void ecore_focus_to_window(Window win); - void ecore_focus_mode_reset(void); - Atom ecore_atom_get(char *name); - - - /* ---------------- GRABBING/UNGRABBING CALLS */ - - /** - * ecore_grab - Grabs the X server connection - * - * This function wraps XGrabServer, which prevents all other - * clients from receiving events. Calls are reference-counted. - */ - void ecore_grab(void); - - /** - * ecore_ungrab - Ungrabs the X server connection - * - * This function releases the server, provided that ecore_grab() - * has been called the same number of times as ecore_ungrab(). - */ - void ecore_ungrab(void); - - void ecore_grab_mouse(Window win, int confine, Cursor cursor); - void ecore_ungrab_mouse(void); - Window ecore_grab_window_get(void); - - void ecore_button_grab(Window win, int button, int events, - Ecore_Event_Key_Modifiers mod, - int any_mod); - void ecore_button_ungrab(Window win, int button, - Ecore_Event_Key_Modifiers mod, - int any_mod); - void ecore_keyboard_grab(Window win); - void ecore_keyboard_ungrab(void); - Window ecore_keyboard_grab_window_get(void); - - - /* ----------------- GRAPHICS CONTEXT AND DRAWING CALLS */ - - GC ecore_gc_new(Drawable d); - void ecore_gc_free(GC gc); - void ecore_gc_set_fg(GC gc, int val); - void ecore_gc_set_include_inferiors(GC gc); - void ecore_fill_rectangle(Drawable d, GC gc, int x, int y, - int w, int h); - void ecore_draw_rectangle(Drawable d, GC gc, int x, int y, - int w, int h); - void ecore_draw_line(Drawable d, GC gc, int x1, int y1, int x2, - int y2); - void ecore_draw_point(Drawable d, GC gc, int x, int y); - void ecore_area_copy(Drawable src, Drawable dest, GC gc, - int sx, int sy, int sw, int sh, int dx, - int dy); - - - /* ---------------- DRAG AND DROP CALLS */ - - - int ecore_dnd_selection_convert(Window win, Window req, - Atom type); - void *ecore_dnd_selection_get(Window win, Window req, Atom type, - int *size); - void ecore_dnd_set_data(Window win); - void ecore_dnd_set_action(Window win); - - void ecore_dnd_send_data(Window win, Window source_win, - void *data, int size, Atom dest_atom, - int type); - void ecore_dnd_set_mode_copy(void); - void ecore_dnd_set_mode_link(void); - void ecore_dnd_set_mode_move(void); - void ecore_dnd_set_mode_ask(void); - void ecore_dnd_own_selection(Window win); - void ecore_dnd_send_drop(Window win, Window source_win); - void ecore_get_virtual_area(int *area_x, int *area_y); - void ecore_clear_target_status(void); - - - /* ---------------- IPC CALLS */ - - void ecore_event_ipc_init(char *path); - void ecore_event_ipc_cleanup(void); - void ecore_add_ipc_service(int service, void (*func) (int fd)); - void ecore_del_ipc_service(int service); - - /* ---------------- SELECTION CALLS */ - - char *ecore_selection_get_data(Window win, Atom prop); - Window ecore_selection_request(void); - Window ecore_selection_set(char *string); - - /* ---------------- CURSOR LOOK CALLS */ - - void ecore_set_blank_pointer(Window w); - Cursor ecore_cursor_new(Pixmap pmap, Pixmap mask, int x, int y, - int fr, int fg, int fb, int br, int bg, - int bb); - void ecore_cursor_free(Cursor c); - void ecore_cursor_set(Window win, Cursor c); - - /* ---------------- EVENT-HANDLING CALLS */ - - void ecore_add_event(Ecore_Event_Type type, void *event, - void (*ev_free) (void *event)); - void ecore_del_event(void *event); - void ecore_del_all_events(void); - Ecore_Event *ecore_get_last_event(void); - void ecore_add_event_fd(int fd, void (*func) (int fd)); - void ecore_del_event_fd(int fd); - void ecore_add_event_pid(pid_t pid, void (*func) (pid_t pid)); - void ecore_del_event_pid(pid_t pid); - void ecore_add_event_ipc(int ipc, void (*func) (int ipc)); - void ecore_del_event_ipc(int ipc); - void ecore_event_loop(void); - void ecore_event_loop_quit(void); - void ecore_add_event_timer(char *name, double in, - void (*func) (int val, void *data), - int val, void *data); - void *ecore_del_event_timer(char *name); - void ecore_event_filter(Ecore_Event * ev); - void ecore_event_filter_events_handle(Ecore_Event * ev); - void ecore_event_filter_idle_handle(void); - - /** - * ecore_event_filter_init - Setup event handlers - * - * This function initializes all ECORE_EVENT_MAX - * event handler to be empty. - */ - void ecore_event_filter_init(void); - - void ecore_event_filter_handler_add(Ecore_Event_Type type, - void (*func) (Ecore_Event *ev)); - void ecore_event_filter_idle_handler_add(void (*func) (void *data), void *data); - - /** - * ecore_event_signal_init - Setup for default signal handlers - * - * This function initializes signal handlers for various - * signals via sigaction(). - */ - void ecore_event_signal_init(void); - - int ecore_event_signal_events_pending(void); - - /** - * ecore_event_x_init - Ecore X initialization - * - * This function initializes Ecore's X event handling - * callbacks. - */ - void ecore_event_x_init(void); - - /* ---------------- MISCELLANEOUS CALLS */ - - double ecore_get_time(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/legacy/ecore/src/Makefile.am b/legacy/ecore/src/Makefile.am deleted file mode 100644 index 3394bc3b8c..0000000000 --- a/legacy/ecore/src/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -## Process this file with automake to produce Makefile.in - -INCLUDES = @x_cflags@ - -lib_LTLIBRARIES = libecore.la -include_HEADERS = \ -Ecore.h - -libecore_la_SOURCES = \ - e_ev_filter.c \ - e_ev_signal.c \ - e_ev_x.c \ - e_events.c \ - e_ipc.c \ - e_util.c \ - e_x.c - -libecore_la_LIBADD = @x_ldflags@ @x_libs@ -lm -libecore_la_LDFLAGS = -version-info 0:2:0 diff --git a/legacy/ecore/src/e_ev_filter.c b/legacy/ecore/src/e_ev_filter.c deleted file mode 100644 index 58c7e0f1f4..0000000000 --- a/legacy/ecore/src/e_ev_filter.c +++ /dev/null @@ -1,132 +0,0 @@ -#include "Ecore.h" - -typedef struct _ecore_event_handler Ecore_Event_Handler; -typedef struct _ecore_event_idle_handler Ecore_Event_Idle_Handler; - -struct _ecore_event_handler -{ - void (*func) (Ecore_Event * ev); - Ecore_Event_Handler *next; -}; - -struct _ecore_event_idle_handler -{ - void (*func) (void *data); - void *data; - Ecore_Event_Idle_Handler *next; -}; - -static Ecore_Event_Handler *handler[ECORE_EVENT_MAX]; -static Ecore_Event_Idle_Handler *idle_handlers = NULL; - -void -ecore_event_filter(Ecore_Event * ev) -{ - Ecore_Event *evp; - int motion_events = 0; - int dnd_pos_events = 0; - int dnd_status_events = 0; - - /* count events to only use last events of some types */ - for (evp = ev; evp; evp = evp->next) - { - if (evp->type == ECORE_EVENT_MOUSE_MOVE) - motion_events++; - if (evp->type == ECORE_EVENT_DND_DROP_POSITION) - dnd_pos_events++; - if (evp->type == ECORE_EVENT_DND_DROP_STATUS) - dnd_status_events++; - } - for (evp = ev; evp; evp = evp->next) - { - if (evp->type == ECORE_EVENT_MOUSE_MOVE) - { - if (motion_events > 1) - { - evp->ignore = 1; - motion_events--; - } - } - else if (evp->type == ECORE_EVENT_DND_DROP_POSITION) - { - if (dnd_pos_events > 1) - { - evp->ignore = 1; - dnd_pos_events--; - } - } - else if (evp->type == ECORE_EVENT_DND_DROP_STATUS) - { - if (dnd_status_events > 1) - { - evp->ignore = 1; - dnd_status_events--; - } - } - } -} - -void -ecore_event_filter_events_handle(Ecore_Event * ev) -{ - Ecore_Event *evp; - - for (evp = ev; evp; evp = evp->next) - { - Ecore_Event_Handler *h; - - if (!evp->ignore) - { - for (h = handler[evp->type]; h; h = h->next) - { - if (h->func) - h->func(evp); - } - } - } -} - -void -ecore_event_filter_idle_handle(void) -{ - Ecore_Event_Idle_Handler *h; - - for (h = idle_handlers; h; h = h->next) - h->func(h->data); -} - -extern int __quit_ev_loop; - -void -ecore_event_filter_init(void) -{ - int i; - - __quit_ev_loop = 0; - for (i = 0; i < ECORE_EVENT_MAX; i++) - handler[i] = NULL; -} - -void -ecore_event_filter_handler_add(Ecore_Event_Type type, - void (*func) (Ecore_Event * ev)) -{ - Ecore_Event_Handler *h; - - h = NEW(Ecore_Event_Handler, 1); - h->func = func; - h->next = handler[type]; - handler[type] = h; -} - -void -ecore_event_filter_idle_handler_add(void (*func) (void *data), void *data) -{ - Ecore_Event_Idle_Handler *h; - - h = NEW(Ecore_Event_Idle_Handler, 1); - h->func = func; - h->data = data; - h->next = idle_handlers; - idle_handlers = h; -} diff --git a/legacy/ecore/src/e_ev_signal.c b/legacy/ecore/src/e_ev_signal.c deleted file mode 100644 index b0e34cb021..0000000000 --- a/legacy/ecore/src/e_ev_signal.c +++ /dev/null @@ -1,320 +0,0 @@ -#include "Ecore.h" -#include -#include -#include -#include -#include - -static void ecore_event_signal_free(void *event); -static void ecore_event_signal_handle_sigchld(int num); -static void ecore_event_signal_handle_sigusr1(int num); -static void ecore_event_signal_handle_sigusr2(int num); -static void ecore_event_signal_handle_sighup(int num); -static void ecore_event_signal_handle_sigpipe(int num); -static void ecore_event_signal_handle_sigsegv(int num); -static void ecore_event_signal_handle_sigfpe(int num); -static void ecore_event_signal_handle_sigill(int num); -static void ecore_event_signal_handle_sigbus(int num); - -#ifdef HAVE_SIGSTKFLT -static void ecore_event_signal_handle_sigstkflt(int num); -#endif -#ifdef HAVE_SIGPWR -static void ecore_event_signal_handle_sigpwr(int num); -#endif -static void ecore_event_signal_handle_sigchld(int num); -static void ecore_event_signal_handle_all(pid_t pid); - -static int signal_chld_count = 0; -static int signal_usr1_count = 0; -static int signal_usr2_count = 0; -static int signal_hup_count = 0; - -/* freeing stuff */ -static void -ecore_event_signal_free(void *event) -{ - FREE(event); -} - -/* signal handlers we can return from and add to signal recieved counts */ -static void -ecore_event_signal_handle_sigchld(int num) -{ - signal_chld_count++; - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigusr1(int num) -{ - signal_usr1_count++; - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigusr2(int num) -{ - signal_usr2_count++; - return; - num = 0; -} - -static void -ecore_event_signal_handle_sighup(int num) -{ - signal_hup_count++; - return; - num = 0; -} - -/* signals to ignore */ -static void -ecore_event_signal_handle_sigpipe(int num) -{ - return; - num = 0; -} - -/* signal handlers we cant return from - so handle here */ -static void -ecore_event_signal_handle_sigsegv(int num) -{ - for (;;) - { - fprintf(stderr, "EEEEEEEEK SEGV - waiting 10 seconds\n"); - sleep(10); - } - /* EEK - can't return - bad */ - abort(); - num = 0; -} - -static void -ecore_event_signal_handle_sigfpe(int num) -{ - /* EEK - can't return - bad */ - abort(); - num = 0; -} - -static void -ecore_event_signal_handle_sigill(int num) -{ - /* EEK - can't return - bad */ - abort(); - num = 0; -} - -static void -ecore_event_signal_handle_sigbus(int num) -{ - /* EEK - can't return - bad */ - abort(); - num = 0; -} - -#ifdef HAVE_SIGSTKFLT -static void -ecore_event_signal_handle_sigstkflt(int num) -{ - /* EEK - can't return - bad */ - abort(); - return; - num = 0; -} -#endif - -static void -ecore_event_signal_handle_sigint(int num) -{ - exit(0); - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigquit(int num) -{ - exit(0); - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigabrt(int num) -{ - abort(); - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigalrm(int num) -{ - return; - num = 0; -} - -static void -ecore_event_signal_handle_sigterm(int num) -{ - exit(0); - return; - num = 0; -} - -#ifdef HAVE_SIGPWR -static void -ecore_event_signal_handle_sigpwr(int num) -{ - exit(0); - return; - num = 0; -} -#endif - -static void -ecore_event_signal_handle_all(pid_t pid_pass) -{ - int status; - pid_t pid; - - if (signal_chld_count > 0) - { - while ((pid = waitpid(-1, &status, WNOHANG)) > 0) - { - if (WIFEXITED(status)) - { - Ecore_Event_Child *e; - int code; - - code = WEXITSTATUS(status); - e = NEW(Ecore_Event_Child, 1); - e->pid = pid; - e->exit_code = code; - ecore_add_event(ECORE_EVENT_CHILD, e, ecore_event_signal_free); - } - } - signal_chld_count = 0; - } - while (signal_usr1_count > 0) - { - Ecore_Event_User *e; - - e = NEW(Ecore_Event_User, 1); - e->num = 0; - e->hup = 0; - ecore_add_event(ECORE_EVENT_USER, e, ecore_event_signal_free); - signal_usr1_count--; - } - while (signal_hup_count > 0) - { - Ecore_Event_User *e; - - e = NEW(Ecore_Event_User, 1); - e->num = 0; - e->hup = 1; - ecore_add_event(ECORE_EVENT_USER, e, ecore_event_signal_free); - signal_hup_count--; - } - return; - pid_pass = 0; -} - -int -ecore_event_signal_events_pending(void) -{ - return (signal_chld_count + signal_usr1_count + signal_hup_count); -} - -void -ecore_event_signal_init(void) -{ - struct sigaction sa; - - ecore_add_event_pid(0, ecore_event_signal_handle_all); - - sa.sa_handler = ecore_event_signal_handle_sigchld; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGCHLD, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigusr1; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGUSR1, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigusr2; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGUSR2, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sighup; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGHUP, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigpipe; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGPIPE, &sa, (struct sigaction *)0); -/* - sa.sa_handler = ecore_event_signal_handle_sigsegv; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGSEGV, &sa, (struct sigaction *)0); -*/ - sa.sa_handler = ecore_event_signal_handle_sigfpe; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGFPE, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigill; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGILL, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigbus; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGBUS, &sa, (struct sigaction *)0); -#ifdef HAVE_SIGSTKFLT - sa.sa_handler = ecore_event_signal_handle_sigstkflt; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGSTKFLT, &sa, (struct sigaction *)0); -#endif - sa.sa_handler = ecore_event_signal_handle_sigint; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGINT, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigquit; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGQUIT, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigabrt; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGABRT, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigalrm; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGALRM, &sa, (struct sigaction *)0); - - sa.sa_handler = ecore_event_signal_handle_sigterm; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGTERM, &sa, (struct sigaction *)0); -#ifdef HAVE_SIGPWR - sa.sa_handler = ecore_event_signal_handle_sigpwr; - sa.sa_flags = SA_RESTART; - sigemptyset(&sa.sa_mask); - sigaction(SIGPWR, &sa, (struct sigaction *)0); -#endif -} diff --git a/legacy/ecore/src/e_ev_x.c b/legacy/ecore/src/e_ev_x.c deleted file mode 100644 index 648e929074..0000000000 --- a/legacy/ecore/src/e_ev_x.c +++ /dev/null @@ -1,1238 +0,0 @@ -#include "Ecore.h" -#include -#include -#include - -/* private funtion prototypes */ -static void ecore_event_x_handle_events(int fd); -static void ecore_event_x_translate_events(XEvent * events, - int num_events); - -static void ecore_event_key_down_free(void *event); -static void ecore_event_key_up_free(void *event); -static void ecore_event_generic_free(void *event); -static void ecore_event_dnd_drop_request_free(void *event); -static void ecore_event_paste_request_free(void *event); - -static void ecore_event_x_handle_keypress(XEvent * xevent); -static void ecore_event_x_handle_keyrelease(XEvent * xevent); -static void ecore_event_x_handle_button_press(XEvent * xevent); -static void ecore_event_x_handle_button_release(XEvent * xevent); -static void ecore_event_x_handle_motion_notify(XEvent * xevent); -static void ecore_event_x_handle_enter_notify(XEvent * xevent); -static void ecore_event_x_handle_leave_notify(XEvent * xevent); -static void ecore_event_x_handle_focus_in(XEvent * xevent); -static void ecore_event_x_handle_focus_out(XEvent * xevent); -static void ecore_event_x_handle_expose(XEvent * xevent); -static void ecore_event_x_handle_visibility_notify(XEvent * xevent); -static void ecore_event_x_handle_create_notify(XEvent * xevent); -static void ecore_event_x_handle_destroy_notify(XEvent * xevent); -static void ecore_event_x_handle_unmap_notify(XEvent * xevent); -static void ecore_event_x_handle_map_notify(XEvent * xevent); -static void ecore_event_x_handle_map_request(XEvent * xevent); -static void ecore_event_x_handle_reparent_notify(XEvent * xevent); -static void ecore_event_x_handle_configure_notify(XEvent * xevent); -static void ecore_event_x_handle_configure_request(XEvent * xevent); -static void ecore_event_x_handle_circulate_notify(XEvent * xevent); -static void ecore_event_x_handle_circulate_request(XEvent * xevent); -static void ecore_event_x_handle_property_notify(XEvent * xevent); -static void ecore_event_x_handle_colormap_notify(XEvent * xevent); -static void ecore_event_x_handle_selection_notify(XEvent * xevent); -static void ecore_event_x_handle_selection_clear(XEvent * xevent); -static void ecore_event_x_handle_selection_request(XEvent * xevent); -static void ecore_event_x_handle_client_message(XEvent * xevent); -static void ecore_event_x_handle_shape_change(XEvent * xevent); - -static int max_event_id = 0; -static void (**event_translator) (XEvent * event) = NULL; - -static int lock_mask_scroll = 0, lock_mask_num = 0, lock_mask_caps = 0; -static int mod_mask_shift = 0, mod_mask_ctrl = 0, mod_mask_alt = - 0, mod_mask_win = 0; - -/* convenience macros */ -#define GETSET_MODS(state, mods) \ -(mods) = ECORE_EVENT_KEY_MODIFIER_NONE;\ -if ((state) & mod_mask_shift) { ecore_mod_shift_set(1); (mods) |= ECORE_EVENT_KEY_MODIFIER_SHIFT; }\ -else ecore_mod_shift_set(0);\ -if ((state) & mod_mask_ctrl) { ecore_mod_ctrl_set(1); (mods) |= ECORE_EVENT_KEY_MODIFIER_CTRL; }\ -else ecore_mod_ctrl_set(0);\ -if ((state) & mod_mask_alt) { ecore_mod_alt_set(1); (mods) |= ECORE_EVENT_KEY_MODIFIER_ALT; }\ -else ecore_mod_alt_set(0);\ -if ((state) & mod_mask_win) { ecore_mod_win_set(1); (mods) |= ECORE_EVENT_KEY_MODIFIER_WIN; }\ -else ecore_mod_win_set(0); - -/* public functions */ - -/* initialise event handling for the fd X is on */ -void -ecore_event_x_init(void) -{ - int i, shape_event_id, current_lock; - - shape_event_id = max_event_id = ecore_event_shape_get_id(); - if (shape_event_id < SelectionRequest) - { - max_event_id = SelectionRequest; - fprintf(stderr, "ERROR: No shape extension! This is BAD!\n"); - } - event_translator = NEW_PTR(max_event_id + 1); - for (i = 0; i < max_event_id + 1; i++) - event_translator[i] = NULL; - event_translator[KeyPress] = ecore_event_x_handle_keypress; - event_translator[KeyRelease] = ecore_event_x_handle_keyrelease; - event_translator[ButtonPress] = ecore_event_x_handle_button_press; - event_translator[ButtonRelease] = ecore_event_x_handle_button_release; - event_translator[MotionNotify] = ecore_event_x_handle_motion_notify; - event_translator[EnterNotify] = ecore_event_x_handle_enter_notify; - event_translator[LeaveNotify] = ecore_event_x_handle_leave_notify; - event_translator[FocusIn] = ecore_event_x_handle_focus_in; - event_translator[FocusOut] = ecore_event_x_handle_focus_out; - event_translator[Expose] = ecore_event_x_handle_expose; - event_translator[VisibilityNotify] = ecore_event_x_handle_visibility_notify; - event_translator[CreateNotify] = ecore_event_x_handle_create_notify; - event_translator[DestroyNotify] = ecore_event_x_handle_destroy_notify; - event_translator[UnmapNotify] = ecore_event_x_handle_unmap_notify; - event_translator[MapNotify] = ecore_event_x_handle_map_notify; - event_translator[MapRequest] = ecore_event_x_handle_map_request; - event_translator[ReparentNotify] = ecore_event_x_handle_reparent_notify; - event_translator[ConfigureNotify] = ecore_event_x_handle_configure_notify; - event_translator[ConfigureRequest] = ecore_event_x_handle_configure_request; - event_translator[CirculateNotify] = ecore_event_x_handle_circulate_notify; - event_translator[CirculateRequest] = ecore_event_x_handle_circulate_request; - event_translator[PropertyNotify] = ecore_event_x_handle_property_notify; - event_translator[ColormapNotify] = ecore_event_x_handle_colormap_notify; - event_translator[ClientMessage] = ecore_event_x_handle_client_message; - event_translator[SelectionNotify] = ecore_event_x_handle_selection_notify; - event_translator[SelectionClear] = ecore_event_x_handle_selection_clear; - event_translator[SelectionRequest] = ecore_event_x_handle_selection_request; - if (shape_event_id > SelectionRequest) - event_translator[shape_event_id] = ecore_event_x_handle_shape_change; - - lock_mask_scroll = ecore_lock_mask_scroll_get(); - lock_mask_num = ecore_lock_mask_num_get(); - lock_mask_caps = ecore_lock_mask_caps_get(); - - mod_mask_shift = ecore_mod_mask_shift_get(); - mod_mask_ctrl = ecore_mod_mask_ctrl_get(); - mod_mask_alt = ecore_mod_mask_alt_get(); - mod_mask_win = ecore_mod_mask_win_get(); - -/* HRRRMMM lets not do this - ecorecore_keygrab("Num_Lock", ECORE_EVENT_KEY_MODIFIER_NONE, 1, 1); - ecorecore_keygrab("Scroll_Lock", ECORE_EVENT_KEY_MODIFIER_NONE, 1, 1); - ecorecore_keygrab("Caps_Lock", ECORE_EVENT_KEY_MODIFIER_NONE, 1, 1); - */ - current_lock = ecore_modifier_mask_get(); - if (current_lock & lock_mask_scroll) - ecore_lock_scroll_set(1); - if (current_lock & lock_mask_num) - ecore_lock_num_set(1); - if (current_lock & lock_mask_caps) - ecore_lock_caps_set(1); - if (current_lock & mod_mask_shift) - ecore_mod_shift_set(1); - if (current_lock & mod_mask_ctrl) - ecore_mod_ctrl_set(1); - if (current_lock & mod_mask_alt) - ecore_mod_alt_set(1); - if (current_lock & mod_mask_win) - ecore_mod_win_set(1); - ecore_add_event_fd(ecore_x_get_fd(), ecore_event_x_handle_events); -} - -/* private functions */ -/* get all events onthe event queue and translate them */ -static void -ecore_event_x_handle_events(int fd) -{ - int num_events = 0, size_events = 0; - XEvent *events = NULL; - - /* while there are events in the queue */ - while (ecore_events_pending()) - { - /* incriment our event count */ - num_events++; - /* if the numebr fo events is > than our buffer size then */ - if (num_events > size_events) - { - /* increase the buffer size by 64 events */ - size_events += 64; - if (events) - { - REALLOC(events, XEvent, size_events)} - else - events = NEW(XEvent, size_events); - } - /* get the next event into the event buffer */ - ecore_get_next_event(&(events[num_events - 1])); - } - /* call the XEvent -> Eevent translator */ - if (events) - { - ecore_event_x_translate_events(events, num_events); - /* if theres an event buffer - free it */ - FREE(events); - } - return; - fd = 0; -} - -/* take an array of events and translate them into E events */ -static void -ecore_event_x_translate_events(XEvent * events, int num_events) -{ - int i; - - for (i = 0; i < num_events; i++) - { - if ((events[i].type <= max_event_id) && - (event_translator[events[i].type])) - (*(event_translator[events[i].type])) (&(events[i])); - } -} - -static void -ecore_event_key_down_free(void *event) -{ - Ecore_Event_Key_Down *e; - - e = (Ecore_Event_Key_Down *) event; - IF_FREE(e->key); - IF_FREE(e->symbol); - IF_FREE(e->compose); - FREE(e); -} - -static void -ecore_event_key_up_free(void *event) -{ - Ecore_Event_Key_Up *e; - - e = (Ecore_Event_Key_Up *) event; - IF_FREE(e->key); - IF_FREE(e->symbol); - IF_FREE(e->compose); - FREE(e); -} - -static void -ecore_event_generic_free(void *event) -{ - FREE(event); -} - -static void -ecore_event_dnd_drop_request_free(void *event) -{ - Ecore_Event_Dnd_Drop_Request *e; - - e = (Ecore_Event_Dnd_Drop_Request *) event; - if (e->files) - { - int i; - - for (i = 0; i < e->num_files; i++) - FREE(e->files[i]); - } - FREE(event); -} - -static void -ecore_event_paste_request_free(void *event) -{ - Ecore_Event_Paste_Request *e; - - e = (Ecore_Event_Paste_Request *) event; - IF_FREE(e->string); - FREE(event); -} - -static void -ecore_event_x_handle_keypress(XEvent * xevent) -{ - Ecore_Event_Key_Down *e; - static KeyCode previous_code = 0; - static Time previous_time = 0; - - /* avoid doubling events up from passive grabs */ - if ((xevent->xkey.keycode == previous_code) && - xevent->xkey.time == previous_time) - return; - previous_code = xevent->xkey.keycode; - previous_time = xevent->xkey.time; -/* - if (ecore_keyget_keysym_from_keycode(xevent->xkey.keycode) == XK_Scroll_Lock) - { - if (ecore_lock_scroll_get()) - ecore_lock_scroll_set(0); - else - ecore_lock_scroll_set(1); - e_event_allow(ReplayKeyboard, xevent->xkey.time); - ecore_flush(); - } - else if (ecore_keyget_keysym_from_keycode(xevent->xkey.keycode) == XK_Num_Lock) - { - if (ecore_lock_num_get()) - ecore_lock_num_set(0); - else - ecore_lock_num_set(1); - e_event_allow(ReplayKeyboard, xevent->xkey.time); - ecore_flush(); - } - else if (ecore_keyget_keysym_from_keycode(xevent->xkey.keycode) == XK_Caps_Lock) - { - if (ecore_lock_caps_get()) - ecore_lock_caps_set(0); - else - ecore_lock_caps_set(1); - e_event_allow(ReplayKeyboard, xevent->xkey.time); - ecore_flush(); - } - */ - e = NEW(Ecore_Event_Key_Down, 1); - e->win = xevent->xkey.window; - e->root = xevent->xkey.root; - GETSET_MODS(xevent->xkey.state, e->mods); - e->time = xevent->xkey.time; - e->key = ecore_key_get_string_from_keycode(xevent->xkey.keycode); - { - int val; - char buf[256]; - KeySym sym; - XComposeStatus stat; - - val = XLookupString((XKeyEvent *) xevent, buf, sizeof(buf), &sym, &stat); - if (val > 0) - { - buf[val] = 0; - e->compose = strdup(buf); - } - else - e->compose = NULL; - e->symbol = ecore_key_get_string_from_keysym(sym); - } - ecore_add_event(ECORE_EVENT_KEY_DOWN, e, ecore_event_key_down_free); -} - -static void -ecore_event_x_handle_keyrelease(XEvent * xevent) -{ - Ecore_Event_Key_Up *e; - static KeyCode previous_code = 0; - static Time previous_time = 0; - - /* avoid doubling events up from passive grabs */ - if ((xevent->xkey.keycode == previous_code) && - xevent->xkey.time == previous_time) - return; - previous_code = xevent->xkey.keycode; - previous_time = xevent->xkey.time; - - e = NEW(Ecore_Event_Key_Up, 1); - e->win = xevent->xkey.window; - e->root = xevent->xkey.root; - GETSET_MODS(xevent->xkey.state, e->mods); - e->time = xevent->xkey.time; - e->key = ecore_key_get_string_from_keycode(xevent->xkey.keycode); - { - int val; - char buf[256]; - KeySym sym; - XComposeStatus stat; - - val = XLookupString((XKeyEvent *) xevent, buf, sizeof(buf), &sym, &stat); - if (val > 0) - { - buf[val] = 0; - e->compose = strdup(buf); - } - else - e->compose = NULL; - e->symbol = ecore_key_get_string_from_keysym(sym); - } - ecore_add_event(ECORE_EVENT_KEY_UP, e, ecore_event_key_up_free); -} - -static void -ecore_event_x_handle_button_press(XEvent * xevent) -{ - static Time last_time = 0, last_last_time = 0; - static int last_button = 0, last_last_button = 0; - static Window last_window = 0, last_last_window = 0; - - ecore_pointer_xy_set(xevent->xbutton.x_root, xevent->xbutton.y_root); - if ((xevent->xbutton.button == 4) || (xevent->xbutton.button == 5)) - { - Ecore_Event_Wheel *e; - - e = NEW(Ecore_Event_Wheel, 1); - e->win = xevent->xbutton.window; - e->root = xevent->xbutton.root; - e->x = xevent->xbutton.x; - e->y = xevent->xbutton.y; - e->rx = xevent->xbutton.x_root; - e->ry = xevent->xbutton.y_root; - e->time = xevent->xbutton.time; - if (xevent->xbutton.button == 5) - e->z = 1; - else - e->z = -1; - if (xevent->xbutton.time - last_time < 15) - e->z *= 16; - else if (xevent->xbutton.time - last_time < 30) - e->z *= 4; - GETSET_MODS(xevent->xbutton.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_WHEEL, e, ecore_event_generic_free); - } - else - { - Ecore_Event_Mouse_Down *e; - - e = NEW(Ecore_Event_Mouse_Down, 1); - e->win = xevent->xbutton.window; - e->root = xevent->xbutton.root; - e->button = xevent->xbutton.button; - e->x = xevent->xbutton.x; - e->y = xevent->xbutton.y; - e->rx = xevent->xbutton.x_root; - e->ry = xevent->xbutton.y_root; - e->time = xevent->xbutton.time; - e->double_click = 0; - e->triple_click = 0; - GETSET_MODS(xevent->xbutton.state, e->mods); - if (xevent->xbutton.time - last_last_time < 500) - { - if ((xevent->xbutton.window == (unsigned int)last_window) && - (last_window == last_last_window) && - (xevent->xbutton.button == (unsigned int)last_button) && - (last_button == last_button)) - e->triple_click = 1; - } - else if (xevent->xbutton.time - last_time < 250) - { - if ((xevent->xbutton.window == (unsigned int)last_window) && - (xevent->xbutton.button == (unsigned int)last_button)) - e->double_click = 1; - } - ecore_add_event(ECORE_EVENT_MOUSE_DOWN, e, ecore_event_generic_free); - { - Ecore_XID *xid = NULL; - - if (XFindContext(xevent->xbutton.display, e->win, - xid_context, (XPointer *) & xid) != XCNOENT) - { - if ((xid->grab_button_auto_replay) && - (xid->grab_button_auto_replay(e))) - { - ecore_pointer_replay(e->time); - } - } - } - } - last_last_window = last_window; - last_window = xevent->xbutton.window; - last_last_button = last_button; - last_button = xevent->xbutton.button; - last_last_time = last_time; - last_time = xevent->xbutton.time; -} - -static void -ecore_event_x_handle_button_release(XEvent * xevent) -{ - Ecore_Event_Mouse_Up *e; - - if (xevent->xbutton.button > 3) - return; - - e = NEW(Ecore_Event_Mouse_Up, 1); - e->win = xevent->xbutton.window; - e->root = xevent->xbutton.root; - e->button = xevent->xbutton.button; - e->x = xevent->xbutton.x; - e->y = xevent->xbutton.y; - e->rx = xevent->xbutton.x_root; - e->ry = xevent->xbutton.y_root; - e->time = xevent->xbutton.time; - GETSET_MODS(xevent->xbutton.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_UP, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_motion_notify(XEvent * xevent) -{ - Ecore_Event_Mouse_Move *e; - - ecore_pointer_xy_set(xevent->xmotion.x_root, xevent->xmotion.y_root); - e = NEW(Ecore_Event_Mouse_Move, 1); - e->win = xevent->xmotion.window; - e->root = xevent->xmotion.root; - e->x = xevent->xmotion.x; - e->y = xevent->xmotion.y; - e->rx = xevent->xmotion.x_root; - e->ry = xevent->xmotion.y_root; - e->time = xevent->xmotion.time; - GETSET_MODS(xevent->xmotion.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_MOVE, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_enter_notify(XEvent * xevent) -{ - Ecore_Event_Window_Enter *e; - -/* if ((xevent->xcrossing.mode == NotifyGrab) || (xevent->xcrossing.mode == NotifyUngrab)) return;*/ - ecore_pointer_xy_set(xevent->xcrossing.x_root, xevent->xcrossing.y_root); - e = NEW(Ecore_Event_Window_Enter, 1); - e->win = xevent->xcrossing.window; - e->root = xevent->xcrossing.root; - e->x = xevent->xcrossing.x; - e->y = xevent->xcrossing.y; - e->rx = xevent->xcrossing.x_root; - e->ry = xevent->xcrossing.y_root; - e->time = xevent->xcrossing.time; - GETSET_MODS(xevent->xcrossing.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_IN, e, ecore_event_generic_free); - ecore_window_mouse_set_in(e->win, 1); - { - Ecore_Event_Mouse_Move *e; - - e = NEW(Ecore_Event_Mouse_Move, 1); - e->win = xevent->xcrossing.window; - e->root = xevent->xcrossing.root; - e->x = xevent->xcrossing.x; - e->y = xevent->xcrossing.y; - e->rx = xevent->xcrossing.x_root; - e->ry = xevent->xcrossing.y_root; - e->time = xevent->xcrossing.time; - GETSET_MODS(xevent->xcrossing.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_MOVE, e, ecore_event_generic_free); - } -} - -static void -ecore_event_x_handle_leave_notify(XEvent * xevent) -{ - Ecore_Event_Window_Leave *e; - -/* if ((xevent->xcrossing.mode == NotifyGrab) || (xevent->xcrossing.mode == NotifyUngrab)) return;*/ - ecore_pointer_xy_set(xevent->xcrossing.x_root, xevent->xcrossing.y_root); - { - Ecore_Event_Mouse_Move *e; - - e = NEW(Ecore_Event_Mouse_Move, 1); - e->win = xevent->xcrossing.window; - e->root = xevent->xcrossing.root; - e->x = xevent->xcrossing.x; - e->y = xevent->xcrossing.y; - e->rx = xevent->xcrossing.x_root; - e->ry = xevent->xcrossing.y_root; - e->time = xevent->xcrossing.time; - GETSET_MODS(xevent->xcrossing.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_MOVE, e, ecore_event_generic_free); - } - e = NEW(Ecore_Event_Window_Leave, 1); - e->win = xevent->xcrossing.window; - e->root = xevent->xcrossing.root; - e->x = xevent->xcrossing.x; - e->y = xevent->xcrossing.y; - e->rx = xevent->xcrossing.x_root; - e->ry = xevent->xcrossing.y_root; - e->time = xevent->xcrossing.time; - GETSET_MODS(xevent->xcrossing.state, e->mods); - ecore_add_event(ECORE_EVENT_MOUSE_OUT, e, ecore_event_generic_free); - ecore_window_mouse_set_in(e->win, 0); -} - -static void -ecore_event_x_handle_focus_in(XEvent * xevent) -{ - Ecore_Event_Window_Focus_In *e; - - e = NEW(Ecore_Event_Window_Focus_In, 1); - e->win = xevent->xfocus.window; - e->root = ecore_window_get_root(e->win); - if (xevent->xfocus.mode != NotifyNormal) - e->key_grab = 1; - else - e->key_grab = 0; - ecore_add_event(ECORE_EVENT_WINDOW_FOCUS_IN, e, ecore_event_generic_free); - ecore_focus_window_set(e->win); -} - -static void -ecore_event_x_handle_focus_out(XEvent * xevent) -{ - Ecore_Event_Window_Focus_Out *e; - - e = NEW(Ecore_Event_Window_Focus_Out, 1); - e->win = xevent->xfocus.window; - e->root = ecore_window_get_root(e->win); - if (xevent->xfocus.mode != NotifyNormal) - e->key_grab = 1; - else - e->key_grab = 0; - ecore_add_event(ECORE_EVENT_WINDOW_FOCUS_OUT, e, ecore_event_generic_free); - ecore_focus_window_set(0); -} - -static void -ecore_event_x_handle_expose(XEvent * xevent) -{ - Ecore_Event_Window_Expose *e; - - e = NEW(Ecore_Event_Window_Expose, 1); - e->win = xevent->xexpose.window; - e->root = ecore_window_get_root(e->win); - e->x = xevent->xexpose.x; - e->y = xevent->xexpose.y; - e->w = xevent->xexpose.width; - e->h = xevent->xexpose.height; - ecore_add_event(ECORE_EVENT_WINDOW_EXPOSE, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_visibility_notify(XEvent * xevent) -{ - if (xevent->xvisibility.state != VisibilityPartiallyObscured) - { - Ecore_Event_Window_Visibility *e; - - e = NEW(Ecore_Event_Window_Visibility, 1); - e->win = xevent->xvisibility.window; - e->root = ecore_window_get_root(e->win); - if (xevent->xvisibility.state == VisibilityFullyObscured) - e->fully_obscured = 1; - else - e->fully_obscured = 0; - ecore_add_event(ECORE_EVENT_WINDOW_VISIBILITY, e, - ecore_event_generic_free); - } -} - -static void -ecore_event_x_handle_create_notify(XEvent * xevent) -{ - Ecore_Event_Window_Create *e; - - e = NEW(Ecore_Event_Window_Create, 1); - e->win = xevent->xcreatewindow.window; - ecore_validate_xid(e->win); - e->root = ecore_window_get_root(e->win); - if (xevent->xcreatewindow.override_redirect) - e->override = 1; - else - e->override = 0; - ecore_add_event(ECORE_EVENT_WINDOW_CREATE, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_destroy_notify(XEvent * xevent) -{ - Ecore_Event_Window_Destroy *e; - - e = NEW(Ecore_Event_Window_Destroy, 1); - e->win = xevent->xdestroywindow.window; - e->root = ecore_window_get_root(e->win); - ecore_add_event(ECORE_EVENT_WINDOW_DESTROY, e, ecore_event_generic_free); - ecore_unvalidate_xid(e->win); -} - -static void -ecore_event_x_handle_unmap_notify(XEvent * xevent) -{ - Ecore_Event_Window_Unmap *e; - Ecore_XID *xid = NULL; - - e = NEW(Ecore_Event_Window_Unmap, 1); - e->win = xevent->xunmap.window; - e->root = ecore_window_get_root(e->win); - ecore_add_event(ECORE_EVENT_WINDOW_UNMAP, e, ecore_event_generic_free); - xid = ecore_validate_xid(e->win); - if (xid) - xid->mapped = 0; -} - -static void -ecore_event_x_handle_map_notify(XEvent * xevent) -{ - Ecore_Event_Window_Map *e; - Ecore_XID *xid = NULL; - - e = NEW(Ecore_Event_Window_Map, 1); - e->win = xevent->xmap.window; - e->root = ecore_window_get_root(e->win); - ecore_add_event(ECORE_EVENT_WINDOW_MAP, e, ecore_event_generic_free); - xid = ecore_validate_xid(e->win); - if (xid) - xid->mapped = 1; -} - -static void -ecore_event_x_handle_map_request(XEvent * xevent) -{ - Ecore_Event_Window_Map_Request *e; - - e = NEW(Ecore_Event_Window_Map_Request, 1); - e->win = xevent->xmaprequest.window; - e->root = ecore_window_get_root(e->win); - ecore_add_event(ECORE_EVENT_WINDOW_MAP_REQUEST, e, ecore_event_generic_free); - ecore_validate_xid(e->win); -} - -static void -ecore_event_x_handle_reparent_notify(XEvent * xevent) -{ - Ecore_Event_Window_Reparent *e; - Window parent; - Ecore_XID *xid = NULL; - - e = NEW(Ecore_Event_Window_Reparent, 1); - e->win = xevent->xreparent.window; - xid = ecore_validate_xid(e->win); - e->root = ecore_window_get_root(e->win); - parent = ecore_window_get_parent(e->win); - e->parent_from = parent; - e->parent = xevent->xreparent.parent; - ecore_validate_xid(e->parent); - ecore_del_child(parent, e->win); - ecore_add_child(xevent->xreparent.parent, xevent->xreparent.window); - if (xid) - xid->parent = e->parent; - ecore_add_event(ECORE_EVENT_WINDOW_REPARENT, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_configure_notify(XEvent * xevent) -{ - Ecore_Event_Window_Configure *e; - Ecore_XID *xid; - - e = NEW(Ecore_Event_Window_Configure, 1); - e->win = xevent->xconfigure.window; - e->root = ecore_window_get_root(e->win); - e->x = xevent->xconfigure.x; - e->y = xevent->xconfigure.y; - e->w = xevent->xconfigure.width; - e->h = xevent->xconfigure.height; - if (!xevent->xconfigure.send_event) - { - xid = ecore_validate_xid(e->win); - if (xid) - { - xid->x = e->x; - xid->y = e->y; - xid->w = e->w; - xid->h = e->h; - } - e->wm_generated = 0; - /* FIXME: don't handle redoing stack for xevent->xconfigure.above */ - /* member (the window is stacked immediately in stack above this) */ - } - else - e->wm_generated = 1; - ecore_add_event(ECORE_EVENT_WINDOW_CONFIGURE, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_configure_request(XEvent * xevent) -{ - Ecore_Event_Window_Configure_Request *e; - - e = NEW(Ecore_Event_Window_Configure_Request, 1); - e->win = xevent->xconfigurerequest.window; - e->root = ecore_window_get_root(e->win); - e->x = xevent->xconfigurerequest.x; - e->y = xevent->xconfigurerequest.y; - e->w = xevent->xconfigurerequest.width; - e->h = xevent->xconfigurerequest.height; - e->stack_win = xevent->xconfigurerequest.above; - e->detail = xevent->xconfigurerequest.detail; - e->mask = xevent->xconfigurerequest.value_mask; - ecore_add_event(ECORE_EVENT_WINDOW_CONFIGURE_REQUEST, e, - ecore_event_generic_free); -} - -static void -ecore_event_x_handle_circulate_notify(XEvent * xevent) -{ - Ecore_Event_Window_Circulate *e; - - e = NEW(Ecore_Event_Window_Circulate, 1); - e->win = xevent->xcirculate.window; - e->root = ecore_window_get_root(e->win); - if (xevent->xcirculate.place == PlaceOnBottom) - e->lower = 1; - else - e->lower = 0; - ecore_add_event(ECORE_EVENT_WINDOW_CIRCULATE, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_circulate_request(XEvent * xevent) -{ - Ecore_Event_Window_Circulate_Request *e; - - e = NEW(Ecore_Event_Window_Circulate_Request, 1); - e->win = xevent->xcirculaterequest.window; - e->root = ecore_window_get_root(e->win); - if (xevent->xcirculaterequest.place == PlaceOnBottom) - e->lower = 1; - else - e->lower = 0; - ecore_add_event(ECORE_EVENT_WINDOW_CIRCULATE_REQUEST, e, - ecore_event_generic_free); -} - -static void -ecore_event_x_handle_property_notify(XEvent * xevent) -{ - Ecore_Event_Window_Property *e; - - e = NEW(Ecore_Event_Window_Property, 1); - e->win = xevent->xproperty.window; - e->root = ecore_window_get_root(e->win); - e->atom = xevent->xproperty.atom; - e->time = xevent->xproperty.time; - ecore_add_event(ECORE_EVENT_WINDOW_PROPERTY, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_colormap_notify(XEvent * xevent) -{ - Ecore_Event_Colormap *e; - - e = NEW(Ecore_Event_Colormap, 1); - e->win = xevent->xcolormap.window; - e->root = ecore_window_get_root(e->win); - e->cmap = xevent->xcolormap.colormap; - if (xevent->xcolormap.state == ColormapInstalled) - e->installed = 1; - else - e->installed = 0; - ecore_add_event(ECORE_EVENT_COLORMAP, e, ecore_event_generic_free); -} - -Ecore_Event_Dnd_Drop_Request *ev_drop_request_pending = NULL; - -static void -ecore_event_x_handle_selection_notify(XEvent * xevent) -{ - Ecore_Event_Dnd_Drop_Request *e; - char *data; - int size; - static Atom atom_xdndactioncopy = 0; - static Atom atom_xdndactionmove = 0; - static Atom atom_xdndactionlink = 0; - static Atom atom_xdndactionask = 0; - static Atom atom_xdndactionlist = 0; - - e = ev_drop_request_pending; - if (!e) - { - Ecore_Event_Paste_Request *e2; - - e2 = NEW(Ecore_Event_Paste_Request, 1); - e2->string = ecore_selection_get_data(xevent->xselection.requestor, - xevent->xselection.property); - if (e2->string) - { - e2->win = xevent->xselection.requestor; - e2->root = ecore_window_get_root(e2->win); - e2->source_win = xevent->xselection.requestor; - ecore_add_event(ECORE_EVENT_PASTE_REQUEST, e2, - ecore_event_paste_request_free); - } - else - { - FREE(e2); - } - return; - } - - ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy"); - ECORE_ATOM(atom_xdndactionmove, "XdndActionMove"); - ECORE_ATOM(atom_xdndactionlink, "XdndActionLink"); - ECORE_ATOM(atom_xdndactionask, "XdndActionAsk"); - ECORE_ATOM(atom_xdndactionlist, "XdndActionList"); - data = ecore_dnd_selection_get(xevent->xany.window, e->source_win, - xevent->xselection.property, &size); - if (data) - { - char *s, *buf; - int i, is; - Atom *method = NULL; - - method = ecore_window_property_get(e->source_win, - atom_xdndactionlist, XA_ATOM, &is); - if (method) - { - e->copy = 0; - e->link = 0; - e->move = 0; - if (*method == atom_xdndactioncopy) - e->copy = 1; - else if (*method == atom_xdndactionmove) - e->move = 1; - else if (*method == atom_xdndactionlink) - e->link = 1; - FREE(method); - } - else - { - e->copy = 0; - e->link = 0; - e->move = 0; - } - s = data; - buf = NEW(char, size); - - i = 0; - is = 0; - e->files = NULL; - while ((s[is]) && (is < size)) - { - if ((i == 0) && (s[is] == '#')) - { - for (; ((s[is] != 0) && (s[is] != '\n')); is++); - } - else - { - if (s[is] != '\r') - { - buf[i++] = s[is]; - } - else - { - buf[i] = 0; - e->num_files++; - REALLOC_PTR(e->files, e->num_files); - e->files[e->num_files - 1] = strdup(buf); - buf[0] = 0; - i = 0; - is++; - } - is++; - } - } - if (i > 0) - { - buf[i] = 0; - e->num_files++; - REALLOC_PTR(e->files, e->num_files); - e->files[e->num_files - 1] = strdup(buf); - } - FREE(buf); - FREE(data); - } - ecore_add_event(ECORE_EVENT_DND_DROP_REQUEST, e, - ecore_event_dnd_drop_request_free); - ev_drop_request_pending = NULL; -} - -static void -ecore_event_x_handle_selection_clear(XEvent * xevent) -{ - Ecore_Event_Clear_Selection *e; - - e = NEW(Ecore_Event_Clear_Selection, 1); - e->win = xevent->xselectionclear.window; - e->root = ecore_window_get_root(e->win); - e->selection = xevent->xselectionclear.selection; - ecore_add_event(ECORE_EVENT_CLEAR_SELECTION, e, ecore_event_generic_free); -} - -static void -ecore_event_x_handle_selection_request(XEvent * xevent) -{ - static Atom atom_xdndselection = 0; - static Atom atom_text_plain = 0; - static Atom atom_text_uri_list = 0; - static Atom atom_text_moz_url = 0; - static Atom atom_netscape_url = 0; - static Atom atom_text_selection = 0; - Ecore_Event_Dnd_Data_Request *e; - - ECORE_ATOM(atom_xdndselection, "XdndSelection"); - ECORE_ATOM(atom_text_plain, "text/plain"); - ECORE_ATOM(atom_text_uri_list, "text/uri-list"); - ECORE_ATOM(atom_text_moz_url, "text/x-moz-url"); - ECORE_ATOM(atom_netscape_url, "_NETSCAPE_URL"); - ECORE_ATOM(atom_text_selection, "TEXT_SELECTION"); - if (xevent->xselectionrequest.selection == atom_xdndselection) - { - e = NEW(Ecore_Event_Dnd_Data_Request, 1); - e->win = xevent->xselectionrequest.owner; - e->root = ecore_window_get_root(e->win); - e->source_win = xevent->xselectionrequest.requestor; - e->plain_text =0; - e->uri_list = 0; - e->moz_url = 0; - e->netscape_url = 0; - - if (xevent->xselectionrequest.target == atom_text_plain) e->plain_text = 1; - if (xevent->xselectionrequest.target == atom_text_uri_list) e->uri_list = 1; - if (xevent->xselectionrequest.target == atom_text_moz_url) e->moz_url = 1; - if (xevent->xselectionrequest.target == atom_netscape_url) e->netscape_url = 1; - e->destination_atom = xevent->xselectionrequest.property; - ecore_add_event(ECORE_EVENT_DND_DATA_REQUEST, e, - ecore_event_generic_free); - } - else - { - XEvent ev; - Atom target_list[2]; - static Atom xa_targets = None; - - if (xa_targets == None) - xa_targets = XInternAtom(xevent->xselectionrequest.display, - "TARGETS", False); - ev.xselection.type = SelectionNotify; - ev.xselection.property = None; - ev.xselection.display = xevent->xselectionrequest.display; - ev.xselection.requestor = xevent->xselectionrequest.requestor; - ev.xselection.selection = xevent->xselectionrequest.selection; - ev.xselection.target = xevent->xselectionrequest.target; - ev.xselection.time = xevent->xselectionrequest.time; - if (xevent->xselectionrequest.target == xa_targets) - { - target_list[0] = (Atom) xa_targets; - target_list[1] = (Atom) XA_STRING; - XChangeProperty(xevent->xselectionrequest.display, - xevent->xselectionrequest.requestor, - xevent->xselectionrequest.property, - xevent->xselectionrequest.target, - (8 * sizeof(target_list[0])), - PropModeReplace, - (unsigned char *)target_list, - (sizeof(target_list) / sizeof(target_list[0]))); - ev.xselection.property = xevent->xselectionrequest.property; - } - else if (xevent->xselectionrequest.target == XA_STRING) - { - void *data; - int size; - - data = ecore_window_property_get(xevent->xselectionrequest.owner, - atom_text_selection, XA_STRING, - &size); - if (data) - { - XChangeProperty(xevent->xselectionrequest.display, - xevent->xselectionrequest.requestor, - xevent->xselectionrequest.property, - xevent->xselectionrequest.target, - 8, PropModeReplace, data, size); - FREE(data); - } - ev.xselection.property = xevent->xselectionrequest.property; - } - XSendEvent(xevent->xselectionrequest.display, - xevent->xselectionrequest.requestor, False, 0, &ev); - } -} - -static void -ecore_event_x_handle_client_message(XEvent * xevent) -{ - static Atom atom_wm_delete_window = 0; - static Atom atom_wm_protocols = 0; - static Atom atom_xdndstatus = 0; - static Atom atom_xdndenter = 0; - static Atom atom_xdndleave = 0; - static Atom atom_xdndfinished = 0; - static Atom atom_xdndposition = 0; - static Atom atom_xdnddrop = 0; - static Atom atom_text_uri_list = 0; - static Atom atom_xdndactioncopy = 0; - static Atom atom_xdndactionlink = 0; - static Atom atom_xdndactionmove = 0; - static Atom atom_xdndactionprivate = 0; - - /* setup some known atoms to translate this message into a sensible event */ - ECORE_ATOM(atom_wm_delete_window, "WM_DELETE_WINDOW"); - ECORE_ATOM(atom_wm_protocols, "WM_PROTOCOLS"); - ECORE_ATOM(atom_xdndstatus, "XdndStatus"); - ECORE_ATOM(atom_xdndfinished, "XdndFinished"); - ECORE_ATOM(atom_xdndenter, "XdndEnter"); - ECORE_ATOM(atom_xdndleave, "XdndLeave"); - ECORE_ATOM(atom_xdnddrop, "XdndDrop"); - ECORE_ATOM(atom_xdndposition, "XdndPosition"); - ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy"); - ECORE_ATOM(atom_xdndactionlink, "XdndActionLink"); - ECORE_ATOM(atom_xdndactionmove, "XdndActionMove"); - ECORE_ATOM(atom_xdndactionprivate, "XdndActionPrivate"); - ECORE_ATOM(atom_text_uri_list, "text/uri-list"); - - /* first type = delete event sent to client */ - if ((xevent->xclient.message_type == atom_wm_protocols) && - (xevent->xclient.format == 32) && - (xevent->xclient.data.l[0] == (long)atom_wm_delete_window)) - { - Ecore_Event_Window_Delete *e; - - e = NEW(Ecore_Event_Window_Delete, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - ecore_add_event(ECORE_EVENT_WINDOW_DELETE, e, ecore_event_generic_free); - } - else if ((xevent->xclient.message_type == atom_xdndenter) && - (xevent->xclient.format == 32)) - { -/* if ((xevent->xclient.data.l[2] == (long)atom_text_uri_list) || - * (xevent->xclient.data.l[3] == (long)atom_text_uri_list) || - * (xevent->xclient.data.l[4] == (long)atom_text_uri_list)) - */ { - Ecore_Event_Dnd_Drop_Request *e; - - - if (ev_drop_request_pending) - { - ecore_event_dnd_drop_request_free(ev_drop_request_pending); - ev_drop_request_pending = NULL; - } - e = NEW(Ecore_Event_Dnd_Drop_Request, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - if (!ecore_dnd_selection_convert - (e->source_win, e->win, atom_text_uri_list)) - { - FREE(e); - return; - } - e->files = NULL; - e->num_files = 0; - ev_drop_request_pending = e; - } - } - else if ((xevent->xclient.message_type == atom_xdndleave) && - (xevent->xclient.format == 32)) - { - Ecore_Event_Dnd_Drop_End *e; - - e = NEW(Ecore_Event_Dnd_Drop_End, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - ecore_add_event(ECORE_EVENT_DND_DROP_END, e, ecore_event_generic_free); - } - else if ((xevent->xclient.message_type == atom_xdndposition) && - (xevent->xclient.format == 32)) - { - Ecore_Event_Dnd_Drop_Position *e; - - e = NEW(Ecore_Event_Dnd_Drop_Position, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - e->x = (xevent->xclient.data.l[2] >> 16) & 0xffff; - e->y = xevent->xclient.data.l[2] & 0xffff; - ecore_add_event(ECORE_EVENT_DND_DROP_POSITION, e, - ecore_event_generic_free); - } - else if ((xevent->xclient.message_type == atom_xdndstatus) && - (xevent->xclient.format == 32)) - { - Ecore_Event_Dnd_Drop_Status *e; - - ecore_clear_target_status(); - e = NEW(Ecore_Event_Dnd_Drop_Status, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - e->x = (xevent->xclient.data.l[2] >> 16) & 0xffff; - e->y = xevent->xclient.data.l[2] & 0xffff; - e->w = (xevent->xclient.data.l[3] >> 16) & 0xffff; - e->h = xevent->xclient.data.l[3] & 0xffff; - - e->copy = e->link = e->move = e->e_private = 0; - if( xevent->xclient.data.l[4] == atom_xdndactioncopy ) - e->copy = 1; - else if( xevent->xclient.data.l[4] == atom_xdndactionlink ) - e->link = 1; - else if( xevent->xclient.data.l[4] == atom_xdndactionmove ) - e->move = 1; - else if( xevent->xclient.data.l[4] == atom_xdndactionprivate ) - e->e_private = 1; - - if (xevent->xclient.data.l[1] & 0x1) - e->ok = 1; - else - e->ok = 0; - if (xevent->xclient.data.l[1] & 0x2) - e->all_position_msgs = 1; - else - e->all_position_msgs = 0; - ecore_add_event(ECORE_EVENT_DND_DROP_STATUS, e, ecore_event_generic_free); - } - else if ((xevent->xclient.message_type == atom_xdndfinished) && - (xevent->xclient.format == 32)) - { - Ecore_Event_Dnd_Drop_End *e; - - e = NEW(Ecore_Event_Dnd_Drop_End, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - ecore_add_event(ECORE_EVENT_DND_DROP_END, e, ecore_event_generic_free); - } - else if ((xevent->xclient.message_type == atom_xdnddrop) && - (xevent->xclient.format == 32)) - { - Ecore_Event_Dnd_Drop *e; - - e = NEW(Ecore_Event_Dnd_Drop, 1); - e->win = xevent->xclient.window; - e->root = ecore_window_get_root(e->win); - e->source_win = (Window) xevent->xclient.data.l[0]; - ecore_add_event(ECORE_EVENT_DND_DROP, e, ecore_event_generic_free); - } - else - { - Ecore_Event_Message *e; - - e = NEW(Ecore_Event_Message, 1); - e->win = xevent->xclient.window; - e->format = xevent->xclient.format; - e->atom = xevent->xclient.message_type; - MEMCPY(xevent->xclient.data.b, e->data.b, char, 20); - - ecore_add_event(ECORE_EVENT_MESSAGE, e, ecore_event_generic_free); - } -} - -static void -ecore_event_x_handle_shape_change(XEvent * xevent) -{ - Ecore_Event_Window_Shape *e; - XShapeEvent *shape_event; - - shape_event = (XShapeEvent *) xevent; - e = NEW(Ecore_Event_Window_Shape, 1); - e->win = shape_event->window; - e->root = ecore_window_get_root(e->win); - e->time = shape_event->time; - ecore_add_event(ECORE_EVENT_WINDOW_SHAPE, e, ecore_event_generic_free); -} - -char * -ecore_keypress_translate_into_typeable(Ecore_Event_Key_Down * e) -{ - /* exceptions */ - if ((!strcmp(e->key, "Delete")) || - (!strcmp(e->key, "BackSpace")) || - (!strcmp(e->key, "Tab")) || - (!strcmp(e->key, "Escape")) || - (!strcmp(e->key, "Return")) || - (!strcmp(e->key, "KP_Enter")) || - (!strcmp(e->key, "Enter")) || - (!strcmp(e->key, "KP_Divide")) || - (!strcmp(e->key, "KP_Multiply")) || - (!strcmp(e->key, "KP_Subtract")) || - (!strcmp(e->key, "KP_Add")) || (!strcmp(e->key, "Enter"))) - return NULL; - return e->compose; -} diff --git a/legacy/ecore/src/e_events.c b/legacy/ecore/src/e_events.c deleted file mode 100644 index 0a8f442e5e..0000000000 --- a/legacy/ecore/src/e_events.c +++ /dev/null @@ -1,430 +0,0 @@ -#include "Ecore.h" -#include -#include -#include -#include -#include - -/* glocal (yes global/local) variabels for events */ -Ecore_Event_Fd_Handler *fd_handlers = NULL; -Ecore_Event_Ipc_Handler *ipc_handlers = NULL; -Ecore_Event_Pid_Handler *pid_handlers = NULL; -Ecore_Event_Timer *timers = NULL; - -Ecore_Event *events = NULL; -Ecore_Event *last_event = NULL; - -int __quit_ev_loop = 0; - -/* local functions for event handling */ -static void ecore_handle_event_timer(void); -static void ecore_handle_zero_event_timer(void); - -/* public functions */ - -/* add an event to the end of the event queue */ -void -ecore_add_event(Ecore_Event_Type type, void *event, - void (*ev_free) (void *event)) -{ - Ecore_Event *ev; - - ev = NEW(Ecore_Event, 1); - ev->type = type; - ev->ignore = 0; - ev->event = event; - ev->next = NULL; - ev->ev_free = ev_free; - if (!events) - events = ev; - else - last_event->next = ev; - last_event = ev; -} - -/* delete an event from the event queue */ -void -ecore_del_event(void *event) -{ - Ecore_Event *ev, *pev; - - pev = NULL; - ev = events; - while (ev) - { - if (ev->event == event) - { - if (pev) - pev->next = ev->next; - else - events = ev->next; - if (!ev->next) - last_event = pev; - if ((ev->event) && (ev->ev_free)) - (*ev->ev_free) (ev->event); - FREE(ev); - return; - } - pev = ev; - ev = ev->next; - } -} - -void -ecore_del_all_events(void) -{ - Ecore_Event *ev, *pev; - - ev = events; - while (ev) - { - pev = ev; - ev = ev->next; - if ((pev->event) && (pev->ev_free)) - pev->ev_free(pev->event); - FREE(pev); - } - events = NULL; - last_event = NULL; -} - -Ecore_Event * -ecore_get_last_event(void) -{ - return last_event; -} - -/* add a callback handler if fd is active for reading */ -void -ecore_add_event_fd(int fd, void (*func) (int fd)) -{ - Ecore_Event_Fd_Handler *fd_h; - - /* new handler struct */ - fd_h = NEW(Ecore_Event_Fd_Handler, 1); - fd_h->next = fd_handlers; - fd_h->fd = fd; - fd_h->func = func; - fd_handlers = fd_h; -} - -/* delete handler for fd */ -void -ecore_del_event_fd(int fd) -{ - START_LIST_DEL(Ecore_Event_Fd_Handler, fd_handlers, (_p->fd == fd)); - FREE(_p); - END_LIST_DEL; -} - -void -ecore_add_event_pid(pid_t pid, void (*func) (pid_t pid)) -{ - Ecore_Event_Pid_Handler *pid_h; - - /* delete the old handler */ - ecore_del_event_pid(pid); - /* new handler struct */ - pid_h = NEW(Ecore_Event_Pid_Handler, 1); - pid_h->next = pid_handlers; - pid_h->pid = pid; - pid_h->func = func; - pid_handlers = pid_h; -} - -void -ecore_del_event_pid(pid_t pid) -{ - START_LIST_DEL(Ecore_Event_Pid_Handler, pid_handlers, (_p->pid == pid)); - FREE(_p); - END_LIST_DEL; -} - -void -ecore_add_event_ipc(int ipc, void (*func) (int ipc)) -{ - Ecore_Event_Ipc_Handler *ipc_h; - - /* delete the old handler */ - ecore_del_event_ipc(ipc); - /* new handler struct */ - ipc_h = NEW(Ecore_Event_Ipc_Handler, 1); - ipc_h->next = ipc_handlers; - ipc_h->ipc = ipc; - ipc_h->func = func; - ipc_handlers = ipc_h; -} - -void -ecore_del_event_ipc(int ipc) -{ - START_LIST_DEL(Ecore_Event_Ipc_Handler, ipc_handlers, (_p->ipc == ipc)); - FREE(_p); - END_LIST_DEL; -} - -/* sit in this loop forever and process events */ -void -ecore_event_loop(void) -{ - int fdcount, fdsize, ipccount, ipcsize; - int timed_out, were_events; - double time1, time2, prev_time = 0.0; - struct timeval tval; - fd_set fdset, ipcset; - Ecore_Event_Fd_Handler *fd_h; - Ecore_Event_Pid_Handler *pid_h; - Ecore_Event_Ipc_Handler *ipc_h; - - /* init some of the time variables */ - time1 = ecore_get_time(); - time2 = time1 - prev_time; - prev_time = time1; - while (__quit_ev_loop == 0) - { - /* state setup */ - timed_out = 0; - were_events = 0; - - /* setup fd array from list of listening fd's */ - fdsize = 0; - FD_ZERO(&fdset); - /* for ever fd handler add the fd to the array and incriment fdsize */ - for (fd_h = fd_handlers; fd_h; fd_h = fd_h->next) - { - FD_SET(fd_h->fd, &fdset); - if (fd_h->fd > fdsize) - fdsize = fd_h->fd; - } - fdcount = 1; - ipcsize = 0; - FD_ZERO(&ipcset); - /* for ever fd handler add the fd to the array and incriment fdsize */ - for (ipc_h = ipc_handlers; ipc_h; ipc_h = ipc_h->next) - { - FD_SET(ipc_h->ipc, &ipcset); - if (ipc_h->ipc > ipcsize) - ipcsize = ipc_h->ipc; - } - ipccount = 1; - /* if there are timers setup adjust timeout value and select */ - if (timers) - { - if (timers->just_added) - { - timers->just_added = 0; - time1 = timers->in; - } - else - { - time1 = timers->in - time2; - if (time1 < 0.0) - time1 = 0.0; - timers->in = time1; - } - tval.tv_sec = (long)time1; - tval.tv_usec = (long)((time1 - ((double)tval.tv_sec)) * 1000000); - if (tval.tv_sec < 0) - tval.tv_sec = 0; - if (tval.tv_usec <= 1000) - tval.tv_usec = 1000; - ecore_handle_zero_event_timer(); - if ((!ecore_events_pending()) && (!ecore_event_signal_events_pending())) - fdcount = select(fdsize + 1, &fdset, NULL, NULL, &tval); - } - /* no timers - just sit and block */ - else - { - if ((!ecore_events_pending()) && (!ecore_event_signal_events_pending())) - fdcount = select(fdsize + 1, &fdset, NULL, NULL, NULL); - } - for (pid_h = pid_handlers; pid_h; pid_h = pid_h->next) - pid_h->func(pid_h->pid); - - /* see if we have any new ipc connections */ - tval.tv_sec = 0; - tval.tv_usec = 0; - ipccount += select(ipcsize + 1, &ipcset, NULL, NULL, &tval); - - /* return < 0 - error or signal interrupt */ - if (fdcount < 0) - { - /* error */ - if ((errno == ENOMEM) || (errno == EINVAL) || (errno == EBADF)) - { - fprintf(stderr, "Lost connection to X display.\n"); - exit(1); - } - } - /* timers are available and its a timeout */ - if ((timers) && (fdcount == 0)) - { - ecore_handle_event_timer(); - timed_out = 1; - } - if (fdcount < 0) - fdcount = 0; - if (ecore_events_pending()) - { - fdcount++; - FD_SET(ecore_x_get_fd(), &fdset); - } - /* fd's are active */ - if (fdcount > 0) - { - /* for every fd handler - if its fd is set - call the func */ - for (fd_h = fd_handlers; fd_h;) - { - Ecore_Event_Fd_Handler *fdh; - - fdh = fd_h; - fd_h = fd_h->next; - if (FD_ISSET(fdh->fd, &fdset)) - fdh->func(fdh->fd); - } - } - - /* ipc clients are active */ - if (ipccount > 0) - { - for (ipc_h = ipc_handlers; ipc_h;) - { - Ecore_Event_Ipc_Handler *ipch; - - ipch = ipc_h; - ipc_h = ipc_h->next; - if (FD_ISSET(ipch->ipc, &ipcset)) - ipch->func(ipch->ipc); - } - } - if (events) - ecore_event_filter(events); - if (events) - { - ecore_event_filter_events_handle(events); - were_events = 1; - } - ecore_del_all_events(); - if ((timed_out) || (were_events)) - ecore_event_filter_idle_handle(); - ecore_flush(); - time1 = ecore_get_time(); - time2 = time1 - prev_time; - prev_time = time1; - } - __quit_ev_loop = 0; -} - -/* set a flag to 0 so that we can quit the event loop and shutdown - * properly */ -void -ecore_event_loop_quit(void) -{ - __quit_ev_loop = 1; -} - -/* add a timeout funcitont o be called in "in" seconds with name name */ -void -ecore_add_event_timer(char *name, double in, void (*func) (int val, void *data), - int val, void *data) -{ - Ecore_Event_Timer *timer, *ptr, *pptr; - double tally; - - if (name) - ecore_del_event_timer(name); - timer = NEW(Ecore_Event_Timer, 1); - timer->next = NULL; - timer->func = func; - timer->data = data; - timer->val = val; - timer->just_added = 1; - timer->in = in; - timer->name = strdup(name); - if (!timers) - timers = timer; - else - { - pptr = NULL; - ptr = timers; - tally = 0.0; - while (ptr) - { - tally += ptr->in; - if (tally > in) - { - tally -= ptr->in; - timer->next = ptr; - if (pptr) - pptr->next = timer; - else - timers = timer; - timer->in -= tally; - if (timer->next) - timer->next->in -= timer->in; - return; - } - pptr = ptr; - ptr = ptr->next; - } - if (pptr) - pptr->next = timer; - else - timers = timer; - timer->in -= tally; - } -} - -/* delete a timer timeout entry named "name" */ -void * -ecore_del_event_timer(char *name) -{ - Ecore_Event_Timer *timer, *ptr, *pptr; - - pptr = NULL; - ptr = timers; - while (ptr) - { - timer = ptr; - if (!strcmp(timer->name, name)) - { - void *data; - - if (pptr) - pptr->next = timer->next; - else - timers = timer->next; - if (timer->next) - timer->next->in += timer->in; - IF_FREE(timer->name); - data = timer->data; - FREE(timer); - return data; - } - pptr = ptr; - ptr = ptr->next; - } - return NULL; -} - -/* private functions */ -static void -ecore_handle_event_timer(void) -{ - Ecore_Event_Timer *timer; - - if (!timers) - return; - timer = timers; - timers = timer->next; - (*(timer->func)) (timer->val, timer->data); - IF_FREE(timer->name); - FREE(timer); -} - -static void -ecore_handle_zero_event_timer(void) -{ - while ((timers) && (timers->in == 0.0)) - ecore_handle_event_timer(); -} diff --git a/legacy/ecore/src/e_ipc.c b/legacy/ecore/src/e_ipc.c deleted file mode 100644 index 2a6de2b4ab..0000000000 --- a/legacy/ecore/src/e_ipc.c +++ /dev/null @@ -1,187 +0,0 @@ -#include "Ecore.h" -#include -#include -#include -#include -#include - -void ecore_ipc_init(char *path); -void ecore_ipc_cleanup(void); -static void ecore_ipc_connect_handler(int fd); -static void ecore_ipc_client_handler(int fd); -void ecore_ipc_get_data(int fd, void *buf); -void ecore_ipc_send_data(int fd, void *buf, int size); -void ecore_add_ipc_service(int service, void (*func) (int fd)); -void ecore_del_ipc_service(int service); - -Ecore_Event_Ipc_Service *ipc_services = NULL; - -void -ecore_ev_ipc_init(char *path) -{ - int fd, len; - struct sockaddr_un saun; - - if (path == NULL) - return; - - /* a UNIX domain, stream socket */ - if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) < 0) - { - printf("Cannot create ipc socket... disabling ipc.\n"); - return; - } - - /* create the address we will be binding to */ - saun.sun_family = AF_UNIX; - strcpy(saun.sun_path, path); - - /* unlink the address so the bind won't fail */ - unlink(path); - len = sizeof(saun.sun_family) + strlen(saun.sun_path); - - if (bind(fd, (struct sockaddr *)&saun, len) < 0) - { - printf("Cannot bind ipc socket... disabling ipc.\n"); - return; - } - - /* listen on the socket */ - if (listen(fd, 5) < 0) - { - printf("Cannot listen on ipc socket... disabling ipc.\n"); - return; - } - - /* add ipc listener */ - ecore_add_event_ipc(fd, ecore_ipc_connect_handler); -} - -void -ecore_ev_ipc_cleanup(void) -{ - Ecore_Event_Ipc_Service *ipc_s; - - /* cleanup services list */ - for (ipc_s = ipc_services; ipc_s; ipc_s = ipc_s->next) - { - ecore_del_ipc_service(ipc_s->service); - } -} - -static void -ecore_ipc_connect_handler(int fd) -{ - struct sockaddr_un fsaun; - int fromlen, nfd; - - /* accept ipc connection */ - fromlen = sizeof(fsaun); - - if ((nfd = accept(fd, (struct sockaddr *)&fsaun, &fromlen)) < 0) - { - printf("Cannot accept ipc connection... ignoring connection attempt.\n"); - return; - } - - /* add ipc client */ - ecore_add_event_ipc(nfd, ecore_ipc_client_handler); -} - -static void -ecore_ipc_client_handler(int fd) -{ - int nread, service; - Ecore_Event_Ipc_Service *ipc_s; - - if ((nread = read(fd, &service, sizeof(service))) == 0) - { - close(fd); - ecore_del_event_ipc(fd); - } - else if (nread > 0) - { - /* call the service function */ - for (ipc_s = ipc_services; ipc_s; ipc_s = ipc_s->next) - { - if (ipc_s->service == service) - { - ipc_s->func(fd); - break; - } - } - } - else - { - printf("ipc error in read service.\n"); - fflush(stdout); - } -} - -void -ecore_ipc_get_data(int fd, void *buf) -{ - int readn, nread; - - /* read number of bytes being sent */ - if ((nread = read(fd, &readn, sizeof(readn))) == -1) - { - printf("ipc error in get data.\n"); - fflush(stdout); - return; - } - - /* get data structure */ - if ((nread = read(fd, buf, readn)) == -1) - { - printf("ipc error in get data.\n"); - fflush(stdout); - return; - } -} - -void -ecore_ipc_send_data(int fd, void *buf, int size) -{ - int n; - - /* send length of data being sent */ - if ((n = write(fd, &size, sizeof(size))) == -1) - { - printf("ipc error in send data length.\n"); - fflush(stdout); - return; - } - - /* send data */ - if ((n = write(fd, buf, size)) == -1) - { - printf("ipc error in send data.\n"); - fflush(stdout); - return; - } -} - -void -ecore_add_ipc_service(int service, void (*func) (int fd)) -{ - Ecore_Event_Ipc_Service *ipc_s; - - /* delete the old service */ - ecore_del_ipc_service(service); - /* new service struct */ - ipc_s = NEW(Ecore_Event_Ipc_Service, 1); - ipc_s->next = ipc_services; - ipc_s->service = service; - ipc_s->func = func; - ipc_services = ipc_s; -} - -void -ecore_del_ipc_service(int service) -{ - START_LIST_DEL(Ecore_Event_Ipc_Service, ipc_services, - (_p->service == service)); - FREE(_p); - END_LIST_DEL; -} diff --git a/legacy/ecore/src/e_util.c b/legacy/ecore/src/e_util.c deleted file mode 100644 index fc4a2ae0cb..0000000000 --- a/legacy/ecore/src/e_util.c +++ /dev/null @@ -1,10 +0,0 @@ -#include "Ecore.h" - -double -ecore_get_time(void) -{ - struct timeval timev; - - gettimeofday(&timev, NULL); - return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); -} diff --git a/legacy/ecore/src/e_x.c b/legacy/ecore/src/e_x.c deleted file mode 100644 index 05073cccfd..0000000000 --- a/legacy/ecore/src/e_x.c +++ /dev/null @@ -1,3621 +0,0 @@ -#include "Ecore.h" -#include -#include -#include -#include - -#ifdef XA_CLIPBOARD -#define X_CLIPBOARD_SELECTION XA_CLIPBOARD(disp) -#define X_CLIPBOARD_PROP XA_CLIPBOARD(disp) -#else -#define X_CLIPBOARD_SELECTION XA_PRIMARY -#define X_CLIPBOARD_PROP XA_CUT_BUFFER0 -#endif - -typedef struct _window_list Window_List; - -struct _window_list -{ - Window win; - Window_List *next; -}; - -XContext xid_context = 0; - -static Display *disp; -static Visual *default_vis; -static Colormap default_cm; -static int default_depth; -static Window default_win; -static Window default_root; - -static int lock_scroll = 0; -static int lock_num = 0; -static int lock_caps = 0; - -static Window focused_win = 0; - -static int mod_shift = 0; -static int mod_ctrl = 0; -static int mod_alt = 0; -static int mod_win = 0; - -static Window grabkey_win = 0; - -static int mouse_x = 0, mouse_y = 0; - -static Window current_dnd_win = 0; -static int current_dnd_target_ok = 0; -static int dnd_await_target_status = 0; - -static int x_grabs = 0; - -static Window_List *ignore_wins = NULL; - -static Window grab_pointer_win = 0; - -static Window keyboard_grab_win = 0; - -static int dnd_copy = 0; -static int dnd_link = 0; -static int dnd_move = 1; - -static void ecore_handle_x_error(Display * d, XErrorEvent * ev); -static void ecore_handle_x_io_error(Display * d); -static Window ecore_window_at_xy_0(Window base, int bx, int by, int x, - int y); - -static void -ecore_handle_x_error(Display * d, XErrorEvent * ev) -{ -/* - char err[16384]; - - XGetErrorText(d, ev->error_code, err, 16000); - printf("X Error:\n" - "Error: %s\nrequest: %i\nminor: %i\n", err, ev->request_code, ev->minor_code); - */ - /* ignore all X errors */ - return; - d = NULL; - ev = NULL; -} - -static void -ecore_handle_x_io_error(Display * d) -{ - /* FIXME: call clean exit handler */ - exit(1); - d = NULL; -} - -void -ecore_del_child(Window win, Window child) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - return; - if (xid) - { - int i; - - for (i = 0; i < xid->children_num; i++) - { - if (xid->children[i] == child) - { - int j; - - for (j = i; j < xid->children_num - 1; j++) - xid->children[j] = xid->children[j + 1]; - xid->children_num--; - REALLOC(xid->children, Window, xid->children_num); - return; - } - } - } -} - -void -ecore_add_child(Window win, Window child) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - return; - if (xid) - { - int i; - - for (i = 0; i < xid->children_num; i++) - { - if (xid->children[i] == child) - return; - } - xid->children_num++; - REALLOC(xid->children, Window, xid->children_num); - xid->children[xid->children_num - 1] = child; - } - xid = ecore_validate_xid(child); -} - -void -ecore_raise_child(Window win, Window child) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - return; - if (xid) - { - int i; - - for (i = 0; i < xid->children_num; i++) - { - if (xid->children[i] == child) - { - int j; - - for (j = i; j < xid->children_num - 1; j++) - xid->children[j] = xid->children[j + 1]; - xid->children[xid->children_num - 1] = child; - return; - } - } - } -} - -void -ecore_lower_child(Window win, Window child) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - return; - if (xid) - { - int i; - - for (i = 0; i < xid->children_num; i++) - { - if (xid->children[i] == child) - { - int j; - - for (j = i; j > 0; j--) - xid->children[j] = xid->children[j - 1]; - xid->children[0] = child; - return; - } - } - } -} - -Ecore_XID * -ecore_add_xid(Window win, int x, int y, int w, int h, int depth, Window parent) -{ - Ecore_XID *xid = NULL; - - ecore_window_add_events(win, XEV_IN_OUT | XEV_CONFIGURE | XEV_VISIBILITY); - xid = NEW(Ecore_XID, 1); - xid->win = win; - xid->x = x; - xid->y = y; - xid->w = w; - xid->h = h; - xid->mapped = 0; - xid->depth = depth; - xid->mouse_in = 0; - xid->parent = parent; - xid->root = ecore_window_get_root(parent); - xid->children_num = 0; - xid->children = NULL; - xid->gravity = ecore_window_get_gravity(win); - xid->coords_invalid = 0; - xid->bw = 0; - xid->grab_button_auto_replay = NULL; - XSaveContext(disp, xid->win, xid_context, (XPointer) xid); - ecore_add_child(parent, win); - return xid; -} - -Ecore_XID * -ecore_validate_xid(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return NULL; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - { - XWindowAttributes att; - Window root_ret = 0, parent_ret = 0, *children_ret = NULL; - unsigned int children_ret_num = 0; - - ecore_window_add_events(win, XEV_IN_OUT | XEV_CONFIGURE | - XEV_VISIBILITY | XEV_CHILD_CHANGE); - xid = NEW(Ecore_XID, 1); - xid->win = win; - if (!XGetWindowAttributes(disp, win, &att)) - { - FREE(xid); - return NULL; - } - if (!XQueryTree(disp, win, &root_ret, &parent_ret, &children_ret, - &children_ret_num)) - { - FREE(xid); - return NULL; - } - xid->parent = parent_ret; - if (xid->parent) - ecore_validate_xid(xid->parent); - if (children_ret) - { - xid->children_num = children_ret_num; - xid->children = NEW(Window, children_ret_num); - MEMCPY(children_ret, xid->children, Window, children_ret_num); - XFree(children_ret); - } - else - { - xid->children_num = 0; - xid->children = NULL; - } - xid->root = root_ret; - xid->x = att.x; - xid->y = att.y; - xid->w = att.width; - xid->h = att.height; - if (att.map_state == IsUnmapped) - xid->mapped = 0; - else - xid->mapped = 1; - xid->depth = att.depth; - xid->mouse_in = 0; - xid->gravity = att.win_gravity; - xid->bw = att.border_width; - xid->coords_invalid = 0; - xid->grab_button_auto_replay = NULL; - XSaveContext(disp, xid->win, xid_context, (XPointer) xid); - ecore_add_child(xid->parent, win); - } - return xid; -} - -void -ecore_unvalidate_xid(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT) - return; - if (xid) - { - int i; - - for (i = 0; i < xid->children_num; i++) - ecore_unvalidate_xid(xid->children[i]); - ecore_del_child(xid->parent, win); - IF_FREE(xid->children); - FREE(xid); - XDeleteContext(disp, win, xid_context); - } -} - -void -ecore_sync(void) -{ - if (!disp) - return; - - XSync(disp, False); -} - -void -ecore_flush(void) -{ - if (!disp) - return; - XFlush(disp); -} - -Window -ecore_window_new(Window parent, int x, int y, int w, int h) -{ - Window win; - XSetWindowAttributes attr; - - if (!disp) - return 0; - if (!parent) - parent = default_root; - attr.backing_store = NotUseful; - attr.override_redirect = False; - attr.colormap = default_cm; - attr.border_pixel = 0; - attr.background_pixmap = None; - attr.save_under = False; - attr.do_not_propagate_mask = True; - win = XCreateWindow(disp, parent, - x, y, w, h, 0, - default_depth, InputOutput, default_vis, - CWOverrideRedirect | CWSaveUnder | CWBackingStore | - CWColormap | CWBackPixmap | CWBorderPixel | - CWDontPropagate, &attr); - ecore_add_xid(win, x, y, w, h, default_depth, parent); - ecore_add_child(parent, win); - ecore_validate_xid(parent); - return win; -} - -Window -ecore_window_override_new(Window parent, int x, int y, int w, int h) -{ - Window win; - XSetWindowAttributes attr; - - if (!disp) - return 0; - if (!parent) - parent = default_root; - attr.backing_store = NotUseful; - attr.override_redirect = True; - attr.colormap = default_cm; - attr.border_pixel = 0; - attr.background_pixmap = None; - attr.save_under = False; - attr.do_not_propagate_mask = True; - win = XCreateWindow(disp, parent, - x, y, w, h, 0, - default_depth, InputOutput, default_vis, - CWOverrideRedirect | CWSaveUnder | CWBackingStore | - CWColormap | CWBackPixmap | CWBorderPixel | - CWDontPropagate, &attr); - ecore_add_xid(win, x, y, w, h, default_depth, parent); - ecore_add_child(parent, win); - ecore_validate_xid(parent); - return win; -} - -Window -ecore_window_input_new(Window parent, int x, int y, int w, int h) -{ - Window win; - XSetWindowAttributes attr; - - if (!disp) - return 0; - if (!parent) - parent = default_root; - attr.override_redirect = True; - attr.do_not_propagate_mask = True; - win = XCreateWindow(disp, parent, - x, y, w, h, 0, - 0, InputOnly, default_vis, - CWOverrideRedirect | CWDontPropagate, &attr); - ecore_add_xid(win, x, y, w, h, 0, parent); - ecore_add_child(parent, win); - ecore_validate_xid(parent); - return win; -} - -void -ecore_window_set_events_propagate(Window win, int propagate) -{ - XSetWindowAttributes attr; - - if (!disp) - return; - if (!win) - win = default_root; - if (!propagate) - attr.do_not_propagate_mask = True; - else - attr.do_not_propagate_mask = False; - XChangeWindowAttributes(disp, win, CWDontPropagate, &attr); -} - -void -ecore_window_show(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - xid = ecore_validate_xid(win); - if (xid) - { - if (xid->mapped) - return; - xid->mapped = 1; - XMapWindow(disp, win); - } -} - -void -ecore_window_hide(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) - return; - xid = ecore_validate_xid(win); - if (xid) - { - if (!xid->mapped) - return; - xid->mapped = 0; - XUnmapWindow(disp, win); - } -} - -Pixmap -ecore_pixmap_new(Window win, int w, int h, int dep) -{ - if (!disp) - return 0; - if (!win) - win = default_win; - if (dep == 0) - dep = default_depth; - return XCreatePixmap(disp, win, w, h, dep); -} - -void -ecore_pixmap_free(Pixmap pmap) -{ - if (!disp) - return; - if (!pmap) - return; - XFreePixmap(disp, pmap); -} - -void -ecore_window_set_background_pixmap(Window win, Pixmap pmap) -{ - if (!disp) - return; - if (win == 0) - win = default_root; - XSetWindowBackgroundPixmap(disp, win, pmap); -} - -void -ecore_window_set_shape_mask(Window win, Pixmap mask) -{ - if (!disp) - return; - XShapeCombineMask(disp, win, ShapeBounding, 0, 0, mask, ShapeSet); -} - -void -ecore_window_add_shape_mask(Window win, Pixmap mask) -{ - if (!disp) - return; - XShapeCombineMask(disp, win, ShapeBounding, 0, 0, mask, ShapeUnion); -} - -void -ecore_window_set_shape_window(Window win, Window src, int x, int y) -{ - if (!disp) - return; - XShapeCombineShape(disp, win, ShapeBounding, x, y, src, ShapeBounding, - ShapeSet); -} - -void -ecore_window_add_shape_window(Window win, Window src, int x, int y) -{ - if (!disp) - return; - XShapeCombineShape(disp, win, ShapeBounding, x, y, src, ShapeBounding, - ShapeUnion); -} - -void -ecore_window_set_shape_rectangle(Window win, int x, int y, int w, int h) -{ - XRectangle rect; - - if (!disp) - return; - rect.x = x; - rect.y = y; - rect.width = w; - rect.height = h; - XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, - Unsorted); -} - -void -ecore_window_add_shape_rectangle(Window win, int x, int y, int w, int h) -{ - XRectangle rect; - - if (!disp) - return; - rect.x = x; - rect.y = y; - rect.width = w; - rect.height = h; - XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeUnion, - Unsorted); -} - -void -ecore_window_set_shape_rectangles(Window win, XRectangle * rect, int num) -{ - if (!disp) - return; - XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rect, num, ShapeSet, - Unsorted); -} - -void -ecore_window_add_shape_rectangles(Window win, XRectangle * rect, int num) -{ - if (!disp) - return; - XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rect, num, ShapeUnion, - Unsorted); -} - -void -ecore_window_clip_shape_by_rectangle(Window win, int x, int y, int w, int h) -{ - XRectangle rect; - - if (!disp) - return; - rect.x = x; - rect.y = y; - rect.width = w; - rect.height = h; - XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, - ShapeIntersect, Unsorted); -} - -XRectangle * -ecore_window_get_shape_rectangles(Window win, int *num) -{ - int ord; - - if (!disp) - return NULL; - return XShapeGetRectangles(disp, win, ShapeBounding, num, &ord); -} - -void -ecore_window_select_shape_events(Window win) -{ - if (!disp) - return; - - XShapeSelectInput(disp, win, ShapeNotifyMask); -} - -void -ecore_window_unselect_shape_events(Window win) -{ - if (!disp) - return; - - XShapeSelectInput(disp, win, 0); -} - -void -ecore_window_clear(Window win) -{ - if (!disp) - return; - if (win == 0) - win = default_root; - XClearWindow(disp, win); -} - -void -ecore_window_clear_area(Window win, int x, int y, int w, int h) -{ - if (!disp) - return; - if (win == 0) - win = default_root; - XClearArea(disp, win, x, y, w, h, False); -} - -void -ecore_pointer_xy(Window win, int *x, int *y) -{ - Window dw; - unsigned int dm; - int wx, wy; - - if (!disp) - return; - - if (win == 0) - win = default_root; - - XQueryPointer(disp, win, &dw, &dw, &mouse_x, &mouse_y, &wx, &wy, &dm); - - if (x) - *x = wx; - if (y) - *y = wy; -} - -void -ecore_pointer_xy_set(int x, int y) -{ - if (!disp) return; - mouse_x = x; - mouse_y = y; -} - -void -ecore_pointer_xy_get(int *x, int *y) -{ - if (!disp) return; - if (x) - *x = mouse_x; - if (y) - *y = mouse_y; -} - -void -ecore_window_set_events(Window win, long mask) -{ - if (!disp) return; - if (win == 0) - win = default_root; - XSelectInput(disp, win, mask); -} - -void -ecore_window_remove_events(Window win, long mask) -{ - XWindowAttributes att; - - if (!disp) return; - if (win == 0) - win = default_root; - if (XGetWindowAttributes(disp, win, &att) == True) - { - mask = att.your_event_mask & (~mask); - ecore_window_set_events(win, mask); - } -} - -void -ecore_window_add_events(Window win, long mask) -{ - XWindowAttributes att; - - if (!disp) return; - if (win == 0) - win = default_root; - if (XGetWindowAttributes(disp, win, &att) == True) - { - mask = att.your_event_mask | mask; - ecore_window_set_events(win, mask); - } -} - -void -ecore_window_move(Window win, int x, int y) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - if (!xid->coords_invalid) - { - if ((xid->x == x) && (xid->y == y)) - return; - } - xid->x = x; - xid->y = y; - xid->coords_invalid = 0; - XMoveWindow(disp, win, x, y); - } -} - -#define REGRAVITATE \ -if (xid->children) \ -{ \ - int j; \ -\ - for (j = 0; j < xid->children_num; j++) \ - { \ - Ecore_XID *xid2; \ -\ - xid2 = ecore_validate_xid(xid->children[j]); \ - if (xid2) \ - { \ - xid2->coords_invalid = 1; \ - } \ - } \ -} - -#if 0 -switch (xid2->gravity) - { - case UnmapGravity: - xid2->mapped = 0; - break; - case NorthWestGravity: - break; - case NorthGravity: - xid2->x += (w - xid->w) / 2; - break; - case NorthEastGravity: - xid2->x += (w - xid->w); - break; - case WestGravity: - xid2->h += (h - xid->h) / 2; - break; - case CenterGravity: - xid2->x += (w - xid->w) / 2; - xid2->h += (h - xid->h) / 2; - break; - case EastGravity: - xid2->x += (w - xid->w); - break; - case SouthWestGravity: - xid2->y += (h - xid->h); - break; - case SouthGravity: - xid2->x += (w - xid->w) / 2; - xid2->y += (h - xid->h); - break; - case SouthEastGravity: - xid2->x += (w - xid->w); - xid2->y += (h - xid->h); - break; - case StaticGravity: - xid2->coords_invalid = 1; - break; - default: - break; - } -} -} -} -#endif - -void -ecore_window_resize(Window win, int w, int h) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - if (!xid->coords_invalid) - { - if ((xid->w == w) && (xid->h == h)) - return; - } - REGRAVITATE; - xid->w = w; - xid->h = h; - xid->coords_invalid = 0; - XResizeWindow(disp, win, w, h); - } -} - -void -ecore_window_move_resize(Window win, int x, int y, int w, int h) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - if (!xid->coords_invalid) - { - if ((xid->x == x) && (xid->y == y) && (xid->w == w) && (xid->h == h)) - return; - } - REGRAVITATE; - xid->x = x; - xid->y = y; - xid->w = w; - xid->h = h; - xid->coords_invalid = 0; - XMoveResizeWindow(disp, win, x, y, w, h); - } -} - -int -ecore_x_get_fd(void) -{ - if (!disp) return 0; - return ConnectionNumber(disp); -} - -void -ecore_set_error_handler(Ecore_Error_Function func) -{ - if (!disp) return; - XSetErrorHandler((XErrorHandler) func); -} - -void -ecore_reset_error_handler(void) -{ - if (!disp) return; - XSetErrorHandler((XErrorHandler) ecore_handle_x_error); -} - -int -ecore_display_init(char *display) -{ - int revert; - - xid_context = XUniqueContext(); - disp = XOpenDisplay(display); - if (!disp) - { - char *d; - - d = getenv("DISPLAY"); -/* no need for this anymore - if (d) - fprintf(stderr, - "Fatal Error:\n" - "Cannot connect to the display nominated by your DISPLAY variable:\n" - "%s\n" - "Try changing your DISPLAY variable like:\n" - "DISPLAY=host:0 application_name\n", d); - else - fprintf(stderr, - "Fatal Error:\n" - "No DISPLAY variable set so cannot determine display to connect to.\n" - "Try setting your DISPLAY variable like:\n" - "DISPLAY=host:0 appication_name\n"); -*/ - return 0; - } - XSetErrorHandler((XErrorHandler) ecore_handle_x_error); - XSetIOErrorHandler((XIOErrorHandler) ecore_handle_x_io_error); - default_vis = DefaultVisual(disp, DefaultScreen(disp)); - default_depth = DefaultDepth(disp, DefaultScreen(disp)); - default_cm = DefaultColormap(disp, DefaultScreen(disp)); - default_win = DefaultRootWindow(disp); - default_root = DefaultRootWindow(disp); - mod_shift = ecore_mod_mask_shift_get(); - mod_ctrl = ecore_mod_mask_ctrl_get(); - mod_alt = ecore_mod_mask_alt_get(); - mod_win = ecore_mod_mask_win_get(); - XGetInputFocus(disp, &focused_win, &revert); - ecore_window_set_events(default_root, XEV_KEY | XEV_IN_OUT | XEV_MOUSE_MOVE | - XEV_CONFIGURE | XEV_CHILD_CHANGE | XEV_PROPERTY | - XEV_COLORMAP | XEV_VISIBILITY); - ecore_pointer_xy(0, NULL, NULL); - return 1; -} - -int -ecore_events_pending(void) -{ - if (!disp) return 0; - return XPending(disp); -} - -void -ecore_get_next_event(XEvent * event) -{ - if (!disp) return; - XNextEvent(disp, event); -} - -int -ecore_event_shape_get_id(void) -{ - int base = -1, err_base; - - if (!disp) return 0; - XShapeQueryExtension(disp, &base, &err_base); - base += ShapeNotify; - return base; -} - -KeySym -ecore_key_get_keysym_from_keycode(KeyCode keycode) -{ - if (!disp) return 0; - return XKeycodeToKeysym(disp, keycode, 0); -} - -char * -ecore_key_get_string_from_keycode(KeyCode keycode) -{ - char *str; - - if (!disp) return strdup(""); - str = XKeysymToString(ecore_key_get_keysym_from_keycode(keycode)); - if (!str) - return strdup(""); - return strdup(str); -} - -char * -ecore_key_get_string_from_keysym(KeySym keysym) -{ - char *str; - - if(keysym == NoSymbol) return strdup(""); - str = XKeysymToString(keysym); - if(!str) str="(no name)"; - return strdup(str); -} - -void -ecore_event_allow(int mode, Time t) -{ - if (!disp) return; - XAllowEvents(disp, mode, t); -} - -int -ecore_lock_mask_scroll_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Scroll_Lock); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_lock_mask_num_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Num_Lock); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_lock_mask_caps_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Caps_Lock); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_mod_mask_shift_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Shift_L); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_mod_mask_ctrl_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Control_L); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_mod_mask_alt_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Alt_L); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_mod_mask_win_get(void) -{ - static int have_mask = 0; - static int mask = 0; - XModifierKeymap *mod; - KeyCode nl; - int i; - int masks[8] = { - ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, - Mod4Mask, Mod5Mask - }; - - if (!disp) return 0; - if (have_mask) - return mask; - mod = XGetModifierMapping(disp); - nl = XKeysymToKeycode(disp, XK_Meta_L); - if ((mod) && (mod->max_keypermod > 0)) - { - for (i = 0; i < (8 * mod->max_keypermod); i++) - { - if ((nl) && (mod->modifiermap[i] == nl)) - { - mask = masks[i / mod->max_keypermod]; - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - if (mask == ecore_mod_mask_alt_get()) - mask = 0; - if (mask == ecore_mod_mask_ctrl_get()) - mask = 0; - have_mask = 1; - return mask; - } - } - } - if (mod) - { - if (mod->modifiermap) - XFree(mod->modifiermap); - XFree(mod); - } - return 0; -} - -int -ecore_lock_mask_get(void) -{ - static int mask = 0; - Window root_ret, child_ret; - int root_x_ret, root_y_ret, win_x_ret, win_y_ret; - unsigned int mask_ret; - - if (!disp) return 0; - if (!mask) - mask = ecore_lock_mask_scroll_get() | ecore_lock_mask_num_get() | - ecore_lock_mask_caps_get(); - XQueryPointer(disp, default_root, &root_ret, &child_ret, &root_x_ret, - &root_y_ret, &win_x_ret, &win_y_ret, &mask_ret); - return (mask_ret & mask); -} - -int -ecore_modifier_mask_get(void) -{ - Window root_ret, child_ret; - int root_x_ret, root_y_ret, win_x_ret, win_y_ret; - unsigned int mask_ret; - - if (!disp) return 0; - XQueryPointer(disp, default_root, &root_ret, &child_ret, &root_x_ret, - &root_y_ret, &win_x_ret, &win_y_ret, &mask_ret); - return (mask_ret); -} - -Window -ecore_get_key_grab_win(void) -{ - if (!disp) return 0; - return grabkey_win; -} - -void -ecore_key_grab(char *key, Ecore_Event_Key_Modifiers mods, int anymod, int sync) -{ - KeyCode keycode; - int i, mod, mask_scroll, mask_num, mask_caps, masks[8], mode; - - if (!disp) return; - keycode = ecore_key_get_keycode(key); - mod = 0; - mode = GrabModeAsync; - if (sync) - mode = GrabModeSync; - if (!grabkey_win) - grabkey_win = default_root; - if (mods & ECORE_EVENT_KEY_MODIFIER_SHIFT) - mod |= ecore_mod_mask_shift_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_CTRL) - mod |= ecore_mod_mask_ctrl_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_ALT) - mod |= ecore_mod_mask_alt_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_WIN) - mod |= ecore_mod_mask_win_get(); - mask_scroll = ecore_lock_mask_scroll_get(); - mask_num = ecore_lock_mask_num_get(); - mask_caps = ecore_lock_mask_caps_get(); - masks[0] = 0; - masks[1] = mask_scroll; - masks[2] = mask_num; - masks[3] = mask_caps; - masks[4] = mask_scroll | mask_num; - masks[5] = mask_scroll | mask_caps; - masks[6] = mask_num | mask_caps; - masks[7] = mask_scroll | mask_num | mask_caps; - if (anymod) - XGrabKey(disp, keycode, AnyModifier, grabkey_win, False, mode, mode); - else - { - for (i = 0; i < 8; i++) - XGrabKey(disp, keycode, masks[i] | mod, grabkey_win, False, mode, mode); - } -} - -void -ecore_key_ungrab(char *key, Ecore_Event_Key_Modifiers mods, int anymod) -{ - KeyCode keycode; - - if (!disp) return; - keycode = ecore_key_get_keycode(key); - if (anymod) - XUngrabKey(disp, keycode, AnyModifier, default_root); - else - { - int i, mod, mask_scroll, mask_num, mask_caps, masks[8]; - - mod = 0; - if (mods & ECORE_EVENT_KEY_MODIFIER_SHIFT) - mod |= ecore_mod_mask_shift_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_CTRL) - mod |= ecore_mod_mask_ctrl_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_ALT) - mod |= ecore_mod_mask_alt_get(); - if (mods & ECORE_EVENT_KEY_MODIFIER_WIN) - mod |= ecore_mod_mask_win_get(); - mask_scroll = ecore_lock_mask_scroll_get(); - mask_num = ecore_lock_mask_num_get(); - mask_caps = ecore_lock_mask_caps_get(); - masks[0] = 0; - masks[1] = mask_scroll; - masks[2] = mask_num; - masks[3] = mask_caps; - masks[4] = mask_scroll | mask_num; - masks[5] = mask_scroll | mask_caps; - masks[6] = mask_num | mask_caps; - masks[7] = mask_scroll | mask_num | mask_caps; - for (i = 0; i < 8; i++) - XUngrabKey(disp, keycode, masks[i] | mod, grabkey_win); - } -} - -KeyCode -ecore_key_get_keycode(char *key) -{ - if (!disp) return 0; - return XKeysymToKeycode(disp, XStringToKeysym(key)); -} - -void -ecore_window_destroy(Window win) -{ - if (!disp) return; - ecore_unvalidate_xid(win); - XDestroyWindow(disp, win); -} - -void -ecore_window_reparent(Window win, Window parent, int x, int y) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - if (parent == 0) - parent = default_root; - XReparentWindow(disp, win, parent, x, y); - ecore_del_child(xid->parent, win); - ecore_add_child(parent, win); - xid->parent = parent; - xid->x = x; - xid->y = y; - } -} - -void -ecore_window_raise(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - XRaiseWindow(disp, win); - ecore_raise_child(xid->parent, win); - } -} - -void -ecore_window_lower(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - XLowerWindow(disp, win); - ecore_lower_child(xid->parent, win); - } -} - -void -ecore_window_get_geometry(Window win, int *x, int *y, int *w, int *h) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - if (win == 0) - win = default_root; - xid = ecore_validate_xid(win); - if ((xid) && (xid->coords_invalid)) - { - Window dw; - int rx, ry; - unsigned int rw, rh, di; - - XGetGeometry(disp, win, &dw, &rx, &ry, &rw, &rh, &di, &di); - xid->x = rx; - xid->y = ry; - xid->w = (int)rw; - xid->h = (int)rh; - xid->coords_invalid = 0; - } - if (xid) - { - if (x) - *x = xid->x; - if (y) - *y = xid->y; - if (w) - *w = xid->w; - if (h) - *h = xid->h; - } - else - { - if (x) - *x = 0; - if (y) - *y = 0; - if (w) - *w = 0; - if (h) - *h = 0; - } -} - -int -ecore_window_get_depth(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - if (win == 0) - win = default_root; - xid = ecore_validate_xid(win); - if (xid) - return xid->depth; - return -1; -} - -int -ecore_window_exists(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - xid = ecore_validate_xid(win); - if (xid) - return 1; - return 0; -} - -Window -ecore_window_get_parent(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - xid = ecore_validate_xid(win); - if (xid) - return xid->parent; - return 0; -} - -Window * -ecore_window_get_children(Window win, int *num) -{ - Ecore_XID *xid = NULL; - - if (!disp) return NULL; - if (win == 0) - win = default_root; - xid = ecore_validate_xid(win); - if (xid) - { - Window *wlist = NULL; - - *num = xid->children_num; - if (xid->children) - { - wlist = NEW(Window, xid->children_num); - MEMCPY(xid->children, wlist, Window, xid->children_num); - } - return wlist; - } - *num = 0; - return NULL; -} - -int -ecore_window_mouse_in(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - if (win == 0) - win = default_root; - xid = ecore_validate_xid(win); - if (xid) - return xid->mouse_in; - return 0; -} - -void -ecore_window_mouse_set_in(Window win, int in) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - if (win == 0) - win = default_root; - xid = ecore_validate_xid(win); - if (xid) - xid->mouse_in = in; -} - -Display * -ecore_display_get(void) -{ - return disp; -} - -Window -ecore_window_get_root(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - xid = ecore_validate_xid(win); - if (xid) - return xid->root; - return 0; -} - -void -ecore_lock_scroll_set(int onoff) -{ - lock_scroll = onoff; -} - -int -ecore_lock_scroll_get(void) -{ - return lock_scroll; -} - -void -ecore_lock_num_set(int onoff) -{ - lock_num = onoff; -} - -int -ecore_lock_num_get(void) -{ - return lock_num; -} - -void -ecore_lock_caps_set(int onoff) -{ - lock_caps = onoff; -} - -int -ecore_lock_caps_get(void) -{ - return lock_caps; -} - -void -ecore_mod_shift_set(int onoff) -{ - mod_shift = onoff; -} - -int -ecore_mod_shift_get(void) -{ - return mod_shift; -} - -void -ecore_mod_ctrl_set(int onoff) -{ - mod_ctrl = onoff; -} - -int -ecore_mod_ctrl_get(void) -{ - return mod_ctrl; -} - -void -ecore_mod_alt_set(int onoff) -{ - mod_alt = onoff; -} - -int -ecore_mod_alt_get(void) -{ - return mod_alt; -} - -void -ecore_mod_win_set(int onoff) -{ - mod_win = onoff; -} - -int -ecore_mod_win_get(void) -{ - return mod_win; -} - -void -ecore_focus_window_set(Window win) -{ - focused_win = win; -} - -Window -ecore_focus_window_get(void) -{ - return focused_win; -} - -void -ecore_focus_to_window(Window win) -{ - if (!disp) return; - if (win == 0) - win = default_root; - XSetInputFocus(disp, win, RevertToNone, CurrentTime); -} - -void -ecore_focus_mode_reset(void) -{ - if (!disp) return; - XSetInputFocus(disp, default_root, RevertToPointerRoot, CurrentTime); -} - -Atom -ecore_atom_get(char *name) -{ - if (!disp) return 0; - return XInternAtom(disp, name, False); -} - -void -ecore_window_set_delete_inform(Window win) -{ - static Atom protocols[1] = { 0 }; - - if (!disp) return; - ECORE_ATOM(protocols[0], "WM_DELETE_WINDOW"); - XSetWMProtocols(disp, win, protocols, 1); -} - -void -ecore_window_property_set(Window win, Atom type, Atom format, int size, - void *data, int number) -{ - if (!disp) return; - if (win == 0) - win = default_root; - if (size != 32) - XChangeProperty(disp, win, type, format, size, PropModeReplace, - (unsigned char *)data, number); - else - { - long *dat; - int i, *ptr; - - dat = NEW(long, number); - - for (ptr = (int *)data, i = 0; i < number; i++) - dat[i] = ptr[i]; - XChangeProperty(disp, win, type, format, size, PropModeReplace, - (unsigned char *)dat, number); - FREE(dat); - } -} - -void * -ecore_window_property_get(Window win, Atom type, Atom format, int *size) -{ - unsigned char *retval; - Atom type_ret; - unsigned long bytes_after, num_ret; - int format_ret; - void *data = NULL; - - if (!disp) - return NULL; - - retval = NULL; - if (win == 0) - win = default_root; - XGetWindowProperty(disp, win, type, 0, 0x7fffffffL, False, format, - &type_ret, &format_ret, &num_ret, &bytes_after, &retval); - if (retval) - { - if (format_ret == 32) - { - int i; - - *size = num_ret * sizeof(unsigned int); - - data = NEW(unsigned int, num_ret); - - for (i = 0; i < (int)num_ret; i++) - ((unsigned int *)data)[i] = ((unsigned long *)retval)[i]; - } - else if (format_ret == 16) - { - int i; - - *size = num_ret * sizeof(unsigned short); - - data = NEW(unsigned short, *size); - - for (i = 0; i < (int)num_ret; i++) - ((unsigned short *)data)[i] = ((unsigned short *)retval)[i]; - } - else if (format_ret == 8) - { - /* format_ret == 8 */ - *size = num_ret; - data = NEW(char, num_ret); - - if (data) - memcpy(data, retval, num_ret); - } - XFree(retval); - return data; - } - *size = 0; - return NULL; -} - -void -ecore_window_dnd_advertise(Window win) -{ - static Atom atom_xdndaware = 0; - int dnd_version = 3; - - if (!disp) return; - ECORE_ATOM(atom_xdndaware, "XdndAware"); - ecore_window_property_set(win, atom_xdndaware, XA_ATOM, 32, &dnd_version, 1); -} - -void -ecore_grab(void) -{ - if (!disp) - return; - - x_grabs++; - - if (x_grabs == 1) - XGrabServer(disp); -} - -void -ecore_ungrab(void) -{ - if (!disp) - return; - - x_grabs--; - - if (x_grabs == 0) - { - XUngrabServer(disp); - ecore_sync(); - } -} - -void -ecore_window_ignore(Window win) -{ - Window_List *w; - - if (!disp) return; - if (win == 0) - win = default_root; - w = NEW(Window_List, 1); - w->win = win; - w->next = ignore_wins; - ignore_wins = w; -} - -void -ecore_window_no_ignore(Window win) -{ - Window_List *w, *pw; - - if (!disp) return; - if (win == 0) - win = default_root; - for (pw = NULL, w = ignore_wins; w; pw = w, w = w->next) - { - if (w->win == win) - { - if (pw) - pw->next = w->next; - else - ignore_wins = w->next; - FREE(w); - return; - } - } -} - -int -ecore_window_is_ignored(Window win) -{ - Window_List *w; - - if (!disp) return 0; - if (win == 0) - win = default_root; - for (w = ignore_wins; w; w = w->next) - { - if (w->win == win) - return 1; - } - return 0; -} - -static Window -ecore_window_at_xy_0(Window base, int bx, int by, int x, int y) -{ - Window *list = NULL; - XWindowAttributes att; - Window child = 0, parent_win = 0, root_win = 0; - int i; - unsigned int ww, wh, num; - int wx, wy; - - if (!disp) return 0; - if ((!XGetWindowAttributes(disp, base, &att)) || - (att.map_state != IsViewable)) - return 0; - - wx = att.x; - wy = att.y; - ww = att.width; - wh = att.height; - - wx += bx; - wy += by; - - if (!((x >= wx) && (y >= wy) && (x < (int)(wx + ww)) && (y < (int)(wy + wh)))) - return 0; - - if (!XQueryTree(disp, base, &root_win, &parent_win, &list, &num)) - return base; - if (list) - { - for (i = num - 1;; i--) - { - if (!ecore_window_is_ignored(list[i])) - { - if ((child = ecore_window_at_xy_0(list[i], wx, wy, x, y)) != 0) - { - XFree(list); - return child; - } - } - if (!i) - break; - } - XFree(list); - } - return base; -} - -Window -ecore_window_get_at_xy(int x, int y) -{ - Window child; - - if (!disp) return 0; - ecore_grab(); - child = ecore_window_at_xy_0(default_root, 0, 0, x, y); - if (child) - { - ecore_ungrab(); - return child; - } - ecore_ungrab(); - return default_root; -} - -int -ecore_window_dnd_capable(Window win) -{ - static Atom atom_xdndaware = 0; - int dnd_version = 3; - int *atom_ret; - int size = 0; - - if (!disp) return 0; - ECORE_ATOM(atom_xdndaware, "XdndAware"); - atom_ret = ecore_window_property_get(win, atom_xdndaware, XA_ATOM, &size); - if ((atom_ret) && (size >= (int)sizeof(int))) - { - if (atom_ret[0] == dnd_version) - { - FREE(atom_ret); - return 1; - } - FREE(atom_ret); - } - return 0; -} - -void -ecore_window_dnd_handle_motion(Window source_win, int x, int y, int dragging) -{ - static Atom atom_xdndenter = 0; - static Atom atom_xdndleave = 0; - static Atom atom_xdnddrop = 0; - static Atom atom_xdndposition = 0; - static Atom atom_xdndactioncopy = 0; - static Atom atom_xdndactionmove = 0; - static Atom atom_xdndactionlink = 0; - static Atom atom_xdndactionask = 0; - static Atom atom_text_uri_list = 0; - static Atom atom_text_plain = 0; - static Atom atom_text_moz_url = 0; - static Atom atom_netscape_url = 0; - Window win; - XEvent xevent; - - if (!disp) return; - win = ecore_window_get_at_xy(x, y); - while ((win) && (!ecore_window_dnd_capable(win))) - win = ecore_window_get_parent(win); - ECORE_ATOM(atom_xdndenter, "XdndEnter"); - ECORE_ATOM(atom_xdndleave, "XdndLeave"); - ECORE_ATOM(atom_xdnddrop, "XdndDrop"); - ECORE_ATOM(atom_xdndposition, "XdndPosition"); - ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy"); - ECORE_ATOM(atom_xdndactionmove, "XdndActionMove"); - ECORE_ATOM(atom_xdndactionlink, "XdndActionLink"); - ECORE_ATOM(atom_xdndactionask, "XdndActionAsk"); - ECORE_ATOM(atom_text_uri_list, "text/uri-list"); - ECORE_ATOM(atom_text_plain, "text/plain"); - ECORE_ATOM(atom_text_moz_url, "text/x-moz-url"); - ECORE_ATOM(atom_netscape_url, "_NETSCAPE_URL"); - if ((win != current_dnd_win) && (current_dnd_win)) - { - /* send leave to old dnd win */ - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.format = 32; - xevent.xclient.window = current_dnd_win; - xevent.xclient.message_type = atom_xdndleave; - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = 0; - xevent.xclient.data.l[2] = 0; - xevent.xclient.data.l[3] = 0; - xevent.xclient.data.l[4] = 0; - XSendEvent(disp, current_dnd_win, False, 0, &xevent); - } - if (win) - { - if (win != current_dnd_win) - { - /* send enter on new win */ - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdndenter; - xevent.xclient.format = 32; - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = (3 << 24); - xevent.xclient.data.l[2] = atom_text_uri_list; - xevent.xclient.data.l[3] = atom_text_plain; - xevent.xclient.data.l[4] = atom_text_moz_url; - XSendEvent(disp, win, False, 0, &xevent); - ecore_clear_target_status(); - } - /* kjb cep */ - if(!dnd_await_target_status) - { - /* send position information */ - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdndposition; - xevent.xclient.format = 32; - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = (3 << 24); - xevent.xclient.data.l[2] = ((x << 16) & 0xffff0000) | (y & 0xffff); - xevent.xclient.data.l[3] = CurrentTime; - if (dnd_copy) - xevent.xclient.data.l[4] = atom_xdndactioncopy; - else if (dnd_link) - xevent.xclient.data.l[4] = atom_xdndactionlink; - else if (dnd_move) - xevent.xclient.data.l[4] = atom_xdndactionmove; - else - xevent.xclient.data.l[4] = atom_xdndactionask; - XSendEvent(disp, win, False, 0, &xevent); - dnd_await_target_status = 1; - } - } - if (!dragging) - { - if (win) - { - if (current_dnd_target_ok) - { - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdnddrop; - xevent.xclient.format = 32; - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = 0; - xevent.xclient.data.l[2] = CurrentTime; - xevent.xclient.data.l[3] = 0; - xevent.xclient.data.l[4] = 0; - XSendEvent(disp, win, False, 0, &xevent); - } - else - { - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdndleave; - xevent.xclient.format = 32; - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = 0; - xevent.xclient.data.l[2] = 0; - xevent.xclient.data.l[3] = 0; - xevent.xclient.data.l[4] = 0; - XSendEvent(disp, win, False, 0, &xevent); - } - } - current_dnd_target_ok = 0; - } - current_dnd_win = win; -} - - -void -ecore_clear_target_status(void) -{ - dnd_await_target_status = 0; -} - - -int -ecore_dnd_selection_convert(Window win, Window req, Atom type) -{ - static Atom atom_xdndselection = 0; - static Atom atom_jxselectionwindowproperty = 0; - - if (!disp) return 0; - ECORE_ATOM(atom_xdndselection, "XdndSelection"); - ECORE_ATOM(atom_jxselectionwindowproperty, "JXSelectionWindowProperty"); - if (win == XGetSelectionOwner(disp, atom_xdndselection)) - { - XConvertSelection(disp, atom_xdndselection, type, - atom_jxselectionwindowproperty, req, CurrentTime); - return 1; - } - return 0; -} - -void * -ecore_dnd_selection_get(Window win, Window req, Atom type, int *size) -{ - unsigned char *data = NULL; - long bytes_read; - unsigned long remaining = 1; - - if (!disp) return NULL; - *size = 0; - bytes_read = 0; - while (remaining) - { - unsigned char *s; - Atom actual; - int format; - unsigned long count; - - s = NULL; - if (XGetWindowProperty(disp, win, type, bytes_read / 4, 0x10000, 1, - AnyPropertyType, &actual, &format, &count, - &remaining, &s) != Success) - { - /* error occured */ - XFree(s); - IF_FREE(data); - *size = 0; - return NULL; - } - if (s) - { - /* got some mroe data - append it */ - bytes_read += count; - if (!data) - data = NEW(char, bytes_read); - - else - REALLOC(data, char, bytes_read); - MEMCPY(s, data + (bytes_read - count), char, count); - - XFree(s); - } - } - *size = bytes_read; - return data; - req = 0; -} - -void -ecore_dnd_set_data(Window win) -{ - static Atom atom_xdndselection = 0; - - if (!disp) return; - ECORE_ATOM(atom_xdndselection, "XdndSelection"); - ecore_dnd_set_action(win); - XSetSelectionOwner(disp, atom_xdndselection, win, CurrentTime); -} - -void -ecore_dnd_set_action(Window win) -{ - static int atom_xdndactioncopy = 0; - static int atom_xdndactionmove = 0; - static int atom_xdndactionlink = 0; - static int atom_xdndactionask = 0; - static Atom atom_xdndactionlist = 0; - - if (!disp) return; - ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy"); - ECORE_ATOM(atom_xdndactionmove, "XdndActionMove"); - ECORE_ATOM(atom_xdndactionlink, "XdndActionLink"); - ECORE_ATOM(atom_xdndactionask, "XdndActionAsk"); - ECORE_ATOM(atom_xdndactionlist, "XdndActionList"); - if (dnd_copy) - ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32, - &atom_xdndactioncopy, 1); - else if (dnd_link) - ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32, - &atom_xdndactionlink, 1); - else if (dnd_move) - ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32, - &atom_xdndactionmove, 1); - else - ecore_window_property_set(win, atom_xdndactionlist, XA_ATOM, 32, - &atom_xdndactionask, 1); -} - -void -ecore_dnd_send_data(Window win, Window source_win, void *data, int size, - Atom dest_atom, int type) -{ - XEvent xevent; - static Atom atom_text_plain = 0; - static Atom atom_text_uri_list = 0; - static Atom atom_text_moz_url = 0; - static Atom atom_netscape_url = 0; - static Atom atom_xdndselection = 0; - Atom target; - - if (!disp) return; - ECORE_ATOM(atom_xdndselection, "XdndSelection"); - ECORE_ATOM(atom_text_uri_list, "text/uri-list"); - ECORE_ATOM(atom_text_plain, "text/plain"); - ECORE_ATOM(atom_text_moz_url, "text/x-moz-url"); - ECORE_ATOM(atom_text_moz_url, "_NETSCAPE_URL"); - ECORE_ATOM(atom_text_plain, "text/plain"); - if (type == DND_TYPE_URI_LIST) target = atom_text_uri_list; - else if (type == DND_TYPE_PLAIN_TEXT) target = atom_text_plain; - else if (type == DND_TYPE_MOZ_URL) target = atom_text_moz_url; - else if (type == DND_TYPE_NETSCAPE_URL) target = atom_netscape_url; - else target = 0; - ecore_window_property_set(win, dest_atom, target, 8, data, size); - xevent.xselection.type = SelectionNotify; - xevent.xselection.property = dest_atom; - xevent.xselection.display = disp; - xevent.xselection.requestor = win; - xevent.xselection.selection = atom_xdndselection; - xevent.xselection.target = target; - xevent.xselection.time = CurrentTime; - XSendEvent(disp, win, False, 0, &xevent); - return; - source_win = 0; -} - -void -ecore_dnd_set_mode_copy(void) -{ - dnd_copy = 1; - dnd_link = 0; - dnd_move = 0; -} - -void -ecore_dnd_set_mode_link(void) -{ - dnd_copy = 0; - dnd_link = 1; - dnd_move = 0; -} - -void -ecore_dnd_set_mode_move(void) -{ - dnd_copy = 0; - dnd_link = 0; - dnd_move = 1; -} - -void -ecore_dnd_set_mode_ask(void) -{ - dnd_copy = 0; - dnd_link = 0; - dnd_move = 0; -} - -void -ecore_dnd_own_selection(Window win) -{ - static Atom atom_xdndselection = 0; - static Atom atom_jxselectionwindowproperty = 0; - - if (!disp) return; - ECORE_ATOM(atom_xdndselection, "XdndSelection"); - ECORE_ATOM(atom_jxselectionwindowproperty, "JXSelectionWindowProperty"); - - if (!XSetSelectionOwner(disp, atom_xdndselection, win, CurrentTime)) - return; -} - -void -ecore_dnd_send_drop(Window win, Window source_win) -{ - static Atom atom_xdnddrop = 0; - XEvent xevent; - - if (!disp) return; - ECORE_ATOM(atom_xdnddrop, "XdndDrop"); - - ecore_dnd_own_selection(source_win); - - memset(&xevent, 0, sizeof(xevent)); - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdnddrop; - xevent.xclient.format = 32; - - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = CurrentTime; - xevent.xclient.data.l[2] = 0; - xevent.xclient.data.l[3] = 0; - xevent.xclient.data.l[4] = 0; - XSendEvent(disp, win, False, 0, &xevent); -} - -void -ecore_window_dnd_send_status_ok(Window source_win, Window win, int x, int y, - int w, int h) -{ - static Atom atom_xdndstatus = 0; - static Atom atom_xdndactioncopy = 0; - static Atom atom_xdndactionmove = 0; - static Atom atom_xdndactionlink = 0; - static Atom atom_xdndactionask = 0; - XEvent xevent; - - if (!disp) return; - ECORE_ATOM(atom_xdndstatus, "XdndStatus"); - ECORE_ATOM(atom_xdndactioncopy, "XdndActionCopy"); - ECORE_ATOM(atom_xdndactionmove, "XdndActionMove"); - ECORE_ATOM(atom_xdndactionlink, "XdndActionLink"); - ECORE_ATOM(atom_xdndactionask, "XdndActionAsk"); - memset(&xevent, 0, sizeof(xevent)); - - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdndstatus; - xevent.xclient.format = 32; - - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = 3; - xevent.xclient.data.l[2] = ((x << 16) & 0xffff0000) | (y & 0xffff); - xevent.xclient.data.l[3] = ((h << 16) & 0xffff0000) | (w & 0xffff); - if (dnd_copy) - xevent.xclient.data.l[4] = atom_xdndactioncopy; - else if (dnd_link) - xevent.xclient.data.l[4] = atom_xdndactionlink; - else if (dnd_move) - xevent.xclient.data.l[4] = atom_xdndactionmove; - else - xevent.xclient.data.l[4] = atom_xdndactionask; - XSendEvent(disp, win, False, 0, &xevent); -} - -void -ecore_window_dnd_send_finished(Window source_win, Window win) -{ - static Atom atom_xdndfinished = 0; - XEvent xevent; - - if (!disp) return; - ECORE_ATOM(atom_xdndfinished, "XdndFinished"); - memset(&xevent, 0, sizeof(xevent)); - - xevent.xany.type = ClientMessage; - xevent.xany.display = disp; - xevent.xclient.window = win; - xevent.xclient.message_type = atom_xdndfinished; - xevent.xclient.format = 32; - - xevent.xclient.data.l[0] = source_win; - xevent.xclient.data.l[1] = 0; - xevent.xclient.data.l[2] = 0; - xevent.xclient.data.l[3] = 0; - xevent.xclient.data.l[4] = 0; - XSendEvent(disp, win, False, 0, &xevent); -} - -void -ecore_window_dnd_ok(int ok) -{ - current_dnd_target_ok = ok; -} - -void -ecore_window_dnd_finished(void) -{ - current_dnd_win = 0; -} - -void -ecore_window_set_title(Window win, char *title) -{ - if (!disp) return; - XStoreName(disp, win, title); -} - -void -ecore_window_set_name_class(Window win, char *name, char *class) -{ - XClassHint hint; - - if (!disp) return; - hint.res_name = name; - hint.res_class = class; - XSetClassHint(disp, win, &hint); -} - -void -ecore_window_get_name_class(Window win, char **name, char **class) -{ - XClassHint xch; - - if (!disp) return; - if (name) - *name = NULL; - if (class) - *class = NULL; - if (XGetClassHint(disp, win, &xch)) - { - if (name) - { - if (xch.res_name) - *name = strdup(xch.res_name); - } - if (class) - { - if (xch.res_class) - *class = strdup(xch.res_class); - } - XFree(xch.res_name); - XFree(xch.res_class); - } -} - -void -ecore_window_get_hints(Window win, int *accepts_focus, int *initial_state, - Pixmap * icon_pixmap, Pixmap * icon_mask, - Window * icon_window, Window * window_group) -{ - XWMHints *hints; - - if (!disp) return; - hints = XGetWMHints(disp, win); - if (hints) - { - if ((hints->flags & InputHint) && (accepts_focus)) - { - if (hints->input) - *accepts_focus = 1; - else - *accepts_focus = 0; - } - if ((hints->flags & StateHint) && (initial_state)) - { - *initial_state = hints->initial_state; - } - if ((hints->flags & IconPixmapHint) && (icon_pixmap)) - { - *icon_pixmap = hints->icon_pixmap; - } - if ((hints->flags & IconMaskHint) && (icon_mask)) - { - *icon_mask = hints->icon_pixmap; - } - if ((hints->flags & IconWindowHint) && (icon_window)) - { - *icon_window = hints->icon_window; - } - if ((hints->flags & WindowGroupHint) && (window_group)) - { - *window_group = hints->window_group; - } - XFree(hints); - } -} - -char * -ecore_window_get_machine(Window win) -{ - XTextProperty xtp; - - if (!disp) return NULL; - if (XGetWMClientMachine(disp, win, &xtp)) - { - char *s; - - if (!xtp.value) - return NULL; - s = strdup(xtp.value); - XFree(xtp.value); - return s; - } - return NULL; -} - -char * -ecore_window_get_command(Window win) -{ - int cargc; - char **cargv; - - if (!disp) return NULL; - if (XGetCommand(disp, win, &cargv, &cargc)) - { - if (cargc > 0) - { - char *s; - int size, i; - - size = 0; - for (i = 0; i < cargc; i++) - size += strlen(cargv[i]); - size += cargc - 1; - s = NEW(char, size + 1); - s[0] = 0; - - strcpy(s, cargv[0]); - for (i = 1; i < cargc; i++) - { - strcat(s, " "); - strcat(s, cargv[i]); - } - XFreeStringList(cargv); - return s; - } - else - return NULL; - } - return NULL; -} - -char * -ecore_window_get_icon_name(Window win) -{ - XTextProperty xtp; - - if (!disp) return NULL; - if (XGetWMIconName(disp, win, &xtp)) - { - char *s; - - if (!xtp.value) - return NULL; - s = strdup(xtp.value); - XFree(xtp.value); - return s; - } - return NULL; -} - -void -ecore_window_set_min_size(Window win, int w, int h) -{ - XSizeHints hints; - long ret; - - if (!disp) return; - memset(&hints, 0, sizeof(XSizeHints)); - XGetWMNormalHints(disp, win, &hints, &ret); - hints.flags |= PMinSize | PSize | USSize; - hints.min_width = w; - hints.min_height = h; - XSetWMNormalHints(disp, win, &hints); -} - -void -ecore_window_set_max_size(Window win, int w, int h) -{ - XSizeHints hints; - long ret; - - if (!disp) return; - memset(&hints, 0, sizeof(XSizeHints)); - XGetWMNormalHints(disp, win, &hints, &ret); - hints.flags |= PMaxSize | PSize | USSize; - hints.max_width = w; - hints.max_height = h; - XSetWMNormalHints(disp, win, &hints); -} - -void -ecore_window_set_xy_hints(Window win, int x, int y) -{ - XSizeHints hints; - long ret; - - if (!disp) return; - memset(&hints, 0, sizeof(XSizeHints)); - XGetWMNormalHints(disp, win, &hints, &ret); - hints.flags |= PPosition | USPosition | PSize | USSize; - hints.x = x; - hints.y = y; - XSetWMNormalHints(disp, win, &hints); -} - -void -ecore_window_get_frame_size(Window win, int *l, int *r, int *t, int *b) -{ - static Atom atom_e_frame_size = 0; - int *data, size; - - if (!disp) return; - ECORE_ATOM(atom_e_frame_size, "_E_FRAME_SIZE"); - data = ecore_window_property_get(win, atom_e_frame_size, XA_CARDINAL, &size); - if (data) - { - if (size == (4 * sizeof(int))) - { - if (l) - *l = data[0]; - if (r) - *r = data[1]; - if (t) - *t = data[2]; - if (b) - *b = data[3]; - } - else - { - if (l) - *l = 0; - if (r) - *r = 0; - if (t) - *t = 0; - if (b) - *b = 0; - } - FREE(data); - } - else - { - if (l) - *l = 0; - if (r) - *r = 0; - if (t) - *t = 0; - if (b) - *b = 0; - } -} - -int -ecore_window_save_under(Window win) -{ - XSetWindowAttributes att; - XWindowAttributes gatt; - - if (!disp) return 0; - att.save_under = True; - XChangeWindowAttributes(disp, win, CWSaveUnder, &att); - XGetWindowAttributes(disp, win, &gatt); - return (gatt.save_under == True) ? 1 : 0; -} - -GC -ecore_gc_new(Drawable d) -{ - XGCValues gcv; - - if (!disp) return 0; - if (d == 0) - d = default_root; - return XCreateGC(disp, d, 0, &gcv); -} - -void -ecore_gc_free(GC gc) -{ - if (!disp) return; - XFreeGC(disp, gc); -} - -void -ecore_gc_set_fg(GC gc, int val) -{ - if (!disp) return; - XSetForeground(disp, gc, val); -} - -void -ecore_fill_rectangle(Drawable d, GC gc, int x, int y, int w, int h) -{ - if (!disp) return; - XFillRectangle(disp, d, gc, x, y, w, h); -} - -void -ecore_draw_rectangle(Drawable d, GC gc, int x, int y, int w, int h) -{ - if (!disp) return; - XDrawRectangle(disp, d, gc, x, y, w - 1, h - 1); -} - -void -ecore_draw_line(Drawable d, GC gc, int x1, int y1, int x2, int y2) -{ - if (!disp) return; - XDrawLine(disp, d, gc, x1, y1, x2, y2); -} - -void -ecore_draw_point(Drawable d, GC gc, int x, int y) -{ - if (!disp) return; - XDrawPoint(disp, d, gc, x, y); -} - -void -ecore_window_hint_set_layer(Window win, int layer) -{ - static Atom atom_win_layer = 0; - - if (!disp) return; - ECORE_ATOM(atom_win_layer, "_WIN_LAYER"); - ecore_window_property_set(win, atom_win_layer, XA_CARDINAL, 32, &layer, 1); -} - -void -ecore_window_hint_set_sticky(Window win, int sticky) -{ - static Atom atom_win_state = 0; - static Atom atom_win_hints = 0; - int data; - - if (!disp) return; - ECORE_ATOM(atom_win_state, "_WIN_STATE"); - ECORE_ATOM(atom_win_hints, "_WIN_HINTS"); - if (sticky) - { - data = ((1 << 0) | (1 << 8) | (1 << 9)); - ecore_window_property_set(win, atom_win_state, XA_CARDINAL, 32, &data, 1); - data = ((1 << 0) | (1 << 1) | (1 << 2)); - ecore_window_property_set(win, atom_win_hints, XA_CARDINAL, 32, &data, 1); - } - else - { - data = 0; - ecore_window_property_set(win, atom_win_state, XA_CARDINAL, 32, &data, 1); - ecore_window_property_set(win, atom_win_hints, XA_CARDINAL, 32, &data, 1); - } -} - -void -ecore_window_hint_set_borderless(Window win) -{ - static Atom atom_motif_wm_hints = 0; - int data[5]; - - if (!disp) return; - ECORE_ATOM(atom_motif_wm_hints, "_MOTIF_WM_HINTS"); - data[0] = 0x3; - data[1] = 0x0; - data[2] = 0x0; - data[3] = 0x2ada27b0; - data[4] = 0x2aabd6b0; - ecore_window_property_set(win, atom_motif_wm_hints, atom_motif_wm_hints, 32, - data, 5); -} - -void -ecore_grab_mouse(Window win, int confine, Cursor cursor) -{ - int ret; - - if (!disp) - return; - if (confine) - ret = XGrabPointer(disp, win, False, - XEV_BUTTON | XEV_MOUSE_MOVE | XEV_IN_OUT, - GrabModeAsync, GrabModeAsync, win, cursor, CurrentTime); - else - ret = XGrabPointer(disp, win, False, - XEV_BUTTON | XEV_MOUSE_MOVE | XEV_IN_OUT, - GrabModeAsync, GrabModeAsync, None, cursor, CurrentTime); - if (ret == GrabSuccess) - grab_pointer_win = win; -} - -void -ecore_ungrab_mouse(void) -{ - if (!disp) return; - XUngrabPointer(disp, CurrentTime); - grab_pointer_win = 0; -} - -Window -ecore_grab_window_get(void) -{ - return grab_pointer_win; -} - -int -ecore_window_get_gravity(Window win) -{ - XWindowAttributes att; - - if (!disp) - return 0; - - XGetWindowAttributes(disp, win, &att); - return att.win_gravity; -} - -void -ecore_window_gravity_reset(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - XSetWindowAttributes att; - -/* if (xid->gravity != NorthWestGravity)*/ - { - att.win_gravity = NorthWestGravity; - XChangeWindowAttributes(disp, win, CWWinGravity, &att); - xid->gravity = NorthWestGravity; - xid->coords_invalid = 1; - } - } -} - -void -ecore_window_gravity_set(Window win, int gravity) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { -/* if (xid->gravity != gravity)*/ - { - XSetWindowAttributes att; - - att.win_gravity = gravity; - XChangeWindowAttributes(disp, win, CWWinGravity, &att); - xid->gravity = gravity; - xid->coords_invalid = 1; - } - } -} - -void -ecore_window_bit_gravity_set(Window win, int gravity) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - XSetWindowAttributes att; - - att.bit_gravity = gravity; - XChangeWindowAttributes(disp, win, CWBitGravity, &att); - } -} - -void -ecore_pointer_warp_by(int dx, int dy) -{ - if (!disp) return; - XWarpPointer(disp, None, None, 0, 0, 0, 0, dx, dy); -} - -void -ecore_pointer_warp_to(int x, int y) -{ - if (!disp) return; - XWarpPointer(disp, None, default_root, 0, 0, 0, 0, x, y); -} - -void -ecore_gc_set_include_inferiors(GC gc) -{ - XGCValues gcv; - - if (!disp) return; - gcv.subwindow_mode = IncludeInferiors; - XChangeGC(disp, gc, GCSubwindowMode, &gcv); -} - -void -ecore_area_copy(Drawable src, Drawable dest, GC gc, - int sx, int sy, int sw, int sh, int dx, int dy) -{ - if (!disp) return; - if (src == 0) - src = default_root; - if (dest == 0) - dest = default_root; - XCopyArea(disp, src, dest, gc, sx, sy, sw, sh, dx, dy); -} - -Window -ecore_window_root(void) -{ - return default_root; -} - -void -ecore_window_get_virtual_area(Window win, int *area_x, int *area_y) -{ - static Atom atom_win_area = 0; - int *data, size; - - if (!disp) return; - ECORE_ATOM(atom_win_area, "_WIN_AREA"); - data = ecore_window_property_get(win, atom_win_area, XA_CARDINAL, &size); - if (data) - { - if (size == (sizeof(int) * 2)) - { - if (area_x) - *area_x = data[0]; - if (area_y) - *area_y = data[1]; - } - FREE(data); - } -} - -void -ecore_get_virtual_area(int *area_x, int *area_y) -{ - static Atom atom_win_area = 0; - int *data, size; - - if (!disp) return; - ECORE_ATOM(atom_win_area, "_WIN_AREA"); - data = ecore_window_property_get(default_root, atom_win_area, XA_CARDINAL, &size); - if (data) - { - if (size == (sizeof(int) * 2)) - { - if (area_x) - *area_x = data[0]; - if (area_y) - *area_y = data[1]; - } - FREE(data); - } -} - -void -ecore_window_get_root_relative_location(Window win, int *x, int *y) -{ - int dx, dy; - Window parent; - Ecore_XID *xid = NULL; - - if (!disp) return; - if (win == 0) - win = default_root; - if (win == default_root) - { - if (x) - *x = 0; - if (y) - *y = 0; - return; - } - xid = ecore_validate_xid(win); - if (!xid) - { - if (x) - *x = 0; - if (y) - *y = 0; - return; - } - dx = 0; - dy = 0; - do - { - parent = xid->parent; - dx += xid->x; - dy += xid->y; - if (parent != default_root) - { - xid = ecore_validate_xid(parent); - if (!xid) - { - if (x) - *x = dx; - if (y) - *y = dy; - return; - } - } - } - while (parent != default_root); - if (x) - *x = dx; - if (y) - *y = dy; -} - -void -ecore_window_button_grab_auto_replay_set(Window win, int (*func) (Ecore_Event_Mouse_Down *ev)) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (!xid) return; - xid->grab_button_auto_replay = func; -} - -void * -ecore_window_button_grab_auto_replay_get(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return NULL; - xid = ecore_validate_xid(win); - if (!xid) return NULL; - return xid->grab_button_auto_replay; -} - -void -ecore_button_grab(Window win, int button, int events, - Ecore_Event_Key_Modifiers mod, int any_mod) -{ - unsigned int b; - unsigned int m; - unsigned int locks[8]; - int i; - - if (!disp) return; - b = button; - if (b == 0) - b = AnyButton; - m = 0; - if (any_mod) - m = AnyModifier; - else - { - if (mod & ECORE_EVENT_KEY_MODIFIER_SHIFT) - m |= ecore_mod_mask_shift_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_CTRL) - m |= ecore_mod_mask_ctrl_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_ALT) - m |= ecore_mod_mask_alt_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_WIN) - m |= ecore_mod_mask_win_get(); - } - locks[0] = 0; - locks[1] = ecore_lock_mask_caps_get(); - locks[2] = ecore_lock_mask_num_get(); - locks[3] = ecore_lock_mask_scroll_get(); - locks[4] = ecore_lock_mask_caps_get() | ecore_lock_mask_num_get(); - locks[5] = ecore_lock_mask_caps_get() | ecore_lock_mask_scroll_get(); - locks[6] = ecore_lock_mask_num_get() | ecore_lock_mask_scroll_get(); - locks[7] = - ecore_lock_mask_caps_get() | ecore_lock_mask_num_get() | - ecore_lock_mask_scroll_get(); - for (i = 0; i < 8; i++) - XGrabButton(disp, b, m | locks[i], - win, False, events, GrabModeSync, GrabModeAsync, None, None); -} - -void -ecore_button_ungrab(Window win, int button, Ecore_Event_Key_Modifiers mod, - int any_mod) -{ - unsigned int b; - unsigned int m; - unsigned int locks[8]; - int i; - - if (!disp) return; - b = button; - if (b == 0) - b = AnyButton; - m = 0; - if (any_mod) - m = AnyModifier; - else - { - if (mod & ECORE_EVENT_KEY_MODIFIER_SHIFT) - m |= ecore_mod_mask_shift_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_CTRL) - m |= ecore_mod_mask_ctrl_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_ALT) - m |= ecore_mod_mask_alt_get(); - if (mod & ECORE_EVENT_KEY_MODIFIER_WIN) - m |= ecore_mod_mask_win_get(); - } - locks[0] = 0; - locks[1] = ecore_lock_mask_caps_get(); - locks[2] = ecore_lock_mask_num_get(); - locks[3] = ecore_lock_mask_scroll_get(); - locks[4] = ecore_lock_mask_caps_get() | ecore_lock_mask_num_get(); - locks[5] = ecore_lock_mask_caps_get() | ecore_lock_mask_scroll_get(); - locks[6] = ecore_lock_mask_num_get() | ecore_lock_mask_scroll_get(); - locks[7] = - ecore_lock_mask_caps_get() | ecore_lock_mask_num_get() | - ecore_lock_mask_scroll_get(); - for (i = 0; i < 8; i++) - XUngrabButton(disp, b, m | locks[i], win); -} - -void -ecore_pointer_replay(Time t) -{ - if (!disp) return; - XSync(disp, False); - XAllowEvents(disp, ReplayPointer, t); - XSync(disp, False); -} - -void -ecore_pointer_grab(Window win, Time t) -{ - if (!disp) return; - XGrabPointer(disp, win, False, XEV_BUTTON | XEV_MOUSE_MOVE | XEV_IN_OUT, - GrabModeAsync, GrabModeAsync, None, None, t); -} - -void -ecore_pointer_ungrab(Time t) -{ - if (!disp) return; - XUngrabPointer(disp, t); -} - -void -ecore_window_send_event_move_resize(Window win, int x, int y, int w, int h) -{ - XEvent ev; - - if (!disp) return; - ev.type = ConfigureNotify; - ev.xconfigure.display = disp; - ev.xconfigure.event = win; - ev.xconfigure.window = win; - ev.xconfigure.x = x; - ev.xconfigure.y = y; - ev.xconfigure.width = w; - ev.xconfigure.height = h; - ev.xconfigure.border_width = 0; - ev.xconfigure.above = win; - ev.xconfigure.override_redirect = False; - XSendEvent(disp, win, False, StructureNotifyMask, &ev); -} - -void -ecore_window_send_client_message(Window win, Atom type, int format, void *data) -{ - XClientMessageEvent ev; - int i; - - if (!disp) return; - ev.type = ClientMessage; - ev.window = win; - ev.message_type = type; - ev.format = format; - if (format == 32) - { - for (i = 0; i < 5; i++) - ev.data.l[i] = ((unsigned int *)data)[i]; - } - else if (format == 16) - { - for (i = 0; i < 10; i++) - ev.data.s[i] = ((unsigned short *)data)[i]; - } - else if (format == 8) - { - for (i = 0; i < 20; i++) - ev.data.b[i] = ((unsigned char *)data)[i]; - } - XSendEvent(disp, win, False, 0, (XEvent *) & ev); -} - -void -ecore_window_add_to_save_set(Window win) -{ - if (!disp) return; - XAddToSaveSet(disp, win); -} - -void -ecore_window_del_from_save_set(Window win) -{ - if (!disp) return; - XRemoveFromSaveSet(disp, win); -} - -void -ecore_window_kill_client(Window win) -{ - if (!disp) return; - XKillClient(disp, (XID) win); -} - -void -ecore_window_set_border_width(Window win, int bw) -{ - Ecore_XID *xid = NULL; - - if (!disp) return; - xid = ecore_validate_xid(win); - if (xid) - { - xid->bw = bw; - } - XSetWindowBorderWidth(disp, win, bw); -} - -int -ecore_window_get_border_width(Window win) -{ - Ecore_XID *xid = NULL; - - if (!disp) return 0; - - xid = ecore_validate_xid(win); - if (xid) - { - return xid->bw; - } - - return 0; -} - -int -ecore_window_get_wm_size_hints(Window win, XSizeHints * hints, int *mask) -{ - long sup_ret; - Status ok; - - if (!disp) return 0; - - ok = XGetWMNormalHints(disp, win, hints, &sup_ret); - *mask = (int)sup_ret; - return ok; -} - -int -ecore_window_is_visible(Window win) -{ - XWindowAttributes att; - - if (!disp) return 0; - if (win == 0) - win = default_root; - if (XGetWindowAttributes(disp, win, &att) == True) - { - if (att.map_state == IsUnmapped) - return 0; - return 1; - } - return 0; -} - -int -ecore_window_is_normal(Window win) -{ - XWindowAttributes att; - - if (!disp) return 0; - if (win == 0) - win = default_root; - if (XGetWindowAttributes(disp, win, &att) == True) - { - if ((att.override_redirect) || (att.class == InputOnly)) - return 0; - return 1; - } - return 0; -} - -int -ecore_window_is_manageable(Window win) -{ - XWindowAttributes att; - - if (!disp) return 0; - if (win == 0) - win = default_root; - if (XGetWindowAttributes(disp, win, &att) == True) - { - if ((att.map_state == IsUnmapped) || (att.override_redirect) - || (att.class == InputOnly)) - return 0; - return 1; - } - return 0; -} - -void -ecore_windows_restack(Window * wins, int num) -{ - if (!disp) return; - XRestackWindows(disp, wins, num); -} - -void -ecore_window_stack_above(Window win, Window above) -{ - XWindowChanges xwc; - - if (!disp) return; - if (win == 0) - win = default_root; - xwc.sibling = above; - xwc.stack_mode = Above; - XConfigureWindow(disp, win, CWSibling | CWStackMode, &xwc); -} - -void -ecore_window_stack_below(Window win, Window below) -{ - XWindowChanges xwc; - - if (!disp) return; - - if (win == 0) - win = default_root; - xwc.sibling = below; - xwc.stack_mode = Below; - XConfigureWindow(disp, win, CWSibling | CWStackMode, &xwc); -} - -char * -ecore_window_get_title(Window win) -{ - XTextProperty xtp; - - if (!disp) return 0; - - if (win == 0) - win = default_root; - if (XGetWMName(disp, win, &xtp)) - { - int items; - char **list; - Status s; - char *title = NULL; - - if (xtp.format == 8) - { - s = XmbTextPropertyToTextList(disp, &xtp, &list, &items); - if ((s == Success) && (items > 0)) - { - title = strdup(*list); - XFreeStringList(list); - } - else - title = strdup((char *)xtp.value); - } - else - title = strdup((char *)xtp.value); - XFree(xtp.value); - return title; - } - return NULL; -} - -void -ecore_keyboard_grab(Window win) -{ - int status; - - if (!disp) return; - if (keyboard_grab_win) - return; - if (win == 0) - win = default_root; - keyboard_grab_win = win; - status = - XGrabKeyboard(disp, win, False, GrabModeAsync, GrabModeAsync, CurrentTime); - if ((status == AlreadyGrabbed) || (status == GrabNotViewable) - || (status == GrabFrozen) || (status == GrabInvalidTime)) - keyboard_grab_win = 0; -} - -void -ecore_keyboard_ungrab(void) -{ - if (!disp) return; - if (!keyboard_grab_win) - return; - keyboard_grab_win = 0; - XUngrabKeyboard(disp, CurrentTime); -} - -Window -ecore_keyboard_grab_window_get(void) -{ - if (!disp) return 0; - return keyboard_grab_win; -} - -Window -ecore_selection_set(char *string) -{ - Window target = 0; - static Atom dest = 0; - Atom selection; - - if (!disp) return 0; - selection = X_CLIPBOARD_SELECTION; - ECORE_ATOM(dest, "TEXT_SELECTION"); - target = ecore_window_new(0, 0, 0, 77, 7); - ecore_window_add_events(target, XEV_CONFIGURE | XEV_PROPERTY); - XSetSelectionOwner(disp, selection, target, CurrentTime); - if (XGetSelectionOwner(disp, XA_PRIMARY) != target) - { - ecore_window_destroy(target); - return 0; - } - XChangeProperty(disp, target, dest, - XA_STRING, 8, PropModeReplace, string, strlen(string)); - return target; -} - -Window -ecore_selection_request(void) -{ - static Atom dest = 0; - Atom selection; - Window target = 0; - - if (!disp) return 0; - selection = X_CLIPBOARD_SELECTION; - ECORE_ATOM(dest, "TEXT_SELECTION"); - target = ecore_window_new(0, 0, 0, 7, 77); - ecore_window_add_events(target, XEV_CONFIGURE | XEV_PROPERTY); - XConvertSelection(disp, XA_PRIMARY, XA_STRING, dest, target, CurrentTime); - return target; -} - -char * -ecore_selection_get_data(Window win, Atom prop) -{ - char *string = NULL; - long nread; - unsigned long bytes_after, nitems; - unsigned char *data; - Atom actual_type; - int actual_fmt; - - if (!disp) return NULL; - if (prop == None) - return NULL; - for (nread = 0, bytes_after = 1; bytes_after > 0;) - { - if ((XGetWindowProperty(disp, win, prop, nread / 4, - 0x10000, True, AnyPropertyType, - &actual_type, &actual_fmt, &nitems, - &bytes_after, &data) != Success)) - { - IF_FREE(string); - if (data) - { - XFree(data); - } - return NULL; - } - nread += nitems; - - if (actual_type == XA_STRING) - { - if (string) - string = realloc(string, strlen(string) + nitems + 1); - else - { - string = malloc(nitems + 1); - string[0] = 0; - } - string[strlen(string) + nitems] = 0; - strncat(string, data, nitems); - } - else - { - int size, i; - XTextProperty xtextp; - char **cl = NULL; - - xtextp.value = data; - xtextp.encoding = actual_type; - xtextp.format = actual_fmt; - xtextp.nitems = nitems; - XmbTextPropertyToTextList(disp, &xtextp, &cl, &size); - - if (cl) - { - for (i = 0; i < size; i++) - { - if (cl[i]) - { - if (string) - string = - realloc(string, strlen(string) + strlen(cl[i]) + 1); - else - { - string = malloc(strlen(cl[i]) + 1); - string[0] = 0; - } - string[strlen(string) + strlen(cl[i])] = 0; - strcat(string, cl[i]); - } - } - XFreeStringList(cl); - } - } - if (data) - { - XFree(data); - } - } - return string; -} - -void -ecore_set_blank_pointer(Window w) -{ - Cursor c; - XColor cl; - Pixmap p, m; - GC gc; - XGCValues gcv; - - if (!disp) return; - if (w == 0) - w = default_root; - p = XCreatePixmap(disp, w, 1, 1, 1); - m = XCreatePixmap(disp, w, 1, 1, 1); - gc = XCreateGC(disp, m, 0, &gcv); - XSetForeground(disp, gc, 0); - XDrawPoint(disp, m, gc, 0, 0); - XFreeGC(disp, gc); - c = XCreatePixmapCursor(disp, p, m, &cl, &cl, 0, 0); - XDefineCursor(disp, w, c); - XFreeCursor(disp, c); - XFreePixmap(disp, p); - XFreePixmap(disp, m); -} - -Cursor -ecore_cursor_new(Pixmap pmap, Pixmap mask, int x, int y, int fr, int fg, int fb, - int br, int bg, int bb) -{ - XColor cl1, cl2; - - if (!disp) return 0; - cl1.pixel = 0; - cl1.red = fr << 8 | fr; - cl1.green = fg << 8 | fg; - cl1.blue = fb << 8 | fb; - cl1.flags = DoRed | DoGreen | DoBlue; - cl2.pixel = 0; - cl2.red = br << 8 | br; - cl2.green = bg << 8 | bg; - cl2.blue = bb << 8 | bb; - cl2.flags = DoRed | DoGreen | DoBlue; - return XCreatePixmapCursor(disp, pmap, mask, &cl1, &cl2, x, y); -} - -void -ecore_cursor_free(Cursor c) -{ - if (!disp) return; - XFreeCursor(disp, c); -} - -void -ecore_cursor_set(Window win, Cursor c) -{ - if (!disp) return; - if (win == 0) - win = default_root; - XDefineCursor(disp, win, c); -}