--- /dev/null
+The Rasterman (Carsten Haitzler) <raster@rasterman.com>
+
--- /dev/null
+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 and its Copyright notices. In addition publicly
+documented acknowledgment must be given that this software has been used if no
+source code of this software is made available publicly. This includes
+acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
+documents or any documentation provided with any product containing this
+software. This License does not apply to any software that links to the
+libraries provided by this software (statically or dynamically), but only to
+the software provided.
+
+Please see the COPYING.PLAIN for a plain-english explanation of this notice
+and it's intent.
+
+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.
--- /dev/null
+Plain English Copyright Notice
+
+This file is not intended to be the actual License. The reason this file
+exists is that we here are programmers and engineers. We aren't lawyers. We
+provide licenses that we THINK say the right things, but we have our own
+intentions at heart. This is a plain-english explanation of what those
+intentions are, and if you follow them you will be within the "spirit" of
+the license.
+
+The intent is for us to enjoy writing software that is useful to us (the
+AUTHORS) and allow others to use it freely and also benefit from the work we
+put into making it. We don't want to restrict others using it. They should
+not *HAVE* to make the source code of the applications they write that
+simply link to these libraries (be that statically or dynamically), or for
+them to be limited as to what license they choose to use (be it open, closed
+or anything else). But we would like to know you are using these libraries.
+We simply would like to know that it has been useful to someone. This is why
+we ask for acknowledgement of some sort.
+
+You can do what you want with the source of this software - it doesn't
+matter. We still have it here for ourselves and it is open and free to use
+and download and play with. It can't be taken away. We don't really mind what
+you do with the source to your software. We would simply like to know that
+you are using it - especially if it makes it to a commerical product. If you
+simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and
+then make sure you include a paragraph or page in the manual for the product
+with the copyright notice and state that you used this software, we will be
+very happy. If you want to contribute back modifications and fixes you may have
+made we will welcome those too with open arms (generally). If you want help
+with changes needed, ports needed or features to be added, arrangements can
+be easily made with some dialogue.
+
+Carsten Haitzler <raster@rasterman.com>
--- /dev/null
+COMPILING and INSTALLING:
+
+If you got a official release tar archive do:
+ ./configure
+
+( otherwise if you got this from enlightenment cvs do: ./autogen.sh )
+
+Then to compile:
+ make
+
+To install (run this as root, or the user who handles installs):
+ make install
+
+NOTE: You MUST make install Enlightenment for it to run properly.
--- /dev/null
+SUBDIRS = src data doc
+
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
+ config.h.in config.sub configure install-sh \
+ ltconfig ltmain.sh missing mkinstalldirs \
+ stamp-h.in acconfig.h
+
+bin_SCRIPTS = enlightenment-config
+
+EXTRA_DIST = README AUTHORS COPYING COPYING-PLAIN enlightenment.spec
--- /dev/null
+Enlightenment 0.17.0 - IN DEVELOPMENT... not a RELEASE.
--- /dev/null
+#!/bin/sh
+
+rm -rf autom4te.cache
+rm -f aclocal.m4
+
+echo "Running aclocal..."; aclocal $ACLOCAL_FLAGS -I m4 \
+&& echo "Running autoheader..."; autoheader \
+&& echo "Running autoconf..."; autoconf \
+&& echo "Running libtoolize..."; libtoolize --automake \
+&& echo "Running automake..."; automake --add-missing --copy --gnu
+
+### If you want this, uncomment it.
+./configure "$@"
--- /dev/null
+dnl Process this file with autoconf to produce a configure script.
+
+# get rid of that stupid cache mechanism
+rm -f config.cache
+
+AC_INIT(configure.in)
+AM_INIT_AUTOMAKE(enlightenment, 0.17.0_pre10)
+AM_CONFIG_HEADER(config.h)
+
+AC_ISC_POSIX
+AC_PROG_CC
+AM_PROG_CC_STDC
+AC_HEADER_STDC
+AC_C_CONST
+AM_ENABLE_SHARED
+AM_PROG_LIBTOOL
+
+if test "x${exec_prefix}" = "xNONE"; then
+ if test "x${prefix}" = "xNONE"; then
+ bindir="${ac_default_prefix}/bin";
+ else
+ bindir="${prefix}/bin";
+ fi
+else
+ if test "x${prefix}" = "xNONE"; then
+ bindir="${ac_default_prefix}/bin";
+ else
+ bindir="${prefix}/bin";
+ fi
+fi
+
+if test "x${exec_prefix}" = "xNONE"; then
+ if test "x${prefix}" = "xNONE"; then
+ libdir="${ac_default_prefix}/lib";
+ else
+ libdir="${prefix}/lib";
+ fi
+else
+ if test "x${prefix}" = "xNONE"; then
+ libdir="${ac_default_prefix}/lib";
+ else
+ libdir="${prefix}/lib";
+ fi
+fi
+
+dnl Set PACKAGE_BIN_DIR in config.h.
+if test "x${bindir}" = 'xNONE'; then
+ if test "x${prefix}" = "xNONE"; then
+ AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin", "Package installed binaries destination")
+ else
+ AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin", "Package installed binaries destination")
+ fi
+else
+ AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}", "Package installed binaries destination")
+fi
+
+dnl Set PACKAGE_LIB_DIR in config.h.
+if test "x${libdir}" = 'xNONE'; then
+ if test "x${prefix}" = "xNONE"; then
+ AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib", "Package installed libraries destination")
+ else
+ AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib", "Package installed libraries destination")
+ fi
+else
+ AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}", "Package installed libraries destination")
+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}", "Package installed data destination")
+ else
+ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}", "Package installed data destination")
+ fi
+else
+ AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}", "Package installed data destination")
+fi
+
+AC_CHECK_LIB(dl, dlopen, dlopen_libs=-ldl)
+AC_SUBST(dlopen_libs)
+
+AC_ARG_WITH(evas-config,
+[ --with-evas-config=EVAS_CONFIG use evas-config specified ],
+[
+ EVAS_CONFIG=$withval;
+ echo "using "$EVAS_CONFIG" for evas-config";
+],[
+ PROG="evas-config";
+ AC_PATH_PROG(EVAS_CONFIG, $PROG, "", $PATH)
+])
+evas_cflags=`$EVAS_CONFIG --cflags`
+evas_libs=`$EVAS_CONFIG --libs`
+
+AC_ARG_WITH(ecore-config,
+[ --with-ecore-config=ECORE_CONFIG use ecore-config specified ],
+[
+ ECORE_CONFIG=$withval;
+ echo "using "$ECORE_CONFIG" for ecore-config";
+],[
+ PROG="ecore-config";
+ AC_PATH_PROG(ECORE_CONFIG, $PROG, "", $PATH)
+])
+ecore_cflags=`$ECORE_CONFIG --cflags`
+ecore_libs=`$ECORE_CONFIG --libs`
+
+AC_ARG_WITH(edje-config,
+[ --with-edje-config=EDJE_CONFIG use edje-config specified ],
+[
+ EDJE_CONFIG=$withval;
+ echo "using "$EDJE_CONFIG" for edje-config";
+],[
+ PROG="edje-config";
+ AC_PATH_PROG(EDJE_CONFIG, $PROG, "", $PATH)
+])
+edje_cflags=`$EDJE_CONFIG --cflags`
+edje_libs=`$EDJE_CONFIG --libs`
+
+AC_ARG_WITH(eet-config,
+[ --with-eet-config=EET_CONFIG use eet-config specified ],
+[
+ EET_CONFIG=$withval;
+ echo "using "$EET_CONFIG" for eet-config";
+],[
+ PROG="eet-config";
+ AC_PATH_PROG(EET_CONFIG, $PROG, "", $PATH)
+])
+eet_cflags=`$EET_CONFIG --cflags`
+eet_libs=`$EET_CONFIG --libs`
+
+AC_ARG_WITH(embryo-config,
+[ --with-embryo-config=EMBRYO_CONFIG use embryo-config specified ],
+[
+ EMBRYO_CONFIG=$withval;
+ echo "using "$EMBRYO_CONFIG" for embryo-config";
+],[
+ PROG="embryo-config";
+ AC_PATH_PROG(EMBRYO_CONFIG, $PROG, "", $PATH)
+])
+embryo_cflags=`$EMBRYO_CONFIG --cflags`
+embryo_libs=`$EMBRYO_CONFIG --libs`
+
+e_libs=$evas_libs" "$ecore_libs" "$edje_libs" "$eet_libs" "$embryo_libs" "
+e_cflags=$evas_cflags" "$ecore_cflags" "$edje_cflags" "$eet_cflags" "$embryo_cflags" "
+AC_SUBST(e_libs)
+AC_SUBST(e_cflags)
+
+profile="FAST_PC"
+AC_ARG_WITH(profile,
+[ --with-profile=TARGET_PROFILE specify a target format profile of:
+ LOWRES_PDA, MEDIUMRES_PDA, HIRES_PDA,
+ SLOW_PC, MEDIUM_PC, FAST_PC ],
+[
+ v=$withval;
+ profile=$v
+ echo " Enlightenment build profile set to "$profile;
+],[
+ profile="FAST_PC"
+])
+EDJE_DEF="-DLOWRES_PDA=1 -DMEDIUMRES_PDA=2 -DHIRES_PDA=3 -DSLOW_PC=4 -DMEDIUM_PC=5 -DFAST_PC=6"
+EDJE_DEF=$EDJE_DEF" -DE17_PROFILE"=$profile
+AC_SUBST(EDJE_DEF)
+
+edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
+AC_ARG_WITH(edje-cc,
+[ --with-edje-cc=PATH specify a specific path to edje_cc],
+[
+ v=$withval;
+ edje_cc=$v
+ echo " Enlightenment edje_cc explicitly set to "$edje_cc;
+],[
+ edje_cc="`$EDJE_CONFIG --prefix`/bin/edje_cc"
+])
+AC_SUBST(edje_cc)
+
+AC_OUTPUT([
+Makefile
+src/Makefile
+src/lib/Makefile
+src/bin/Makefile
+src/modules/Makefile
+src/modules/test/Makefile
+src/modules/ibar/Makefile
+src/modules/dropshadow/Makefile
+data/Makefile
+data/fonts/Makefile
+data/images/Makefile
+data/init/Makefile
+data/init/images/Makefile
+data/themes/Makefile
+data/themes/images/Makefile
+data/other/Makefile
+doc/Makefile
+enlightenment-config
+],[
+chmod +x enlightenment-config
+])
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = fonts images init themes other
+
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+filesdir = $(datadir)/enlightenment/data/fonts
+files_DATA = \
+Vera.ttf \
+VeraBI.ttf \
+VeraBd.ttf \
+VeraIt.ttf \
+VeraMoBI.ttf \
+VeraMoBd.ttf \
+VeraMoIt.ttf \
+VeraMono.ttf \
+VeraSe.ttf \
+VeraSeBd.ttf \
+fonts.alias \
+fonts.dir
+
+EXTRA_DIST = $(files_DATA)
--- /dev/null
+Vera-Bold-Italic -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-ascii-0
+Vera-Normal -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Bold -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Italic -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-ascii-
+Vera-Mono-Bold-Italic -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-ascii-0
+Vera-Mono-Bold -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-ascii-0
+Vera-Mono-Italic -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-ascii-0
+Vera-Mono -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-ascii-0
+Vera-Serif -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera-Serif-Bold -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-ascii-0
+Vera -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
--- /dev/null
+50
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-ascii-0
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-fcd8859-15
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-1
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-15
+VeraBI.ttf -Bitstream-Bitstream Vera Sans-bold-i-normal--0-0-0-0-p-0-iso8859-9
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-ascii-0
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-fcd8859-15
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-1
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-15
+Vera.ttf -Bitstream-Bitstream Vera Sans-medium-r-normal--0-0-0-0-p-0-iso8859-9
+VeraBd.ttf -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-ascii-0
+VeraBd.ttf -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-fcd8859-15
+VeraBd.ttf -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-iso8859-1
+VeraBd.ttf -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-iso8859-15
+VeraBd.ttf -Bitstream-Bitstream Vera Sans-bold-r-normal--0-0-0-0-p-0-iso8859-9
+VeraIt.ttf -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-ascii-0
+VeraIt.ttf -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-fcd8859-15
+VeraIt.ttf -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-iso8859-1
+VeraIt.ttf -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-iso8859-15
+VeraIt.ttf -Bitstream-Bitstream Vera Sans-medium-i-normal--0-0-0-0-p-0-iso8859-9
+VeraMoBI.ttf -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-ascii-0
+VeraMoBI.ttf -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-fcd8859-15
+VeraMoBI.ttf -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-iso8859-1
+VeraMoBI.ttf -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-iso8859-15
+VeraMoBI.ttf -Bitstream-Bitstream Vera Sans Mono-bold-i-normal--0-0-0-0-m-0-iso8859-9
+VeraMoBd.ttf -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-ascii-0
+VeraMoBd.ttf -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-fcd8859-15
+VeraMoBd.ttf -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-iso8859-1
+VeraMoBd.ttf -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-iso8859-15
+VeraMoBd.ttf -Bitstream-Bitstream Vera Sans Mono-bold-r-normal--0-0-0-0-m-0-iso8859-9
+VeraMoIt.ttf -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-ascii-0
+VeraMoIt.ttf -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-fcd8859-15
+VeraMoIt.ttf -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-iso8859-1
+VeraMoIt.ttf -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-iso8859-15
+VeraMoIt.ttf -Bitstream-Bitstream Vera Sans Mono-medium-i-normal--0-0-0-0-m-0-iso8859-9
+VeraMono.ttf -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-ascii-0
+VeraMono.ttf -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-fcd8859-15
+VeraMono.ttf -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-iso8859-1
+VeraMono.ttf -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-iso8859-15
+VeraMono.ttf -Bitstream-Bitstream Vera Sans Mono-medium-r-normal--0-0-0-0-m-0-iso8859-9
+VeraSe.ttf -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-ascii-0
+VeraSe.ttf -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-fcd8859-15
+VeraSe.ttf -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-iso8859-1
+VeraSe.ttf -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-iso8859-15
+VeraSe.ttf -Bitstream-Bitstream Vera Serif-medium-r-normal--0-0-0-0-p-0-iso8859-9
+VeraSeBd.ttf -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-ascii-0
+VeraSeBd.ttf -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-fcd8859-15
+VeraSeBd.ttf -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-iso8859-1
+VeraSeBd.ttf -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-iso8859-15
+VeraSeBd.ttf -Bitstream-Bitstream Vera Serif-bold-r-normal--0-0-0-0-p-0-iso8859-9
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+filesdir = $(datadir)/enlightenment/data/images
+files_DATA = \
+button_in.png \
+button_out.png \
+e.png \
+error_bg.png \
+pointer.png
+
+EXTRA_DIST = $(files_DATA)
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = images
+
+EDJE_CC = @edje_cc@
+EDJE_FLAGS = \
+-v \
+-id $(top_srcdir)/data/init/images \
+-fd $(top_srcdir)/data/fonts \
+@EDJE_DEF@
+
+filesdir = $(datadir)/enlightenment/data/init
+files_DATA = \
+init.eet
+
+EXTRA_DIST = init.edc
+
+init.eet: Makefile init.edc
+ $(EDJE_CC) $(EDJE_FLAGS) \
+ $(top_srcdir)/data/init/init.edc \
+ $(top_builddir)/data/init/init.eet
+
+clean-local:
+ rm -f *.eet
+
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = \
+brushed.png \
+loop_eintro_121.png \
+loop_eintro_122.png \
+loop_eintro_123.png \
+loop_eintro_124.png \
+loop_eintro_125.png \
+loop_eintro_126.png \
+loop_eintro_127.png \
+loop_eintro_128.png \
+loop_eintro_129.png \
+loop_eintro_130.png \
+loop_eintro_131.png \
+loop_eintro_132.png \
+loop_eintro_133.png \
+loop_eintro_134.png \
+loop_eintro_135.png \
+loop_eintro_136.png \
+loop_eintro_137.png \
+loop_eintro_138.png \
+loop_eintro_139.png \
+loop_eintro_140.png \
+loop_eintro_141.png \
+loop_eintro_142.png \
+loop_eintro_143.png \
+loop_eintro_144.png \
+loop_eintro_145.png \
+loop_eintro_146.png \
+loop_eintro_147.png \
+loop_eintro_148.png \
+loop_eintro_149.png \
+loop_eintro_150.png \
+loop_eintro_151.png \
+loop_eintro_152.png \
+loop_eintro_153.png \
+loop_eintro_154.png \
+loop_eintro_155.png \
+loop_eintro_156.png \
+loop_eintro_157.png \
+loop_eintro_158.png \
+loop_eintro_159.png \
+loop_eintro_160.png \
+loop_eintro_161.png \
+loop_eintro_162.png \
+loop_eintro_163.png \
+loop_eintro_164.png \
+loop_eintro_165.png \
+loop_eintro_166.png \
+loop_eintro_167.png \
+loop_eintro_168.png \
+loop_eintro_169.png \
+loop_eintro_170.png \
+loop_eintro_171.png \
+loop_eintro_172.png \
+loop_eintro_173.png \
+loop_eintro_174.png \
+loop_eintro_175.png \
+loop_eintro_176.png \
+loop_eintro_177.png \
+loop_eintro_178.png \
+loop_eintro_179.png \
+loop_eintro_180.png \
+loop_eintro_181.png \
+loop_eintro_182.png \
+loop_eintro_183.png \
+loop_eintro_184.png \
+loop_eintro_185.png \
+loop_eintro_186.png \
+loop_eintro_187.png \
+loop_eintro_188.png \
+loop_eintro_189.png \
+loop_eintro_190.png \
+loop_eintro_191.png \
+loop_eintro_192.png \
+loop_eintro_193.png \
+loop_eintro_194.png \
+loop_eintro_195.png \
+loop_eintro_196.png \
+loop_eintro_197.png \
+loop_eintro_198.png \
+loop_eintro_199.png \
+loop_eintro_200.png \
+loop_eintro_201.png \
+loop_eintro_202.png \
+loop_eintro_203.png \
+loop_eintro_204.png \
+loop_eintro_205.png \
+loop_eintro_206.png \
+loop_eintro_207.png \
+loop_eintro_208.png \
+loop_eintro_209.png \
+loop_eintro_210.png \
+loop_eintro_211.png \
+loop_eintro_212.png \
+loop_eintro_213.png \
+loop_eintro_214.png \
+loop_eintro_215.png \
+loop_eintro_216.png \
+loop_eintro_217.png \
+loop_eintro_218.png \
+loop_eintro_219.png \
+loop_eintro_220.png \
+loop_eintro_221.png \
+loop_eintro_222.png \
+loop_eintro_223.png \
+loop_eintro_224.png \
+loop_eintro_225.png \
+loop_eintro_226.png \
+loop_eintro_227.png \
+loop_eintro_228.png \
+loop_eintro_229.png \
+loop_eintro_230.png \
+loop_eintro_231.png \
+loop_eintro_232.png \
+loop_eintro_233.png \
+loop_eintro_234.png \
+loop_eintro_235.png \
+loop_eintro_236.png \
+loop_eintro_237.png \
+loop_eintro_238.png \
+loop_eintro_239.png \
+loop_eintro_240.png \
+reflection_overlay.png \
+shadow.png \
+start_eintro_001.png \
+start_eintro_002.png \
+start_eintro_003.png \
+start_eintro_004.png \
+start_eintro_005.png \
+start_eintro_006.png \
+start_eintro_007.png \
+start_eintro_008.png \
+start_eintro_009.png \
+start_eintro_010.png \
+start_eintro_011.png \
+start_eintro_012.png \
+start_eintro_013.png \
+start_eintro_014.png \
+start_eintro_015.png \
+start_eintro_016.png \
+start_eintro_017.png \
+start_eintro_018.png \
+start_eintro_019.png \
+start_eintro_020.png \
+start_eintro_021.png \
+start_eintro_022.png \
+start_eintro_023.png \
+start_eintro_024.png \
+start_eintro_025.png \
+start_eintro_026.png \
+start_eintro_027.png \
+start_eintro_028.png \
+start_eintro_029.png \
+start_eintro_030.png \
+start_eintro_031.png \
+start_eintro_032.png \
+start_eintro_033.png \
+start_eintro_034.png \
+start_eintro_035.png \
+start_eintro_036.png \
+start_eintro_037.png \
+start_eintro_038.png \
+start_eintro_039.png \
+start_eintro_040.png \
+start_eintro_041.png \
+start_eintro_042.png \
+start_eintro_043.png \
+start_eintro_044.png \
+start_eintro_045.png \
+start_eintro_046.png \
+start_eintro_047.png \
+start_eintro_048.png \
+start_eintro_049.png \
+start_eintro_050.png \
+start_eintro_051.png \
+start_eintro_052.png \
+start_eintro_053.png \
+start_eintro_054.png \
+start_eintro_055.png \
+start_eintro_056.png \
+start_eintro_057.png \
+start_eintro_058.png \
+start_eintro_059.png \
+start_eintro_060.png \
+start_eintro_061.png \
+start_eintro_062.png \
+start_eintro_063.png \
+start_eintro_064.png \
+start_eintro_065.png \
+start_eintro_066.png \
+start_eintro_067.png \
+start_eintro_068.png \
+start_eintro_069.png \
+start_eintro_070.png \
+start_eintro_071.png \
+start_eintro_072.png \
+start_eintro_073.png \
+start_eintro_074.png \
+start_eintro_075.png \
+start_eintro_076.png \
+start_eintro_077.png \
+start_eintro_078.png \
+start_eintro_079.png \
+start_eintro_080.png \
+start_eintro_081.png \
+start_eintro_082.png \
+start_eintro_083.png \
+start_eintro_084.png \
+start_eintro_085.png \
+start_eintro_086.png \
+start_eintro_087.png \
+start_eintro_088.png \
+start_eintro_089.png \
+start_eintro_090.png \
+start_eintro_091.png \
+start_eintro_092.png \
+start_eintro_093.png \
+start_eintro_094.png \
+start_eintro_095.png \
+start_eintro_096.png \
+start_eintro_097.png \
+start_eintro_098.png \
+start_eintro_099.png \
+start_eintro_100.png \
+start_eintro_101.png \
+start_eintro_102.png \
+start_eintro_103.png \
+start_eintro_104.png \
+start_eintro_105.png \
+start_eintro_106.png \
+start_eintro_107.png \
+start_eintro_108.png \
+start_eintro_109.png \
+start_eintro_110.png \
+start_eintro_111.png \
+start_eintro_112.png \
+start_eintro_113.png \
+start_eintro_114.png \
+start_eintro_115.png \
+start_eintro_116.png \
+start_eintro_117.png \
+start_eintro_118.png \
+start_eintro_119.png \
+start_eintro_120.png \
+sm_loop_eintro_121.png \
+sm_loop_eintro_122.png \
+sm_loop_eintro_123.png \
+sm_loop_eintro_124.png \
+sm_loop_eintro_125.png \
+sm_loop_eintro_126.png \
+sm_loop_eintro_127.png \
+sm_loop_eintro_128.png \
+sm_loop_eintro_129.png \
+sm_loop_eintro_130.png \
+sm_loop_eintro_131.png \
+sm_loop_eintro_132.png \
+sm_loop_eintro_133.png \
+sm_loop_eintro_134.png \
+sm_loop_eintro_135.png \
+sm_loop_eintro_136.png \
+sm_loop_eintro_137.png \
+sm_loop_eintro_138.png \
+sm_loop_eintro_139.png \
+sm_loop_eintro_140.png \
+sm_loop_eintro_141.png \
+sm_loop_eintro_142.png \
+sm_loop_eintro_143.png \
+sm_loop_eintro_144.png \
+sm_loop_eintro_145.png \
+sm_loop_eintro_146.png \
+sm_loop_eintro_147.png \
+sm_loop_eintro_148.png \
+sm_loop_eintro_149.png \
+sm_loop_eintro_150.png \
+sm_loop_eintro_151.png \
+sm_loop_eintro_152.png \
+sm_loop_eintro_153.png \
+sm_loop_eintro_154.png \
+sm_loop_eintro_155.png \
+sm_loop_eintro_156.png \
+sm_loop_eintro_157.png \
+sm_loop_eintro_158.png \
+sm_loop_eintro_159.png \
+sm_loop_eintro_160.png \
+sm_loop_eintro_161.png \
+sm_loop_eintro_162.png \
+sm_loop_eintro_163.png \
+sm_loop_eintro_164.png \
+sm_loop_eintro_165.png \
+sm_loop_eintro_166.png \
+sm_loop_eintro_167.png \
+sm_loop_eintro_168.png \
+sm_loop_eintro_169.png \
+sm_loop_eintro_170.png \
+sm_loop_eintro_171.png \
+sm_loop_eintro_172.png \
+sm_loop_eintro_173.png \
+sm_loop_eintro_174.png \
+sm_loop_eintro_175.png \
+sm_loop_eintro_176.png \
+sm_loop_eintro_177.png \
+sm_loop_eintro_178.png \
+sm_loop_eintro_179.png \
+sm_loop_eintro_180.png \
+sm_loop_eintro_181.png \
+sm_loop_eintro_182.png \
+sm_loop_eintro_183.png \
+sm_loop_eintro_184.png \
+sm_loop_eintro_185.png \
+sm_loop_eintro_186.png \
+sm_loop_eintro_187.png \
+sm_loop_eintro_188.png \
+sm_loop_eintro_189.png \
+sm_loop_eintro_190.png \
+sm_loop_eintro_191.png \
+sm_loop_eintro_192.png \
+sm_loop_eintro_193.png \
+sm_loop_eintro_194.png \
+sm_loop_eintro_195.png \
+sm_loop_eintro_196.png \
+sm_loop_eintro_197.png \
+sm_loop_eintro_198.png \
+sm_loop_eintro_199.png \
+sm_loop_eintro_200.png \
+sm_loop_eintro_201.png \
+sm_loop_eintro_202.png \
+sm_loop_eintro_203.png \
+sm_loop_eintro_204.png \
+sm_loop_eintro_205.png \
+sm_loop_eintro_206.png \
+sm_loop_eintro_207.png \
+sm_loop_eintro_208.png \
+sm_loop_eintro_209.png \
+sm_loop_eintro_210.png \
+sm_loop_eintro_211.png \
+sm_loop_eintro_212.png \
+sm_loop_eintro_213.png \
+sm_loop_eintro_214.png \
+sm_loop_eintro_215.png \
+sm_loop_eintro_216.png \
+sm_loop_eintro_217.png \
+sm_loop_eintro_218.png \
+sm_loop_eintro_219.png \
+sm_loop_eintro_220.png \
+sm_loop_eintro_221.png \
+sm_loop_eintro_222.png \
+sm_loop_eintro_223.png \
+sm_loop_eintro_224.png \
+sm_loop_eintro_225.png \
+sm_loop_eintro_226.png \
+sm_loop_eintro_227.png \
+sm_loop_eintro_228.png \
+sm_loop_eintro_229.png \
+sm_loop_eintro_230.png \
+sm_loop_eintro_231.png \
+sm_loop_eintro_232.png \
+sm_loop_eintro_233.png \
+sm_loop_eintro_234.png \
+sm_loop_eintro_235.png \
+sm_loop_eintro_236.png \
+sm_loop_eintro_237.png \
+sm_loop_eintro_238.png \
+sm_loop_eintro_239.png \
+sm_loop_eintro_240.png \
+sm_reflection_overlay.png \
+sm_shadow.png \
+sm_start_eintro_001.png \
+sm_start_eintro_002.png \
+sm_start_eintro_003.png \
+sm_start_eintro_004.png \
+sm_start_eintro_005.png \
+sm_start_eintro_006.png \
+sm_start_eintro_007.png \
+sm_start_eintro_008.png \
+sm_start_eintro_009.png \
+sm_start_eintro_010.png \
+sm_start_eintro_011.png \
+sm_start_eintro_012.png \
+sm_start_eintro_013.png \
+sm_start_eintro_014.png \
+sm_start_eintro_015.png \
+sm_start_eintro_016.png \
+sm_start_eintro_017.png \
+sm_start_eintro_018.png \
+sm_start_eintro_019.png \
+sm_start_eintro_020.png \
+sm_start_eintro_021.png \
+sm_start_eintro_022.png \
+sm_start_eintro_023.png \
+sm_start_eintro_024.png \
+sm_start_eintro_025.png \
+sm_start_eintro_026.png \
+sm_start_eintro_027.png \
+sm_start_eintro_028.png \
+sm_start_eintro_029.png \
+sm_start_eintro_030.png \
+sm_start_eintro_031.png \
+sm_start_eintro_032.png \
+sm_start_eintro_033.png \
+sm_start_eintro_034.png \
+sm_start_eintro_035.png \
+sm_start_eintro_036.png \
+sm_start_eintro_037.png \
+sm_start_eintro_038.png \
+sm_start_eintro_039.png \
+sm_start_eintro_040.png \
+sm_start_eintro_041.png \
+sm_start_eintro_042.png \
+sm_start_eintro_043.png \
+sm_start_eintro_044.png \
+sm_start_eintro_045.png \
+sm_start_eintro_046.png \
+sm_start_eintro_047.png \
+sm_start_eintro_048.png \
+sm_start_eintro_049.png \
+sm_start_eintro_050.png \
+sm_start_eintro_051.png \
+sm_start_eintro_052.png \
+sm_start_eintro_053.png \
+sm_start_eintro_054.png \
+sm_start_eintro_055.png \
+sm_start_eintro_056.png \
+sm_start_eintro_057.png \
+sm_start_eintro_058.png \
+sm_start_eintro_059.png \
+sm_start_eintro_060.png \
+sm_start_eintro_061.png \
+sm_start_eintro_062.png \
+sm_start_eintro_063.png \
+sm_start_eintro_064.png \
+sm_start_eintro_065.png \
+sm_start_eintro_066.png \
+sm_start_eintro_067.png \
+sm_start_eintro_068.png \
+sm_start_eintro_069.png \
+sm_start_eintro_070.png \
+sm_start_eintro_071.png \
+sm_start_eintro_072.png \
+sm_start_eintro_073.png \
+sm_start_eintro_074.png \
+sm_start_eintro_075.png \
+sm_start_eintro_076.png \
+sm_start_eintro_077.png \
+sm_start_eintro_078.png \
+sm_start_eintro_079.png \
+sm_start_eintro_080.png \
+sm_start_eintro_081.png \
+sm_start_eintro_082.png \
+sm_start_eintro_083.png \
+sm_start_eintro_084.png \
+sm_start_eintro_085.png \
+sm_start_eintro_086.png \
+sm_start_eintro_087.png \
+sm_start_eintro_088.png \
+sm_start_eintro_089.png \
+sm_start_eintro_090.png \
+sm_start_eintro_091.png \
+sm_start_eintro_092.png \
+sm_start_eintro_093.png \
+sm_start_eintro_094.png \
+sm_start_eintro_095.png \
+sm_start_eintro_096.png \
+sm_start_eintro_097.png \
+sm_start_eintro_098.png \
+sm_start_eintro_099.png \
+sm_start_eintro_100.png \
+sm_start_eintro_101.png \
+sm_start_eintro_102.png \
+sm_start_eintro_103.png \
+sm_start_eintro_104.png \
+sm_start_eintro_105.png \
+sm_start_eintro_106.png \
+sm_start_eintro_107.png \
+sm_start_eintro_108.png \
+sm_start_eintro_109.png \
+sm_start_eintro_110.png \
+sm_start_eintro_111.png \
+sm_start_eintro_112.png \
+sm_start_eintro_113.png \
+sm_start_eintro_114.png \
+sm_start_eintro_115.png \
+sm_start_eintro_116.png \
+sm_start_eintro_117.png \
+sm_start_eintro_118.png \
+sm_start_eintro_119.png \
+sm_start_eintro_120.png
--- /dev/null
+#ifdef E17_PROFILE
+# if E17_PROFILE == LOWRES_PDA
+# define SM "sm_"
+# define FRAME LOSSY 30
+# define LOGOSZ 160 120
+# define TSIZE 12
+# define SSIZE 8
+# define VSIZE 6
+# elif E17_PROFILE == MEDIUMRES_PDA
+# define SM "sm_"
+# define FRAME LOSSY 70
+# define LOGOSZ 240 180
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+# elif E17_PROFILE == HIRES_PDA
+# define SM "sm_"
+# define FRAME LOSSY 70
+# define LOGOSZ 320 240
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+# elif E17_PROFILE == SLOW_PC
+# define HALFFRAMES
+# define SM
+# define FRAME LOSSY 90
+# define LOGOSZ 320 240
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+# elif E17_PROFILE == MEDIUM_PC
+# define HALFFRAMES
+# define SM
+# define FRAME LOSSY 90
+# define LOGOSZ 640 480
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+# elif E17_PROFILE == FAST_PC
+# define ALLFRAMES
+# define SM
+# define FRAME LOSSY 90
+# define LOGOSZ 640 480
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+# endif
+#else
+# define ALLFRAMES
+# define SM
+# define FRAME LOSSY 90
+# define LOGOSZ 640 480
+# define TSIZE 16
+# define SSIZE 10
+# define VSIZE 10
+#endif
+
+fonts {
+ font: "Vera.ttf" "Edje Vera";
+ font: "VeraBd.ttf" "Edje Vera Bold";
+}
+
+images {
+ image: "brushed.png" COMP;
+ image: SM"shadow.png" LOSSY 70;
+ image: SM"reflection_overlay.png" LOSSY 70;
+
+#ifdef ALLFRAMES
+ image: SM"start_eintro_001.png" FRAME;
+ image: SM"start_eintro_002.png" FRAME;
+ image: SM"start_eintro_003.png" FRAME;
+ image: SM"start_eintro_004.png" FRAME;
+ image: SM"start_eintro_005.png" FRAME;
+ image: SM"start_eintro_006.png" FRAME;
+ image: SM"start_eintro_007.png" FRAME;
+ image: SM"start_eintro_008.png" FRAME;
+ image: SM"start_eintro_009.png" FRAME;
+ image: SM"start_eintro_010.png" FRAME;
+ image: SM"start_eintro_011.png" FRAME;
+ image: SM"start_eintro_012.png" FRAME;
+ image: SM"start_eintro_013.png" FRAME;
+ image: SM"start_eintro_014.png" FRAME;
+ image: SM"start_eintro_015.png" FRAME;
+ image: SM"start_eintro_016.png" FRAME;
+ image: SM"start_eintro_017.png" FRAME;
+ image: SM"start_eintro_018.png" FRAME;
+ image: SM"start_eintro_019.png" FRAME;
+ image: SM"start_eintro_020.png" FRAME;
+ image: SM"start_eintro_021.png" FRAME;
+ image: SM"start_eintro_022.png" FRAME;
+ image: SM"start_eintro_023.png" FRAME;
+ image: SM"start_eintro_024.png" FRAME;
+ image: SM"start_eintro_025.png" FRAME;
+ image: SM"start_eintro_026.png" FRAME;
+ image: SM"start_eintro_027.png" FRAME;
+ image: SM"start_eintro_028.png" FRAME;
+ image: SM"start_eintro_029.png" FRAME;
+ image: SM"start_eintro_030.png" FRAME;
+ image: SM"start_eintro_031.png" FRAME;
+ image: SM"start_eintro_032.png" FRAME;
+ image: SM"start_eintro_033.png" FRAME;
+ image: SM"start_eintro_034.png" FRAME;
+ image: SM"start_eintro_035.png" FRAME;
+ image: SM"start_eintro_036.png" FRAME;
+ image: SM"start_eintro_037.png" FRAME;
+ image: SM"start_eintro_038.png" FRAME;
+ image: SM"start_eintro_039.png" FRAME;
+ image: SM"start_eintro_040.png" FRAME;
+ image: SM"start_eintro_041.png" FRAME;
+ image: SM"start_eintro_042.png" FRAME;
+ image: SM"start_eintro_043.png" FRAME;
+ image: SM"start_eintro_044.png" FRAME;
+ image: SM"start_eintro_045.png" FRAME;
+ image: SM"start_eintro_046.png" FRAME;
+ image: SM"start_eintro_047.png" FRAME;
+ image: SM"start_eintro_048.png" FRAME;
+ image: SM"start_eintro_049.png" FRAME;
+ image: SM"start_eintro_050.png" FRAME;
+ image: SM"start_eintro_051.png" FRAME;
+ image: SM"start_eintro_052.png" FRAME;
+ image: SM"start_eintro_053.png" FRAME;
+ image: SM"start_eintro_054.png" FRAME;
+ image: SM"start_eintro_055.png" FRAME;
+ image: SM"start_eintro_056.png" FRAME;
+ image: SM"start_eintro_057.png" FRAME;
+ image: SM"start_eintro_058.png" FRAME;
+ image: SM"start_eintro_059.png" FRAME;
+ image: SM"start_eintro_060.png" FRAME;
+ image: SM"start_eintro_061.png" FRAME;
+ image: SM"start_eintro_062.png" FRAME;
+ image: SM"start_eintro_063.png" FRAME;
+ image: SM"start_eintro_064.png" FRAME;
+ image: SM"start_eintro_065.png" FRAME;
+ image: SM"start_eintro_066.png" FRAME;
+ image: SM"start_eintro_067.png" FRAME;
+ image: SM"start_eintro_068.png" FRAME;
+ image: SM"start_eintro_069.png" FRAME;
+ image: SM"start_eintro_070.png" FRAME;
+ image: SM"start_eintro_071.png" FRAME;
+ image: SM"start_eintro_072.png" FRAME;
+ image: SM"start_eintro_073.png" FRAME;
+ image: SM"start_eintro_074.png" FRAME;
+ image: SM"start_eintro_075.png" FRAME;
+ image: SM"start_eintro_076.png" FRAME;
+ image: SM"start_eintro_077.png" FRAME;
+ image: SM"start_eintro_078.png" FRAME;
+ image: SM"start_eintro_079.png" FRAME;
+ image: SM"start_eintro_080.png" FRAME;
+ image: SM"start_eintro_081.png" FRAME;
+ image: SM"start_eintro_082.png" FRAME;
+ image: SM"start_eintro_083.png" FRAME;
+ image: SM"start_eintro_084.png" FRAME;
+ image: SM"start_eintro_085.png" FRAME;
+ image: SM"start_eintro_086.png" FRAME;
+ image: SM"start_eintro_087.png" FRAME;
+ image: SM"start_eintro_088.png" FRAME;
+ image: SM"start_eintro_089.png" FRAME;
+ image: SM"start_eintro_090.png" FRAME;
+ image: SM"start_eintro_091.png" FRAME;
+ image: SM"start_eintro_092.png" FRAME;
+ image: SM"start_eintro_093.png" FRAME;
+ image: SM"start_eintro_094.png" FRAME;
+ image: SM"start_eintro_095.png" FRAME;
+ image: SM"start_eintro_096.png" FRAME;
+ image: SM"start_eintro_097.png" FRAME;
+ image: SM"start_eintro_098.png" FRAME;
+ image: SM"start_eintro_099.png" FRAME;
+ image: SM"start_eintro_100.png" FRAME;
+ image: SM"start_eintro_101.png" FRAME;
+ image: SM"start_eintro_102.png" FRAME;
+ image: SM"start_eintro_103.png" FRAME;
+ image: SM"start_eintro_104.png" FRAME;
+ image: SM"start_eintro_105.png" FRAME;
+ image: SM"start_eintro_106.png" FRAME;
+ image: SM"start_eintro_107.png" FRAME;
+ image: SM"start_eintro_108.png" FRAME;
+ image: SM"start_eintro_109.png" FRAME;
+ image: SM"start_eintro_110.png" FRAME;
+ image: SM"start_eintro_111.png" FRAME;
+ image: SM"start_eintro_112.png" FRAME;
+ image: SM"start_eintro_113.png" FRAME;
+ image: SM"start_eintro_114.png" FRAME;
+ image: SM"start_eintro_115.png" FRAME;
+ image: SM"start_eintro_116.png" FRAME;
+ image: SM"start_eintro_117.png" FRAME;
+ image: SM"start_eintro_118.png" FRAME;
+ image: SM"start_eintro_119.png" FRAME;
+ image: SM"start_eintro_120.png" FRAME;
+ image: SM"loop_eintro_121.png" FRAME;
+ image: SM"loop_eintro_122.png" FRAME;
+ image: SM"loop_eintro_123.png" FRAME;
+ image: SM"loop_eintro_124.png" FRAME;
+ image: SM"loop_eintro_125.png" FRAME;
+ image: SM"loop_eintro_126.png" FRAME;
+ image: SM"loop_eintro_127.png" FRAME;
+ image: SM"loop_eintro_128.png" FRAME;
+ image: SM"loop_eintro_129.png" FRAME;
+ image: SM"loop_eintro_130.png" FRAME;
+ image: SM"loop_eintro_131.png" FRAME;
+ image: SM"loop_eintro_132.png" FRAME;
+ image: SM"loop_eintro_133.png" FRAME;
+ image: SM"loop_eintro_134.png" FRAME;
+ image: SM"loop_eintro_135.png" FRAME;
+ image: SM"loop_eintro_136.png" FRAME;
+ image: SM"loop_eintro_137.png" FRAME;
+ image: SM"loop_eintro_138.png" FRAME;
+ image: SM"loop_eintro_139.png" FRAME;
+ image: SM"loop_eintro_140.png" FRAME;
+ image: SM"loop_eintro_141.png" FRAME;
+ image: SM"loop_eintro_142.png" FRAME;
+ image: SM"loop_eintro_143.png" FRAME;
+ image: SM"loop_eintro_144.png" FRAME;
+ image: SM"loop_eintro_145.png" FRAME;
+ image: SM"loop_eintro_146.png" FRAME;
+ image: SM"loop_eintro_147.png" FRAME;
+ image: SM"loop_eintro_148.png" FRAME;
+ image: SM"loop_eintro_149.png" FRAME;
+ image: SM"loop_eintro_150.png" FRAME;
+ image: SM"loop_eintro_151.png" FRAME;
+ image: SM"loop_eintro_152.png" FRAME;
+ image: SM"loop_eintro_153.png" FRAME;
+ image: SM"loop_eintro_154.png" FRAME;
+ image: SM"loop_eintro_155.png" FRAME;
+ image: SM"loop_eintro_156.png" FRAME;
+ image: SM"loop_eintro_157.png" FRAME;
+ image: SM"loop_eintro_158.png" FRAME;
+ image: SM"loop_eintro_159.png" FRAME;
+ image: SM"loop_eintro_160.png" FRAME;
+ image: SM"loop_eintro_161.png" FRAME;
+ image: SM"loop_eintro_162.png" FRAME;
+ image: SM"loop_eintro_163.png" FRAME;
+ image: SM"loop_eintro_164.png" FRAME;
+ image: SM"loop_eintro_165.png" FRAME;
+ image: SM"loop_eintro_166.png" FRAME;
+ image: SM"loop_eintro_167.png" FRAME;
+ image: SM"loop_eintro_168.png" FRAME;
+ image: SM"loop_eintro_169.png" FRAME;
+ image: SM"loop_eintro_170.png" FRAME;
+ image: SM"loop_eintro_171.png" FRAME;
+ image: SM"loop_eintro_172.png" FRAME;
+ image: SM"loop_eintro_173.png" FRAME;
+ image: SM"loop_eintro_174.png" FRAME;
+ image: SM"loop_eintro_175.png" FRAME;
+ image: SM"loop_eintro_176.png" FRAME;
+ image: SM"loop_eintro_177.png" FRAME;
+ image: SM"loop_eintro_178.png" FRAME;
+ image: SM"loop_eintro_179.png" FRAME;
+ image: SM"loop_eintro_180.png" FRAME;
+ image: SM"loop_eintro_181.png" FRAME;
+ image: SM"loop_eintro_182.png" FRAME;
+ image: SM"loop_eintro_183.png" FRAME;
+ image: SM"loop_eintro_184.png" FRAME;
+ image: SM"loop_eintro_185.png" FRAME;
+ image: SM"loop_eintro_186.png" FRAME;
+ image: SM"loop_eintro_187.png" FRAME;
+ image: SM"loop_eintro_188.png" FRAME;
+ image: SM"loop_eintro_189.png" FRAME;
+ image: SM"loop_eintro_190.png" FRAME;
+ image: SM"loop_eintro_191.png" FRAME;
+ image: SM"loop_eintro_192.png" FRAME;
+ image: SM"loop_eintro_193.png" FRAME;
+ image: SM"loop_eintro_194.png" FRAME;
+ image: SM"loop_eintro_195.png" FRAME;
+ image: SM"loop_eintro_196.png" FRAME;
+ image: SM"loop_eintro_197.png" FRAME;
+ image: SM"loop_eintro_198.png" FRAME;
+ image: SM"loop_eintro_199.png" FRAME;
+ image: SM"loop_eintro_200.png" FRAME;
+ image: SM"loop_eintro_201.png" FRAME;
+ image: SM"loop_eintro_202.png" FRAME;
+ image: SM"loop_eintro_203.png" FRAME;
+ image: SM"loop_eintro_204.png" FRAME;
+ image: SM"loop_eintro_205.png" FRAME;
+ image: SM"loop_eintro_206.png" FRAME;
+ image: SM"loop_eintro_207.png" FRAME;
+ image: SM"loop_eintro_208.png" FRAME;
+ image: SM"loop_eintro_209.png" FRAME;
+ image: SM"loop_eintro_210.png" FRAME;
+ image: SM"loop_eintro_211.png" FRAME;
+ image: SM"loop_eintro_212.png" FRAME;
+ image: SM"loop_eintro_213.png" FRAME;
+ image: SM"loop_eintro_214.png" FRAME;
+ image: SM"loop_eintro_215.png" FRAME;
+ image: SM"loop_eintro_216.png" FRAME;
+ image: SM"loop_eintro_217.png" FRAME;
+ image: SM"loop_eintro_218.png" FRAME;
+ image: SM"loop_eintro_219.png" FRAME;
+ image: SM"loop_eintro_220.png" FRAME;
+ image: SM"loop_eintro_221.png" FRAME;
+ image: SM"loop_eintro_222.png" FRAME;
+ image: SM"loop_eintro_223.png" FRAME;
+ image: SM"loop_eintro_224.png" FRAME;
+ image: SM"loop_eintro_225.png" FRAME;
+ image: SM"loop_eintro_226.png" FRAME;
+ image: SM"loop_eintro_227.png" FRAME;
+ image: SM"loop_eintro_228.png" FRAME;
+ image: SM"loop_eintro_229.png" FRAME;
+ image: SM"loop_eintro_230.png" FRAME;
+ image: SM"loop_eintro_231.png" FRAME;
+ image: SM"loop_eintro_232.png" FRAME;
+ image: SM"loop_eintro_233.png" FRAME;
+ image: SM"loop_eintro_234.png" FRAME;
+ image: SM"loop_eintro_235.png" FRAME;
+ image: SM"loop_eintro_236.png" FRAME;
+ image: SM"loop_eintro_237.png" FRAME;
+ image: SM"loop_eintro_238.png" FRAME;
+ image: SM"loop_eintro_239.png" FRAME;
+ image: SM"loop_eintro_240.png" FRAME;
+#else
+#ifdef HALFFRAMES
+ image: SM"start_eintro_001.png" FRAME;
+ image: SM"start_eintro_003.png" FRAME;
+ image: SM"start_eintro_005.png" FRAME;
+ image: SM"start_eintro_007.png" FRAME;
+ image: SM"start_eintro_009.png" FRAME;
+ image: SM"start_eintro_011.png" FRAME;
+ image: SM"start_eintro_013.png" FRAME;
+ image: SM"start_eintro_015.png" FRAME;
+ image: SM"start_eintro_017.png" FRAME;
+ image: SM"start_eintro_019.png" FRAME;
+ image: SM"start_eintro_021.png" FRAME;
+ image: SM"start_eintro_023.png" FRAME;
+ image: SM"start_eintro_025.png" FRAME;
+ image: SM"start_eintro_027.png" FRAME;
+ image: SM"start_eintro_029.png" FRAME;
+ image: SM"start_eintro_031.png" FRAME;
+ image: SM"start_eintro_033.png" FRAME;
+ image: SM"start_eintro_035.png" FRAME;
+ image: SM"start_eintro_037.png" FRAME;
+ image: SM"start_eintro_039.png" FRAME;
+ image: SM"start_eintro_041.png" FRAME;
+ image: SM"start_eintro_043.png" FRAME;
+ image: SM"start_eintro_045.png" FRAME;
+ image: SM"start_eintro_047.png" FRAME;
+ image: SM"start_eintro_049.png" FRAME;
+ image: SM"start_eintro_051.png" FRAME;
+ image: SM"start_eintro_053.png" FRAME;
+ image: SM"start_eintro_055.png" FRAME;
+ image: SM"start_eintro_057.png" FRAME;
+ image: SM"start_eintro_059.png" FRAME;
+ image: SM"start_eintro_061.png" FRAME;
+ image: SM"start_eintro_063.png" FRAME;
+ image: SM"start_eintro_065.png" FRAME;
+ image: SM"start_eintro_067.png" FRAME;
+ image: SM"start_eintro_069.png" FRAME;
+ image: SM"start_eintro_071.png" FRAME;
+ image: SM"start_eintro_073.png" FRAME;
+ image: SM"start_eintro_075.png" FRAME;
+ image: SM"start_eintro_077.png" FRAME;
+ image: SM"start_eintro_079.png" FRAME;
+ image: SM"start_eintro_081.png" FRAME;
+ image: SM"start_eintro_083.png" FRAME;
+ image: SM"start_eintro_085.png" FRAME;
+ image: SM"start_eintro_087.png" FRAME;
+ image: SM"start_eintro_089.png" FRAME;
+ image: SM"start_eintro_091.png" FRAME;
+ image: SM"start_eintro_093.png" FRAME;
+ image: SM"start_eintro_095.png" FRAME;
+ image: SM"start_eintro_097.png" FRAME;
+ image: SM"start_eintro_099.png" FRAME;
+ image: SM"start_eintro_101.png" FRAME;
+ image: SM"start_eintro_103.png" FRAME;
+ image: SM"start_eintro_105.png" FRAME;
+ image: SM"start_eintro_107.png" FRAME;
+ image: SM"start_eintro_109.png" FRAME;
+ image: SM"start_eintro_111.png" FRAME;
+ image: SM"start_eintro_113.png" FRAME;
+ image: SM"start_eintro_115.png" FRAME;
+ image: SM"start_eintro_117.png" FRAME;
+ image: SM"start_eintro_119.png" FRAME;
+ image: SM"loop_eintro_121.png" FRAME;
+ image: SM"loop_eintro_123.png" FRAME;
+ image: SM"loop_eintro_125.png" FRAME;
+ image: SM"loop_eintro_127.png" FRAME;
+ image: SM"loop_eintro_129.png" FRAME;
+ image: SM"loop_eintro_131.png" FRAME;
+ image: SM"loop_eintro_133.png" FRAME;
+ image: SM"loop_eintro_135.png" FRAME;
+ image: SM"loop_eintro_137.png" FRAME;
+ image: SM"loop_eintro_139.png" FRAME;
+ image: SM"loop_eintro_141.png" FRAME;
+ image: SM"loop_eintro_143.png" FRAME;
+ image: SM"loop_eintro_145.png" FRAME;
+ image: SM"loop_eintro_147.png" FRAME;
+ image: SM"loop_eintro_149.png" FRAME;
+ image: SM"loop_eintro_151.png" FRAME;
+ image: SM"loop_eintro_153.png" FRAME;
+ image: SM"loop_eintro_155.png" FRAME;
+ image: SM"loop_eintro_157.png" FRAME;
+ image: SM"loop_eintro_159.png" FRAME;
+ image: SM"loop_eintro_161.png" FRAME;
+ image: SM"loop_eintro_163.png" FRAME;
+ image: SM"loop_eintro_165.png" FRAME;
+ image: SM"loop_eintro_167.png" FRAME;
+ image: SM"loop_eintro_169.png" FRAME;
+ image: SM"loop_eintro_171.png" FRAME;
+ image: SM"loop_eintro_173.png" FRAME;
+ image: SM"loop_eintro_175.png" FRAME;
+ image: SM"loop_eintro_177.png" FRAME;
+ image: SM"loop_eintro_179.png" FRAME;
+ image: SM"loop_eintro_181.png" FRAME;
+ image: SM"loop_eintro_183.png" FRAME;
+ image: SM"loop_eintro_185.png" FRAME;
+ image: SM"loop_eintro_187.png" FRAME;
+ image: SM"loop_eintro_189.png" FRAME;
+ image: SM"loop_eintro_191.png" FRAME;
+ image: SM"loop_eintro_193.png" FRAME;
+ image: SM"loop_eintro_195.png" FRAME;
+ image: SM"loop_eintro_197.png" FRAME;
+ image: SM"loop_eintro_199.png" FRAME;
+ image: SM"loop_eintro_201.png" FRAME;
+ image: SM"loop_eintro_203.png" FRAME;
+ image: SM"loop_eintro_205.png" FRAME;
+ image: SM"loop_eintro_207.png" FRAME;
+ image: SM"loop_eintro_209.png" FRAME;
+ image: SM"loop_eintro_211.png" FRAME;
+ image: SM"loop_eintro_213.png" FRAME;
+ image: SM"loop_eintro_215.png" FRAME;
+ image: SM"loop_eintro_217.png" FRAME;
+ image: SM"loop_eintro_219.png" FRAME;
+ image: SM"loop_eintro_221.png" FRAME;
+ image: SM"loop_eintro_223.png" FRAME;
+ image: SM"loop_eintro_225.png" FRAME;
+ image: SM"loop_eintro_227.png" FRAME;
+ image: SM"loop_eintro_229.png" FRAME;
+ image: SM"loop_eintro_231.png" FRAME;
+ image: SM"loop_eintro_233.png" FRAME;
+ image: SM"loop_eintro_235.png" FRAME;
+ image: SM"loop_eintro_237.png" FRAME;
+ image: SM"loop_eintro_239.png" FRAME;
+#else
+ image: SM"start_eintro_001.png" FRAME;
+ image: SM"start_eintro_005.png" FRAME;
+ image: SM"start_eintro_009.png" FRAME;
+ image: SM"start_eintro_013.png" FRAME;
+ image: SM"start_eintro_017.png" FRAME;
+ image: SM"start_eintro_021.png" FRAME;
+ image: SM"start_eintro_025.png" FRAME;
+ image: SM"start_eintro_029.png" FRAME;
+ image: SM"start_eintro_033.png" FRAME;
+ image: SM"start_eintro_037.png" FRAME;
+ image: SM"start_eintro_041.png" FRAME;
+ image: SM"start_eintro_045.png" FRAME;
+ image: SM"start_eintro_049.png" FRAME;
+ image: SM"start_eintro_053.png" FRAME;
+ image: SM"start_eintro_057.png" FRAME;
+ image: SM"start_eintro_061.png" FRAME;
+ image: SM"start_eintro_065.png" FRAME;
+ image: SM"start_eintro_069.png" FRAME;
+ image: SM"start_eintro_073.png" FRAME;
+ image: SM"start_eintro_077.png" FRAME;
+ image: SM"start_eintro_081.png" FRAME;
+ image: SM"start_eintro_085.png" FRAME;
+ image: SM"start_eintro_089.png" FRAME;
+ image: SM"start_eintro_093.png" FRAME;
+ image: SM"start_eintro_097.png" FRAME;
+ image: SM"start_eintro_101.png" FRAME;
+ image: SM"start_eintro_105.png" FRAME;
+ image: SM"start_eintro_109.png" FRAME;
+ image: SM"start_eintro_113.png" FRAME;
+ image: SM"start_eintro_117.png" FRAME;
+ image: SM"loop_eintro_121.png" FRAME;
+ image: SM"loop_eintro_125.png" FRAME;
+ image: SM"loop_eintro_129.png" FRAME;
+ image: SM"loop_eintro_133.png" FRAME;
+ image: SM"loop_eintro_137.png" FRAME;
+ image: SM"loop_eintro_141.png" FRAME;
+ image: SM"loop_eintro_145.png" FRAME;
+ image: SM"loop_eintro_149.png" FRAME;
+ image: SM"loop_eintro_153.png" FRAME;
+ image: SM"loop_eintro_157.png" FRAME;
+ image: SM"loop_eintro_161.png" FRAME;
+ image: SM"loop_eintro_165.png" FRAME;
+ image: SM"loop_eintro_169.png" FRAME;
+ image: SM"loop_eintro_173.png" FRAME;
+ image: SM"loop_eintro_177.png" FRAME;
+ image: SM"loop_eintro_181.png" FRAME;
+ image: SM"loop_eintro_185.png" FRAME;
+ image: SM"loop_eintro_189.png" FRAME;
+ image: SM"loop_eintro_193.png" FRAME;
+ image: SM"loop_eintro_197.png" FRAME;
+ image: SM"loop_eintro_201.png" FRAME;
+ image: SM"loop_eintro_205.png" FRAME;
+ image: SM"loop_eintro_209.png" FRAME;
+ image: SM"loop_eintro_213.png" FRAME;
+ image: SM"loop_eintro_217.png" FRAME;
+ image: SM"loop_eintro_221.png" FRAME;
+ image: SM"loop_eintro_225.png" FRAME;
+ image: SM"loop_eintro_229.png" FRAME;
+ image: SM"loop_eintro_233.png" FRAME;
+ image: SM"loop_eintro_237.png" FRAME;
+#endif
+#endif
+}
+
+collections {
+ group {
+ name: "init/splash";
+ parts {
+ part {
+ name: "background";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "background_image";
+ description {
+ state: "default" 0.0;
+ image {
+ normal: "brushed.png";
+ }
+ fill {
+ size {
+ relative: 0 0;
+ offset: 400 300;
+ }
+ }
+ }
+ }
+ part {
+ name: "reflection_overlay";
+ description {
+ state: "default" 0.0;
+ image {
+ normal: SM"reflection_overlay.png";
+ }
+ }
+ }
+ part {
+ name: "title";
+ type: TEXT;
+ effect: SOFT_SHADOW;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.0;
+ rel1 {
+ relative: 0.0 0.75;
+ offset: 0 0;
+ to: "logo_point";
+ }
+ rel2 {
+ relative: 1.0 0.75;
+ offset: -1 -1;
+ to: "logo_point";
+ }
+ color: 255 255 255 255;
+ color3: 0 0 0 32;
+ text {
+ text: "Enlightenment";
+ font: "Edje Vera Bold";
+ size: TSIZE;
+ min: 1 1;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ part {
+ name: "version";
+ type: TEXT;
+ effect: SHADOW;
+ description {
+ state: "default" 0.0;
+ align: 1.0 1.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ }
+ color: 0 0 0 128;
+ color3: 255 255 255 128;
+ text {
+ text: "0.17.0";
+ font: "Edje Vera";
+ size: VSIZE;
+ min: 1 1;
+ align: 0.0 0.0;
+ }
+ }
+ }
+ part {
+ name: "status";
+ type: TEXT;
+ effect: SHADOW;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 5;
+ to: "title";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 5;
+ to: "title";
+ }
+ color: 0 0 0 128;
+ color3: 255 255 255 128;
+ text {
+ text: "Starting Enlightenment. Please wait.";
+ font: "Edje Vera";
+ size: SSIZE;
+ min: 1 1;
+ align: 0.5 0.5;
+ }
+ }
+ }
+ part {
+ name: "logo_point";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ color: 255 255 255 0;
+ visible: 0;
+ aspect: 1.333333333333333333 1.333333333333333333;
+ max: LOGOSZ;
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ color: 255 255 255 255;
+ visible: 1;
+ }
+ }
+ part {
+ name: "logo";
+ clip_to: "logo_point";
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ image {
+ normal: SM"start_eintro_001.png";
+ };
+ }
+ description {
+ state: "intro_start" 0.0;
+ visible: 1;
+ // 3 3, 425x412
+ rel1 {
+ relative: 0.0046875 0.00625;
+ offset: 0 0;
+ to: "logo_point";
+ }
+ rel2 {
+ relative: 0.66875 0.864583333;
+ offset: -1 -1;
+ to: "logo_point";
+ }
+ image {
+ normal: SM"start_eintro_001.png";
+ };
+ }
+ description {
+ state: "intro_go" 0.0;
+ inherit: "intro_start" 0.0;
+ // 3 3, 425x412
+ image {
+#ifdef ALLFRAMES
+ normal: SM"start_eintro_120.png";
+ tween: SM"start_eintro_001.png";
+ tween: SM"start_eintro_002.png";
+ tween: SM"start_eintro_003.png";
+ tween: SM"start_eintro_004.png";
+ tween: SM"start_eintro_005.png";
+ tween: SM"start_eintro_006.png";
+ tween: SM"start_eintro_007.png";
+ tween: SM"start_eintro_008.png";
+ tween: SM"start_eintro_009.png";
+ tween: SM"start_eintro_010.png";
+ tween: SM"start_eintro_011.png";
+ tween: SM"start_eintro_012.png";
+ tween: SM"start_eintro_013.png";
+ tween: SM"start_eintro_014.png";
+ tween: SM"start_eintro_015.png";
+ tween: SM"start_eintro_016.png";
+ tween: SM"start_eintro_017.png";
+ tween: SM"start_eintro_018.png";
+ tween: SM"start_eintro_019.png";
+ tween: SM"start_eintro_020.png";
+ tween: SM"start_eintro_021.png";
+ tween: SM"start_eintro_022.png";
+ tween: SM"start_eintro_023.png";
+ tween: SM"start_eintro_024.png";
+ tween: SM"start_eintro_025.png";
+ tween: SM"start_eintro_026.png";
+ tween: SM"start_eintro_027.png";
+ tween: SM"start_eintro_028.png";
+ tween: SM"start_eintro_029.png";
+ tween: SM"start_eintro_030.png";
+ tween: SM"start_eintro_031.png";
+ tween: SM"start_eintro_032.png";
+ tween: SM"start_eintro_033.png";
+ tween: SM"start_eintro_034.png";
+ tween: SM"start_eintro_035.png";
+ tween: SM"start_eintro_036.png";
+ tween: SM"start_eintro_037.png";
+ tween: SM"start_eintro_038.png";
+ tween: SM"start_eintro_039.png";
+ tween: SM"start_eintro_040.png";
+ tween: SM"start_eintro_041.png";
+ tween: SM"start_eintro_042.png";
+ tween: SM"start_eintro_043.png";
+ tween: SM"start_eintro_044.png";
+ tween: SM"start_eintro_045.png";
+ tween: SM"start_eintro_046.png";
+ tween: SM"start_eintro_047.png";
+ tween: SM"start_eintro_048.png";
+ tween: SM"start_eintro_049.png";
+ tween: SM"start_eintro_050.png";
+ tween: SM"start_eintro_051.png";
+ tween: SM"start_eintro_052.png";
+ tween: SM"start_eintro_053.png";
+ tween: SM"start_eintro_054.png";
+ tween: SM"start_eintro_055.png";
+ tween: SM"start_eintro_056.png";
+ tween: SM"start_eintro_057.png";
+ tween: SM"start_eintro_058.png";
+ tween: SM"start_eintro_059.png";
+ tween: SM"start_eintro_060.png";
+ tween: SM"start_eintro_061.png";
+ tween: SM"start_eintro_062.png";
+ tween: SM"start_eintro_063.png";
+ tween: SM"start_eintro_064.png";
+ tween: SM"start_eintro_065.png";
+ tween: SM"start_eintro_066.png";
+ tween: SM"start_eintro_067.png";
+ tween: SM"start_eintro_068.png";
+ tween: SM"start_eintro_069.png";
+ tween: SM"start_eintro_070.png";
+ tween: SM"start_eintro_071.png";
+ tween: SM"start_eintro_072.png";
+ tween: SM"start_eintro_073.png";
+ tween: SM"start_eintro_074.png";
+ tween: SM"start_eintro_075.png";
+ tween: SM"start_eintro_076.png";
+ tween: SM"start_eintro_077.png";
+ tween: SM"start_eintro_078.png";
+ tween: SM"start_eintro_079.png";
+ tween: SM"start_eintro_080.png";
+ tween: SM"start_eintro_081.png";
+ tween: SM"start_eintro_082.png";
+ tween: SM"start_eintro_083.png";
+ tween: SM"start_eintro_084.png";
+ tween: SM"start_eintro_085.png";
+ tween: SM"start_eintro_086.png";
+ tween: SM"start_eintro_087.png";
+ tween: SM"start_eintro_088.png";
+ tween: SM"start_eintro_089.png";
+ tween: SM"start_eintro_090.png";
+ tween: SM"start_eintro_091.png";
+ tween: SM"start_eintro_092.png";
+ tween: SM"start_eintro_093.png";
+ tween: SM"start_eintro_094.png";
+ tween: SM"start_eintro_095.png";
+ tween: SM"start_eintro_096.png";
+ tween: SM"start_eintro_097.png";
+ tween: SM"start_eintro_098.png";
+ tween: SM"start_eintro_099.png";
+ tween: SM"start_eintro_100.png";
+ tween: SM"start_eintro_101.png";
+ tween: SM"start_eintro_102.png";
+ tween: SM"start_eintro_103.png";
+ tween: SM"start_eintro_104.png";
+ tween: SM"start_eintro_105.png";
+ tween: SM"start_eintro_106.png";
+ tween: SM"start_eintro_107.png";
+ tween: SM"start_eintro_108.png";
+ tween: SM"start_eintro_109.png";
+ tween: SM"start_eintro_110.png";
+ tween: SM"start_eintro_111.png";
+ tween: SM"start_eintro_112.png";
+ tween: SM"start_eintro_113.png";
+ tween: SM"start_eintro_114.png";
+ tween: SM"start_eintro_115.png";
+ tween: SM"start_eintro_116.png";
+ tween: SM"start_eintro_117.png";
+ tween: SM"start_eintro_118.png";
+ tween: SM"start_eintro_119.png";
+#else
+#ifdef HALFFRAMES
+ normal: SM"start_eintro_119.png";
+ tween: SM"start_eintro_001.png";
+ tween: SM"start_eintro_003.png";
+ tween: SM"start_eintro_005.png";
+ tween: SM"start_eintro_007.png";
+ tween: SM"start_eintro_009.png";
+ tween: SM"start_eintro_011.png";
+ tween: SM"start_eintro_013.png";
+ tween: SM"start_eintro_015.png";
+ tween: SM"start_eintro_017.png";
+ tween: SM"start_eintro_019.png";
+ tween: SM"start_eintro_021.png";
+ tween: SM"start_eintro_023.png";
+ tween: SM"start_eintro_025.png";
+ tween: SM"start_eintro_027.png";
+ tween: SM"start_eintro_029.png";
+ tween: SM"start_eintro_031.png";
+ tween: SM"start_eintro_033.png";
+ tween: SM"start_eintro_035.png";
+ tween: SM"start_eintro_037.png";
+ tween: SM"start_eintro_039.png";
+ tween: SM"start_eintro_041.png";
+ tween: SM"start_eintro_043.png";
+ tween: SM"start_eintro_045.png";
+ tween: SM"start_eintro_047.png";
+ tween: SM"start_eintro_049.png";
+ tween: SM"start_eintro_051.png";
+ tween: SM"start_eintro_053.png";
+ tween: SM"start_eintro_055.png";
+ tween: SM"start_eintro_057.png";
+ tween: SM"start_eintro_059.png";
+ tween: SM"start_eintro_061.png";
+ tween: SM"start_eintro_063.png";
+ tween: SM"start_eintro_065.png";
+ tween: SM"start_eintro_067.png";
+ tween: SM"start_eintro_069.png";
+ tween: SM"start_eintro_071.png";
+ tween: SM"start_eintro_073.png";
+ tween: SM"start_eintro_075.png";
+ tween: SM"start_eintro_077.png";
+ tween: SM"start_eintro_079.png";
+ tween: SM"start_eintro_081.png";
+ tween: SM"start_eintro_083.png";
+ tween: SM"start_eintro_085.png";
+ tween: SM"start_eintro_087.png";
+ tween: SM"start_eintro_089.png";
+ tween: SM"start_eintro_091.png";
+ tween: SM"start_eintro_093.png";
+ tween: SM"start_eintro_095.png";
+ tween: SM"start_eintro_097.png";
+ tween: SM"start_eintro_099.png";
+ tween: SM"start_eintro_101.png";
+ tween: SM"start_eintro_103.png";
+ tween: SM"start_eintro_105.png";
+ tween: SM"start_eintro_107.png";
+ tween: SM"start_eintro_109.png";
+ tween: SM"start_eintro_111.png";
+ tween: SM"start_eintro_113.png";
+ tween: SM"start_eintro_115.png";
+ tween: SM"start_eintro_117.png";
+#else
+ normal: SM"start_eintro_117.png";
+ tween: SM"start_eintro_001.png";
+ tween: SM"start_eintro_005.png";
+ tween: SM"start_eintro_009.png";
+ tween: SM"start_eintro_013.png";
+ tween: SM"start_eintro_017.png";
+ tween: SM"start_eintro_021.png";
+ tween: SM"start_eintro_025.png";
+ tween: SM"start_eintro_029.png";
+ tween: SM"start_eintro_033.png";
+ tween: SM"start_eintro_037.png";
+ tween: SM"start_eintro_041.png";
+ tween: SM"start_eintro_045.png";
+ tween: SM"start_eintro_049.png";
+ tween: SM"start_eintro_053.png";
+ tween: SM"start_eintro_057.png";
+ tween: SM"start_eintro_061.png";
+ tween: SM"start_eintro_065.png";
+ tween: SM"start_eintro_069.png";
+ tween: SM"start_eintro_073.png";
+ tween: SM"start_eintro_077.png";
+ tween: SM"start_eintro_081.png";
+ tween: SM"start_eintro_085.png";
+ tween: SM"start_eintro_089.png";
+ tween: SM"start_eintro_093.png";
+ tween: SM"start_eintro_097.png";
+ tween: SM"start_eintro_101.png";
+ tween: SM"start_eintro_105.png";
+ tween: SM"start_eintro_109.png";
+ tween: SM"start_eintro_113.png";
+#endif
+#endif
+ }
+ }
+ description {
+ state: "loop" 0.0;
+ visible: 1;
+ // 228 120, 187x247
+ rel1 {
+ relative: 0.35625 0.25;
+ offset: 0 0;
+ to: "logo_point";
+ }
+ rel2 {
+ relative: 0.6484375 0.76458333;
+ offset: -1 -1;
+ to: "logo_point";
+ }
+ image {
+#ifdef ALLFRAMES
+ normal: SM"loop_eintro_240.png";
+ tween: SM"loop_eintro_121.png";
+ tween: SM"loop_eintro_122.png";
+ tween: SM"loop_eintro_123.png";
+ tween: SM"loop_eintro_124.png";
+ tween: SM"loop_eintro_125.png";
+ tween: SM"loop_eintro_126.png";
+ tween: SM"loop_eintro_127.png";
+ tween: SM"loop_eintro_128.png";
+ tween: SM"loop_eintro_129.png";
+ tween: SM"loop_eintro_130.png";
+ tween: SM"loop_eintro_131.png";
+ tween: SM"loop_eintro_132.png";
+ tween: SM"loop_eintro_133.png";
+ tween: SM"loop_eintro_134.png";
+ tween: SM"loop_eintro_135.png";
+ tween: SM"loop_eintro_136.png";
+ tween: SM"loop_eintro_137.png";
+ tween: SM"loop_eintro_138.png";
+ tween: SM"loop_eintro_139.png";
+ tween: SM"loop_eintro_140.png";
+ tween: SM"loop_eintro_141.png";
+ tween: SM"loop_eintro_142.png";
+ tween: SM"loop_eintro_143.png";
+ tween: SM"loop_eintro_144.png";
+ tween: SM"loop_eintro_145.png";
+ tween: SM"loop_eintro_146.png";
+ tween: SM"loop_eintro_147.png";
+ tween: SM"loop_eintro_148.png";
+ tween: SM"loop_eintro_149.png";
+ tween: SM"loop_eintro_150.png";
+ tween: SM"loop_eintro_151.png";
+ tween: SM"loop_eintro_152.png";
+ tween: SM"loop_eintro_153.png";
+ tween: SM"loop_eintro_154.png";
+ tween: SM"loop_eintro_155.png";
+ tween: SM"loop_eintro_156.png";
+ tween: SM"loop_eintro_157.png";
+ tween: SM"loop_eintro_158.png";
+ tween: SM"loop_eintro_159.png";
+ tween: SM"loop_eintro_160.png";
+ tween: SM"loop_eintro_161.png";
+ tween: SM"loop_eintro_162.png";
+ tween: SM"loop_eintro_163.png";
+ tween: SM"loop_eintro_164.png";
+ tween: SM"loop_eintro_165.png";
+ tween: SM"loop_eintro_166.png";
+ tween: SM"loop_eintro_167.png";
+ tween: SM"loop_eintro_168.png";
+ tween: SM"loop_eintro_169.png";
+ tween: SM"loop_eintro_170.png";
+ tween: SM"loop_eintro_171.png";
+ tween: SM"loop_eintro_172.png";
+ tween: SM"loop_eintro_173.png";
+ tween: SM"loop_eintro_174.png";
+ tween: SM"loop_eintro_175.png";
+ tween: SM"loop_eintro_176.png";
+ tween: SM"loop_eintro_177.png";
+ tween: SM"loop_eintro_178.png";
+ tween: SM"loop_eintro_179.png";
+ tween: SM"loop_eintro_180.png";
+ tween: SM"loop_eintro_181.png";
+ tween: SM"loop_eintro_182.png";
+ tween: SM"loop_eintro_183.png";
+ tween: SM"loop_eintro_184.png";
+ tween: SM"loop_eintro_185.png";
+ tween: SM"loop_eintro_186.png";
+ tween: SM"loop_eintro_187.png";
+ tween: SM"loop_eintro_188.png";
+ tween: SM"loop_eintro_189.png";
+ tween: SM"loop_eintro_190.png";
+ tween: SM"loop_eintro_191.png";
+ tween: SM"loop_eintro_192.png";
+ tween: SM"loop_eintro_193.png";
+ tween: SM"loop_eintro_194.png";
+ tween: SM"loop_eintro_195.png";
+ tween: SM"loop_eintro_196.png";
+ tween: SM"loop_eintro_197.png";
+ tween: SM"loop_eintro_198.png";
+ tween: SM"loop_eintro_199.png";
+ tween: SM"loop_eintro_200.png";
+ tween: SM"loop_eintro_201.png";
+ tween: SM"loop_eintro_202.png";
+ tween: SM"loop_eintro_203.png";
+ tween: SM"loop_eintro_204.png";
+ tween: SM"loop_eintro_205.png";
+ tween: SM"loop_eintro_206.png";
+ tween: SM"loop_eintro_207.png";
+ tween: SM"loop_eintro_208.png";
+ tween: SM"loop_eintro_209.png";
+ tween: SM"loop_eintro_210.png";
+ tween: SM"loop_eintro_211.png";
+ tween: SM"loop_eintro_212.png";
+ tween: SM"loop_eintro_213.png";
+ tween: SM"loop_eintro_214.png";
+ tween: SM"loop_eintro_215.png";
+ tween: SM"loop_eintro_216.png";
+ tween: SM"loop_eintro_217.png";
+ tween: SM"loop_eintro_218.png";
+ tween: SM"loop_eintro_219.png";
+ tween: SM"loop_eintro_220.png";
+ tween: SM"loop_eintro_221.png";
+ tween: SM"loop_eintro_222.png";
+ tween: SM"loop_eintro_223.png";
+ tween: SM"loop_eintro_224.png";
+ tween: SM"loop_eintro_225.png";
+ tween: SM"loop_eintro_226.png";
+ tween: SM"loop_eintro_227.png";
+ tween: SM"loop_eintro_228.png";
+ tween: SM"loop_eintro_229.png";
+ tween: SM"loop_eintro_230.png";
+ tween: SM"loop_eintro_231.png";
+ tween: SM"loop_eintro_232.png";
+ tween: SM"loop_eintro_233.png";
+ tween: SM"loop_eintro_234.png";
+ tween: SM"loop_eintro_235.png";
+ tween: SM"loop_eintro_236.png";
+ tween: SM"loop_eintro_237.png";
+ tween: SM"loop_eintro_238.png";
+ tween: SM"loop_eintro_239.png";
+#else
+#ifdef HALFFRAMES
+ normal: SM"loop_eintro_239.png";
+ tween: SM"loop_eintro_121.png";
+ tween: SM"loop_eintro_123.png";
+ tween: SM"loop_eintro_125.png";
+ tween: SM"loop_eintro_127.png";
+ tween: SM"loop_eintro_129.png";
+ tween: SM"loop_eintro_131.png";
+ tween: SM"loop_eintro_133.png";
+ tween: SM"loop_eintro_135.png";
+ tween: SM"loop_eintro_137.png";
+ tween: SM"loop_eintro_139.png";
+ tween: SM"loop_eintro_141.png";
+ tween: SM"loop_eintro_143.png";
+ tween: SM"loop_eintro_145.png";
+ tween: SM"loop_eintro_147.png";
+ tween: SM"loop_eintro_149.png";
+ tween: SM"loop_eintro_151.png";
+ tween: SM"loop_eintro_153.png";
+ tween: SM"loop_eintro_155.png";
+ tween: SM"loop_eintro_157.png";
+ tween: SM"loop_eintro_159.png";
+ tween: SM"loop_eintro_161.png";
+ tween: SM"loop_eintro_163.png";
+ tween: SM"loop_eintro_165.png";
+ tween: SM"loop_eintro_167.png";
+ tween: SM"loop_eintro_169.png";
+ tween: SM"loop_eintro_171.png";
+ tween: SM"loop_eintro_173.png";
+ tween: SM"loop_eintro_175.png";
+ tween: SM"loop_eintro_177.png";
+ tween: SM"loop_eintro_179.png";
+ tween: SM"loop_eintro_181.png";
+ tween: SM"loop_eintro_183.png";
+ tween: SM"loop_eintro_185.png";
+ tween: SM"loop_eintro_187.png";
+ tween: SM"loop_eintro_189.png";
+ tween: SM"loop_eintro_191.png";
+ tween: SM"loop_eintro_193.png";
+ tween: SM"loop_eintro_195.png";
+ tween: SM"loop_eintro_197.png";
+ tween: SM"loop_eintro_199.png";
+ tween: SM"loop_eintro_201.png";
+ tween: SM"loop_eintro_203.png";
+ tween: SM"loop_eintro_205.png";
+ tween: SM"loop_eintro_207.png";
+ tween: SM"loop_eintro_209.png";
+ tween: SM"loop_eintro_211.png";
+ tween: SM"loop_eintro_213.png";
+ tween: SM"loop_eintro_215.png";
+ tween: SM"loop_eintro_217.png";
+ tween: SM"loop_eintro_219.png";
+ tween: SM"loop_eintro_221.png";
+ tween: SM"loop_eintro_223.png";
+ tween: SM"loop_eintro_225.png";
+ tween: SM"loop_eintro_227.png";
+ tween: SM"loop_eintro_229.png";
+ tween: SM"loop_eintro_231.png";
+ tween: SM"loop_eintro_233.png";
+ tween: SM"loop_eintro_235.png";
+ tween: SM"loop_eintro_237.png";
+#else
+ normal: SM"loop_eintro_237.png";
+ tween: SM"loop_eintro_121.png";
+ tween: SM"loop_eintro_125.png";
+ tween: SM"loop_eintro_129.png";
+ tween: SM"loop_eintro_133.png";
+ tween: SM"loop_eintro_137.png";
+ tween: SM"loop_eintro_141.png";
+ tween: SM"loop_eintro_145.png";
+ tween: SM"loop_eintro_149.png";
+ tween: SM"loop_eintro_153.png";
+ tween: SM"loop_eintro_157.png";
+ tween: SM"loop_eintro_161.png";
+ tween: SM"loop_eintro_165.png";
+ tween: SM"loop_eintro_169.png";
+ tween: SM"loop_eintro_173.png";
+ tween: SM"loop_eintro_177.png";
+ tween: SM"loop_eintro_181.png";
+ tween: SM"loop_eintro_185.png";
+ tween: SM"loop_eintro_189.png";
+ tween: SM"loop_eintro_193.png";
+ tween: SM"loop_eintro_197.png";
+ tween: SM"loop_eintro_201.png";
+ tween: SM"loop_eintro_205.png";
+ tween: SM"loop_eintro_209.png";
+ tween: SM"loop_eintro_213.png";
+ tween: SM"loop_eintro_217.png";
+ tween: SM"loop_eintro_221.png";
+ tween: SM"loop_eintro_225.png";
+ tween: SM"loop_eintro_229.png";
+ tween: SM"loop_eintro_233.png";
+#endif
+#endif
+ }
+ }
+ }
+ part {
+ name: "shadow";
+ description {
+ state: "default" 0.0;
+ image {
+ normal: SM"shadow.png";
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "init_pause";
+ signal: "show";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 1.0;
+ target: "logo_point";
+ after: "logo_show";
+ after: "logo_animate";
+ }
+ program {
+ name: "logo_show";
+ action: STATE_SET "visible" 0.0;
+ transition: SINUSOIDAL 1.0;
+ target: "logo_point";
+ }
+ program {
+ name: "logo_animate";
+ action: STATE_SET "intro_start" 0.0;
+ target: "logo";
+ after: "logo_animate2";
+ }
+ program {
+ name: "logo_animate2";
+ action: STATE_SET "intro_go" 0.0;
+ transition: LINEAR 4.0;
+ target: "logo";
+ after: "logo_animate3";
+ }
+ program {
+ name: "logo_animate3";
+ action: STATE_SET "loop" 0.0;
+ target: "logo";
+ after: "logo_animate4";
+ }
+ program {
+ name: "logo_animate4";
+ action: STATE_SET "loop" 0.0;
+ transition: LINEAR 4.0;
+ target: "logo";
+ after: "logo_animate4";
+ }
+ }
+ }
+}
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+filesdir = $(datadir)/enlightenment/data/other
+files_DATA = favorite_apps.tar.gz
+
+EXTRA_DIST = $(files_DATA)
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = images
+
+EDJE_CC = @edje_cc@
+EDJE_FLAGS = \
+-v \
+-id $(top_srcdir)/data/themes/images \
+-fd $(top_srcdir)/data/fonts \
+@EDJE_DEF@
+
+filesdir = $(datadir)/enlightenment/data/themes
+files_DATA = \
+default.eet
+
+EXTRA_DIST = default.edc
+
+default.eet: Makefile default.edc
+ $(EDJE_CC) $(EDJE_FLAGS) \
+ $(top_srcdir)/data/themes/default.edc \
+ $(top_builddir)/data/themes/default.eet
+
+clean-local:
+ rm -f *.eet
+
--- /dev/null
+#ifdef E17_PROFILE
+# if E17_PROFILE == LOWRES_PDA
+# define SM "sm_"
+# elif E17_PROFILE == MEDIUMRES_PDA
+# define SM "sm_"
+# elif E17_PROFILE == HIRES_PDA
+# define SM "sm_"
+# elif E17_PROFILE == SLOW_PC
+# define SM "sm_"
+# elif E17_PROFILE == MEDIUM_PC
+# define SM
+# elif E17_PROFILE == FAST_PC
+# define SM
+# endif
+#else
+# define SM
+#endif
+
+fonts {
+ font: "Vera.ttf" "Edje Vera";
+// font: "kochi-gothic.ttf" "Edje Vera";
+// font: "VeraBd.ttf" "Edje Vera Bold";
+}
+
+images {
+ image: "e17_brushed.png" COMP;
+ image: "e17_"SM"reflection_shadow_overlay.png" LOSSY 70;
+
+ image: "e17_menu_arrow.png" COMP;
+ image: "e17_menu_bg.png" COMP;
+ image: "e17_menu_check1.png" COMP;
+ image: "e17_menu_check2.png" COMP;
+ image: "e17_menu_radio1.png" COMP;
+ image: "e17_menu_radio2.png" COMP;
+ image: "e17_menu_separator.png" COMP;
+
+ image: "e17_border1.png" COMP;
+ image: "e17_border2.png" COMP;
+ image: "e17_border3.png" COMP;
+ image: "e17_border4.png" COMP;
+ image: "e17_border5.png" COMP;
+ image: "e17_border6.png" COMP;
+ image: "e17_border7.png" COMP;
+ image: "e17_titlebar_outline.png" COMP;
+ image: "e17_titlebar.png" COMP;
+ image: "e17_titlebar_shadow1.png" COMP;
+ image: "e17_titlebar_shadow2.png" COMP;
+ image: "e17_button_detail_close.png" COMP;
+ image: "e17_button_detail_maximize.png" COMP;
+ image: "e17_button_detail_minimize.png" COMP;
+ image: "e17_mini_button.png" COMP;
+ image: "e17_mini_button_shadow1.png" COMP;
+ image: "e17_mini_button_shadow2.png" COMP;
+
+ image: "e17_ibar_arrow_d.png" COMP;
+ image: "e17_ibar_arrow_l.png" COMP;
+ image: "e17_ibar_arrow_r.png" COMP;
+ image: "e17_ibar_arrow_u.png" COMP;
+ image: "e17_ibar_bg_h.png" COMP;
+ image: "e17_ibar_bg_v.png" COMP;
+ image: "e17_ibar_handle_h.png" COMP;
+ image: "e17_ibar_handle_h2.png" COMP;
+ image: "e17_ibar_handle_thumb_h.png" COMP;
+ image: "e17_ibar_handle_thumb_v.png" COMP;
+ image: "e17_ibar_handle_v.png" COMP;
+ image: "e17_ibar_handle_v2.png" COMP;
+ image: "e17_ibar_lamp_d.png" COMP;
+ image: "e17_ibar_lamp_l.png" COMP;
+ image: "e17_ibar_lamp_r.png" COMP;
+ image: "e17_ibar_lamp_u.png" COMP;
+ image: "e17_ibar_over_h.png" COMP;
+ image: "e17_ibar_over_v.png" COMP;
+}
+
+images {
+}
+
+collections {
+ group {
+ name: "desktop/background";
+ parts {
+ part {
+ name: "background_image";
+ description {
+ state: "default" 0.0;
+ image {
+ normal: "e17_brushed.png";
+ }
+ fill {
+ size {
+ relative: 0 0;
+ offset: 400 300;
+ }
+ }
+ }
+ }
+ part {
+ name: "reflection_shadow_overlay";
+ description {
+ state: "default" 0.0;
+ image {
+ normal: "e17_"SM"reflection_shadow_overlay.png";
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/border/default/border";
+ data {
+ item: "client_inset" "4 4 24 4";
+ }
+ parts {
+ part {
+ name: "title2";
+ type: TEXT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 7;
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: 0 7;
+ }
+ text {
+ text_source: "title_text";
+ source: "title_text";
+ min: 0 1;
+ }
+ }
+ }
+ part {
+ name: "t1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 5;
+ to_y: "title2";
+ }
+ image {
+ normal: "e17_border1.png";
+ border: 6 2 3 3;
+ }
+ }
+ }
+ part {
+ name: "t2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 0 1;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "t1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "t3";
+ }
+ image {
+ normal: "e17_border2.png";
+ border: 2 2 3 3;
+ }
+ }
+ }
+ part {
+ name: "t3";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to_x: "button_2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 5;
+ to_y: "title2";
+ }
+ image {
+ normal: "e17_border3.png";
+ border: 3 6 3 3;
+ }
+ }
+ }
+ part {
+ name: "b1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: -4 0;
+ to_y: "t3";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to_y: "b2";
+ }
+ image {
+ normal: "e17_border4.png";
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ }
+ part {
+ name: "b2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: -4 -4;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_border5.png";
+ }
+ }
+ }
+ part {
+ name: "b3";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "b4";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "b2";
+ }
+ image {
+ normal: "e17_border6.png";
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ }
+ part {
+ name: "b4";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -4;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 3 -1;
+ }
+ image {
+ normal: "e17_border7.png";
+ }
+ }
+ }
+ part {
+ name: "b5";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_y: "t1";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: 3 -1;
+ to_y: "b4";
+ }
+ image {
+ normal: "e17_border4.png";
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ }
+ part {
+ name: "title_outline";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 14 14;
+ visible: 1;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 -7;
+ to_x: "t1";
+ to_y: "title2";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -2 4;
+ to_x: "t3";
+ to_y: "title2";
+ }
+ image {
+ normal: "e17_titlebar_outline.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "active" 0.0;
+ min: 14 14;
+ visible: 0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 -7;
+ to_x: "t1";
+ to_y: "title2";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -2 4;
+ to_x: "t3";
+ to_y: "title2";
+ }
+ image {
+ normal: "e17_titlebar_outline.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "title_shadow2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "title_shadow1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "title_bar";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "title_text";
+ type: TEXT;
+ effect: SHADOW;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 9 7;
+ to_x: "t1";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: -10 7;
+ to_x: "t3";
+ }
+ color: 0 0 0 255;
+ color3: 255 255 255 128;
+ text {
+ text: "";
+ font: "Edje Vera";
+ size: 10;
+ min: 0 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ part {
+ name: "button_0_shadow2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_0_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_0_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_0_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_0_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_1_shadow2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_1_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_1_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_1_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_1_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_2_shadow2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_2_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_2_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_2_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_2_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_0_shadow1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_0_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_0_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_0_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_0_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_1_shadow1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_1_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_1_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_1_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_1_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_2_shadow1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_2_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_2_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_2_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_2_bg";
+ }
+ image {
+ normal: "e17_mini_button_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "button_0_bg";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_0";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_0";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 1 1;
+ to: "button_0";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to: "button_0";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ }
+ part {
+ name: "button_1_bg";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_1";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 1 1;
+ to: "button_1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to: "button_1";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ }
+ part {
+ name: "button_2_bg";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "button_2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "button_2";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ description {
+ state: "active" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 1 1;
+ to: "button_2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to: "button_2";
+ }
+ image {
+ normal: "e17_mini_button.png";
+ border: 8 8 8 8;
+ }
+ }
+ }
+ part {
+ name: "button_0_detail";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ max: 16 16;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 4 4;
+ to: "button_0_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ to: "button_0_bg";
+ }
+ image {
+ normal: "e17_button_detail_close.png";
+ }
+ }
+ }
+ part {
+ name: "button_1_detail";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ max: 16 16;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 4 4;
+ to: "button_1_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ to: "button_1_bg";
+ }
+ image {
+ normal: "e17_button_detail_maximize.png";
+ }
+ }
+ }
+ part {
+ name: "button_2_detail";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ max: 16 16;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 4 4;
+ to: "button_2_bg";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ to: "button_2_bg";
+ }
+ image {
+ normal: "e17_button_detail_minimize.png";
+ }
+ }
+ }
+ part {
+ name: "client";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 4 0;
+ to: "t1";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: -1 -1;
+ to: "t2";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "icon_swallow";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 2 2;
+ to: "t1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -2 -3;
+ to: "t1";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "resize_l";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_y: "t1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 3 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "resize_r";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: -4 0;
+ to_y: "t3";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "resize_b";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -4;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "resize_bl";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -24;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 23 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "resize_br";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: -24 -24;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "icon";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "icon_swallow";
+ }
+ rel2 {
+ to: "icon_swallow";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "button_0";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 5;
+ to_y: "title2";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "button_1";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 3 0;
+ to: "button_0";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 3 -1;
+ to: "button_0";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "button_2";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: VERTICAL;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 3 0;
+ to: "button_1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 3 -1;
+ to: "button_1";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "title";
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "title_bar";
+ }
+ rel2 {
+ to: "title_bar";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "move_window1";
+ signal: "mouse,down,1";
+ source: "title";
+ action: SIGNAL_EMIT "move_start" "mouse,1";
+ }
+ program {
+ name: "move_window2";
+ signal: "mouse,up,1";
+ source: "title";
+ action: SIGNAL_EMIT "move_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_tl1";
+ signal: "mouse,down,1";
+ source: "resize_tl";
+ action: SIGNAL_EMIT "resize_tl_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_tl2";
+ signal: "mouse,up,1";
+ source: "resize_tl";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_t1";
+ signal: "mouse,down,1";
+ source: "resize_t";
+ action: SIGNAL_EMIT "resize_t_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_t2";
+ signal: "mouse,up,1";
+ source: "resize_t";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_tr1";
+ signal: "mouse,down,1";
+ source: "resize_tr";
+ action: SIGNAL_EMIT "resize_tr_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_tr2";
+ signal: "mouse,up,1";
+ source: "resize_tr";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_r1";
+ signal: "mouse,down,1";
+ source: "resize_r";
+ action: SIGNAL_EMIT "resize_r_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_r2";
+ signal: "mouse,up,1";
+ source: "resize_r";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_br1";
+ signal: "mouse,down,1";
+ source: "resize_br";
+ action: SIGNAL_EMIT "resize_br_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_br2";
+ signal: "mouse,up,1";
+ source: "resize_br";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_b1";
+ signal: "mouse,down,1";
+ source: "resize_b";
+ action: SIGNAL_EMIT "resize_b_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_b2";
+ signal: "mouse,up,1";
+ source: "resize_b";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_bl1";
+ signal: "mouse,down,1";
+ source: "resize_bl";
+ action: SIGNAL_EMIT "resize_bl_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_bl2";
+ signal: "mouse,up,1";
+ source: "resize_bl";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "resize_window_l1";
+ signal: "mouse,down,1";
+ source: "resize_l";
+ action: SIGNAL_EMIT "resize_l_start" "mouse,1";
+ }
+ program {
+ name: "resize_window_l2";
+ signal: "mouse,up,1";
+ source: "resize_l";
+ action: SIGNAL_EMIT "resize_stop" "mouse,1";
+ }
+ program {
+ name: "close_action";
+ signal: "mouse,clicked,1";
+ source: "button_0";
+ action: SIGNAL_EMIT "action" "close";
+ }
+
+ program {
+ name: "go_active_pre";
+ signal: "active";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ target: "title_shadow1";
+ target: "title_shadow2";
+ after: "go_active";
+ }
+ program {
+ name: "go_active";
+ action: STATE_SET "active" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ transition: LINEAR 0.05;
+ after: "go_active2";
+ }
+ program {
+ name: "go_active2";
+ action: STATE_SET "active" 0.0;
+ target: "title_shadow1";
+ transition: LINEAR 0.05;
+ after: "go_active3";
+ }
+ program {
+ name: "go_active3";
+ action: STATE_SET "active" 0.0;
+ target: "title_shadow2";
+ transition: LINEAR 0.05;
+ }
+
+ program {
+ name: "go_passive_pre";
+ signal: "passive";
+ source: "";
+ action: STATE_SET "active" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ target: "title_shadow1";
+ target: "title_shadow2";
+ after: "go_passive";
+ }
+ program {
+ name: "go_passive";
+ action: STATE_SET "default" 0.0;
+ target: "title_shadow2";
+ transition: LINEAR 0.1;
+ after: "go_passive2";
+ }
+ program {
+ name: "go_passive2";
+ action: STATE_SET "default" 0.0;
+ target: "title_shadow1";
+ transition: LINEAR 0.1;
+ after: "go_passive3";
+ }
+ program {
+ name: "go_passive3";
+ action: STATE_SET "default" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ transition: LINEAR 0.1;
+ }
+
+ program {
+ name: "button_0_active_pre";
+ signal: "mouse,down,1";
+ source: "button_0";
+ action: STATE_SET "default" 0.0;
+ target: "button_0_shadow1";
+ target: "button_0_shadow2";
+ target: "button_0_bg";
+ target: "button_0_detail";
+ after: "button_0_active";
+ after: "button_0_active_p";
+ }
+ program {
+ name: "button_0_active";
+ action: STATE_SET "active" 0.0;
+ target: "button_0_shadow2";
+ transition: LINEAR 0.05;
+ after: "button_0_active2";
+ }
+ program {
+ name: "button_0_active2";
+ action: STATE_SET "active" 0.0;
+ target: "button_0_shadow1";
+ transition: LINEAR 0.05;
+ }
+ program {
+ name: "button_0_active_p";
+ action: STATE_SET "active" 0.0;
+ target: "button_0_bg";
+ target: "button_0_detail";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_0_passive_pre";
+ signal: "mouse,up,1";
+ source: "button_0";
+ action: STATE_SET "active" 0.0;
+ target: "button_0_shadow1";
+ target: "button_0_shadow2";
+ target: "button_0_bg";
+ target: "button_0_detail";
+ after: "button_0_passive";
+ after: "button_0_passive_p";
+ }
+ program {
+ name: "button_0_passive";
+ action: STATE_SET "default" 0.0;
+ target: "button_0_shadow2";
+ transition: LINEAR 0.1;
+ after: "button_0_passive2";
+ }
+ program {
+ name: "button_0_passive2";
+ action: STATE_SET "default" 0.0;
+ target: "button_0_shadow1";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_0_passive_p";
+ action: STATE_SET "default" 0.0;
+ target: "button_0_bg";
+ target: "button_0_detail";
+ transition: LINEAR 0.2;
+ }
+
+
+ program {
+ name: "button_1_active_pre";
+ signal: "mouse,down,1";
+ source: "button_1";
+ action: STATE_SET "default" 0.0;
+ target: "button_1_shadow1";
+ target: "button_1_shadow2";
+ target: "button_1_bg";
+ target: "button_1_detail";
+ after: "button_1_active";
+ after: "button_1_active_p";
+ }
+ program {
+ name: "button_1_active";
+ action: STATE_SET "active" 0.0;
+ target: "button_1_shadow2";
+ transition: LINEAR 0.05;
+ after: "button_1_active2";
+ }
+ program {
+ name: "button_1_active2";
+ action: STATE_SET "active" 0.0;
+ target: "button_1_shadow1";
+ transition: LINEAR 0.05;
+ }
+ program {
+ name: "button_1_active_p";
+ action: STATE_SET "active" 0.0;
+ target: "button_1_bg";
+ target: "button_1_detail";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_1_passive_pre";
+ signal: "mouse,up,1";
+ source: "button_1";
+ action: STATE_SET "active" 0.0;
+ target: "button_1_shadow1";
+ target: "button_1_shadow2";
+ target: "button_1_bg";
+ target: "button_1_detail";
+ after: "button_1_passive";
+ after: "button_1_passive_p";
+ }
+ program {
+ name: "button_1_passive";
+ action: STATE_SET "default" 0.0;
+ target: "button_1_shadow2";
+ transition: LINEAR 0.1;
+ after: "button_1_passive2";
+ }
+ program {
+ name: "button_1_passive2";
+ action: STATE_SET "default" 0.0;
+ target: "button_1_shadow1";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_1_passive_p";
+ action: STATE_SET "default" 0.0;
+ target: "button_1_bg";
+ target: "button_1_detail";
+ transition: LINEAR 0.2;
+ }
+
+ program {
+ name: "button_2_active_pre";
+ signal: "mouse,down,1";
+ source: "button_2";
+ action: STATE_SET "default" 0.0;
+ target: "button_2_shadow1";
+ target: "button_2_shadow2";
+ target: "button_2_bg";
+ target: "button_2_detail";
+ after: "button_2_active";
+ after: "button_2_active_p";
+ }
+ program {
+ name: "button_2_active";
+ action: STATE_SET "active" 0.0;
+ target: "button_2_shadow2";
+ transition: LINEAR 0.05;
+ after: "button_2_active2";
+ }
+ program {
+ name: "button_2_active2";
+ action: STATE_SET "active" 0.0;
+ target: "button_2_shadow1";
+ transition: LINEAR 0.05;
+ }
+ program {
+ name: "button_2_active_p";
+ action: STATE_SET "active" 0.0;
+ target: "button_2_bg";
+ target: "button_2_detail";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_2_passive_pre";
+ signal: "mouse,up,1";
+ source: "button_2";
+ action: STATE_SET "active" 0.0;
+ target: "button_2_shadow1";
+ target: "button_2_shadow2";
+ target: "button_2_bg";
+ target: "button_2_detail";
+ after: "button_2_passive";
+ after: "button_2_passive_p";
+ }
+ program {
+ name: "button_2_passive";
+ action: STATE_SET "default" 0.0;
+ target: "button_2_shadow2";
+ transition: LINEAR 0.1;
+ after: "button_2_passive2";
+ }
+ program {
+ name: "button_2_passive2";
+ action: STATE_SET "default" 0.0;
+ target: "button_2_shadow1";
+ transition: LINEAR 0.1;
+ }
+ program {
+ name: "button_2_passive_p";
+ action: STATE_SET "default" 0.0;
+ target: "button_2_bg";
+ target: "button_2_detail";
+ transition: LINEAR 0.2;
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/background";
+ parts {
+ part {
+ name: "base";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_bg.png";
+ border: 3 3 3 3;
+ }
+ }
+ }
+ part {
+ name: "items";
+ mouse_events: 0;
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 1 1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -2 -2;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/separator";
+ parts {
+ part {
+ name: "separator";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 20 2;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 2 2;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -3 -3;
+ }
+ image {
+ normal: "e17_menu_separator.png";
+ border: 3 3 0 0;
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/item_bg";
+ parts {
+ part {
+ name: "item";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/submenu_bg";
+ parts {
+ part {
+ name: "item";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/check";
+ parts {
+ part {
+ name: "background";
+ mouse_events: 0;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 18 18;
+ max: 18 18;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "outline";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_check1.png";
+ }
+ }
+ }
+ part {
+ name: "item1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_check2.png";
+ }
+ }
+ description {
+ state: "active" 0.0;
+ min: 16 16;
+ max: 16 16;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_check2.png";
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "turn_on1";
+ signal: "toggle_on";
+ source: "";
+ action: STATE_SET "active" 0.0;
+ target: "item1";
+ }
+ program {
+ name: "turn_off1";
+ signal: "toggle_off";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "item1";
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/radio";
+ parts {
+ part {
+ name: "background";
+ mouse_events: 0;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 18 18;
+ max: 18 18;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "outline";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_radio1.png";
+ }
+ }
+ }
+ part {
+ name: "item1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 16 16;
+ max: 16 16;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_radio2.png";
+ }
+ }
+ description {
+ state: "active" 0.0;
+ min: 16 16;
+ max: 16 16;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_menu_radio2.png";
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "turn_on1";
+ signal: "toggle_on";
+ source: "";
+ action: STATE_SET "active" 0.0;
+ target: "item1";
+ }
+ program {
+ name: "turn_off1";
+ signal: "toggle_off";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "item1";
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/icon";
+ parts {
+ part {
+ name: "item";
+ type: SWALLOW;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 2 2;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -3 -3;
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/label";
+ parts {
+ part {
+ name: "title_outline";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 14 14;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 -1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_titlebar_outline.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "active" 0.0;
+ min: 14 14;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 -1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_titlebar_outline.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "title_shadow2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow2.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "title_shadow1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar_shadow1.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "title_bar";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "active" 0.0;
+ visible: 1;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "title_outline";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "title_outline";
+ }
+ image {
+ normal: "e17_titlebar.png";
+ border: 8 8 8 8;
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "label";
+ type: TEXT;
+ effect: SHADOW;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 8 6;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -8 -6;
+ }
+ color: 0 0 0 255;
+ color3: 255 255 255 128;
+ text {
+ text: "Item Label";
+ font: "Edje Vera";
+ size: 10;
+ min: 1 1;
+ align: 0.0 0.5;
+ }
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active_pre";
+ signal: "active";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ target: "title_shadow1";
+ target: "title_shadow2";
+ after: "go_active";
+ }
+ program {
+ name: "go_active";
+ action: STATE_SET "active" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ transition: LINEAR 0.05;
+ after: "go_active2";
+ }
+ program {
+ name: "go_active2";
+ action: STATE_SET "active" 0.0;
+ target: "title_shadow1";
+ transition: LINEAR 0.05;
+ after: "go_active3";
+ }
+ program {
+ name: "go_active3";
+ action: STATE_SET "active" 0.0;
+ target: "title_shadow2";
+ transition: LINEAR 0.05;
+ }
+
+ program {
+ name: "go_passive_pre";
+ signal: "passive";
+ source: "";
+ action: STATE_SET "active" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ target: "title_shadow1";
+ target: "title_shadow2";
+ after: "go_passive";
+ }
+ program {
+ name: "go_passive";
+ action: STATE_SET "default" 0.0;
+ target: "title_shadow2";
+ transition: LINEAR 0.1;
+ after: "go_passive2";
+ }
+ program {
+ name: "go_passive2";
+ action: STATE_SET "default" 0.0;
+ target: "title_shadow1";
+ transition: LINEAR 0.1;
+ after: "go_passive3";
+ }
+ program {
+ name: "go_passive3";
+ action: STATE_SET "default" 0.0;
+ target: "title_outline";
+ target: "title_bar";
+ transition: LINEAR 0.1;
+ }
+ }
+ }
+ group {
+ name: "widgets/menu/default/submenu";
+ parts {
+ part {
+ name: "background";
+ mouse_events: 0;
+ type: RECT;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ min: 12 12;
+ max: 12 12;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "arrow";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ min: 6 12;
+ max: 6 12;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "background";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "background";
+ }
+ image {
+ normal: "e17_menu_arrow.png";
+ }
+ }
+ }
+ }
+ }
+ group {
+ name: "modules/ibar/main";
+ data {
+// item: "item_list", "item item2 item3";
+ }
+ script {
+ public orient;
+ }
+ parts {
+ part {
+ name: "background";
+ mouse_events: 1;
+ clip_to: "items_clip";
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 2 2;
+ to: "overlay";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -3 -3;
+ to: "overlay";
+ }
+ image {
+ normal: "e17_ibar_bg_h.png";
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ description {
+ state: "vert" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 2 2;
+ to: "overlay";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -3 -3;
+ to: "overlay";
+ }
+ image {
+ normal: "e17_ibar_bg_v.png";
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ }
+ part {
+ name: "items_clip";
+ type: RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ to: "background";
+ }
+ rel2 {
+ to: "background";
+ }
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "items";
+ type: SWALLOW;
+ mouse_events: 0;
+ clip_to: "items_clip";
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_x: "h1";
+ to_y: "h3";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to_x: "h2";
+ }
+ color: 0 0 0 0;
+ }
+ description {
+ state: "top" 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to_x: "h1";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: -1 -1;
+ to_x: "h2";
+ to_y: "h3";
+ }
+ color: 0 0 0 0;
+ }
+ description {
+ state: "left" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to_y: "h1";
+ }
+ rel2 {
+ relative: 0.0 0.0;
+ offset: -1 -1;
+ to_y: "h2";
+ to_x: "h3";
+ }
+ color: 0 0 0 0;
+ }
+ description {
+ state: "right" 0.0;
+ rel1 {
+ relative: 1.0 1.0;
+ offset: 0 0;
+ to_y: "h1";
+ to_x: "h3";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to_y: "h2";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ part {
+ name: "overlay";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 18 0;
+ to_y: "h3";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -19 -1;
+ }
+ image {
+ normal: "e17_ibar_over_h.png";
+ border: 25 25 25 25;
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ description {
+ state: "top" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 18 0;
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -19 -1;
+ to_y: "h3";
+ }
+ image {
+ normal: "e17_ibar_over_h.png";
+ border: 25 25 25 25;
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ description {
+ state: "left" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 18;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -19;
+ to_x: "h3";
+ }
+ image {
+ normal: "e17_ibar_over_v.png";
+ border: 25 25 25 25;
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ description {
+ state: "right" 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 18;
+ to_x: "h3";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -19;
+ }
+ image {
+ normal: "e17_ibar_over_v.png";
+ border: 25 25 25 25;
+ }
+ fill {
+ smooth: 0;
+ }
+ }
+ }
+ part {
+ name: "h1a1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 0;
+ to: "h1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "h1";
+ }
+ image {
+ normal: "e17_ibar_arrow_l.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 1.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 -1;
+ to: "h1";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to: "h1";
+ }
+ image {
+ normal: "e17_ibar_arrow_u.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h1a2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 0;
+ to: "h1a1";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "h1a1";
+ }
+ image {
+ normal: "e17_ibar_arrow_l.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 1.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 -1;
+ to: "h1a1";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to: "h1a1";
+ }
+ image {
+ normal: "e17_ibar_arrow_u.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h1a3";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 0;
+ to: "h1a2";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "h1a2";
+ }
+ image {
+ normal: "e17_ibar_arrow_l.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 1.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 -1;
+ to: "h1a2";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to: "h1a2";
+ }
+ image {
+ normal: "e17_ibar_arrow_u.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h1a4";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -1 0;
+ to: "h1a3";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: -1 -1;
+ to: "h1a3";
+ }
+ image {
+ normal: "e17_ibar_arrow_l.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 1.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 -1;
+ to: "h1a3";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 -1;
+ to: "h1a3";
+ }
+ image {
+ normal: "e17_ibar_arrow_u.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h1";
+ mouse_events: 1;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ min: 18 36;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to_y: "overlay";
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ description {
+ state: "top" 0.0;
+ align: 0.0 0.5;
+ min: 18 36;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ to_y: "overlay";
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "top2" 0.0;
+ inherit: "top" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ description {
+ state: "left" 0.0;
+ align: 0.5 0.0;
+ min: 36 18;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ to_x: "overlay";
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "left2" 0.0;
+ inherit: "left" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ description {
+ state: "right" 0.0;
+ align: 0.5 0.0;
+ min: 36 18;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to_x: "overlay";
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "right2" 0.0;
+ inherit: "right" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ }
+ part {
+ name: "h1th";
+ mouse_events: 0;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ max: 6 16;
+ rel1 {
+ offset: -1 -1;
+ to: "h1";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h1";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_h.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ description {
+ state: "vert" 0.0;
+ max: 16 6;
+ rel1 {
+ offset: -1 -1;
+ to: "h1";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h1";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_v.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ }
+ part {
+ name: "h2a1";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "h2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 -1;
+ to: "h2";
+ }
+ image {
+ normal: "e17_ibar_arrow_r.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 0.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to: "h2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 0;
+ to: "h2";
+ }
+ image {
+ normal: "e17_ibar_arrow_d.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h2a2";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "h2a1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 -1;
+ to: "h2a1";
+ }
+ image {
+ normal: "e17_ibar_arrow_r.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 0.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to: "h2a1";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 0;
+ to: "h2a1";
+ }
+ image {
+ normal: "e17_ibar_arrow_d.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h2a3";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "h2a2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 -1;
+ to: "h2a2";
+ }
+ image {
+ normal: "e17_ibar_arrow_r.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 0.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to: "h2a2";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 0;
+ to: "h2a2";
+ }
+ image {
+ normal: "e17_ibar_arrow_d.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h2a4";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.0 0.5;
+ min: 21 29;
+ max: 21 29;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: 0 0;
+ to: "h2a3";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 0 -1;
+ to: "h2a3";
+ }
+ image {
+ normal: "e17_ibar_arrow_r.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ description {
+ state: "vert" 0.0;
+ align: 0.5 0.0;
+ min: 29 21;
+ max: 29 21;
+ visible: 0;
+ color: 255 255 255 0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 0;
+ to: "h2a3";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 0;
+ to: "h2a3";
+ }
+ image {
+ normal: "e17_ibar_arrow_d.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "h2";
+ mouse_events: 1;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ align: 1.0 0.5;
+ min: 18 36;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ to_y: "overlay";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ description {
+ state: "top" 0.0;
+ align: 1.0 0.5;
+ min: 18 36;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to_y: "overlay";
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "top2" 0.0;
+ inherit: "top" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ description {
+ state: "left" 0.0;
+ align: 0.5 1.0;
+ min: 36 18;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to_x: "overlay";
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "left2" 0.0;
+ inherit: "left" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ description {
+ state: "right" 0.0;
+ align: 0.5 1.0;
+ min: 36 18;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ to_x: "overlay";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "right2" 0.0;
+ inherit: "right" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ }
+ part {
+ name: "h2th";
+ mouse_events: 0;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ max: 6 16;
+ rel1 {
+ offset: -1 -1;
+ to: "h2";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h2";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_h.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ description {
+ state: "vert" 0.0;
+ max: 16 6;
+ rel1 {
+ offset: -1 -1;
+ to: "h2";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h2";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_v.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ }
+ part {
+ name: "h3";
+ mouse_events: 1;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.0;
+ min: 36 18;
+ max: 60 18;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ description {
+ state: "top" 0.0;
+ align: 0.5 1.0;
+ min: 36 18;
+ max: 60 18;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_v.png";
+ border: 19 19 0 0;
+ }
+ }
+ description {
+ state: "top2" 0.0;
+ inherit: "top" 0.0;
+ image {
+ normal: "e17_ibar_handle_v2.png";
+ }
+ }
+ description {
+ state: "left" 0.0;
+ align: 1.0 0.5;
+ min: 18 36;
+ max: 18 60;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: -1 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "left2" 0.0;
+ inherit: "left" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ description {
+ state: "right" 0.0;
+ align: 0.0 0.5;
+ min: 18 36;
+ max: 18 60;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ }
+ image {
+ normal: "e17_ibar_handle_h.png";
+ border: 0 0 19 19;
+ }
+ }
+ description {
+ state: "right2" 0.0;
+ inherit: "right" 0.0;
+ image {
+ normal: "e17_ibar_handle_h2.png";
+ }
+ }
+ }
+ part {
+ name: "h3th";
+ mouse_events: 0;
+ clip_to: "clp";
+ description {
+ state: "default" 0.0;
+ max: 16 6;
+ rel1 {
+ offset: -1 -1;
+ to: "h3";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h3";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_v.png";
+ }
+ }
+ description {
+ state: "default2" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ description {
+ state: "vert" 0.0;
+ max: 6 16;
+ rel1 {
+ offset: -1 -1;
+ to: "h3";
+ }
+ rel2 {
+ offset: -2 -2;
+ to: "h3";
+ }
+ image {
+ normal: "e17_ibar_handle_thumb_h.png";
+ }
+ }
+ description {
+ state: "vert2" 0.0;
+ inherit: "vert" 0.0;
+ rel1 {
+ offset: 0 0;
+ }
+ rel2 {
+ offset: -1 -1;
+ }
+ }
+ }
+ part {
+ name: "clp";
+ type: RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ visible: 0;
+ color: 255 255 255 0;
+ }
+ description {
+ state: "on" 0.0;
+ visible: 1;
+ color: 255 255 255 255;
+ }
+ }
+ part {
+ name: "inn";
+ type: RECT;
+ repeat_events: 1;
+ description {
+ state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "load";
+ signal: "load";
+ source: "";
+ action: SIGNAL_EMIT "set_orientation" "bottom";
+ }
+ program {
+ name: "orient";
+ signal: "set_orientation";
+ source: "*";
+ script { // sig, src
+ if (!strcmp(src, "left")) {
+ set_int(orient, 0);
+ set_state(PART:"background", "vert", 0.0);
+ set_state(PART:"overlay", "left", 0.0);
+ set_state(PART:"items", "left", 0.0);
+ set_state(PART:"h1", "left", 0.0);
+ set_state(PART:"h2", "left", 0.0);
+ set_state(PART:"h1th", "vert", 0.0);
+ set_state(PART:"h2th", "vert", 0.0);
+ set_state(PART:"h1a1", "vert", 0.0);
+ set_state(PART:"h1a2", "vert", 0.0);
+ set_state(PART:"h1a3", "vert", 0.0);
+ set_state(PART:"h1a4", "vert", 0.0);
+ set_state(PART:"h2a1", "vert", 0.0);
+ set_state(PART:"h2a2", "vert", 0.0);
+ set_state(PART:"h2a3", "vert", 0.0);
+ set_state(PART:"h2a4", "vert", 0.0);
+ set_state(PART:"h3", "left", 0.0);
+ set_state(PART:"h3th", "vert", 0.0);
+ }
+ else if (!strcmp(src, "right")) {
+ set_int(orient, 1);
+ set_state(PART:"background", "vert", 0.0);
+ set_state(PART:"overlay", "right", 0.0);
+ set_state(PART:"items", "right", 0.0);
+ set_state(PART:"h1", "right", 0.0);
+ set_state(PART:"h2", "right", 0.0);
+ set_state(PART:"h1th", "vert", 0.0);
+ set_state(PART:"h2th", "vert", 0.0);
+ set_state(PART:"h1a1", "vert", 0.0);
+ set_state(PART:"h1a2", "vert", 0.0);
+ set_state(PART:"h1a3", "vert", 0.0);
+ set_state(PART:"h1a4", "vert", 0.0);
+ set_state(PART:"h2a1", "vert", 0.0);
+ set_state(PART:"h2a2", "vert", 0.0);
+ set_state(PART:"h2a3", "vert", 0.0);
+ set_state(PART:"h2a4", "vert", 0.0);
+ set_state(PART:"h3", "right", 0.0);
+ set_state(PART:"h3th", "vert", 0.0);
+ }
+ else if (!strcmp(src, "top")) {
+ set_int(orient, 2);
+ set_state(PART:"background", "default", 0.0);
+ set_state(PART:"overlay", "top", 0.0);
+ set_state(PART:"items", "top", 0.0);
+ set_state(PART:"h1", "top", 0.0);
+ set_state(PART:"h2", "top", 0.0);
+ set_state(PART:"h1th", "default", 0.0);
+ set_state(PART:"h2th", "default", 0.0);
+ set_state(PART:"h1a1", "default", 0.0);
+ set_state(PART:"h1a2", "default", 0.0);
+ set_state(PART:"h1a3", "default", 0.0);
+ set_state(PART:"h1a4", "default", 0.0);
+ set_state(PART:"h2a1", "default", 0.0);
+ set_state(PART:"h2a2", "default", 0.0);
+ set_state(PART:"h2a3", "default", 0.0);
+ set_state(PART:"h2a4", "default", 0.0);
+ set_state(PART:"h3", "top", 0.0);
+ set_state(PART:"h3th", "default", 0.0);
+ }
+ else if (!strcmp(src, "bottom")) {
+ set_int(orient, 3);
+ set_state(PART:"background", "default", 0.0);
+ set_state(PART:"overlay", "default", 0.0);
+ set_state(PART:"items", "default", 0.0);
+ set_state(PART:"h1", "default", 0.0);
+ set_state(PART:"h2", "default", 0.0);
+ set_state(PART:"h1th", "default", 0.0);
+ set_state(PART:"h2th", "default", 0.0);
+ set_state(PART:"h1a1", "default", 0.0);
+ set_state(PART:"h1a2", "default", 0.0);
+ set_state(PART:"h1a3", "default", 0.0);
+ set_state(PART:"h1a4", "default", 0.0);
+ set_state(PART:"h2a1", "default", 0.0);
+ set_state(PART:"h2a2", "default", 0.0);
+ set_state(PART:"h2a3", "default", 0.0);
+ set_state(PART:"h2a4", "default", 0.0);
+ set_state(PART:"h3", "default", 0.0);
+ set_state(PART:"h3th", "default", 0.0);
+ }
+ }
+ }
+
+ program {
+ name: "inn_in";
+ signal: "mouse,in";
+ source: "inn";
+ action: STATE_SET "on" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "clp";
+ }
+ program {
+ name: "inn_out";
+ signal: "mouse,out";
+ source: "inn";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 1.0;
+ target: "clp";
+ }
+
+ program {
+ name: "h1_in";
+ signal: "mouse,in";
+ source: "h1";
+ script {
+ new ori = get_int(orient);
+ if ((ori == 0) || (ori == 1)) {
+ emit("h1_v_pulse", "");
+ }
+ else {
+ emit("h1_h_pulse", "");
+ }
+ }
+ }
+ program {
+ name: "h1_out";
+ signal: "mouse,out";
+ source: "h1";
+ action: ACTION_STOP;
+ target: "h1_h_in1a";
+ target: "h1_h_in1b";
+ target: "h1_h_in2a";
+ target: "h1_h_in2b";
+ target: "h1_h_in3a";
+ target: "h1_h_in3b";
+ target: "h1_h_in4a";
+ target: "h1_h_in4b";
+ target: "h1_v_in1a";
+ target: "h1_v_in1b";
+ target: "h1_v_in2a";
+ target: "h1_v_in2b";
+ target: "h1_v_in3a";
+ target: "h1_v_in3b";
+ target: "h1_v_in4a";
+ target: "h1_v_in4b";
+ after: "h1_out2";
+ }
+ program {
+ name: "h1_out2";
+ script {
+ new ori = get_int(orient);
+ if ((ori == 0) || (ori == 1)) {
+ set_state(PART:"h1a1", "vert", 0.0);
+ set_state(PART:"h1a2", "vert", 0.0);
+ set_state(PART:"h1a3", "vert", 0.0);
+ set_state(PART:"h1a4", "vert", 0.0);
+ }
+ else {
+ set_state(PART:"h1a1", "default", 0.0);
+ set_state(PART:"h1a2", "default", 0.0);
+ set_state(PART:"h1a3", "default", 0.0);
+ set_state(PART:"h1a4", "default", 0.0);
+ }
+ }
+ }
+
+ program {
+ name: "h1_h_0";
+ signal: "h1_h_pulse";
+ source: "";
+ after: "h1_h_in1a";
+ }
+ program {
+ name: "h1_h_in1a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a1";
+ after: "h1_h_in2a";
+ after: "h1_h_in2b";
+ }
+ program {
+ name: "h1_h_in1b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a4";
+ }
+
+ program {
+ name: "h1_h_in2a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a2";
+ after: "h1_h_in3a";
+ after: "h1_h_in3b";
+ }
+ program {
+ name: "h1_h_in2b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a1";
+ }
+
+ program {
+ name: "h1_h_in3a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a3";
+ after: "h1_h_in4a";
+ after: "h1_h_in4b";
+ }
+ program {
+ name: "h1_h_in3b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a2";
+ }
+
+ program {
+ name: "h1_h_in4a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a4";
+ after: "h1_h_in1a";
+ after: "h1_h_in1b";
+ }
+ program {
+ name: "h1_h_in4b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a3";
+ }
+
+ program {
+ name: "h1_v_0";
+ signal: "h1_v_pulse";
+ source: "";
+ after: "h1_v_in1a";
+ }
+ program {
+ name: "h1_v_in1a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a1";
+ after: "h1_v_in2a";
+ after: "h1_v_in2b";
+ }
+ program {
+ name: "h1_v_in1b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a4";
+ }
+
+ program {
+ name: "h1_v_in2a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a2";
+ after: "h1_v_in3a";
+ after: "h1_v_in3b";
+ }
+ program {
+ name: "h1_v_in2b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a1";
+ }
+
+ program {
+ name: "h1_v_in3a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a3";
+ after: "h1_v_in4a";
+ after: "h1_v_in4b";
+ }
+ program {
+ name: "h1_v_in3b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a2";
+ }
+
+ program {
+ name: "h1_v_in4a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h1a4";
+ after: "h1_v_in1a";
+ after: "h1_v_in1b";
+ }
+ program {
+ name: "h1_v_in4b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h1a3";
+ }
+
+ program {
+ name: "h1_click1";
+ signal: "mouse,down,1";
+ source: "h1";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h1", "left2", 0.0);
+ set_state(PART:"h1th", "vert2", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h1", "right2", 0.0);
+ set_state(PART:"h1th", "vert2", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h1", "top2", 0.0);
+ set_state(PART:"h1th", "default2", 0.0);
+ }
+ else {
+ set_state(PART:"h1", "default2", 0.0);
+ set_state(PART:"h1th", "default2", 0.0);
+ }
+ emit("resize1_start", "");
+ }
+ }
+ program {
+ name: "h1_click2";
+ signal: "mouse,up,1";
+ source: "h1";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h1", "left", 0.0);
+ set_state(PART:"h1th", "vert", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h1", "right", 0.0);
+ set_state(PART:"h1th", "vert", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h1", "top", 0.0);
+ set_state(PART:"h1th", "default", 0.0);
+ }
+ else {
+ set_state(PART:"h1", "default", 0.0);
+ set_state(PART:"h1th", "default", 0.0);
+ }
+ emit("resize1_stop", "");
+ }
+ }
+
+ program {
+ name: "h2_in";
+ signal: "mouse,in";
+ source: "h2";
+ script {
+ new ori = get_int(orient);
+ if ((ori == 0) || (ori == 1)) {
+ emit("h2_v_pulse", "");
+ }
+ else {
+ emit("h2_h_pulse", "");
+ }
+ }
+ }
+ program {
+ name: "h2_out";
+ signal: "mouse,out";
+ source: "h2";
+ action: ACTION_STOP;
+ target: "h2_h_in1a";
+ target: "h2_h_in1b";
+ target: "h2_h_in2a";
+ target: "h2_h_in2b";
+ target: "h2_h_in3a";
+ target: "h2_h_in3b";
+ target: "h2_h_in4a";
+ target: "h2_h_in4b";
+ target: "h2_v_in1a";
+ target: "h2_v_in1b";
+ target: "h2_v_in2a";
+ target: "h2_v_in2b";
+ target: "h2_v_in3a";
+ target: "h2_v_in3b";
+ target: "h2_v_in4a";
+ target: "h2_v_in4b";
+ after: "h2_out2";
+ }
+ program {
+ name: "h2_out2";
+ script {
+ new ori = get_int(orient);
+ if ((ori == 0) || (ori == 1)) {
+ set_state(PART:"h2a1", "vert", 0.0);
+ set_state(PART:"h2a2", "vert", 0.0);
+ set_state(PART:"h2a3", "vert", 0.0);
+ set_state(PART:"h2a4", "vert", 0.0);
+ }
+ else {
+ set_state(PART:"h2a1", "default", 0.0);
+ set_state(PART:"h2a2", "default", 0.0);
+ set_state(PART:"h2a3", "default", 0.0);
+ set_state(PART:"h2a4", "default", 0.0);
+ }
+ }
+ }
+
+ program {
+ name: "h2_h_0";
+ signal: "h2_h_pulse";
+ source: "";
+ after: "h2_h_in1a";
+ }
+ program {
+ name: "h2_h_in1a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a1";
+ after: "h2_h_in2a";
+ after: "h2_h_in2b";
+ }
+ program {
+ name: "h2_h_in1b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a4";
+ }
+
+ program {
+ name: "h2_h_in2a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a2";
+ after: "h2_h_in3a";
+ after: "h2_h_in3b";
+ }
+ program {
+ name: "h2_h_in2b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a1";
+ }
+
+ program {
+ name: "h2_h_in3a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a3";
+ after: "h2_h_in4a";
+ after: "h2_h_in4b";
+ }
+ program {
+ name: "h2_h_in3b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a2";
+ }
+
+ program {
+ name: "h2_h_in4a";
+ action: STATE_SET "default2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a4";
+ after: "h2_h_in1a";
+ after: "h2_h_in1b";
+ }
+ program {
+ name: "h2_h_in4b";
+ action: STATE_SET "default" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a3";
+ }
+
+ program {
+ name: "h2_v_0";
+ signal: "h2_v_pulse";
+ source: "";
+ after: "h2_v_in1a";
+ }
+ program {
+ name: "h2_v_in1a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a1";
+ after: "h2_v_in2a";
+ after: "h2_v_in2b";
+ }
+ program {
+ name: "h2_v_in1b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a4";
+ }
+
+ program {
+ name: "h2_v_in2a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a2";
+ after: "h2_v_in3a";
+ after: "h2_v_in3b";
+ }
+ program {
+ name: "h2_v_in2b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a1";
+ }
+
+ program {
+ name: "h2_v_in3a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a3";
+ after: "h2_v_in4a";
+ after: "h2_v_in4b";
+ }
+ program {
+ name: "h2_v_in3b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a2";
+ }
+
+ program {
+ name: "h2_v_in4a";
+ action: STATE_SET "vert2" 0.0;
+ transition: SINUSOIDAL 0.25;
+ target: "h2a4";
+ after: "h2_v_in1a";
+ after: "h2_v_in1b";
+ }
+ program {
+ name: "h2_v_in4b";
+ action: STATE_SET "vert" 0.0;
+ transition: DECELERATE 0.75;
+ target: "h2a3";
+ }
+
+ program {
+ name: "h2_click1";
+ signal: "mouse,down,1";
+ source: "h2";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h2", "left2", 0.0);
+ set_state(PART:"h2th", "vert2", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h2", "right2", 0.0);
+ set_state(PART:"h2th", "vert2", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h2", "top2", 0.0);
+ set_state(PART:"h2th", "default2", 0.0);
+ }
+ else {
+ set_state(PART:"h2", "default2", 0.0);
+ set_state(PART:"h2th", "default2", 0.0);
+ }
+ emit("resize2_start", "");
+ }
+ }
+ program {
+ name: "h2_click2";
+ signal: "mouse,up,1";
+ source: "h2";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h2", "left", 0.0);
+ set_state(PART:"h2th", "vert", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h2", "right", 0.0);
+ set_state(PART:"h2th", "vert", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h2", "top", 0.0);
+ set_state(PART:"h2th", "default", 0.0);
+ }
+ else {
+ set_state(PART:"h2", "default", 0.0);
+ set_state(PART:"h2th", "default", 0.0);
+ }
+ emit("resize2_stop", "");
+ }
+ }
+
+
+ program {
+ name: "h3_click1";
+ signal: "mouse,down,1";
+ source: "h3";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h3", "left2", 0.0);
+ set_state(PART:"h3th", "vert2", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h3", "right2", 0.0);
+ set_state(PART:"h3th", "vert2", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h3", "top2", 0.0);
+ set_state(PART:"h3th", "default2", 0.0);
+ }
+ else {
+ set_state(PART:"h3", "default2", 0.0);
+ set_state(PART:"h3th", "default2", 0.0);
+ }
+ emit("move_start", "");
+ }
+ }
+ program {
+ name: "h3_click2";
+ signal: "mouse,up,1";
+ source: "h3";
+ script {
+ new ori = get_int(orient);
+ if (ori == 0) {
+ set_state(PART:"h3", "left", 0.0);
+ set_state(PART:"h3th", "vert", 0.0);
+ }
+ else if (ori == 1) {
+ set_state(PART:"h3", "right", 0.0);
+ set_state(PART:"h3th", "vert", 0.0);
+ }
+ else if (ori == 2) {
+ set_state(PART:"h3", "top", 0.0);
+ set_state(PART:"h3th", "default", 0.0);
+ }
+ else {
+ set_state(PART:"h3", "default", 0.0);
+ set_state(PART:"h3th", "default", 0.0);
+ }
+ emit("move_stop", "");
+ }
+ }
+ }
+ }
+ group {
+ name: "modules/ibar/follower";
+ min: 56 56;
+ data {
+// item: "item_list", "item item2 item3";
+ }
+ parts {
+ part {
+ name: "top";
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 -13;
+ }
+ rel2 {
+ relative: 1.0 0.0;
+ offset: -1 27;
+ }
+ image {
+ normal: "e17_ibar_lamp_d.png";
+ }
+ }
+ description {
+ state: "top" 0.0;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -27;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 13;
+ }
+ image {
+ normal: "e17_ibar_lamp_u.png";
+ }
+ }
+ description {
+ state: "right" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: -13 0;
+ }
+ rel2 {
+ relative: 0.0 1.0;
+ offset: 27 -1;
+ }
+ image {
+ normal: "e17_ibar_lamp_r.png";
+ }
+ }
+ description {
+ state: "left" 0.0;
+ rel1 {
+ relative: 1.0 0.0;
+ offset: -27 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: 13 -1;
+ }
+ image {
+ normal: "e17_ibar_lamp_l.png";
+ }
+ }
+ }
+ program {
+ name: "orient";
+ signal: "set_orientation";
+ source: "bottom";
+ action: STATE_SET "default" 0.0;
+ target: "top";
+ }
+ program {
+ name: "orient2";
+ signal: "set_orientation";
+ source: "top";
+ action: STATE_SET "top" 0.0;
+ target: "top";
+ }
+ program {
+ name: "orient3";
+ signal: "set_orientation";
+ source: "left";
+ action: STATE_SET "left" 0.0;
+ target: "top";
+ }
+ program {
+ name: "orient4";
+ signal: "set_orientation";
+ source: "right";
+ action: STATE_SET "right" 0.0;
+ target: "top";
+ }
+ }
+ }
+ group {
+ name: "modules/ibar/icon";
+ data {
+ item: "raise_on_hilight" "0"; // 1 or 0 if u want an icon holder to raise when the mouse (or keyboard) hilights it
+// item: "item_list" "item item2 item3";
+ }
+ parts {
+ part {
+ name: "item";
+ type: SWALLOW;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 4 4;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ }
+ color: 0 0 0 0;
+ }
+ }
+ }
+ }
+ group {
+ name: "modules/ibar/icon_overlay";
+ data {
+// item: "item_list", "item item2 item3";
+ }
+ parts {
+ part {
+ name: "base";
+ type: RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 4 4;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -5 -5;
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "background";
+ type: RECT;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "base";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "base";
+ }
+ color: 255 255 255 0;
+ }
+ description {
+ state: "visible" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "base";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "base";
+ }
+ color: 255 255 255 255;
+ }
+ description {
+ state: "hidden" 0.0;
+ rel1 {
+ relative: -0.5 -0.5;
+ offset: 0 0;
+ to: "base";
+ }
+ rel2 {
+ relative: 1.5 1.5;
+ offset: -1 -1;
+ to: "base";
+ }
+ color: 255 255 255 0;
+ }
+ }
+ part {
+ name: "item";
+ type: SWALLOW;
+ mouse_events: 0;
+ clip_to: "background";
+ description {
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ to: "background";
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ to: "background";
+ }
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program {
+ name: "go_active";
+ signal: "active";
+ source: "";
+ action: STATE_SET "visible" 0.0;
+ target: "background";
+ after: "go_active2";
+ }
+ program {
+ name: "go_active2";
+ signal: "";
+ source: "";
+ action: STATE_SET "hidden" 0.0;
+ transition: LINEAR 0.5;
+ target: "background";
+ after: "go_active";
+ }
+ program {
+ name: "go_passive";
+ signal: "passive";
+ source: "";
+ action: ACTION_STOP;
+ target: "go_active";
+ target: "go_active2";
+ after: "go_passive2";
+ }
+ program {
+ name: "go_passive2";
+ signal: "";
+ source: "";
+ action: STATE_SET "default" 0.0;
+ target: "background";
+ }
+ }
+ }
+}
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+EXTRA_DIST = \
+e17_brushed.png \
+e17_reflection_shadow_overlay.png \
+e17_sm_reflection_shadow_overlay.png \
+e17_border1.png \
+e17_border2.png \
+e17_border3.png \
+e17_border4.png \
+e17_border5.png \
+e17_border6.png \
+e17_border7.png \
+e17_button.png \
+e17_button2.png \
+e17_button_detail_close.png \
+e17_button_detail_maximize.png \
+e17_button_detail_minimize.png \
+e17_menu_arrow.png \
+e17_menu_bg.png \
+e17_menu_check1.png \
+e17_menu_check2.png \
+e17_menu_radio1.png \
+e17_menu_radio2.png \
+e17_menu_separator.png \
+e17_mini_button.png \
+e17_mini_button_shadow1.png \
+e17_mini_button_shadow2.png \
+e17_titlebar.png \
+e17_titlebar_outline.png \
+e17_titlebar_shadow1.png \
+e17_titlebar_shadow2.png \
+e17_ibar_arrow_d.png \
+e17_ibar_arrow_l.png \
+e17_ibar_arrow_r.png \
+e17_ibar_arrow_u.png \
+e17_ibar_bg_h.png \
+e17_ibar_bg_v.png \
+e17_ibar_handle_h.png \
+e17_ibar_handle_h2.png \
+e17_ibar_handle_thumb_h.png \
+e17_ibar_handle_thumb_v.png \
+e17_ibar_handle_v.png \
+e17_ibar_handle_v2.png \
+e17_ibar_lamp_d.png \
+e17_ibar_lamp_l.png \
+e17_ibar_lamp_r.png \
+e17_ibar_lamp_u.png \
+e17_ibar_over_h.png \
+e17_ibar_over_v.png
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+filesdir = $(datadir)/enlightenment/doc
+files_DATA = \
+documentation.html \
+enlightenment.png
+
+EXTRA_DIST = $(files_DATA)
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+ <TITLE>Enlightenment Developer Documentation</TITLE>
+ <STYLE>
+ <!--
+ @page { size: 51pc 66pc }
+ P.western { font-size: 8pt }
+ P.cjk { font-family: "Bitstream Vera Sans"; font-size: 8pt }
+ A.western:link { font-size: 8pt }
+ A.cjk:link { font-family: "Bitstream Vera Sans"; font-size: 8pt }
+ A.sdfootnotesym-western { font-size: 8pt }
+ A.sdfootnotesym-cjk { font-family: "Bitstream Vera Sans"; font-size: 8pt }
+ A.sdendnotesym-western { font-size: 8pt }
+ A.sdendnotesym-cjk { font-family: "Bitstream Vera Sans"; font-size: 8pt }
+ -->
+ </STYLE>
+</HEAD>
+<BODY LANG="en-US" DIR="LTR">
+<TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=0 STYLE="page-break-before: always">
+ <COL WIDTH=256*>
+ <TR>
+ <TD WIDTH=100% VALIGN=TOP>
+ <P CLASS="western" ALIGN=CENTER STYLE="margin-bottom: 0pc"><IMG SRC="enlightenment.png" NAME="Graphic1" ALIGN=LEFT WIDTH=320 HEIGHT=320 BORDER=0><FONT FACE="Bitstream Vera Sans"><FONT SIZE=5><B>Enlightenment</B></FONT></FONT></P>
+ <P CLASS="western" STYLE="margin-bottom: 0pc"><BR>
+ </P>
+ <P CLASS="western" ALIGN=CENTER STYLE="margin-bottom: 0pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 6pt">Version
+ 0.17.0 </FONT></FONT>
+ </P>
+ <P CLASS="western" STYLE="margin-bottom: 0pc"><BR>
+ </P>
+ <P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>What
+ is Enlightenment?</B> </FONT></FONT>
+ </P>
+ <P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Enlightenment
+ is a Window Manager for X11. This is the latest incarnation of
+ code of the Enlightenment window manager (often referred to in
+ short as WM). This WM is built on the EFL (Enlightenment
+ Foundation Libraries) that have been worked on very hard over the
+ last few years. These libraries provide a sound base on which to
+ build the WM and related tools, utilities, and applications.</FONT></FONT></P>
+ <P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Right
+ now if you are just a "user" this code is NOT for you.
+ You're on your own. If you are a developer wanting to work on the
+ code - read on. But first we should take a break for some
+ history... </FONT></FONT>
+ </P>
+ </TD>
+ </TR>
+</TABLE>
+<HR>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>A
+Brief History of Time... err Enlightenment</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">In
+the past E has undergone 1 major rewrite since release DR
+(Development Release) 0.1. This rewrite occurred for DR 0.14). DR
+0.17 heralds another major rewrite. We have to be honest here. The
+reason for this is the fact that we got lazy. Design went out the
+window in favor of quick fixes and fast features. Too many people
+worked on the code with too little care and attention to detail.
+Large design mistakes were made, that to undo would be paramount to
+half a rewrite. Patches were accepted without taking care to look at
+them in detail, clean them or even reject them if not “well
+done” enough for E's code. Thus the decision was made to fix
+things once and for all and split things up, have well defined
+interfaces (the EFL library API's) and clean and consistent code and
+naming schemes. No it's not perfect - probably it will never be, but
+we are trying. It is a massive improvement over anything
+Enlightenment had before, and we are proud enough to probably say
+it's some of the better API's and code of any available in the world
+or used in any application or WM. It's not the best, but it's pretty
+good. In doing this rewrite and split, we aim to not make those
+mistakes again that happened before DR 0.17.0.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">With
+Enlightenment and EFL's massive break-up into smaller sized chunks,
+many users will complain about “how hard it is to install”
+because there are so many libraries and inter-dependencies to handle.
+We believe this is not our job, but the job of a package management
+system to handle. We have documented the dependencies for people to
+follow, but if anything, we aim to split things up more to make
+maintenance, in the long term, an easier task. So in an effort to
+avoid them, Here is a quick style and design guide for working on
+this code. Please follow it, and if what you want to do doesn't fit
+in, please discuss it first. Discuss your designs on the e-devel
+(enlightemment-devel@lists.sourceforge.net) mailing list. Make your
+code consistent and easy to follow - make it follow the style of the
+rest in function naming, variable naming, access functions etc. Use
+existing infrastructures - or extend them cleanly as needed. Just
+because an infrastructure or system doesn't provide an accessor or
+way of doing something does NOT mean you can't add it. Choose a clean
+“correct” implementation over a nasty hack, all the time.
+You get the idea. Now, on to the style guide.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Enlightenment
+Stylin'</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Firstly
+comes naming. All functions are name spaced. The EFL libraries begin
+with library_something_something. It is object oriented naming so you
+will have system_subsystem_subsystem_object_verb() as a name. For
+example: e_config_load() or e_border_move() etc. All functions are
+all lower-case with underscores between "words". All
+functions that are accessed outside a file must have a prototype in
+the file's header. All files have their code file (e_file.c) and a
+header (e_file.h). The main "master" header (e.h) includes
+all the smaller ones. All functions within that file are the same
+name as the file. i.e. e_frog.c contains functions called
+e_frog_something(). All internal functions only used within that file
+should be declared as static and should begin with an underscore.
+i.e. _e_frog_something(). All "local" globals (global to
+that file only) should be declared static and beginning with _e_frog
+just like functions. All static local functions should be at the end
+of the file. All static function prototypes should be first at the
+top of each file. All static local variables should come next, then
+followed by the accessible functions. Any system that has "state"
+should have an init and shutdown function. The init and shutdown
+functions should be called from e_main.c during startup and shutdown
+of the WM. It is encouraged that even systems that do not have state
+have an init and shutdown call pair, just in case in future they will
+gain state internally.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Any
+system that returns objects (allocated structures) should probably
+use the E_Object system as a parent. See examples on its use in the
+code. E_Object provides a simple object wrapper with reference
+counting, object pointer and type checking and safety that should,
+runtime, trap a lot of potential problems and let the programmer know
+about them. Use the object type checking macros for checking if an
+object passed into a function as a parameter is a valid object.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Keep
+to the indentation and spacing style thats there - it makes it easier
+to read if all the code matches. All functions called as "callbacks"
+should be called _e_system_cb_something. The "cb" denotes
+that that function may get called by other code, maybe unpredictably,
+at any time in response to an event, timer, or something mostly out
+of the control of the program itself. Functions such as the free
+function for an object aren't the same kind of callback, since they
+are predictable and controllable, so they do not get "cb"
+in their name.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">So
+that's the quick rundown on basic coding style. More will likely be
+added to this list, but the best way to put it all is "look at
+what's there and follow the same style".</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Tree
+Layout</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">The
+E17 source tree is well structured, with a location for everything.
+In the top-level directory you will find a src directory that is the
+master directory for all the C source code for the WM and components.
+You will also find a doc and data directories. The doc directory
+contains all documentation (this document for example).</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">The
+data directory contains all cross-platform data needed for the WM to
+run as well as a basic default theme that it also needs to run.
+Currently the default theme is not complete at all and is no
+indication of Enlightenments final look when it is released. It is
+only just enough to make it work and demonstrate an example of how to
+make a theme. There is also other data used for things like low-level
+error dialogs (used for example if the theme doesn't work) as well as
+a default font and other system data such as data for the splash
+screen displayed while Enlightenment starts up.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">The
+src directory contains 3 main repositories of code. They are bin, lib
+and modules. The bin directory contains all the source code for the
+WM itself and any primary executables it uses curing execution. The
+modules directory contains all plug-in modules that E17 can load and
+unload dynamically at runtime, allowing the WM to be extended even
+after it has been compiled and installed by users, other developers
+or by the E development team itself. These modules are intended to
+provide clean modular boundaries for certain features of
+Enlightenment too, so if a feature isn't used it doesn't have to use
+any resources at all. Each module lives in its own subdirectory with
+the code and special module specific data like images, Edje .eet
+files etc. that are specific to that module. See further on for more
+information on modules.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Design
+Ethos</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">As
+for design, Enlightenment doesn't strictly follow a conservative WM
+design. It does some things quite differently, with the aim of
+providing more features with simpler internal design to achieve more
+features with more solidity than a conservative design. An example of
+this is the fact that E17 does away completely with the root window
+and puts all managed windows within a virtual root. Virtual roots are
+valid to be used in WM's but are rarely used and many client
+applications are badly written to hunt for windows on the screen
+ASSUMING there is no virtual root. These are bugs in the respective
+applications (some of which are: Mozilla, xwininfo, xprop, xkill)
+which when searching for an application window should walk the window
+tree correctly. The reason for Enlightenment to adopt virtual roots
+is not to make users annoyed or force application developers to
+change their code, but to allow certain things to be done much more
+efficiently. A virtual root allows the WM to scroll windows
+seamlessly and all in sync by using window gravity and resizing of
+the virtual root container. It also allows the WM to simulate
+different resolutions very easily since it can control the virtual
+root window, which is not normally possible to do with the real root
+window.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Managers</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Managers
+are the basic unit of window management. One Manager object is create
+per root window to manage. For more people, even if they run Xinerama
+across multiple screens, there is only 1 root window, and thus E17
+will only ever have 1 Manager object. If the user runs traditional
+Multihead there will be 1 root window per screen, that may be a
+different size and color depth. E17 will create 1 Manager object per
+screen in this situation. The Manager object handles redirection WM
+specific events for the root window into the WM, thus effectively
+being able to trap several kinds of events before a client gets to
+perform them, thus enabling it to be a WM. A Manager object actually
+creates a window the size of the root window it manages and covers
+the root window up completely. Each Manager object may contain 1 or
+more Container objects which in-turn create their own child windows
+of the Manager window.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Containers</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Container
+objects create their own windows to CONTAIN managed window frames,
+the desktop window (the desktop background is actually just a big
+window that is always kept below all frame windows that contains a
+canvas for displaying the desktop background and all desktop objects
+such as a launcher bar, file icons, etc. etc.). The Container is
+responsible for holding this together and also managing a list of
+“obscuring” objects that fully obscure the desktop
+canvas, so it can help optimize drawing to the desktop canvas by
+avoiding to draw parts of the desktop background canvas that cannot
+be seen at all. This list is also used to draw soft drop shadows on
+the desktop canvas by the Dropshadow module. The Container object
+managed the desktop background, which is actually a complete EDJE
+object. This may seem strange as a simple JPEG or PNG or GIF may be
+enough, but by using an EDJE object for the background, the desktop
+wallpaper can be animated, react to events and input, scale
+intelligently (not just “stretch” or “tile”),
+where the desktop wallpaper designer can specify what elements of the
+wallpaper scale, align, where and how, if they tile, overlay,
+underlay each other, and how.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Currently
+the Container only responds to configuration change events to change
+the background, which needs to be a path to a Edje .eet file that
+contains a Edje group of the key “desktop/background”. It
+will load this group, if present in the file as the background. What
+it needs is a configuration tool that can browse the filing system
+and directories for .eet files that are like this, display thumbnails
+and previews, allow a user to select a new background and maybe
+specify if the background file should change between different
+virtual desktops (which are currently not implemented), and also be
+able to browse normal JPEG, PNG etc. files and “import”
+them into a users wallpaper database (a directory of wallpaper .eet
+files) and thus convert into a Edje .eet file, which now retains the
+scaling, tiling and other preferences the user selected within the
+file. The user can now give this file to others and it will retain
+the same information, without them needing to know if the wallpaper
+needs to tile as a pattern, stretch etc.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">The
+desktop canvas is also shared by many modules that may display things
+like battery meters, cpu load, launcher bars, drop shadows etc. on
+the desktop background. The desktop canvas lets this be a bit more
+organized than it would be with a “free for all” drawing
+to the root window under more conservative WM's.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Borders</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Borders
+are the frame outside an application window that is controlled by the
+WM and that holds the application window within, and allows users to
+move, resize, shade, lower, close and otherwise control windows. This
+is currently buggy and not very useful and needs work in combination
+with the Manager system.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Menus</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Enlightenment
+has its own Menu widget code to allow for highly themable menus that
+match your WM's theme. These menus are intended to act as ways to
+launch programs, select actions to perform with context sensitive
+menus and to provide basic on/off and option select options for
+simple enabling and disabling of features of states on objects. The
+menu code is fairly solid, but incomplete. It is efficient, able to
+let the user navigate with the keyboard, mouse wheel or mouse. It
+currently needs work to support shaped menu windows, be able to add,
+delete and modify menu items while the item is still realized, and a
+set of other things listed in the TODO list at the top of the
+e_menu.c source file.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Modules</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Modules
+are a new and powerful way to extend E17 by being able to load and
+execute code during runtime that may be shipped with E17 or even
+developed after installation as enhancements and additions. This
+system still needs work in the configuration department, knowing what
+modules to load and not load, if they are to be enabled once they are
+loaded etc. It is possible to have “dormant” modules that
+are loaded but not enabled. They will use memory and resources for
+the module entry and the binary executable code loaded into memory,
+but nothing else. An enabled module will also use resources for
+objects, images, etc. etc.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Dropshadow
+Module</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+module demonstrates the Container shape system allowing a module to
+monitor obscuring shapes in a container. This lets the module, in
+this case, draw soft shadows under these obscuring shapes. It is a
+fairly simple module and also demonstrates a module that has no
+visible elements on the screen you can click on or control directly
+with the mouse or keyboard. It could do with some optimization work
+with the blur algorithm, like clipping out the obscuring shape
+entirely from the blurring algorithm, and perhaps finding a way of
+blurring using a Gaussian blur that is faster.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>IBar
+Module</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">The
+IBar module is a template for doing a “launcher panel” in
+E17. It allows the user to manage a list of frequently used
+applications to go into the IBar's panel. It is an attempt to unify
+the configuration of “bars” in E17 so if a user changes
+launcher bar modules, they can retain at least most of the basic
+configuration, like what applications are in the bar, and so-on. The
+IBar has some unique characteristics allowing a lot of applications
+to be held in a small bar, by having it auto-scroll on mouse over to
+the desired location in the list. It uses the Application interface
+to fetch a list of applications and monitor this list for changes on
+disk. The IBar also allows itself to be resized and dragged around
+the edges of the screen, set to fill a edge, auto-size to fit its
+contents, or be a fixed size.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">It
+needs work to be done on auto hide and auto show, so on an auto show
+it could signal other parts of E17, for example, to slide all windows
+out of the way, or other such features. It needs work to display
+application names, descriptions and other such information as well.
+It also needs to support the icon size changing on the fly as well as
+saving and loading its configuration, On of the largest pieces of
+work is to support subdirectories in the bar's application list. How
+best to do this is still up in the air. For now this isn't supported.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Test
+Module</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+is just a test module for playing with new module features. It will
+not make its way into a final E17 release, but can be used as a bare
+skeleton for building a new module.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Applications</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+subsystem is responsible for being able to list applications held in
+E17 specific application directories. This system can inform other
+parts of E17 and modules of changes, such as an application being
+deleted or added, its name or icon changed, the order of applications
+in a directory changing, an application being executed or displaying
+its window, or finishing execution. It can share the application
+lists between multiple systems to save RAM and CPU and I/O in loading
+them multiple times.</FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">It
+may be of surprise to find E17 is not loading the XML, .desktop
+entries etc. etc. than KDE and GNOME use. In all honesty that system
+is a little overcomplicated and hard to keep up with. It also is not
+as robust as E17's system. With E17's system the images for the icons
+are within the application file. They cannot be separately deleted.
+Also using an Edje .eet file for the application entry allows for
+fully scalable and animated icons as well, with excellent compression
+abilities. The intent is to have external tools that can import and
+create such files FROM existing system databases of applications and
+monitor these for changes, reflecting those changes in Enlightenments
+application directories.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>IPC</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">IPC
+(inter process communication) is provided in E17 as a mechanism for
+another application to send commands and requests to Enlightenment
+and receive responses with information. This mechanism is intended to
+allow external utilities to be written and ask Enlightenment to do
+things via a communications channel built into the WM. E17 uses the
+Ecore IPC system to do this. So far it support no commands at all,
+but will accept clients connecting. Many commands need to be
+implemented here, such as being able to ask E17 to load or unload a
+module, change background, change focus mode, theme, restart etc.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Objects</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+provides a basic Object Oriented handling system for E17. Any major
+“object” in E17 should use this system for handling
+reference counting, destruction and creation of objects, as it
+provides safety mechanisms to check if an object has accidentally
+been destroyed and still has a pointer to it, keep references on
+objects intact etc. This should be used as much as possible, as well
+as the macros it provides for checking on entry points into subsystem
+functions etc.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Pointers</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+subsystem handles setting of X mouse cursors in an abstract fashion.
+In theory E just looks at a cursor as RGBA pixel data. In future
+Ecore will be expanded to be able to set full color cursors in X as
+well as monochrome versions of them. Currently it is very simplistic
+loading a fixed PNG as a cursor. This needs to be improved.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Box</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+is a basic Evas Smart Object that acts as a horizontal or vertical
+box layout container. It needs more features for layout, like better
+non homogeneous layout. This is a handy object that is sued by menus
+and the IBar module for starters.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Icons</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+is an Evas Smart Object that creates a icon display object That
+handles scaling the icon sensibly within the object bounds, so the
+application doesn't have to handle trying to retain aspect ratio for
+the object. This is a simple smart object and indicative of possibly
+more in future to go into E17's code to save time and effort.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Paths</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+helps E17 find files in a list of paths/directories. There isn't a
+lot to say about this except that it works and may need some minimal
+expansion in future.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>User
+Information</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+returns information about a user such as their home directory. This
+will expand in future.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Virtual
+and Multiple Desktops</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+is not implemented yet.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Error
+Dialogs</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+displays very basic error dialogs right now, either as text in the
+console inf E17 isn't ready to run graphically yet, This needs to be
+made more robust, so it can display errors if it cannot find the font
+and images for the basic error dialog. It should also be expanded to
+support fully themed dialogs if the theme loads properly and properly
+supports theming of dialogs, so dialogs look good.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Initialization
+Splash Screen</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">This
+keeps the user amused while E17 starts up and launches all programs.
+For now it is artificially fixed to stay up for 4 seconds so you can
+enjoy its radiant splendor, as E17 starts so quickly you'd never see
+it, but in future it will stay up until the WM is all ready to go.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Configuration</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt">Loading
+and saving configuration is a big task. E17 uses Ecore Config as its
+underlying layer for saving and loading configuration. The E17 Config
+system simply sets up all listeners for when configuration values
+change, loads all the initial configuration values, and saves them
+when and if they change internally. It needs work to make it much
+simpler as many more config values will be added and it needs to be
+more efficient ad loading them if they change runtime via a listener
+(the number of listeners needs to be reduced), so maybe loading
+config values in sections/groups and deferring a reload in a Ecore
+Job would limit the reloading effects. Also declaring config values
+and how to load and declare them is required. Maybe a big table with
+default values, min, max, step, descriptions etc.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>File
+Operations</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT SIZE=1 STYLE="font-size: 8pt"><FONT FACE="Bitstream Vera Sans">Files
+need to be accessed, listed, found, examined as part of E17 running.
+This file has simplified, easy-to-use functions for doing anything
+related to files. This file will expand over time as more file
+operations are needed.</FONT></FONT></P>
+<P CLASS="western"><FONT FACE="Bitstream Vera Sans"><FONT SIZE=1 STYLE="font-size: 8pt"><B>Miscellaneous
+Utilities</B></FONT></FONT></P>
+<P CLASS="western" STYLE="margin-left: 4.73pc"><FONT SIZE=1 STYLE="font-size: 8pt"><FONT FACE="Bitstream Vera Sans">Things
+that are useful in many places but do not have enough scope to have a
+file of their own go into this file.</FONT></FONT></P>
+</BODY>
+</HTML>
--- /dev/null
+#!/bin/sh
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+exec_prefix_set=no
+
+usage="\
+Usage: evas-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
+ ;;
+ --libs)
+ libdirs=-L@libdir@
+ echo $libdirs
+ ;;
+ *)
+ echo "${usage}" 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+exit 0
--- /dev/null
+DESCRIPTION = "Enlightenment 0.17.0 snapshot release"
+HOMEPAGE = "http://www.enlightenment.org"
+MAINTAINER = "Carsten Haitzler (Rasterman) <raster@rasterman.com>"
+SECTION = "e/windowmanager"
+PRIORITY = "optional"
+DEPENDS = "ecore edje eet embryo evas imlib2 embryo-native edje-native imlib2-native"
+PV = "0.17.0_pre5"
+PR = "1"
+
+do_prepsources () {
+ make clean distclean || true
+}
+addtask prepsources after do_fetch before do_unpack
+SRC_URI = "file://./"
+S = "${WORKDIR}/e"
+
+inherit autotools pkgconfig binconfig
+
+export EET_CONFIG = "${STAGING_BINDIR}/eet-config"
+export EVAS_CONFIG = "${STAGING_BINDIR}/evas-config"
+export ECORE_CONFIG = "${STAGING_BINDIR}/ecore-config"
+export EMBRYO_CONFIG = "${STAGING_BINDIR}/embryo-config"
+export EDJE_CONFIG = "${STAGING_BINDIR}/edje-config"
+
+EXTRA_OECONF = "--with-profile=HIRES_PDA \
+ --with-edje-cc=/usr/local/bin/edje_cc"
+
+FILES_${PN} = "${bindir}/* ${libdir}/* ${datadir}"
--- /dev/null
+# Note that this is NOT a relocatable package
+%define ver 0.17.0_pre5
+%define rel NOT_RELEASE_1
+%define prefix /usr
+
+Summary: enlightenment
+Name: enlightenment
+Version: %ver
+Release: %rel
+Copyright: BSD
+Group: System Environment/Desktops
+Source: ftp://ftp.enlightenment.org/pub/enlightenment/enlightenment-%{ver}.tar.gz
+BuildRoot: /var/tmp/enlightenment-root
+Packager: The Rasterman <raster@rasterman.com>
+URL: http://www.enlightenment.org/
+BuildRequires: evas-devel
+BuildRequires: edje-devel
+BuildRequires: ecore-devel
+Requires: edje
+Requires: evas
+Requires: ecore
+
+Docdir: %{prefix}/doc
+
+%description
+
+Enlightenment is a window manager
+
+%prep
+rm -rf $RPM_BUILD_ROOT
+
+%setup -q
+
+%build
+./configure --prefix=%prefix
+
+if [ "$SMP" != "" ]; then
+ (make "MAKE=make -k -j $SMP"; exit 0)
+ make
+else
+ make
+fi
+###########################################################################
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+
+%postun
+
+%files
+%defattr(-,root,root)
+%attr(755,root,root) %{prefix}/lib/enlightenment
+%attr(755,root,root) %{prefix}/bin/*
+%attr(755,root,root) %{prefix}/share/enlightenment
+%doc AUTHORS
+%doc COPYING
+%doc COPYING-PLAIN
+%doc README
+
+%changelog
+* Sat Jun 23 2001 The Rasterman <raster@rasterman.com>
+- Created spec file
--- /dev/null
+dnl AC_EXPAND_DIR(VARNAME, DIR)
+dnl expands occurrences of ${prefix} and ${exec_prefix} in the given DIR,
+dnl and assigns the resulting string to VARNAME
+dnl example: AC_DEFINE_DIR(DATADIR, "$datadir")
+dnl by Alexandre Oliva <oliva@dcc.unicamp.br>
+AC_DEFUN([AC_EXPAND_DIR], [
+ $1=$2
+ $1=`(
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+ test "x$exec_prefix" = xNONE && exec_prefix="${prefix}"
+ eval echo \""[$]$1"\"
+ )`
+])
+
--- /dev/null
+dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl
+dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and LIBRARY_LIBS
+dnl
+dnl The script must support `--cflags' and `--libs' args.
+dnl If MINIMUM-VERSION is specified, the script must also support the
+dnl `--version' arg.
+dnl If the `--with-library-[exec-]prefix' arguments to ./configure are given,
+dnl it must also support `--prefix' and `--exec-prefix'.
+dnl (In other words, it must be like gtk-config.)
+dnl
+dnl For example:
+dnl
+dnl AC_PATH_GENERIC(Foo, 1.0.0)
+dnl
+dnl would run `foo-config --version' and check that it is at least 1.0.0
+dnl
+dnl If so, the following would then be defined:
+dnl
+dnl FOO_CFLAGS to `foo-config --cflags`
+dnl FOO_LIBS to `foo-config --libs`
+dnl
+dnl At present there is no support for additional "MODULES" (see AM_PATH_GTK)
+dnl (shamelessly stolen from gtk.m4 and then hacked around a fair amount)
+dnl
+dnl @author Angus Lees <gusl@cse.unsw.edu.au>
+
+AC_DEFUN([AC_PATH_GENERIC],
+[dnl
+dnl we're going to need uppercase, lowercase and user-friendly versions of the
+dnl string `LIBRARY'
+pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
+pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
+
+dnl
+dnl Get the cflags and libraries from the LIBRARY-config script
+dnl
+AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)],
+ DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
+AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)],
+ DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
+
+ if test x$DOWN[]_config_exec_prefix != x ; then
+ DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
+ if test x${UP[]_CONFIG+set} != xset ; then
+ UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
+ fi
+ fi
+ if test x$DOWN[]_config_prefix != x ; then
+ DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
+ if test x${UP[]_CONFIG+set} != xset ; then
+ UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
+ fi
+ fi
+
+ AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no)
+ ifelse([$2], ,
+ AC_MSG_CHECKING(for $1),
+ AC_MSG_CHECKING(for $1 - version >= $2)
+ )
+ no_[]DOWN=""
+ if test "$UP[]_CONFIG" = "no" ; then
+ no_[]DOWN=yes
+ else
+ UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
+ UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
+ ifelse([$2], , ,[
+ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \
+ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])"
+ DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])"
+ DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])"
+
+ # Compare wanted version to what config script returned.
+ # If I knew what library was being run, i'd probably also compile
+ # a test program at this point (which also extracted and tested
+ # the version in some library-specific way)
+ if test "$DOWN[]_config_major_version" -lt \
+ "$DOWN[]_wanted_major_version" \
+ -o \( "$DOWN[]_config_major_version" -eq \
+ "$DOWN[]_wanted_major_version" \
+ -a "$DOWN[]_config_minor_version" -lt \
+ "$DOWN[]_wanted_minor_version" \) \
+ -o \( "$DOWN[]_config_major_version" -eq \
+ "$DOWN[]_wanted_major_version" \
+ -a "$DOWN[]_config_minor_version" -eq \
+ "$DOWN[]_wanted_minor_version" \
+ -a "$DOWN[]_config_micro_version" -lt \
+ "$DOWN[]_wanted_micro_version" \) ; then
+ # older version found
+ no_[]DOWN=yes
+ echo -n "*** An old version of $1 "
+ echo -n "($DOWN[]_config_major_version"
+ echo -n ".$DOWN[]_config_minor_version"
+ echo ".$DOWN[]_config_micro_version) was found."
+ echo -n "*** You need a version of $1 newer than "
+ echo -n "$DOWN[]_wanted_major_version"
+ echo -n ".$DOWN[]_wanted_minor_version"
+ echo ".$DOWN[]_wanted_micro_version."
+ echo "***"
+ echo "*** If you have already installed a sufficiently new version, this error"
+ echo "*** probably means that the wrong copy of the DOWN-config shell script is"
+ echo "*** being found. The easiest way to fix this is to remove the old version"
+ echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the"
+ echo "*** correct copy of DOWN-config. (In this case, you will have to"
+ echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf"
+ echo "*** so that the correct libraries are found at run-time)"
+ fi
+ ])
+ fi
+ if test "x$no_[]DOWN" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$3], , :, [$3])
+ else
+ AC_MSG_RESULT(no)
+ if test "$UP[]_CONFIG" = "no" ; then
+ echo "*** The DOWN-config script installed by $1 could not be found"
+ echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in"
+ echo "*** your path, or set the UP[]_CONFIG environment variable to the"
+ echo "*** full path to DOWN-config."
+ fi
+ UP[]_CFLAGS=""
+ UP[]_LIBS=""
+ ifelse([$4], , :, [$4])
+ fi
+ AC_SUBST(UP[]_CFLAGS)
+ AC_SUBST(UP[]_LIBS)
+
+ popdef([UP])
+ popdef([DOWN])
+])
+
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = lib bin modules
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+INCLUDES = -I$(includedir) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/src/bin \
+ -I$(top_srcdir)/src/lib \
+ @e_cflags@ \
+ @EDJE_DEF@
+
+bin_PROGRAMS = enlightenment
+
+enlightenment_SOURCES = \
+e.h \
+e_file.h \
+e_file.c \
+e_main.c \
+e_user.h \
+e_user.c \
+e_manager.h \
+e_manager.c \
+e_path.h \
+e_path.c \
+e_init.h \
+e_init.c \
+e_ipc.h \
+e_ipc.c \
+e_error.h \
+e_error.c \
+e_container.h \
+e_container.c \
+e_desk.h \
+e_desk.c \
+e_border.h \
+e_border.c \
+e_pointer.h \
+e_pointer.c \
+e_config.h \
+e_config.c \
+e_menu.h \
+e_menu.c \
+e_object.h \
+e_object.c \
+e_icon.h \
+e_icon.c \
+e_box.h \
+e_box.c \
+e_int_menus.h \
+e_int_menus.c \
+e_module.h \
+e_module.c \
+e_apps.h \
+e_apps.c \
+e_utils.h \
+e_utils.c \
+e_canvas.h \
+e_canvas.c \
+e_focus.h \
+e_focus.c \
+e_place.h \
+e_place.c \
+e_resist.h \
+e_resist.c
+
+enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
--- /dev/null
+#ifndef E_H
+#define E_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/param.h>
+#include <dlfcn.h>
+
+#include <Evas.h>
+#include <Ecore.h>
+#include <Ecore_X.h>
+#include <Ecore_Evas.h>
+#include <Ecore_Con.h>
+#include <Ecore_Ipc.h>
+#include <Ecore_Job.h>
+#include <Ecore_Txt.h>
+#include <Ecore_Config.h>
+#include <Eet.h>
+#include <Edje.h>
+
+#include "config.h"
+
+#include "e_object.h"
+#include "e_file.h"
+#include "e_user.h"
+#include "e_manager.h"
+#include "e_path.h"
+#include "e_ipc.h"
+#include "e_error.h"
+#include "e_container.h"
+#include "e_desk.h"
+#include "e_border.h"
+#include "e_pointer.h"
+#include "e_config.h"
+#include "e_menu.h"
+#include "e_icon.h"
+#include "e_box.h"
+#include "e_init.h"
+#include "e_int_menus.h"
+#include "e_module.h"
+#include "e_apps.h"
+#include "e_utils.h"
+#include "e_canvas.h"
+#include "e_focus.h"
+#include "e_place.h"
+
+typedef struct _E_Before_Idler E_Before_Idler;
+
+E_Before_Idler *e_main_idler_before_add(int (*func) (void *data), void *data, int once);
+void e_main_idler_before_del(E_Before_Idler *eb);
+
+extern E_Path *path_data;
+extern E_Path *path_images;
+extern E_Path *path_fonts;
+extern E_Path *path_themes;
+extern E_Path *path_init;
+
+/* convenience macro to compress code and avoid typos */
+#define E_FN_DEL(_fn, _h) \
+if (_h) \
+{ \
+ _fn(_h); \
+ _h = NULL; \
+}
+
+#define E_INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
+(((x) < ((xx) + (ww))) && \
+((y) < ((yy) + (hh))) && \
+(((x) + (w)) > (xx)) && \
+(((y) + (h)) > (yy)))
+
+#define E_SPANS_COMMON(x1, w1, x2, w2) \
+(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
+
+#define E_REALLOC(p, s, n) \
+ p = realloc(p, sizeof(s) * n)
+
+#define E_NEW(s, n) \
+ calloc(n, sizeof(s))
+
+#define E_NEW_BIG(s, n) \
+ malloc(n * sizeof(s))
+
+#define E_FREE(p) \
+ { if (p) {free(p); p = NULL;} }
+
+typedef struct _E_Rect E_Rect;
+
+struct _E_Rect
+{
+ int x, y, w, h;
+};
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * if a application .eet file is added in a different location in a monitored app tree but has the same filename as an existing one somewhere else, the existing one gets a changed callback, not an dded callback for the new one
+ * * track app execution state, visibility state etc. and call callbacks
+ * * calls to execute an app or query its runing/starting state etc.
+ */
+
+/* local subsystem functions */
+typedef struct _E_App_Change_Info E_App_Change_Info;
+typedef struct _E_App_Callback E_App_Callback;
+
+struct _E_App_Change_Info
+{
+ E_App *app;
+ E_App_Change change;
+};
+
+struct _E_App_Callback
+{
+ void (*func) (void *data, E_App *a, E_App_Change ch);
+ void *data;
+ unsigned char delete_me : 1;
+};
+
+static void _e_app_free (E_App *a);
+static void _e_app_fields_fill (E_App *a, char *path);
+static void _e_app_fields_empty (E_App *a);
+static Evas_List *_e_app_dir_file_list_get (E_App *a, char *path);
+static E_App *_e_app_subapp_path_find (E_App *a, char *subpath);
+static void _e_app_monitor (void);
+static void _e_app_change (E_App *a, E_App_Change ch);
+static int _e_app_check (void *data);
+static Evas_Bool _e_app_check_each (Evas_Hash *hash, const char *key, void *data, void *fdata);
+static int _e_apps_cb_exit (void *data, int type, void *event);
+
+/* local subsystem globals */
+static Evas_Hash *_e_apps = NULL;
+static Ecore_Timer *_e_apps_checker = NULL;
+static int _e_apps_callbacks_walking = 0;
+static int _e_apps_callbacks_delete_me = 0;
+static Evas_List *_e_apps_change_callbacks = NULL;
+static Ecore_Event_Handler *_e_apps_exit_handler = NULL;
+
+/* externally accessible functions */
+int
+e_app_init(void)
+{
+ _e_apps_exit_handler = ecore_event_handler_add(ECORE_EVENT_EXE_EXIT, _e_apps_cb_exit, NULL);
+ return 1;
+}
+
+int
+e_app_shutdown(void)
+{
+ if (_e_apps_exit_handler)
+ {
+ ecore_event_handler_del(_e_apps_exit_handler);
+ _e_apps_exit_handler = NULL;
+ }
+ return 1;
+}
+
+E_App *
+e_app_new(char *path, int scan_subdirs)
+{
+ E_App *a;
+
+ a = evas_hash_find(_e_apps, path);
+ if (a)
+ {
+ e_object_ref(E_OBJECT(a));
+ return a;
+ }
+ a = E_OBJECT_ALLOC(E_App, _e_app_free);
+ a->mod_time = e_file_mod_time(path);
+ if (e_file_is_dir(path))
+ {
+ char buf[4096];
+
+ a->path = strdup(path);
+ snprintf(buf, sizeof(buf), "%s/.directory.eet", path);
+ a->directory_mod_time = e_file_mod_time(buf);
+ if (e_file_exists(buf))
+ _e_app_fields_fill(a, buf);
+ else
+ a->name = strdup(e_file_get_file(path));
+ if (scan_subdirs) e_app_subdir_scan(a, scan_subdirs);
+ }
+ else if (e_file_exists(path))
+ {
+ char *p;
+
+ /* check if file ends in .eet */
+ p = strrchr(path, '.');
+ if (!p)
+ {
+ free(a);
+ return NULL;
+ }
+ p++;
+ if (strcasecmp(p, "eet"))
+ {
+ free(a);
+ return NULL;
+ }
+ /* record the path */
+ a->path = strdup(path);
+
+ /* get the field data */
+ _e_app_fields_fill(a, path);
+
+ /* no exe field.. not valid. drop it */
+ if (!a->exe)
+ {
+ if (a->name) free(a->name);
+ if (a->generic) free(a->generic);
+ if (a->comment) free(a->comment);
+ if (a->exe) free(a->exe);
+ if (a->path) free(a->path);
+ if (a->win_name) free(a->win_name);
+ if (a->win_class) free(a->win_class);
+ free(a);
+ return NULL;
+ }
+ }
+ else
+ {
+ free(a);
+ return NULL;
+ }
+ _e_apps = evas_hash_add(_e_apps, a->path, a);
+ _e_app_monitor();
+ return a;
+}
+
+void
+e_app_subdir_scan(E_App *a, int scan_subdirs)
+{
+ Evas_List *files, *files2 = NULL;
+ FILE *f;
+ char buf[4096];
+
+ E_OBJECT_CHECK(a);
+ if (a->exe) return;
+ if (a->scanned)
+ {
+ Evas_List *l;
+
+ if (!scan_subdirs) return;
+ for (l = a->subapps; l; l = l->next)
+ e_app_subdir_scan(l->data, scan_subdirs);
+ return;
+ }
+ a->scanned = 1;
+ files = _e_app_dir_file_list_get(a, a->path);
+ while (files)
+ {
+ E_App *a2;
+ char *s;
+
+ s = files->data;
+ if (s[0] != '.')
+ {
+ snprintf(buf, sizeof(buf), "%s/%s", a->path, s);
+ free(s);
+ a2 = e_app_new(buf, scan_subdirs);
+ if (a2)
+ {
+ a->subapps = evas_list_append(a->subapps, a2);
+ a2->parent = a;
+ }
+ }
+ files = evas_list_remove_list(files, files);
+ }
+}
+
+int
+e_app_exec(E_App *a)
+{
+ Ecore_Exe *exe;
+
+ E_OBJECT_CHECK_RETURN(a, 0);
+ if (!a->exe) return 0;
+ exe = ecore_exe_run(a->exe, a);
+ if (!exe) return 0;
+ a->instances = evas_list_append(a->instances, exe);
+ if (a->startup_notify) a->starting = 1;
+ _e_app_change(a, E_APP_EXEC);
+ return 1;
+}
+
+int
+e_app_starting_get(E_App *a)
+{
+ E_OBJECT_CHECK_RETURN(a, 0);
+ return a->starting;
+}
+
+int
+e_app_running_get(E_App *a)
+{
+ E_OBJECT_CHECK_RETURN(a, 0);
+ if (a->instances) return 1;
+ return 0;
+}
+
+void
+e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), void *data)
+{
+ E_App_Callback *cb;
+
+ cb = calloc(1, sizeof(E_App_Callback));
+ cb->func = func;
+ cb->data = data;
+ _e_apps_change_callbacks = evas_list_append(_e_apps_change_callbacks, cb);
+ _e_app_monitor();
+}
+
+void
+e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch), void *data)
+{
+ Evas_List *l;
+
+ for (l = _e_apps_change_callbacks; l; l = l->next)
+ {
+ E_App_Callback *cb;
+
+ cb = l->data;
+ if ((cb->func == func) && (cb->data == data))
+ {
+ if (_e_apps_callbacks_walking)
+ {
+ cb->delete_me = 1;
+ _e_apps_callbacks_delete_me = 1;
+ }
+ else
+ {
+ _e_apps_change_callbacks = evas_list_remove_list(_e_apps_change_callbacks, l);
+ free(cb);
+ _e_app_monitor();
+ }
+ return;
+ }
+ }
+}
+
+/* local subsystem functions */
+static void
+_e_app_free(E_App *a)
+{
+ while (a->instances)
+ {
+ Ecore_Exe *exe;
+
+ exe = a->instances->data;
+ ecore_exe_free(exe);
+ a->instances = evas_list_remove_list(a->instances, a->instances);
+ }
+ while (a->subapps)
+ {
+ E_App *a2;
+
+ a2 = a->subapps->data;
+ e_object_unref(E_OBJECT(a2));
+ a->subapps = evas_list_remove(a->subapps, a2);
+ }
+ if (a->parent)
+ a->parent->subapps = evas_list_remove(a->parent->subapps, a);
+ _e_apps = evas_hash_del(_e_apps, a->path, a);
+ if (a->name) free(a->name);
+ if (a->generic) free(a->generic);
+ if (a->comment) free(a->comment);
+ if (a->exe) free(a->exe);
+ if (a->path) free(a->path);
+ if (a->win_name) free(a->win_name);
+ if (a->win_class) free(a->win_class);
+ free(a);
+ _e_app_monitor();
+}
+
+static void
+_e_app_fields_fill(E_App *a, char *path)
+{
+ char buf[4096];
+ char *str;
+ char *lang;
+
+ /* get our current language */
+ lang = getenv("LANG");
+ /* if its "C" its the default - so drop it */
+ if ((lang) && (!strcmp(lang, "C")))
+ lang = NULL;
+ /* get fields (language local preferred) */
+ if (lang)
+ {
+ snprintf(buf, sizeof(buf), "app/name[%s]", lang);
+ a->name = edje_file_data_get(path, buf);
+ }
+ if (!a->name) a->name = edje_file_data_get(path, "app/name");
+ if (lang)
+ {
+ snprintf(buf, sizeof(buf), "app/generic[%s]", lang);
+ a->generic = edje_file_data_get(path, buf);
+ }
+ if (!a->generic) a->generic = edje_file_data_get(path, "app/generic");
+ if (lang)
+ {
+ snprintf(buf, sizeof(buf), "app/comment[%s]", lang);
+ a->comment = edje_file_data_get(path, buf);
+ }
+ if (!a->comment) a->comment = edje_file_data_get(path, "app/comment");
+
+ a->exe = edje_file_data_get(path, "app/exe");
+ a->win_name = edje_file_data_get(path, "app/window/name");
+ a->win_class = edje_file_data_get(path, "app/window/class");
+
+ str = edje_file_data_get(path, "app/startup_notify");
+ if (str)
+ {
+ a->startup_notify = atoi(str);
+ free(str);
+ }
+}
+
+static void
+_e_app_fields_empty(E_App *a)
+{
+ if (a->name)
+ {
+ free(a->name);
+ a->name = NULL;
+ }
+ if (a->generic)
+ {
+ free(a->generic);
+ a->generic = NULL;
+ }
+ if (a->comment)
+ {
+ free(a->comment);
+ a->comment = NULL;
+ }
+ if (a->exe)
+ {
+ free(a->exe);
+ a->exe = NULL;
+ }
+ if (a->win_name)
+ {
+ free(a->win_name);
+ a->win_name = NULL;
+ }
+ if (a->win_class)
+ {
+ free(a->win_class);
+ a->win_class = NULL;
+ }
+}
+
+static Evas_List *
+_e_app_dir_file_list_get(E_App *a, char *path)
+{
+ Evas_List *files, *files2 = NULL, *l;
+ FILE *f;
+ char buf[4096];
+
+ snprintf(buf, sizeof(buf), "%s/.order", path);
+ a->order_mod_time = e_file_mod_time(buf);
+ files = e_file_ls(path);
+ f = fopen(buf, "rb");
+ if (f)
+ {
+ while (fgets(buf, sizeof(buf), f))
+ {
+ int len;
+
+ len = strlen(buf);
+ if (len > 0)
+ {
+ int ok = 0;
+
+ if (buf[len - 1] == '\n') buf[len - 1] = 0;
+ for (l = files; l; l = l->next)
+ {
+ if (!strcmp(buf, l->data))
+ {
+ free(l->data);
+ files = evas_list_remove_list(files, l);
+ ok = 1;
+ break;
+ }
+ }
+ if (ok)
+ files2 = evas_list_append(files2, strdup(buf));
+ }
+ }
+ fclose(f);
+ }
+ else
+ {
+ files2 = files;
+ files = NULL;
+ }
+ while (files)
+ {
+ char *s;
+
+ s = files->data;
+ if (s[0] != '.')
+ files2 = evas_list_append(files2, s);
+ else
+ free(s);
+ files = evas_list_remove_list(files, files);
+ }
+ files = files2;
+ return files;
+}
+
+static E_App *
+_e_app_subapp_path_find(E_App *a, char *subpath)
+{
+ Evas_List *l;
+
+ for (l = a->subapps; l; l = l->next)
+ {
+ E_App *a2;
+
+ a2 = l->data;
+ if (!strcmp(a2->path, subpath)) return a2;
+ }
+ return NULL;
+}
+
+static void
+_e_app_monitor(void)
+{
+ if ((_e_apps) && (_e_apps_change_callbacks))
+ {
+ if (!_e_apps_checker)
+ _e_apps_checker = ecore_timer_add(1.0, _e_app_check, NULL);
+ }
+ else
+ {
+ if (_e_apps_checker)
+ {
+ ecore_timer_del(_e_apps_checker);
+ _e_apps_checker = NULL;
+ }
+ }
+}
+
+static void
+_e_app_change(E_App *a, E_App_Change ch)
+{
+ Evas_List *l;
+
+ _e_apps_callbacks_walking = 1;
+ for (l = _e_apps_change_callbacks; l; l = l->next)
+ {
+ E_App_Callback *cb;
+
+ cb = l->data;
+ if (!cb->delete_me)
+ {
+ cb->func(cb->data, a, ch);
+ }
+ }
+ _e_apps_callbacks_walking = 0;
+ if (_e_apps_callbacks_delete_me)
+ {
+ for (l = _e_apps_change_callbacks; l;)
+ {
+ E_App_Callback *cb;
+ Evas_List *pl;
+
+ cb = l->data;
+ pl = l;
+ l = l->next;
+ if (cb->delete_me)
+ {
+ _e_apps_change_callbacks = evas_list_remove_list(_e_apps_change_callbacks, pl);
+ free(cb);
+ }
+ }
+ _e_apps_callbacks_delete_me = 0;
+ _e_app_monitor();
+ }
+}
+
+static int
+_e_app_check(void *data)
+{
+ Evas_List *changes = NULL;
+
+ evas_hash_foreach(_e_apps, _e_app_check_each, &changes);
+
+ while (changes)
+ {
+ E_App_Change_Info *ch;
+ Evas_List *l;
+
+ ch = changes->data;
+ changes = evas_list_remove_list(changes, changes);
+ _e_app_change(ch->app, ch->change);
+ e_object_unref(E_OBJECT(ch->app));
+ free(ch);
+ }
+ if (_e_apps_checker) return 1;
+ return 0;
+}
+
+static Evas_Bool
+_e_app_check_each(Evas_Hash *hash, const char *key, void *data, void *fdata)
+{
+ Evas_List **changes;
+ E_App *a;
+ E_App_Change_Info *ch;
+
+ changes = fdata;
+ a = data;
+ if (a->exe)
+ {
+ time_t mod_time;
+
+ mod_time = e_file_mod_time(a->path);
+ if (mod_time != a->mod_time)
+ {
+ a->mod_time = mod_time;
+ if (e_file_exists(a->path))
+ {
+ _e_app_fields_empty(a);
+ _e_app_fields_fill(a, a->path);
+ if (!a->exe)
+ {
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_DEL;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ else
+ {
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_CHANGE;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ }
+ else
+ {
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_DEL;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ }
+ }
+ else
+ {
+ time_t mod_time, order_mod_time, directory_mod_time;
+ char buf[4096];
+
+ mod_time = e_file_mod_time(a->path);
+ snprintf(buf, sizeof(buf), "%s/.order", a->path);
+ order_mod_time = e_file_mod_time(buf);
+ snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
+ directory_mod_time = e_file_mod_time(buf);
+ if ((mod_time != a->mod_time) ||
+ (order_mod_time != a->order_mod_time) ||
+ (directory_mod_time != a->directory_mod_time))
+ {
+ a->mod_time = mod_time;
+ if (!e_file_is_dir(a->path))
+ {
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_DEL;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ else
+ {
+ if (order_mod_time != a->order_mod_time)
+ {
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_ORDER;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ if (directory_mod_time != a->directory_mod_time)
+ {
+ snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
+ _e_app_fields_empty(a);
+ _e_app_fields_fill(a, buf);
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a;
+ ch->change = E_APP_CHANGE;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ a->order_mod_time = order_mod_time;
+ a->directory_mod_time = directory_mod_time;
+ if (a->scanned)
+ {
+ Evas_List *l, *files;
+
+ files = _e_app_dir_file_list_get(a, a->path);
+ for (l = files; l; l = l->next)
+ {
+ E_App *a2;
+ char *s;
+
+ s = l->data;
+ snprintf(buf, sizeof(buf), "%s/%s", a->path, s);
+ if (!_e_app_subapp_path_find(a, buf))
+ {
+ a2 = e_app_new(buf, 0);
+ if (a2)
+ {
+ a2->parent = a;
+ a->subapps = evas_list_append(a->subapps, a2);
+ ch = calloc(1, sizeof(E_App_Change_Info));
+ ch->app = a2;
+ ch->change = E_APP_ADD;
+ e_object_ref(E_OBJECT(ch->app));
+ *changes = evas_list_append(*changes, ch);
+ }
+ }
+ }
+ for (l = files; l; l = l->next)
+ {
+ E_App *a2;
+ char *s;
+
+ s = l->data;
+ snprintf(buf, sizeof(buf), "%s/%s", a->path, s);
+ a2 = _e_app_subapp_path_find(a, buf);
+ if (a2)
+ {
+ a->subapps = evas_list_remove(a->subapps, a2);
+ a->subapps = evas_list_append(a->subapps, a2);
+ }
+ }
+ while (files)
+ {
+ free(files->data);
+ files = evas_list_remove_list(files, files);
+ }
+ }
+ }
+ }
+ }
+ return 1;
+}
+
+static int
+_e_apps_cb_exit(void *data, int type, void *event)
+{
+ Ecore_Event_Exe_Exit *ev;
+ E_App *a;
+
+ ev = event;
+ if (ev->exe)
+ {
+ a = ecore_exe_data_get(ev->exe);
+ if (a)
+ {
+ a->instances = evas_list_remove(a->instances, ev->exe);
+ _e_app_change(a, E_APP_EXIT);
+ }
+ }
+ return 1;
+}
--- /dev/null
+#ifndef E_APPS_H
+#define E_APPS_H
+
+typedef enum _E_App_Change
+{
+ E_APP_ADD,
+ E_APP_DEL,
+ E_APP_CHANGE,
+ E_APP_ORDER,
+ E_APP_EXEC,
+ E_APP_READY,
+ E_APP_EXIT
+} E_App_Change;
+
+typedef struct _E_App E_App;
+
+struct _E_App
+{
+ E_Object e_obj_inherit;
+
+ E_App *parent; /* the parent e_app node */
+
+ char *name; /* app name */
+ char *generic; /* generic app name */
+ char *comment; /* a longer description */
+ char *exe; /* command to execute, NULL if directory */
+ char *path; /* path to .eet containing icons etc. etc. */
+
+ char *win_name; /* window name */
+ char *win_class; /* window class */
+
+ Evas_List *subapps; /* if this a directory, a list of more E_App's */
+
+ time_t mod_time; /* last modified time for file or dir */
+ time_t order_mod_time; /* secondary modified time for .order */
+ time_t directory_mod_time; /* secondary modified time for .directory.eet */
+
+ Evas_List *instances; /* a list of all the exe handles for executions */
+
+ unsigned char startup_notify : 1; /* disable while starting etc. */
+ unsigned char starting : 1; /* this app is starting */
+
+ unsigned char scanned : 1; /* have we scanned a subdir app yet */
+};
+
+int e_app_init(void);
+int e_app_shutdown(void);
+
+E_App *e_app_new(char *path, int scan_subdirs);
+void e_app_subdir_scan(E_App *a, int scan_subdirs);
+int e_app_exec(E_App *a);
+int e_app_starting_get(E_App *a);
+int e_app_running_get(E_App *a);
+
+void e_app_change_callback_add(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
+void e_app_change_callback_del(void (*func) (void *data, E_App *a, E_App_Change ch), void *data);
+#endif
--- /dev/null
+#include "e.h"
+
+#define RESIZE_NONE 0
+#define RESIZE_TL 1
+#define RESIZE_T 2
+#define RESIZE_TR 3
+#define RESIZE_R 4
+#define RESIZE_BR 5
+#define RESIZE_B 6
+#define RESIZE_BL 7
+#define RESIZE_L 8
+
+/* local subsystem functions */
+static void _e_border_free(E_Border *bd);
+
+/* FIXME: these likely belong in a separate icccm/client handler */
+/* and the border needs to be come a dumb object that just does what its */
+/* told to do */
+static int _e_border_cb_window_show_request(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_destroy(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_hide(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_reparent(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_configure_request(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_gravity(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_stack_request(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_property(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_colormap(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_shape(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_focus_in(void *data, int ev_type, void *ev);
+static int _e_border_cb_window_focus_out(void *data, int ev_type, void *ev);
+static int _e_border_cb_client_message(void *data, int ev_type, void *ev);
+
+static void _e_border_cb_signal_move_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_tl_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_t_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_tr_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_r_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_br_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_b_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_bl_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_l_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _e_border_cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source);
+static int _e_border_cb_mouse_in(void *data, int type, void *event);
+static int _e_border_cb_mouse_out(void *data, int type, void *event);
+static int _e_border_cb_mouse_down(void *data, int type, void *event);
+static int _e_border_cb_mouse_up(void *data, int type, void *event);
+static int _e_border_cb_mouse_move(void *data, int type, void *event);
+static int _e_border_cb_mouse_wheel(void *data, int type, void *event);
+
+static void _e_border_eval(E_Border *bd);
+static void _e_border_resize_limit(E_Border *bd, int *w, int *h);
+static void _e_border_moveinfo_gather(E_Border *bd, const char *source);
+static void _e_border_resize_handle(E_Border *bd);
+
+/* local subsystem globals */
+static Evas_List *handlers = NULL;
+static Evas_List *borders = NULL;
+
+/* externally accessible functions */
+int
+e_border_init(void)
+{
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_border_cb_window_show_request, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, _e_border_cb_window_destroy, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_HIDE, _e_border_cb_window_hide, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_REPARENT, _e_border_cb_window_reparent, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE_REQUEST, _e_border_cb_window_configure_request, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_GRAVITY, _e_border_cb_window_gravity, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_STACK_REQUEST, _e_border_cb_window_stack_request, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, _e_border_cb_window_property, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_COLORMAP, _e_border_cb_window_colormap, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHAPE, _e_border_cb_window_shape, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _e_border_cb_window_focus_in, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _e_border_cb_window_focus_out, NULL));
+ handlers = evas_list_append(handlers, ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, _e_border_cb_client_message, NULL));
+ return 1;
+}
+
+int
+e_border_shutdown(void)
+{
+ while (handlers)
+ {
+ Ecore_Event_Handler *h;
+
+ h = handlers->data;
+ handlers = evas_list_remove(handlers, h);
+ ecore_event_handler_del(h);
+ }
+ return 1;
+}
+
+E_Border *
+e_border_new(E_Container *con, Ecore_X_Window win, int first_map)
+{
+ E_Border *bd;
+ Ecore_Event_Handler *h;
+ Ecore_X_Window_Attributes *att;
+
+ bd = E_OBJECT_ALLOC(E_Border, _e_border_free);
+ if (!bd) return NULL;
+ bd->container = con;
+ bd->w = 1;
+ bd->h = 1;
+ bd->win = ecore_x_window_override_new(bd->container->win, 0, 0, bd->w, bd->h);
+ bd->bg_ecore_evas = ecore_evas_software_x11_new(NULL, bd->win, 0, 0, bd->w, bd->h);
+ ecore_evas_software_x11_direct_resize_set(bd->bg_ecore_evas, 1);
+ e_canvas_add(bd->bg_ecore_evas);
+ bd->event_win = ecore_x_window_input_new(bd->win, 0, 0, bd->w, bd->h);
+ bd->bg_evas = ecore_evas_get(bd->bg_ecore_evas);
+ bd->bg_win = ecore_evas_software_x11_window_get(bd->bg_ecore_evas);
+ ecore_evas_name_class_set(bd->bg_ecore_evas, "E", "Frame_Window");
+ ecore_evas_title_set(bd->bg_ecore_evas, "Enlightenment Frame");
+ /* ecore_evas_avoid_damage_set(bd->bg_ecore_evas, 1); */
+ ecore_evas_show(bd->bg_ecore_evas);
+ evas_font_path_append(bd->bg_evas, e_path_find(path_data, "fonts"));
+ bd->client.shell_win = ecore_x_window_override_new(bd->win, 0, 0, 1, 1);
+ ecore_x_window_container_manage(bd->client.shell_win);
+ ecore_x_window_client_manage(win);
+ /* FIXME: Round trip. XCB */
+ /* 2nd fetch needed to avoid grabbing the server as window may vanish */
+ att = &bd->client.initial_attributes;
+ if ((!ecore_x_window_attributes_get(win, att)) || (att->input_only))
+ {
+ e_canvas_del(bd->bg_ecore_evas);
+ ecore_evas_free(bd->bg_ecore_evas);
+ ecore_x_window_del(bd->client.shell_win);
+ ecore_x_window_del(bd->win);
+ free(bd);
+ return NULL;
+ }
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_IN, _e_border_cb_mouse_in, bd));
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT, _e_border_cb_mouse_out, bd));
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_border_cb_mouse_down, bd));
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _e_border_cb_mouse_up, bd));
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _e_border_cb_mouse_move, bd));
+ bd->handlers = evas_list_append(bd->handlers, ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL, _e_border_cb_mouse_wheel, bd));
+
+ bd->client.win = win;
+
+ bd->client.icccm.title = strdup("");
+ bd->client.icccm.name = strdup("");
+ bd->client.icccm.class = strdup("");
+ bd->client.icccm.icon_name = strdup("");
+ bd->client.icccm.machine = strdup("");
+ bd->client.icccm.min_w = 1;
+ bd->client.icccm.min_h = 1;
+ bd->client.icccm.max_w = 32767;
+ bd->client.icccm.max_h = 32767;
+ bd->client.icccm.base_w = 0;
+ bd->client.icccm.base_h = 0;
+ bd->client.icccm.step_w = 1;
+ bd->client.icccm.step_h = 1;
+ bd->client.icccm.min_aspect = 0.0;
+ bd->client.icccm.max_aspect = 0.0;
+
+ bd->client.icccm.fetch.title = 1;
+ bd->client.icccm.fetch.name_class = 1;
+ bd->client.icccm.fetch.icon_name = 1;
+ bd->client.icccm.fetch.machine = 1;
+ bd->client.icccm.fetch.hints = 1;
+ bd->client.icccm.fetch.size_pos_hints = 1;
+ bd->client.icccm.fetch.protocol = 1;
+ bd->client.mwm.fetch.borderless = 1;
+ bd->client.netwm.fetch.pid = 1;
+ bd->client.netwm.fetch.desktop = 1;
+ bd->client.border.changed = 1;
+
+ bd->client.w = att->w;
+ bd->client.h = att->h;
+
+ bd->w = bd->client.w;
+ bd->h = bd->client.h;
+ bd->changes.size = 1;
+
+ /* FIXME: if first_map is 1 then we should ignore the first hide event
+ * or ensure the window is alreayd hidden and events flushed before we
+ * create a border for it
+ */
+ if (first_map)
+ {
+ bd->x = att->x;
+ bd->y = att->y;
+ bd->changes.pos = 1;
+ bd->re_manage = 1;
+ bd->ignore_first_unmap = 2;
+ }
+
+ ecore_x_window_save_set_add(win);
+ ecore_x_window_reparent(win, bd->client.shell_win, 0, 0);
+ ecore_x_window_border_width_set(win, 0);
+ ecore_x_window_show(bd->event_win);
+ ecore_x_window_show(bd->client.shell_win);
+ bd->shape = e_container_shape_add(con);
+
+ bd->new_client = 1;
+ bd->changed = 1;
+
+ con->clients = evas_list_append(con->clients, bd);
+ borders = evas_list_append(borders, bd);
+ return bd;
+}
+
+void
+e_border_show(E_Border *bd)
+{
+ if (bd->visible) return;
+ e_container_shape_show(bd->shape);
+ ecore_x_window_show(bd->client.win);
+ ecore_x_icccm_state_set(bd->client.win, ECORE_X_WINDOW_STATE_HINT_NORMAL);
+ bd->visible = 1;
+ bd->changed = 1;
+ bd->changes.visible = 1;
+}
+
+void
+e_border_hide(E_Border *bd)
+{
+ if (!bd->visible) return;
+ ecore_x_window_hide(bd->client.win);
+ e_container_shape_hide(bd->shape);
+ /* FIXME: might be iconic too - need to do this elsewhere */
+ ecore_x_icccm_state_set(bd->client.win, ECORE_X_WINDOW_STATE_HINT_WITHDRAWN);
+ /* ecore_x_icccm_state_set(bd->client.win, ECORE_X_WINDOW_STATE_HINT_ICONIC); */
+ bd->visible = 0;
+ bd->changed = 1;
+ bd->changes.visible = 1;
+}
+
+void
+e_border_move(E_Border *bd, int x, int y)
+{
+ if ((x == bd->x) && (y == bd->y)) return;
+ bd->x = x;
+ bd->y = y;
+ bd->changed = 1;
+ bd->changes.pos = 1;
+ ecore_x_icccm_move_resize_send(bd->client.win,
+ bd->x + bd->client_inset.l,
+ bd->y + bd->client_inset.t,
+ bd->client.w,
+ bd->client.h);
+}
+
+void
+e_border_resize(E_Border *bd, int w, int h)
+{
+ if ((w == bd->w) && (h == bd->h)) return;
+ bd->w = w;
+ bd->h = h;
+ bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r);
+ bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b);
+ bd->changed = 1;
+ bd->changes.size = 1;
+ ecore_x_icccm_move_resize_send(bd->client.win,
+ bd->x + bd->client_inset.l,
+ bd->y + bd->client_inset.t,
+ bd->client.w,
+ bd->client.h);
+}
+
+void
+e_border_move_resize(E_Border *bd, int x, int y, int w, int h)
+{
+ if ((x == bd->x) && (y == bd->y) && (w == bd->w) && (h == bd->h)) return;
+ bd->x = x;
+ bd->y = y;
+ bd->w = w;
+ bd->h = h;
+ bd->client.w = bd->w - (bd->client_inset.l + bd->client_inset.r);
+ bd->client.h = bd->h - (bd->client_inset.t + bd->client_inset.b);
+ bd->changed = 1;
+ bd->changes.pos = 1;
+ bd->changes.size = 1;
+ ecore_x_icccm_move_resize_send(bd->client.win,
+ bd->x + bd->client_inset.l,
+ bd->y + bd->client_inset.t,
+ bd->client.w,
+ bd->client.h);
+}
+
+void
+e_border_raise(E_Border *bd)
+{
+ bd->container->clients = evas_list_remove(bd->container->clients, bd);
+ bd->container->clients = evas_list_append(bd->container->clients, bd);
+ ecore_x_window_raise(bd->win);
+}
+
+void
+e_border_lower(E_Border *bd)
+{
+ bd->container->clients = evas_list_remove(bd->container->clients, bd);
+ bd->container->clients = evas_list_prepend(bd->container->clients, bd);
+ ecore_x_window_lower(bd->win);
+}
+
+void
+e_border_stack_above(E_Border *bd, E_Border *above)
+{
+ bd->container->clients = evas_list_remove(bd->container->clients, bd);
+ bd->container->clients = evas_list_append_relative(bd->container->clients, bd, above);
+ ecore_x_window_configure(bd->win,
+ ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
+ ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
+ 0, 0, 0, 0, 0,
+ above->win, ECORE_X_WINDOW_STACK_ABOVE);
+}
+
+void
+e_border_stack_below(E_Border *bd, E_Border *below)
+{
+ bd->container->clients = evas_list_remove(bd->container->clients, bd);
+ bd->container->clients = evas_list_prepend_relative(bd->container->clients, bd, below);
+ ecore_x_window_configure(bd->win,
+ ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING |
+ ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE,
+ 0, 0, 0, 0, 0,
+ below->win, ECORE_X_WINDOW_STACK_BELOW);
+}
+
+E_Border *
+e_border_find_by_client_window(Ecore_X_Window win)
+{
+ Evas_List *l;
+
+ for (l = borders; l; l = l->next)
+ {
+ E_Border *bd;
+
+ bd = l->data;
+ if (bd->client.win == win) return bd;
+ }
+ return NULL;
+}
+
+void
+e_border_idler_before(void)
+{
+ Evas_List *l;
+
+ for (l = borders; l; l = l->next)
+ {
+ E_Border *bd;
+
+ bd = l->data;
+ if (bd->changed) _e_border_eval(bd);
+ }
+}
+
+
+/* local subsystem functions */
+static void
+_e_border_free(E_Border *bd)
+{
+ while (bd->handlers)
+ {
+ Ecore_Event_Handler *h;
+
+ h = bd->handlers->data;
+ bd->handlers = evas_list_remove(bd->handlers, h);
+ ecore_event_handler_del(h);
+ }
+ ecore_x_window_reparent(bd->client.win, bd->container->manager->root, bd->x + bd->client_inset.l, bd->y + bd->client_inset.t);
+ ecore_x_window_save_set_del(bd->client.win);
+ if (bd->client.border.name) free(bd->client.border.name);
+ if (bd->client.icccm.title) free(bd->client.icccm.title);
+ if (bd->client.icccm.name) free(bd->client.icccm.name);
+ if (bd->client.icccm.class) free(bd->client.icccm.class);
+ if (bd->client.icccm.icon_name) free(bd->client.icccm.icon_name);
+ if (bd->client.icccm.machine) free(bd->client.icccm.machine);
+ e_object_del(E_OBJECT(bd->shape));
+ evas_object_del(bd->bg_object);
+ e_canvas_del(bd->bg_ecore_evas);
+ ecore_evas_free(bd->bg_ecore_evas);
+ ecore_x_window_del(bd->client.shell_win);
+ ecore_x_window_del(bd->win);
+ bd->container->clients = evas_list_remove(bd->container->clients, bd);
+ borders = evas_list_remove(borders, bd);
+ free(bd);
+}
+
+static int
+_e_border_cb_window_show_request(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Show_Request *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ return 0;
+}
+
+static int _e_border_cb_window_destroy(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Destroy *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ e_object_del(E_OBJECT(bd));
+ return 0;
+}
+
+static int
+_e_border_cb_window_hide(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Hide *e;
+
+ bd = data;
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ if (bd->ignore_first_unmap > 0)
+ {
+ bd->ignore_first_unmap--;
+ return 1;
+ }
+ e_object_del(E_OBJECT(bd));
+ return 0;
+}
+
+static int
+_e_border_cb_window_reparent(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Reparent *e;
+
+ bd = data;
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ if (e->parent == bd->client.shell_win) return 1;
+ e_object_del(E_OBJECT(bd));
+ return 0;
+}
+
+static int
+_e_border_cb_window_configure_request(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Configure_Request *e;
+
+ bd = data;
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd)
+ {
+ printf("generic config request %x %i %i %ix%i ...\n",
+ e->win, e->x, e->y, e->w, e->h);
+ ecore_x_window_configure(e->win, e->value_mask,
+ e->x, e->y, e->w, e->h, e->border,
+ e->abovewin, e->detail);
+ return 1;
+ }
+ printf("config req %0x\n", e->win);
+ {
+ if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X) ||
+ (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y))
+ {
+ int x, y;
+
+ y = bd->y;
+ x = bd->x;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_X)
+ x = e->x - bd->client_inset.l;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_Y)
+ y = e->y - bd->client_inset.t;
+ if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W) ||
+ (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H))
+ {
+ int w, h;
+
+ h = bd->h;
+ w = bd->w;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W)
+ w = e->w + bd->client_inset.l + bd->client_inset.r;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
+ h = e->h + bd->client_inset.t + bd->client_inset.b;
+ e_border_move_resize(bd, x, y, w, h);
+ }
+ else
+ e_border_move(bd, x, y);
+ }
+ else if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W) ||
+ (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H))
+ {
+ int w, h;
+
+ h = bd->h;
+ w = bd->w;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_W)
+ w = e->w + bd->client_inset.l + bd->client_inset.r;
+ if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_H)
+ h = e->h + bd->client_inset.t + bd->client_inset.b;
+ e_border_resize(bd, w, h);
+ }
+ if ((e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE) &&
+ (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_SIBLING))
+ {
+ E_Border *obd;
+
+ if (e->detail == ECORE_X_WINDOW_STACK_ABOVE)
+ {
+ obd = e_border_find_by_client_window(e->abovewin);
+ if (obd)
+ e_border_stack_above(bd, obd);
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_BELOW)
+ {
+ obd = e_border_find_by_client_window(e->abovewin);
+ if (obd)
+ e_border_stack_below(bd, obd);
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_TOP_IF)
+ {
+ /* FIXME: do */
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_BOTTOM_IF)
+ {
+ /* FIXME: do */
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_OPPOSITE)
+ {
+ /* FIXME: do */
+ }
+ }
+ else if (e->value_mask & ECORE_X_WINDOW_CONFIGURE_MASK_STACK_MODE)
+ {
+ if (e->detail == ECORE_X_WINDOW_STACK_ABOVE)
+ {
+ e_border_raise(bd);
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_BELOW)
+ {
+ e_border_lower(bd);
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_TOP_IF)
+ {
+ /* FIXME: do */
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_BOTTOM_IF)
+ {
+ /* FIXME: do */
+ }
+ else if (e->detail == ECORE_X_WINDOW_STACK_OPPOSITE)
+ {
+ /* FIXME: do */
+ }
+ }
+ }
+ return 0;
+}
+
+static int
+_e_border_cb_window_gravity(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Gravity *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ printf("gravity for %0x\n", e->win);
+ return 0;
+}
+
+static int
+_e_border_cb_window_stack_request(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Stack_Request *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ printf("stack req for %0x bd %p\n", e->win, bd);
+ if (!bd) return 1;
+ return 0;
+}
+
+static int
+_e_border_cb_window_property(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Property *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ {
+ char *name;
+
+ name = XGetAtomName(ecore_x_display_get(), e->atom);
+ printf("property for %0x [%s]\n", e->win, name);
+ XFree(name);
+ }
+ /* FIXME: only flag the property to fetch based on the atom of the change */
+ bd->client.icccm.fetch.title = 1;
+ bd->client.icccm.fetch.name_class = 1;
+ bd->client.icccm.fetch.icon_name = 1;
+ bd->client.icccm.fetch.machine = 1;
+ bd->client.icccm.fetch.hints = 1;
+ bd->client.icccm.fetch.size_pos_hints = 1;
+ bd->client.icccm.fetch.protocol = 1;
+ bd->client.mwm.fetch.borderless = 1;
+ bd->client.netwm.fetch.pid = 1;
+ bd->client.netwm.fetch.desktop = 1;
+// bd->client.border.changed = 1;
+ bd->changed = 1;
+ return 0;
+}
+
+static int
+_e_border_cb_window_colormap(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Colormap *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ return 0;
+}
+
+static int
+_e_border_cb_window_shape(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Shape *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ return 0;
+}
+
+static int
+_e_border_cb_window_focus_in(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Focus_In *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ printf("f IN %i | %i\n", e->mode, e->detail);
+ if (!bd->focused)
+ {
+ bd->focused = 1;
+ edje_object_signal_emit(bd->bg_object, "active", "");
+ }
+ return 0;
+}
+
+static int
+_e_border_cb_window_focus_out(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Window_Focus_Out *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ printf("f OUT %i | %i\n", e->mode, e->detail);
+ if (bd->focused)
+ {
+ bd->focused = 0;
+ edje_object_signal_emit(bd->bg_object, "passive", "");
+ }
+ return 0;
+}
+
+static int
+_e_border_cb_client_message(void *data, int ev_type, void *ev)
+{
+ E_Border *bd;
+ Ecore_X_Event_Client_Message *e;
+
+ e = ev;
+ bd = e_border_find_by_client_window(e->win);
+ if (!bd) return 1;
+ printf("client message for %0x\n", e->win);
+ return 0;
+}
+
+static void
+_e_border_cb_signal_move_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->moving = 1;
+ _e_border_moveinfo_gather(bd, source);
+ e_border_raise(bd);
+}
+
+static void
+_e_border_cb_signal_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+ int x, y;
+
+ bd = data;
+ bd->moving = 0;
+}
+
+#define GRAV_SET(bd, grav) \
+printf("GRAV TO %i\n", grav); \
+ecore_x_window_gravity_set(bd->bg_win, grav); \
+ecore_x_window_pixel_gravity_set(bd->bg_win, grav); \
+ecore_x_window_gravity_set(bd->client.shell_win, grav); \
+ecore_x_window_pixel_gravity_set(bd->client.shell_win, grav); \
+ecore_x_window_gravity_set(bd->client.win, grav); \
+ecore_x_window_gravity_set(ecore_evas_software_x11_subwindow_get(bd->bg_ecore_evas), grav); \
+ecore_x_window_pixel_gravity_set(ecore_evas_software_x11_subwindow_get(bd->bg_ecore_evas), grav);
+
+static void
+_e_border_cb_signal_resize_tl_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_TL;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_SE);
+}
+
+static void
+_e_border_cb_signal_resize_t_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_T;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_S);
+ ecore_x_window_gravity_set(bd->bg_win, ECORE_X_GRAVITY_S);
+}
+
+static void
+_e_border_cb_signal_resize_tr_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_TR;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_SW);
+}
+
+static void
+_e_border_cb_signal_resize_r_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_R;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_W);
+}
+
+static void
+_e_border_cb_signal_resize_br_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_BR;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_NW);
+}
+
+static void
+_e_border_cb_signal_resize_b_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_B;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_N);
+}
+
+static void
+_e_border_cb_signal_resize_bl_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_BL;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_NE);
+}
+
+static void
+_e_border_cb_signal_resize_l_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ bd->resize_mode = RESIZE_L;
+ _e_border_moveinfo_gather(bd, source);
+ GRAV_SET(bd, ECORE_X_GRAVITY_E);
+}
+
+static void
+_e_border_cb_signal_resize_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+ int x, y;
+
+ bd = data;
+ _e_border_resize_handle(bd);
+ bd->resize_mode = RESIZE_NONE;
+ bd->changes.reset_gravity = 1;
+ bd->changed = 1;
+}
+
+static void
+_e_border_cb_signal_action(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ E_Border *bd;
+
+ bd = data;
+ printf("action %s\n", source);
+ if (!strcmp(source, "close"))
+ {
+ if (bd->client.icccm.delete_request)
+ ecore_x_window_delete_request_send(bd->client.win);
+ else
+ {
+ ecore_x_killall(bd->client.win);
+// ecore_x_window_del(bd->client.win);
+ e_object_del(E_OBJECT(bd));
+ }
+ }
+}
+
+static int
+_e_border_cb_mouse_in(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_In *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ if (ev->event_win == bd->win)
+ {
+ /* FIXME: this would normally put focus on the client on pointer */
+ /* focus - but click to focus it wouldnt */
+ if (bd->client.icccm.accepts_focus)
+ {
+ if (bd->client.icccm.take_focus)
+ ecore_x_icccm_take_focus_send(bd->client.win, ECORE_X_CURRENT_TIME);
+ else
+ ecore_x_window_focus(bd->client.win);
+ }
+ }
+ if (ev->win != bd->event_win) return 1;
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ evas_event_feed_mouse_in(bd->bg_evas);
+ return 1;
+}
+
+static int
+_e_border_cb_mouse_out(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Out *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ /* FIXME: this would normally take focus away in pointer focus mode */
+ if (ev->event_win == bd->win)
+ ecore_x_window_focus(bd->container->manager->win);
+ if (ev->win != bd->event_win) return 1;
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ evas_event_feed_mouse_out(bd->bg_evas);
+ return 1;
+}
+
+static int
+_e_border_cb_mouse_down(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Button_Down *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ if (ev->win != bd->event_win) return 1;
+ if ((ev->button >= 1) && (ev->button <= 3))
+ {
+ bd->mouse.last_down[ev->button - 1].mx = ev->root.x;
+ bd->mouse.last_down[ev->button - 1].my = ev->root.y;
+ bd->mouse.last_down[ev->button - 1].x = bd->x;
+ bd->mouse.last_down[ev->button - 1].y = bd->y;
+ bd->mouse.last_down[ev->button - 1].w = bd->w;
+ bd->mouse.last_down[ev->button - 1].h = bd->h;
+ }
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ if (bd->moving)
+ {
+ }
+ else
+ {
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ evas_event_feed_mouse_down(bd->bg_evas, ev->button);
+ }
+ return 1;
+}
+
+static int
+_e_border_cb_mouse_up(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Button_Up *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ if (ev->win != bd->event_win) return 1;
+ if ((ev->button >= 1) && (ev->button <= 3))
+ {
+ bd->mouse.last_up[ev->button - 1].mx = ev->root.x;
+ bd->mouse.last_up[ev->button - 1].my = ev->root.y;
+ bd->mouse.last_up[ev->button - 1].x = bd->x;
+ bd->mouse.last_up[ev->button - 1].y = bd->y;
+ }
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ evas_event_feed_mouse_up(bd->bg_evas, ev->button);
+ return 1;
+}
+
+static int
+_e_border_cb_mouse_move(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Move *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ if (ev->win != bd->event_win) return 1;
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ if (bd->moving)
+ {
+ int x, y, new_x, new_y;
+ Evas_List *skiplist = NULL;
+
+ if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3))
+ {
+ x = bd->mouse.last_down[bd->moveinfo.down.button - 1].x +
+ (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ y = bd->mouse.last_down[bd->moveinfo.down.button - 1].y +
+ (bd->mouse.current.my - bd->moveinfo.down.my);
+ }
+ else
+ {
+ x = bd->x +
+ (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ y = bd->y +
+ (bd->mouse.current.my - bd->moveinfo.down.my);
+ }
+ new_x = x;
+ new_y = y;
+ skiplist = evas_list_append(skiplist, bd);
+ e_resist_container_position(bd->container, skiplist,
+ bd->x, bd->y, bd->w, bd->h,
+ x, y, bd->w, bd->h,
+ &new_x, &new_y);
+ evas_list_free(skiplist);
+ e_border_move(bd, new_x, new_y);
+ }
+ else if (bd->resize_mode != RESIZE_NONE)
+ {
+ _e_border_resize_handle(bd);
+ }
+ else
+ {
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ }
+ return 1;
+}
+
+static int
+_e_border_cb_mouse_wheel(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Wheel *ev;
+ E_Border *bd;
+
+ ev = event;
+ bd = data;
+ if (ev->win != bd->event_win) return 1;
+ bd->mouse.current.mx = ev->root.x;
+ bd->mouse.current.my = ev->root.y;
+ evas_event_feed_mouse_move(bd->bg_evas, ev->x, ev->y);
+ evas_event_feed_mouse_wheel(bd->bg_evas, ev->direction, ev->z);
+ return 1;
+}
+
+static void
+_e_border_eval(E_Border *bd)
+{
+ /* FIXME: get min/max/start size etc. gravity etc. */
+
+ /* fetch any info queued to be fetched */
+ if (bd->client.icccm.fetch.title)
+ {
+ if (bd->client.icccm.title) free(bd->client.icccm.title);
+ bd->client.icccm.title = ecore_x_icccm_title_get(bd->client.win);
+ bd->client.icccm.fetch.title = 0;
+ if (bd->bg_object)
+ {
+ edje_object_part_text_set(bd->bg_object, "title_text",
+ bd->client.icccm.title);
+ printf("SET TITLE %s\n", bd->client.icccm.title);
+ }
+ }
+ if (bd->client.icccm.fetch.name_class)
+ {
+ if (bd->client.icccm.name) free(bd->client.icccm.name);
+ bd->client.icccm.name = NULL;
+ if (bd->client.icccm.class) free(bd->client.icccm.class);
+ bd->client.icccm.class = NULL;
+ ecore_x_window_prop_name_class_get(bd->client.win, &bd->client.icccm.name, &bd->client.icccm.class);
+ bd->client.icccm.fetch.name_class = 0;
+ }
+ if (bd->client.icccm.fetch.icon_name)
+ {
+ if (bd->client.icccm.icon_name) free(bd->client.icccm.icon_name);
+ bd->client.icccm.icon_name = ecore_x_window_prop_icon_name_get(bd->client.win);
+ bd->client.icccm.fetch.icon_name = 0;
+ }
+ if (bd->client.icccm.fetch.machine)
+ {
+ if (bd->client.icccm.machine) free(bd->client.icccm.machine);
+ bd->client.icccm.machine = ecore_x_window_prop_client_machine_get(bd->client.win);
+ bd->client.icccm.fetch.machine = 0;
+ }
+ if (bd->client.icccm.fetch.hints)
+ {
+ int accepts_focus = 1;
+ int is_urgent = 0;
+
+ bd->client.icccm.initial_state = ECORE_X_WINDOW_STATE_HINT_NORMAL;
+ ecore_x_icccm_hints_get(bd->client.win,
+ &accepts_focus,
+ &bd->client.icccm.initial_state,
+ &bd->client.icccm.icon_pixmap,
+ &bd->client.icccm.icon_mask,
+ &bd->client.icccm.icon_window,
+ &bd->client.icccm.window_group,
+ &is_urgent);
+ bd->client.icccm.accepts_focus = accepts_focus;
+ bd->client.icccm.urgent = is_urgent;
+ bd->client.icccm.fetch.hints = 0;
+ }
+ if (bd->client.icccm.fetch.size_pos_hints)
+ {
+ int request_pos = 0;
+
+ if (!ecore_x_icccm_size_pos_hints_get(bd->client.win,
+ &request_pos,
+ &bd->client.icccm.gravity,
+ &bd->client.icccm.min_w,
+ &bd->client.icccm.min_h,
+ &bd->client.icccm.max_w,
+ &bd->client.icccm.max_h,
+ &bd->client.icccm.base_w,
+ &bd->client.icccm.base_h,
+ &bd->client.icccm.step_w,
+ &bd->client.icccm.step_h,
+ &bd->client.icccm.min_aspect,
+ &bd->client.icccm.max_aspect))
+ {
+ printf("NO SIZE HINTS!\n");
+ }
+ if (bd->client.icccm.min_w > 32767) bd->client.icccm.min_w = 32767;
+ if (bd->client.icccm.min_h > 32767) bd->client.icccm.min_h = 32767;
+ if (bd->client.icccm.max_w > 32767) bd->client.icccm.max_w = 32767;
+ if (bd->client.icccm.max_h > 32767) bd->client.icccm.max_h = 32767;
+ if (bd->client.icccm.base_w > 32767) bd->client.icccm.base_w = 32767;
+ if (bd->client.icccm.base_h > 32767) bd->client.icccm.base_h = 32767;
+ bd->client.icccm.request_pos = request_pos;
+ bd->client.icccm.fetch.size_pos_hints = 0;
+ }
+ if (bd->client.icccm.fetch.protocol)
+ {
+ int i, num;
+ Ecore_X_WM_Protocol *proto;
+
+ proto = ecore_x_window_prop_protocol_list_get(bd->client.win, &num);
+ if (proto)
+ {
+ for (i = 0; i < num; i++)
+ {
+ if (proto[i] == ECORE_X_WM_PROTOCOL_DELETE_REQUEST)
+ bd->client.icccm.delete_request = 1;
+ if (proto[i] == ECORE_X_WM_PROTOCOL_TAKE_FOCUS)
+ bd->client.icccm.take_focus = 1;
+ }
+ free(proto);
+ }
+ bd->client.icccm.fetch.protocol = 0;
+ }
+ if (bd->client.mwm.fetch.borderless)
+ {
+ int pb;
+
+ pb = bd->client.mwm.borderless;
+ bd->client.mwm.borderless = ecore_x_window_prop_borderless_get(bd->client.win);
+ bd->client.mwm.fetch.borderless = 0;
+ if (bd->client.mwm.borderless != pb)
+ {
+ if (bd->client.border.name) free(bd->client.border.name);
+ if (bd->client.mwm.borderless)
+ bd->client.border.name = strdup("borderless");
+ else
+ bd->client.border.name = strdup("default");
+ bd->client.border.changed = 1;
+ }
+ }
+ if (bd->client.netwm.fetch.pid)
+ {
+ bd->client.netwm.pid = ecore_x_window_prop_pid_get(bd->client.win);
+ bd->client.netwm.fetch.pid = 0;
+ }
+ if (bd->client.netwm.fetch.desktop)
+ {
+ bd->client.netwm.desktop = ecore_x_window_prop_desktop_get(bd->client.win);
+ bd->client.netwm.fetch.desktop = 0;
+ }
+
+ if (bd->client.border.changed)
+ {
+ Evas_Object *o;
+ int iw, ih;
+ const char *path, *str;
+ char buf[4096];
+
+ if (!bd->client.border.name)
+ {
+ bd->client.border.name = strdup("default");
+ }
+ if (bd->bg_object)
+ {
+ bd->w -= (bd->client_inset.l + bd->client_inset.r);
+ bd->h -= (bd->client_inset.t + bd->client_inset.b);
+ bd->client_inset.l = 0;
+ bd->client_inset.r = 0;
+ bd->client_inset.t = 0;
+ bd->client_inset.b = 0;
+ bd->changes.size = 1;
+ evas_object_del(bd->bg_object);
+ }
+ o = edje_object_add(bd->bg_evas);
+ bd->bg_object = o;
+ /* FIXME: "default.eet" needs to come from conf */
+ path = e_path_find(path_themes, "default.eet");
+ snprintf(buf, sizeof(buf), "widgets/border/%s/border",
+ bd->client.border.name);
+ edje_object_file_set(o, path, buf);
+ edje_object_part_text_set(o, "title_text",
+ bd->client.icccm.title);
+ printf("SET TITLE2 %s\n", bd->client.icccm.title);
+ str = edje_object_data_get(o, "client_inset");
+ if (str)
+ {
+ int l, r, t, b;
+
+ if (sscanf(str, "%i %i %i %i", &l, &r, &t, &b) == 4)
+ {
+ bd->client_inset.l = l;
+ bd->client_inset.r = r;
+ bd->client_inset.t = t;
+ bd->client_inset.b = b;
+ bd->w += (bd->client_inset.l + bd->client_inset.r);
+ bd->h += (bd->client_inset.t + bd->client_inset.b);
+ bd->changes.size = 1;
+ ecore_x_window_move(bd->client.shell_win, l, t);
+ }
+ }
+ edje_object_signal_callback_add(o, "move_start", "*",
+ _e_border_cb_signal_move_start, bd);
+ edje_object_signal_callback_add(o, "move_stop", "*",
+ _e_border_cb_signal_move_stop, bd);
+ edje_object_signal_callback_add(o, "resize_tl_start", "*",
+ _e_border_cb_signal_resize_tl_start, bd);
+ edje_object_signal_callback_add(o, "resize_t_start", "*",
+ _e_border_cb_signal_resize_t_start, bd);
+ edje_object_signal_callback_add(o, "resize_tr_start", "*",
+ _e_border_cb_signal_resize_tr_start, bd);
+ edje_object_signal_callback_add(o, "resize_r_start", "*",
+ _e_border_cb_signal_resize_r_start, bd);
+ edje_object_signal_callback_add(o, "resize_br_start", "*",
+ _e_border_cb_signal_resize_br_start, bd);
+ edje_object_signal_callback_add(o, "resize_b_start", "*",
+ _e_border_cb_signal_resize_b_start, bd);
+ edje_object_signal_callback_add(o, "resize_bl_start", "*",
+ _e_border_cb_signal_resize_bl_start, bd);
+ edje_object_signal_callback_add(o, "resize_l_start", "*",
+ _e_border_cb_signal_resize_l_start, bd);
+ edje_object_signal_callback_add(o, "resize_stop", "*",
+ _e_border_cb_signal_resize_stop, bd);
+ edje_object_signal_callback_add(o, "action", "*",
+ _e_border_cb_signal_action, bd);
+ if (bd->focused)
+ edje_object_signal_emit(bd->bg_object, "active", "");
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, bd->w, bd->h);
+ evas_object_show(o);
+ bd->client.border.changed = 0;
+ }
+
+ if (bd->new_client)
+ {
+ printf("NEW CLIENT SETUP\n");
+ if (bd->re_manage)
+ {
+ printf("REMANAGE!\n");
+ bd->x -= bd->client_inset.l;
+ bd->y -= bd->client_inset.t;
+ bd->changes.pos = 1;
+ }
+ else
+ {
+ if (bd->client.icccm.request_pos)
+ {
+ Ecore_X_Window_Attributes *att;
+ int bw;
+
+ printf("REQUEST POS!\n");
+ att = &bd->client.initial_attributes;
+ bw = att->border * 2;
+ switch (bd->client.icccm.gravity)
+ {
+ case ECORE_X_GRAVITY_N:
+ bd->x = (att->x - (bw / 2));
+ bd->y = att->y;
+ break;
+ case ECORE_X_GRAVITY_NE:
+ bd->x = (att->x - (bw)) - (bd->client_inset.l);
+ bd->y = att->y;
+ break;
+ case ECORE_X_GRAVITY_E:
+ bd->x = (att->x - (bw)) - (bd->client_inset.l);
+ bd->y = (att->y - (bw / 2));
+ break;
+ case ECORE_X_GRAVITY_SE:
+ bd->x = (att->x - (bw)) - (bd->client_inset.l);
+ bd->y = (att->y - (bw)) - (bd->client_inset.t);
+ break;
+ case ECORE_X_GRAVITY_S:
+ bd->x = (att->x - (bw / 2));
+ bd->y = (att->y - (bw)) - (bd->client_inset.t);
+ break;
+ case ECORE_X_GRAVITY_SW:
+ bd->x = att->x;
+ bd->y = (att->y - (bw)) - (bd->client_inset.t);
+ break;
+ case ECORE_X_GRAVITY_W:
+ bd->x = att->x;
+ bd->y = (att->y - (bw)) - (bd->client_inset.t);
+ break;
+ case ECORE_X_GRAVITY_NW:
+ default:
+ bd->x = att->x;
+ bd->y = att->y;
+ }
+ bd->changes.pos = 1;
+ }
+ else
+ {
+ Evas_List *skiplist = NULL;
+ int new_x, new_y;
+
+ printf("AUTO POS!\n");
+ new_x = rand() % (bd->container->w - bd->w);
+ new_y = rand() % (bd->container->h - bd->h);
+ skiplist = evas_list_append(skiplist, bd);
+ e_place_container_region_smart(bd->container, skiplist,
+ bd->x, bd->y, bd->w, bd->h,
+ &new_x, &new_y);
+ evas_list_free(skiplist);
+ bd->x = new_x;
+ bd->y = new_y;
+ bd->changes.pos = 1;
+ }
+ }
+ }
+
+ /* effect changes to the window border itself */
+ if (bd->changes.visible)
+ {
+ if (bd->visible) ecore_x_window_show(bd->win);
+ else ecore_x_window_hide(bd->win);
+ bd->changes.visible = 0;
+ }
+ if ((bd->changes.pos) && (bd->changes.size))
+ {
+ printf("border move resize\n");
+ evas_obscured_clear(bd->bg_evas);
+ evas_obscured_rectangle_add(bd->bg_evas,
+ bd->client_inset.l, bd->client_inset.t,
+ bd->w - (bd->client_inset.l + bd->client_inset.r),
+ bd->h - (bd->client_inset.t + bd->client_inset.b));
+ ecore_x_window_move_resize(bd->win, bd->x, bd->y, bd->w, bd->h);
+ ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
+ ecore_x_window_move_resize(bd->client.shell_win,
+ bd->client_inset.l, bd->client_inset.t,
+ bd->client.w, bd->client.h);
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
+ ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
+ evas_object_resize(bd->bg_object, bd->w, bd->h);
+ e_container_shape_resize(bd->shape, bd->w, bd->h);
+ e_container_shape_move(bd->shape, bd->x, bd->y);
+ bd->changes.pos = 0;
+ bd->changes.size = 0;
+ printf("border move resize done\n");
+ }
+ else if (bd->changes.pos)
+ {
+ ecore_x_window_move(bd->win, bd->x, bd->y);
+ e_container_shape_move(bd->shape, bd->x, bd->y);
+ bd->changes.pos = 0;
+ }
+ else if (bd->changes.size)
+ {
+ printf("border move resize\n");
+ evas_obscured_clear(bd->bg_evas);
+ evas_obscured_rectangle_add(bd->bg_evas,
+ bd->client_inset.l, bd->client_inset.t,
+ bd->w - (bd->client_inset.l + bd->client_inset.r), bd->h - (bd->client_inset.t + bd->client_inset.b));
+ ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
+ ecore_x_window_resize(bd->win, bd->w, bd->h);
+ ecore_x_window_move_resize(bd->client.shell_win,
+ bd->client_inset.l, bd->client_inset.t,
+ bd->client.w, bd->client.h);
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
+ ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
+ evas_object_resize(bd->bg_object, bd->w, bd->h);
+ e_container_shape_resize(bd->shape, bd->w, bd->h);
+ printf("border move resize done\n");
+ bd->changes.size = 0;
+ }
+ if (bd->changes.reset_gravity)
+ {
+ GRAV_SET(bd, ECORE_X_GRAVITY_NW);
+ bd->changes.reset_gravity = 0;
+ }
+
+ bd->new_client = 0;
+ bd->changed = 0;
+
+ bd->changes.stack = 0;
+ bd->changes.prop = 0;
+ bd->changes.border = 0;
+}
+
+static void
+_e_border_resize_limit(E_Border *bd, int *w, int *h)
+{
+ double a;
+
+ *w -= bd->client_inset.l + bd->client_inset.r;
+ *h -= bd->client_inset.t + bd->client_inset.b;
+ if (*h < 1) *h = 1;
+ if (*w < 1) *w = 1;
+ a = *w / *h;
+ if ((bd->client.icccm.min_aspect != 0.0) &&
+ (a < bd->client.icccm.min_aspect))
+ *w = *h / bd->client.icccm.min_aspect;
+ else if
+ ((bd->client.icccm.max_aspect != 0.0) &&
+ (a > bd->client.icccm.max_aspect))
+ *h = *w * bd->client.icccm.max_aspect;
+ *w = bd->client.icccm.base_w +
+ (((*w - bd->client.icccm.base_w) / bd->client.icccm.step_w) *
+ bd->client.icccm.step_w);
+ *h = bd->client.icccm.base_h +
+ (((*h - bd->client.icccm.base_h) / bd->client.icccm.step_h) *
+ bd->client.icccm.step_h);
+ if (*w > bd->client.icccm.max_w) *w = bd->client.icccm.max_w;
+ else if (*w < bd->client.icccm.min_w) *w = bd->client.icccm.min_w;
+ if (*h > bd->client.icccm.max_h) *h = bd->client.icccm.max_h;
+ else if (*h < bd->client.icccm.min_h) *h = bd->client.icccm.min_h;
+
+ *w += bd->client_inset.l + bd->client_inset.r;
+ *h += bd->client_inset.t + bd->client_inset.b;
+}
+
+static void
+_e_border_moveinfo_gather(E_Border *bd, const char *source)
+{
+ if (!strcmp(source, "mouse,1")) bd->moveinfo.down.button = 1;
+ else if (!strcmp(source, "mouse,2")) bd->moveinfo.down.button = 2;
+ else if (!strcmp(source, "mouse,3")) bd->moveinfo.down.button = 3;
+ else bd->moveinfo.down.button = 0;
+ if ((bd->moveinfo.down.button >= 1) && (bd->moveinfo.down.button <= 3))
+ {
+ bd->moveinfo.down.mx = bd->mouse.last_down[bd->moveinfo.down.button - 1].mx;
+ bd->moveinfo.down.my = bd->mouse.last_down[bd->moveinfo.down.button - 1].my;
+ }
+ else
+ {
+ bd->moveinfo.down.mx = bd->mouse.current.mx;
+ bd->moveinfo.down.my = bd->mouse.current.my;
+ }
+}
+
+static void
+_e_border_resize_handle(E_Border *bd)
+{
+ int x, y, w, h;
+ int tw, th;
+
+ x = bd->x;
+ y = bd->y;
+ w = bd->w;
+ h = bd->h;
+
+ if ((bd->resize_mode == RESIZE_TR) ||
+ (bd->resize_mode == RESIZE_R) ||
+ (bd->resize_mode == RESIZE_BR))
+ {
+ if ((bd->moveinfo.down.button >= 1) &&
+ (bd->moveinfo.down.button <= 3))
+ w = bd->mouse.last_down[bd->moveinfo.down.button - 1].w +
+ (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ else
+ w = bd->w + (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ }
+ else if ((bd->resize_mode == RESIZE_TL) ||
+ (bd->resize_mode == RESIZE_L) ||
+ (bd->resize_mode == RESIZE_BL))
+ {
+ if ((bd->moveinfo.down.button >= 1) &&
+ (bd->moveinfo.down.button <= 3))
+ w = bd->mouse.last_down[bd->moveinfo.down.button - 1].w -
+ (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ else
+ w = bd->w - (bd->mouse.current.mx - bd->moveinfo.down.mx);
+ }
+
+ if ((bd->resize_mode == RESIZE_TL) ||
+ (bd->resize_mode == RESIZE_T) ||
+ (bd->resize_mode == RESIZE_TR))
+ {
+ if ((bd->moveinfo.down.button >= 1) &&
+ (bd->moveinfo.down.button <= 3))
+ h = bd->mouse.last_down[bd->moveinfo.down.button - 1].h -
+ (bd->mouse.current.my - bd->moveinfo.down.my);
+ else
+ h = bd->h - (bd->mouse.current.my - bd->moveinfo.down.my);
+ }
+ else if ((bd->resize_mode == RESIZE_BL) ||
+ (bd->resize_mode == RESIZE_B) ||
+ (bd->resize_mode == RESIZE_BR))
+ {
+ if ((bd->moveinfo.down.button >= 1) &&
+ (bd->moveinfo.down.button <= 3))
+ h = bd->mouse.last_down[bd->moveinfo.down.button - 1].h +
+ (bd->mouse.current.my - bd->moveinfo.down.my);
+ else
+ h = bd->h + (bd->mouse.current.my - bd->moveinfo.down.my);
+ }
+
+ tw = bd->w;
+ th = bd->h;
+ _e_border_resize_limit(bd, &w, &h);
+
+ if ((bd->resize_mode == RESIZE_TL) ||
+ (bd->resize_mode == RESIZE_L) ||
+ (bd->resize_mode == RESIZE_BL))
+ x += (tw - w);
+ if ((bd->resize_mode == RESIZE_TL) ||
+ (bd->resize_mode == RESIZE_T) ||
+ (bd->resize_mode == RESIZE_TR))
+ y += (th - h);
+
+ e_border_move_resize(bd, x, y, w, h);
+}
--- /dev/null
+#ifndef E_BORDER_H
+#define E_BORDER_H
+
+typedef struct _E_Border E_Border;
+
+struct _E_Border
+{
+ E_Object e_obj_inherit;
+
+ struct {
+ struct {
+ int x, y, w, h;
+ int mx, my;
+ } current, last_down[3], last_up[3];
+ } mouse;
+
+ struct {
+ struct {
+ int x, y, w, h;
+ int mx, my;
+ int button;
+ } down;
+ } moveinfo;
+
+ Ecore_X_Window win;
+ int x, y, w, h;
+ int ref;
+ E_Container *container;
+ Evas_List *handlers;
+
+ struct {
+ int l, r, t, b;
+ } client_inset;
+
+ Ecore_Evas *bg_ecore_evas;
+ Evas *bg_evas;
+ Ecore_X_Window bg_win;
+ Evas_Object *bg_object;
+ Ecore_X_Window event_win;
+
+ struct {
+ Ecore_X_Window shell_win;
+ Ecore_X_Window win;
+
+ int x, y, w, h;
+
+ struct {
+ unsigned char changed : 1;
+ char *name;
+ } border;
+
+ struct {
+ char *title;
+ char *name;
+ char *class;
+ char *icon_name;
+ char *machine;
+ int min_w, min_h;
+ int max_w, max_h;
+ int base_w, base_h;
+ int step_w, step_h;
+ int start_x, start_y;
+ double min_aspect, max_aspect;
+ Ecore_X_Window_State_Hint initial_state;
+ Ecore_X_Pixmap icon_pixmap;
+ Ecore_X_Pixmap icon_mask;
+ Ecore_X_Window icon_window;
+ Ecore_X_Window window_group;
+ Ecore_X_Gravity gravity;
+ unsigned char take_focus : 1;
+ unsigned char accepts_focus : 1;
+ unsigned char urgent : 1;
+ unsigned char delete_request : 1;
+ unsigned char withdrawn : 1;
+ unsigned char iconic : 1;
+ unsigned char request_pos : 1;
+ struct {
+ unsigned int title : 1;
+ unsigned int name_class : 1;
+ unsigned int icon_name : 1;
+ unsigned int machine : 1;
+ unsigned int hints : 1;
+ unsigned int size_pos_hints : 1;
+ unsigned int protocol : 1;
+ } fetch;
+ } icccm;
+ struct {
+ unsigned char borderless : 1;
+ struct {
+ unsigned int borderless : 1;
+ } fetch;
+ } mwm;
+ struct {
+ pid_t pid;
+ int desktop;
+ struct {
+ unsigned int pid : 1;
+ unsigned int desktop : 1;
+ } fetch;
+ } netwm;
+ Ecore_X_Window_Attributes initial_attributes;
+ } client;
+
+ E_Container_Shape *shape;
+
+ unsigned char visible : 1;
+ unsigned char moving : 1;
+ unsigned char focused : 1;
+ unsigned char new_client : 1;
+ unsigned char re_manage : 1;
+
+ unsigned char changed : 1;
+
+ unsigned char ignore_first_unmap;
+ unsigned char resize_mode;
+
+ struct {
+ unsigned int visible : 1;
+ unsigned int pos : 1;
+ unsigned int size : 1;
+ unsigned int stack : 1;
+ unsigned int prop : 1;
+ unsigned int border : 1;
+ unsigned int reset_gravity : 1;
+ } changes;
+};
+
+int e_border_init(void);
+int e_border_shutdown(void);
+
+E_Border *e_border_new(E_Container *con, Ecore_X_Window win, int first_map);
+void e_border_free(E_Border *bd);
+void e_border_ref(E_Border *bd);
+void e_border_unref(E_Border *bd);
+void e_border_show(E_Border *bd);
+void e_border_hide(E_Border *bd);
+void e_border_move(E_Border *bd, int x, int y);
+void e_border_resize(E_Border *bd, int w, int h);
+void e_border_move_resize(E_Border *bd, int x, int y, int w, int h);
+void e_border_raise(E_Border *bd);
+void e_border_lower(E_Border *bd);
+void e_border_stack_above(E_Border *bd, E_Border *above);
+void e_border_stack_below(E_Border *bd, E_Border *below);
+
+E_Border *e_border_find_by_client_window(Ecore_X_Window win);
+
+void e_border_idler_before(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+typedef struct _E_Smart_Data E_Smart_Data;
+typedef struct _E_Box_Item E_Box_Item;
+
+struct _E_Smart_Data
+{
+ Evas_Coord x, y, w, h;
+ Evas_Object *obj;
+ int frozen;
+ unsigned char changed : 1;
+ unsigned char horizontal : 1;
+ unsigned char homogenous : 1;
+ Evas_List *items;
+ struct {
+ Evas_Coord w, h;
+ } min, max;
+ struct {
+ double x, y;
+ } align;
+};
+
+struct _E_Box_Item
+{
+ E_Smart_Data *sd;
+ unsigned char fill_w : 1;
+ unsigned char fill_h : 1;
+ unsigned char expand_w : 1;
+ unsigned char expand_h : 1;
+ struct {
+ Evas_Coord w, h;
+ } min, max;
+ struct {
+ double x, y;
+ } align;
+ Evas_Object *obj;
+};
+
+/* local subsystem functions */
+static E_Box_Item *_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj);
+static void _e_box_smart_disown(Evas_Object *obj);
+static void _e_box_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _e_box_smart_reconfigure(E_Smart_Data *sd);
+static void _e_box_smart_extents_calcuate(E_Smart_Data *sd);
+
+static void _e_box_smart_init(void);
+static void _e_box_smart_add(Evas_Object *obj);
+static void _e_box_smart_del(Evas_Object *obj);
+static void _e_box_smart_layer_set(Evas_Object *obj, int layer);
+static void _e_box_smart_raise(Evas_Object *obj);
+static void _e_box_smart_lower(Evas_Object *obj);
+static void _e_box_smart_stack_above(Evas_Object *obj, Evas_Object * above);
+static void _e_box_smart_stack_below(Evas_Object *obj, Evas_Object * below);
+static void _e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
+static void _e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
+static void _e_box_smart_show(Evas_Object *obj);
+static void _e_box_smart_hide(Evas_Object *obj);
+static void _e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
+static void _e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip);
+static void _e_box_smart_clip_unset(Evas_Object *obj);
+
+/* local subsystem globals */
+static Evas_Smart *_e_smart = NULL;
+
+/* externally accessible functions */
+Evas_Object *
+e_box_add(Evas *evas)
+{
+ _e_box_smart_init();
+ return evas_object_smart_add(evas, _e_smart);
+}
+
+int
+e_box_freeze(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ sd->frozen++;
+ return sd->frozen;
+}
+
+int
+e_box_thaw(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ sd->frozen--;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+ return sd->frozen;
+}
+
+void
+e_box_orientation_set(Evas_Object *obj, int horizontal)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (((sd->horizontal) && (horizontal)) ||
+ ((!sd->horizontal) && (!horizontal))) return;
+ sd->horizontal = horizontal;
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+}
+
+void
+e_box_homogenous_set(Evas_Object *obj, int homogenous)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (sd->homogenous == homogenous) return;
+ sd->homogenous = homogenous;
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+}
+
+int
+e_box_pack_start(Evas_Object *obj, Evas_Object *child)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ _e_box_smart_adopt(sd, child);
+ sd->items = evas_list_prepend(sd->items, child);
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+ return 0;
+}
+
+int
+e_box_pack_end(Evas_Object *obj, Evas_Object *child)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ _e_box_smart_adopt(sd, child);
+ sd->items = evas_list_append(sd->items, child);
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+ return evas_list_count(sd->items) - 1;
+}
+
+int
+e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before)
+{
+ E_Smart_Data *sd;
+ int i = 0;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+ _e_box_smart_adopt(sd, child);
+ sd->items = evas_list_prepend_relative(sd->items, child, before);
+ for (i = 0, l = sd->items; l; l = l->next, i++)
+ {
+ if (l->data == child) break;
+ }
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+ return i;
+}
+
+int
+e_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after)
+{
+ E_Smart_Data *sd;
+ int i = 0;
+ Evas_List *l;
+
+ sd = evas_object_smart_data_get(obj);
+ _e_box_smart_adopt(sd, child);
+ sd->items = evas_list_append_relative(sd->items, child, after);
+ for (i = 0, l = sd->items; l; l = l->next, i++)
+ {
+ if (l->data == child) break;
+ }
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+ return i;
+}
+
+int
+e_box_pack_count_get(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_list_count(sd->items);
+}
+
+Evas_Object *
+e_box_pack_object_nth(Evas_Object *obj, int n)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_list_nth(sd->items, n);
+}
+
+Evas_Object *
+e_box_pack_object_first(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_list_data(sd->items);
+}
+
+Evas_Object *
+e_box_pack_object_last(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_list_data(evas_list_last(sd->items));
+}
+
+void
+e_box_pack_options_set(Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h)
+{
+ E_Box_Item *bi;
+
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (!bi) return;
+ bi->fill_w = fill_w;
+ bi->fill_h = fill_h;
+ bi->expand_w = expand_w;
+ bi->expand_h = expand_h;
+ bi->align.x = align_x;
+ bi->align.y = align_y;
+ bi->min.w = min_w;
+ bi->min.h = min_h;
+ bi->max.w = max_w;
+ bi->max.h = max_h;
+ bi->sd->changed = 1;
+ if (bi->sd->frozen <= 0) _e_box_smart_reconfigure(bi->sd);
+}
+
+void
+e_box_unpack(Evas_Object *obj)
+{
+ E_Box_Item *bi;
+ E_Smart_Data *sd;
+
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (!bi) return;
+ sd = bi->sd;
+ sd->items = evas_list_remove(sd->items, obj);
+ _e_box_smart_disown(obj);
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+}
+
+void
+e_box_min_size_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (sd->changed) _e_box_smart_extents_calcuate(sd);
+ if (minw) *minw = sd->min.w;
+ if (minh) *minh = sd->min.h;
+}
+
+void
+e_box_max_size_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (sd->changed) _e_box_smart_extents_calcuate(sd);
+ if (maxw) *maxw = sd->max.w;
+ if (maxh) *maxh = sd->max.h;
+}
+
+void
+e_box_align_get(Evas_Object *obj, double *ax, double *ay)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (ax) *ax = sd->align.x;
+ if (ay) *ay = sd->align.y;
+}
+
+void
+e_box_align_set(Evas_Object *obj, double ax, double ay)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if ((sd->align.x == ax) && (sd->align.y == ay)) return;
+ sd->align.x = ax;
+ sd->align.y = ay;
+ sd->changed = 1;
+ if (sd->frozen <= 0) _e_box_smart_reconfigure(sd);
+}
+
+/* local subsystem functions */
+static E_Box_Item *
+_e_box_smart_adopt(E_Smart_Data *sd, Evas_Object *obj)
+{
+ E_Box_Item *bi;
+
+ bi = calloc(1, sizeof(E_Box_Item));
+ if (!bi) return NULL;
+ bi->sd = sd;
+ bi->obj = obj;
+ /* defaults */
+ bi->fill_w = 0;
+ bi->fill_h = 0;
+ bi->expand_w = 0;
+ bi->expand_h = 0;
+ bi->align.x = 0.5;
+ bi->align.y = 0.5;
+ bi->min.w = 0;
+ bi->min.h = 0;
+ bi->max.w = 0;
+ bi->max.h = 0;
+ evas_object_clip_set(obj, evas_object_clip_get(sd->obj));
+ evas_object_stack_above(obj, sd->obj);
+ evas_object_smart_member_add(bi->sd->obj, obj);
+ evas_object_data_set(obj, "e_box_data", bi);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE,
+ _e_box_smart_item_del_hook, NULL);
+ return bi;
+}
+
+static void
+_e_box_smart_disown(Evas_Object *obj)
+{
+ E_Box_Item *bi;
+
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (!bi) return;
+ evas_object_event_callback_del(obj,
+ EVAS_CALLBACK_FREE,
+ _e_box_smart_item_del_hook);
+ evas_object_smart_member_del(bi->sd->obj);
+ evas_object_data_del(obj, "e_box_data");
+ free(bi);
+}
+
+static void
+_e_box_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ e_box_unpack(obj);
+}
+
+static void
+_e_box_smart_reconfigure(E_Smart_Data *sd)
+{
+ Evas_Coord x, y, w, h, xx, yy;
+ Evas_List *l;
+ int minw, minh;
+ int count, expand;
+
+ if (!sd->changed) return;
+
+ x = sd->x;
+ y = sd->y;
+ w = sd->w;
+ h = sd->h;
+
+ _e_box_smart_extents_calcuate(sd);
+ minw = sd->min.w;
+ minh = sd->min.h;
+ count = evas_list_count(sd->items);
+ expand = 0;
+ if (w < minw)
+ {
+ x = x + ((w - minw) * (1.0 - sd->align.x));
+ w = minw;
+ }
+ if (h < minh)
+ {
+ y = y + ((h - minh) * (1.0 - sd->align.y));
+ h = minh;
+ }
+ for (l = sd->items; l; l = l->next)
+ {
+ E_Box_Item *bi;
+ Evas_Object *obj;
+
+ obj = l->data;
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (sd->horizontal)
+ {
+ if (bi->expand_w) expand++;
+ }
+ else
+ {
+ if (bi->expand_h) expand++;
+ }
+ }
+ if (expand == 0)
+ {
+ if (sd->horizontal)
+ {
+ x += (w - minw) / 2;
+ w = minw;
+ }
+ else
+ {
+ y += (h - minh) / 2;
+ h = minh;
+ }
+ }
+ xx = x;
+ yy = y;
+ for (l = sd->items; l; l = l->next)
+ {
+ E_Box_Item *bi;
+ Evas_Object *obj;
+
+ obj = l->data;
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (sd->horizontal)
+ {
+ if (sd->homogenous)
+ {
+ Evas_Coord ww, hh, ow, oh;
+
+ ww = (w / (Evas_Coord)count);
+ hh = h;
+ ow = bi->min.w;
+ if (bi->expand_w) ow = ww;
+ if ((bi->max.w >= 0) && (bi->max.w < oh)) ow = bi->max.w;
+ oh = bi->min.h;
+ if (bi->expand_h) oh = hh;
+ if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
+ evas_object_move(obj,
+ xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x),
+ yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y));
+ evas_object_resize(obj, ow, oh);
+ xx += ww;
+ }
+ else
+ {
+ /* FIXME: not done - this is fucked atm */
+ Evas_Coord ww, hh, ow, oh;
+
+ ww = bi->min.w;
+ hh = h;
+ ow = bi->min.w;
+ if (bi->expand_w) ow = ww;
+ if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
+ oh = bi->min.h;
+ if (bi->expand_h) oh = hh;
+ if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
+ evas_object_move(obj,
+ xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x),
+ yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y));
+ evas_object_resize(obj, ow, oh);
+ xx += ww;
+ }
+ }
+ else
+ {
+ if (sd->homogenous)
+ {
+ Evas_Coord ww, hh, ow, oh;
+
+ ww = w;
+ hh = (h / (Evas_Coord)count);
+ ow = bi->min.w;
+ if (bi->expand_w) ow = ww;
+ if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
+ oh = bi->min.h;
+ if (bi->expand_h) oh = hh;
+ if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
+ evas_object_move(obj,
+ xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x),
+ yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y));
+ evas_object_resize(obj, ow, oh);
+ yy += hh;
+ }
+ else
+ {
+ /* FIXME: not done - this is fucked atm */
+ Evas_Coord ww, hh, ow, oh;
+
+ ww = w;
+ hh = bi->min.h;
+ ow = bi->min.w;
+ if (bi->expand_w) ow = ww;
+ if ((bi->max.w >= 0) && (bi->max.w < ow)) ow = bi->max.w;
+ oh = bi->min.h;
+ if (bi->expand_h) oh = hh;
+ if ((bi->max.h >= 0) && (bi->max.h < oh)) oh = bi->max.h;
+ evas_object_move(obj,
+ xx + (Evas_Coord)(((double)(ww - ow)) * bi->align.x),
+ yy + (Evas_Coord)(((double)(hh - oh)) * bi->align.y));
+ evas_object_resize(obj, ow, oh);
+ yy += hh;
+ }
+ }
+ }
+ sd->changed = 0;
+}
+
+/* FIXME: need to have min/max size calc routines */
+static void
+_e_box_smart_extents_calcuate(E_Smart_Data *sd)
+{
+ Evas_List *l;
+ int minw, minh;
+
+ sd->max.w = -1; /* max < 0 == unlimited */
+ sd->max.h = -1;
+
+ minw = 0;
+ minh = 0;
+ if (sd->homogenous)
+ {
+ for (l = sd->items; l; l = l->next)
+ {
+ E_Box_Item *bi;
+ Evas_Object *obj;
+
+ obj = l->data;
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (sd->horizontal)
+ {
+ if (minh < bi->min.h) minh = bi->min.h;
+ if (minw < bi->min.w) minw = bi->min.w;
+ }
+ else
+ {
+ if (minw < bi->min.w) minw = bi->min.w;
+ if (minh < bi->min.h) minh = bi->min.h;
+ }
+ }
+ if (sd->horizontal)
+ {
+ minw *= evas_list_count(sd->items);
+ }
+ else
+ {
+ minh *= evas_list_count(sd->items);
+ }
+ }
+ else
+ {
+ for (l = sd->items; l; l = l->next)
+ {
+ E_Box_Item *bi;
+ Evas_Object *obj;
+
+ obj = l->data;
+ bi = evas_object_data_get(obj, "e_box_data");
+ if (sd->horizontal)
+ {
+ if (minh < bi->min.h) minh = bi->min.h;
+ minw += bi->min.w;
+ }
+ else
+ {
+ if (minw < bi->min.w) minw = bi->min.w;
+ minh += bi->min.h;
+ }
+ }
+ }
+ sd->min.w = minw;
+ sd->min.h = minh;
+}
+
+static void
+_e_box_smart_init(void)
+{
+ if (_e_smart) return;
+ _e_smart = evas_smart_new("e_box",
+ _e_box_smart_add,
+ _e_box_smart_del,
+ _e_box_smart_layer_set,
+ _e_box_smart_raise,
+ _e_box_smart_lower,
+ _e_box_smart_stack_above,
+ _e_box_smart_stack_below,
+ _e_box_smart_move,
+ _e_box_smart_resize,
+ _e_box_smart_show,
+ _e_box_smart_hide,
+ _e_box_smart_color_set,
+ _e_box_smart_clip_set,
+ _e_box_smart_clip_unset,
+ NULL);
+}
+
+static void
+_e_box_smart_add(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = calloc(1, sizeof(E_Smart_Data));
+ if (!sd) return;
+ sd->obj = obj;
+ sd->x = 0;
+ sd->y = 0;
+ sd->w = 0;
+ sd->h = 0;
+ evas_object_smart_data_set(obj, sd);
+}
+
+static void
+_e_box_smart_del(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ while (sd->items)
+ {
+ Evas_Object *child;
+
+ child = sd->items->data;
+ e_box_unpack(child);
+ }
+ free(sd);
+}
+
+static void
+_e_box_smart_layer_set(Evas_Object *obj, int layer)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = sd->items; l; l = l->next)
+ {
+ evas_object_layer_set(l->data, layer);
+ }
+ }
+}
+
+static void
+_e_box_smart_raise(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = evas_list_last(sd->items); l; l = l->prev)
+ {
+ evas_object_raise(l->data);
+ }
+ }
+}
+
+static void
+_e_box_smart_lower(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = sd->items; l; l = l->next)
+ {
+ evas_object_lower(l->data);
+ }
+ }
+}
+
+static void
+_e_box_smart_stack_above(Evas_Object *obj, Evas_Object *above)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = sd->items; l; l = l->next)
+ {
+ evas_object_stack_above(l->data, above);
+ }
+ }
+}
+
+static void
+_e_box_smart_stack_below(Evas_Object *obj, Evas_Object *below)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = evas_list_last(sd->items); l; l = l->prev)
+ {
+ evas_object_stack_below(l->data, below);
+ }
+ }
+}
+
+static void
+_e_box_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ if ((x == sd->x) && (y == sd->y)) return;
+ sd->x = x;
+ sd->y = y;
+ sd->changed = 1;
+ _e_box_smart_reconfigure(sd);
+}
+
+static void
+_e_box_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ if ((w == sd->w) && (h == sd->h)) return;
+ sd->w = w;
+ sd->h = h;
+ sd->changed = 1;
+ _e_box_smart_reconfigure(sd);
+}
+
+static void
+_e_box_smart_show(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+}
+
+static void
+_e_box_smart_hide(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+}
+
+static void
+_e_box_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+}
+
+static void
+_e_box_smart_clip_set(Evas_Object *obj, Evas_Object *clip)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = sd->items; l; l = l->next)
+ {
+ evas_object_clip_set(l->data, clip);
+ }
+ }
+}
+
+static void
+_e_box_smart_clip_unset(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+
+ {
+ Evas_List *l;
+
+ for (l = sd->items; l; l = l->next)
+ {
+ evas_object_clip_unset(l->data);
+ }
+ }
+}
--- /dev/null
+#ifndef E_BOX_H
+#define E_BOX_H
+
+Evas_Object *e_box_add (Evas *evas);
+
+int e_box_freeze (Evas_Object *obj);
+int e_box_thaw (Evas_Object *obj);
+void e_box_orientation_set (Evas_Object *obj, int horizontal);
+void e_box_homogenous_set (Evas_Object *obj, int homogenous);
+int e_box_pack_start (Evas_Object *obj, Evas_Object *child);
+int e_box_pack_end (Evas_Object *obj, Evas_Object *child);
+int e_box_pack_before (Evas_Object *obj, Evas_Object *child, Evas_Object *before);
+int e_box_pack_after (Evas_Object *obj, Evas_Object *child, Evas_Object *after);
+int e_box_pack_count_get (Evas_Object *obj);
+Evas_Object *e_box_pack_object_nth (Evas_Object *obj, int n);
+Evas_Object *e_box_pack_object_first (Evas_Object *obj);
+Evas_Object *e_box_pack_object_last (Evas_Object *obj);
+void e_box_pack_options_set (Evas_Object *obj, int fill_w, int fill_h, int expand_w, int expand_h, double align_x, double align_y, Evas_Coord min_w, Evas_Coord min_h, Evas_Coord max_w, Evas_Coord max_h);
+void e_box_unpack (Evas_Object *obj);
+void e_box_min_size_get (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
+void e_box_max_size_get (Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
+void e_box_align_get (Evas_Object *obj, double *ax, double *ay);
+void e_box_align_set (Evas_Object *obj, double ax, double ay);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* local subsystem functions */
+
+/* local subsystem globals */
+static Evas_List *_e_canvases = NULL;
+
+void
+e_canvas_add(Ecore_Evas *ee)
+{
+ Evas *e;
+
+ _e_canvases = evas_list_prepend(_e_canvases, ee);
+ e = ecore_evas_get(ee);
+ evas_image_cache_set(e, e_config_val_image_cache * 1024);
+ evas_font_cache_set(e, e_config_val_font_cache * 1024);
+// evas_image_cache_flush(e);
+// evas_image_cache_reload(e);
+}
+
+void
+e_canvas_del(Ecore_Evas *ee)
+{
+ _e_canvases = evas_list_remove(_e_canvases, ee);
+}
+
+void
+e_canvas_recache(void)
+{
+ Evas_List *l;
+
+ for (l = _e_canvases; l; l = l->next)
+ {
+ Ecore_Evas *ee;
+ Evas *e;
+
+ ee = l->data;
+ e = ecore_evas_get(ee);
+ evas_image_cache_set(e, e_config_val_image_cache * 1024);
+ evas_font_cache_set(e, e_config_val_font_cache * 1024);
+ }
+}
+
+void
+e_canvas_cache_flush(void)
+{
+ Evas_List *l;
+
+ for (l = _e_canvases; l; l = l->next)
+ {
+ Ecore_Evas *ee;
+ Evas *e;
+
+ ee = l->data;
+ e = ecore_evas_get(ee);
+ evas_image_cache_flush(e);
+ evas_font_cache_flush(e);
+ }
+}
+
+void
+e_canvas_cache_reload(void)
+{
+ Evas_List *l;
+
+ for (l = _e_canvases; l; l = l->next)
+ {
+ Ecore_Evas *ee;
+ Evas *e;
+
+ ee = l->data;
+ e = ecore_evas_get(ee);
+ evas_image_cache_reload(e);
+ }
+}
--- /dev/null
+#ifndef E_CANVAS_H
+#define E_CANVAS_H
+
+void e_canvas_add(Ecore_Evas *ee);
+void e_canvas_del(Ecore_Evas *ee);
+void e_canvas_recache(void);
+void e_canvas_cache_flush(void);
+void e_canvas_cache_reload(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List
+ *
+ * * setting up a new config value and a listener callback is too long winded - need to have helper funcs and macros do this so it's more like 1 line per new config value or 2
+ */
+
+#if ((E17_PROFILE >= LOWRES_PDA) && (E17_PROFILE <= HIRES_PDA))
+#define DEF_MENUCLICK 1.25
+#else
+#define DEF_MENUCLICK 0.25
+#endif
+
+char *e_config_val_desktop_default_background = NULL;
+double e_config_val_menus_scroll_speed = 1000.0;
+double e_config_val_menus_fast_mouse_move_thresthold = 500.0;
+double e_config_val_menus_click_drag_timeout = DEF_MENUCLICK;
+double e_config_val_framerate = 30.0;
+int e_config_val_image_cache = 2048;
+int e_config_val_font_cache = 512;
+
+/* local subsystem functions */
+static void _e_config_save_cb(void *data);
+
+static int _e_config_listener_desktop_default_background(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_menus_scroll_speed(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_menus_fast_mouse_move_threshold(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_menus_click_drag_timeout(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_framerate(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_image_cache(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _e_config_listener_font_cache(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+
+/* local subsystem globals */
+static Ecore_Job *_e_config_save_job = NULL;
+
+/* externally accessible functions */
+int
+e_config_init(void)
+{
+ int ret;
+
+ ecore_config_init("e");
+
+ ecore_config_string_create
+ ("e.desktop.default.background",
+ PACKAGE_DATA_DIR"/data/themes/default.eet",
+ 'b', "default-background",
+ "The default background for desktops without a custom background");
+ ecore_config_float_create_bound
+ ("e.menus.scroll_speed",
+ 1000.0, 1.0, 20000.0, 10.0,
+ 0, "menus-scroll-speed",
+ "Pixels per second menus scroll around the screen");
+ ecore_config_float_create_bound
+ ("e.menus.fast_mouse_move_threshold",
+ 300.0, 1.0, 2000.0, 1.0,
+ 0, "menus-scroll-speed",
+ "Pixels per second menus scroll around the screen");
+ ecore_config_float_create_bound
+ ("e.menus.click_drag_timeout",
+ DEF_MENUCLICK, 0.0, 10.0, 0.01,
+ 0, "menus-click-drag-timeout",
+ "Seconds after a mouse press when a release will not hide the menu");
+ ecore_config_float_create_bound
+ ("e.framerate",
+ 30.0, 1.0, 200.0, 0.1,
+ 0, "framerate",
+ "A hint at the framerate (in frames per second) Enlightenment should try and animate at");
+ ecore_config_int_create_bound
+ ("e.image-cache",
+ 2048, 0, 32768, 1,
+ 0, "image-cache",
+ "The mount of memory (in Kb) to use as a sepculative image cache");
+ ecore_config_int_create_bound
+ ("e.font-cache",
+ 512, 0, 4096, 1,
+ 0, "font-cache",
+ "The mount of memory (in Kb) to use as a sepculative font cache");
+
+ ecore_config_load();
+ ret = ecore_config_args_parse();
+
+ e_config_val_desktop_default_background =
+ ecore_config_string_get("e.desktop.default.background");
+ ecore_config_listen("e.desktop.default.background",
+ "e.desktop.default.background",
+ _e_config_listener_desktop_default_background,
+ 0, NULL);
+ e_config_val_menus_scroll_speed =
+ ecore_config_float_get("e.menus.scroll_speed");
+ ecore_config_listen("e.menus.scroll_speed",
+ "e.menus.scroll_speed",
+ _e_config_listener_menus_scroll_speed,
+ 0, NULL);
+ e_config_val_menus_fast_mouse_move_thresthold =
+ ecore_config_float_get("e.menus.fast_mouse_move_threshold");
+ ecore_config_listen("e.menus.fast_mouse_move_threshold",
+ "e.menus.fast_mouse_move_threshold",
+ _e_config_listener_menus_fast_mouse_move_threshold,
+ 0, NULL);
+ e_config_val_menus_click_drag_timeout =
+ ecore_config_float_get("e.menus.click_drag_timeout");
+ ecore_config_listen("e.menus.click_drag_timeout",
+ "e.menus.click_drag_timeout",
+ _e_config_listener_menus_click_drag_timeout,
+ 0, NULL);
+ e_config_val_framerate =
+ ecore_config_float_get("e.framerate");
+ if (e_config_val_framerate <= 0.0) e_config_val_framerate = 30.0;
+ ecore_config_listen("e.framerate",
+ "e.framerate",
+ _e_config_listener_framerate,
+ 0, NULL);
+ e_config_val_image_cache =
+ ecore_config_int_get("e.image-cache");
+ ecore_config_listen("e.image-cache",
+ "e.image-cache",
+ _e_config_listener_image_cache,
+ 0, NULL);
+ e_config_val_font_cache =
+ ecore_config_int_get("e.font-cache");
+ ecore_config_listen("e.font-cache",
+ "e.font-cache",
+ _e_config_listener_font_cache,
+ 0, NULL);
+ return 1;
+}
+
+int
+e_config_shutdown(void)
+{
+ /* FIXME: unset listeners */
+ return 1;
+}
+
+int
+e_config_save(void)
+{
+ if (_e_config_save_job)
+ {
+ ecore_job_del(_e_config_save_job);
+ _e_config_save_job = NULL;
+ }
+ return ecore_config_save();
+}
+
+void
+e_config_save_queue(void)
+{
+ if (_e_config_save_job) ecore_job_del(_e_config_save_job);
+ _e_config_save_job = ecore_job_add(_e_config_save_cb, NULL);
+}
+
+/* local subsystem functions */
+static void
+_e_config_save_cb(void *data)
+{
+ _e_config_save_job = NULL;
+ e_module_save_all();
+ e_config_save();
+}
+
+static int
+_e_config_listener_desktop_default_background(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ Evas_List *managers, *l;
+
+ if (e_config_val_desktop_default_background)
+ free(e_config_val_desktop_default_background);
+ e_config_val_desktop_default_background =
+ ecore_config_string_get("e.desktop.default.background");
+ managers = e_manager_list();
+ for (l = managers; l; l = l->next)
+ {
+ Evas_List *ll;
+ E_Manager *man;
+
+ man = l->data;
+ for (ll = man->containers; ll; ll = ll->next)
+ {
+ E_Container *con;
+
+ con = ll->data;
+ e_container_bg_reconfigure(con);
+ }
+ }
+ return 1;
+}
+
+static int
+_e_config_listener_menus_scroll_speed(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_menus_scroll_speed =
+ ecore_config_float_get("e.menus.scroll_speed");
+ return 1;
+}
+
+static int
+_e_config_listener_menus_fast_mouse_move_threshold(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_menus_fast_mouse_move_thresthold =
+ ecore_config_float_get("e.menus.fast_mouse_move_threshold");
+ return 1;
+}
+
+static int
+_e_config_listener_menus_click_drag_timeout(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_menus_click_drag_timeout =
+ ecore_config_float_get("e.menus.click_drag_timeout");
+ return 1;
+}
+
+static int
+_e_config_listener_framerate(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_framerate =
+ ecore_config_float_get("e.framerate");
+ if (e_config_val_framerate <= 0.0) e_config_val_framerate = 30.0;
+ edje_frametime_set(1.0 / e_config_val_framerate);
+ return 1;
+}
+
+static int
+_e_config_listener_image_cache(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_image_cache =
+ ecore_config_int_get("e.image-cache");
+ ecore_config_listen("e.image-cache",
+ "e.image-cache",
+ _e_config_listener_image_cache,
+ 0, NULL);
+ e_canvas_recache();
+ return 1;
+}
+
+static int
+_e_config_listener_font_cache(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ e_config_val_font_cache =
+ ecore_config_int_get("e.font-cache");
+ ecore_config_listen("e.font-cache",
+ "e.font-cache",
+ _e_config_listener_font_cache,
+ 0, NULL);
+ e_canvas_recache();
+ return 1;
+}
--- /dev/null
+#ifndef E_CONFIG_H
+#define E_CONFIG_H
+
+int e_config_init(void);
+int e_config_shutdown(void);
+
+int e_config_save(void);
+void e_config_save_queue(void);
+
+extern char *e_config_val_desktop_default_background;
+extern double e_config_val_menus_scroll_speed;
+extern double e_config_val_menus_fast_mouse_move_thresthold;
+extern double e_config_val_menus_click_drag_timeout;
+extern double e_config_val_framerate;
+extern int e_config_val_image_cache;
+extern int e_config_val_font_cache;
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * fix shape callbacks to be able to be safely deleted
+ */
+
+/* local subsystem functions */
+static void _e_container_free(E_Container *con);
+
+static void _e_container_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void _e_container_cb_bg_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void _e_container_cb_bg_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void _e_container_cb_bg_ecore_evas_resize(Ecore_Evas *ee);
+
+static void _e_container_shape_del(E_Container_Shape *es);
+static void _e_container_shape_free(E_Container_Shape *es);
+static void _e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change ch);
+
+/* externally accessible functions */
+int
+e_container_init(void)
+{
+ return 1;
+}
+
+int
+e_container_shutdown(void)
+{
+ return 1;
+}
+
+E_Container *
+e_container_new(E_Manager *man)
+{
+ E_Container *con;
+ Ecore_Event_Handler *h;
+
+ con = E_OBJECT_ALLOC(E_Container, _e_container_free);
+ if (!con) return NULL;
+ con->manager = man;
+ e_object_ref(E_OBJECT(con->manager));
+ con->manager->containers = evas_list_append(con->manager->containers, con);
+ con->w = con->manager->w;
+ con->h = con->manager->h;
+ con->win = ecore_x_window_override_new(con->manager->win, con->x, con->y, con->w, con->h);
+ ecore_x_icccm_title_set(con->win, "Enlightenment Container");
+ con->bg_ecore_evas = ecore_evas_software_x11_new(NULL, con->win, 0, 0, con->w, con->h);
+ e_canvas_add(con->bg_ecore_evas);
+ con->bg_evas = ecore_evas_get(con->bg_ecore_evas);
+ con->bg_win = ecore_evas_software_x11_window_get(con->bg_ecore_evas);
+ ecore_evas_name_class_set(con->bg_ecore_evas, "E", "Background_Window");
+ ecore_evas_title_set(con->bg_ecore_evas, "Enlightenment Background");
+ ecore_evas_avoid_damage_set(con->bg_ecore_evas, 1);
+ ecore_evas_show(con->bg_ecore_evas);
+ e_path_evas_append(path_fonts, con->bg_evas);
+
+ e_pointer_container_set(con);
+
+ if (1) /* for now ALWAYS on - but later maybe a config option */
+ {
+ Evas_Object *o;
+
+ o = evas_object_rectangle_add(con->bg_evas);
+ con->bg_blank_object = 0;
+ evas_object_layer_set(o, -100);
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, con->w, con->h);
+ evas_object_color_set(o, 255, 255, 255, 255);
+ evas_object_show(o);
+
+ o = edje_object_add(con->bg_evas);
+ con->bg_object = o;
+ evas_object_layer_set(o, -1);
+ evas_object_name_set(o, "desktop/background");
+ evas_object_data_set(o, "e_container", con);
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, con->w, con->h);
+ edje_object_file_set(o,
+ e_config_val_desktop_default_background,
+ "desktop/background");
+ evas_object_show(o);
+
+ o = evas_object_rectangle_add(con->bg_evas);
+ con->bg_event_object = 0;
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, con->w, con->h);
+ evas_object_color_set(o, 255, 255, 255, 0);
+ evas_object_show(o);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_container_cb_bg_mouse_down, con);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_container_cb_bg_mouse_up, con);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _e_container_cb_bg_mouse_move, con);
+
+ ecore_evas_callback_resize_set(con->bg_ecore_evas, _e_container_cb_bg_ecore_evas_resize);
+ }
+ return con;
+}
+
+void
+e_container_show(E_Container *con)
+{
+ E_OBJECT_CHECK(con);
+ if (con->visible) return;
+ ecore_x_window_show(con->win);
+ con->visible = 1;
+}
+
+void
+e_container_hide(E_Container *con)
+{
+ E_OBJECT_CHECK(con);
+ if (!con->visible) return;
+ ecore_x_window_hide(con->win);
+ con->visible = 0;
+}
+
+void
+e_container_move(E_Container *con, int x, int y)
+{
+ E_OBJECT_CHECK(con);
+ if ((x == con->x) && (y == con->y)) return;
+ con->x = x;
+ con->y = y;
+ ecore_x_window_move(con->win, con->x, con->y);
+}
+
+void
+e_container_resize(E_Container *con, int w, int h)
+{
+ E_OBJECT_CHECK(con);
+ if ((w == con->w) && (h == con->h)) return;
+ con->w = w;
+ con->h = h;
+ ecore_x_window_resize(con->win, con->w, con->h);
+ ecore_evas_resize(con->bg_ecore_evas, con->w, con->h);
+}
+
+void
+e_container_move_resize(E_Container *con, int x, int y, int w, int h)
+{
+ E_OBJECT_CHECK(con);
+ if ((x == con->x) && (y == con->y) && (w == con->w) && (h == con->h)) return;
+ con->x = x;
+ con->y = y;
+ con->w = w;
+ con->h = h;
+ ecore_x_window_move_resize(con->win, con->x, con->y, con->w, con->h);
+ ecore_evas_resize(con->bg_ecore_evas, con->w, con->h);
+}
+
+void
+e_container_raise(E_Container *con)
+{
+ E_OBJECT_CHECK(con);
+ ecore_x_window_raise(con->win);
+}
+
+void
+e_container_lower(E_Container *con)
+{
+ E_OBJECT_CHECK(con);
+ ecore_x_window_lower(con->win);
+}
+
+void
+e_container_bg_reconfigure(E_Container *con)
+{
+ Evas_Object *o;
+
+ E_OBJECT_CHECK(con);
+ o = con->bg_object;
+ evas_object_hide(o);
+ edje_object_file_set(o,
+ e_config_val_desktop_default_background,
+ "desktop/background");
+ evas_object_layer_set(o, -1);
+ evas_object_show(o);
+}
+
+
+
+E_Container_Shape *
+e_container_shape_add(E_Container *con)
+{
+ E_Container_Shape *es;
+
+ E_OBJECT_CHECK_RETURN(con, NULL);
+
+ es = E_OBJECT_ALLOC(E_Container_Shape, _e_container_shape_free);
+ E_OBJECT_DEL_SET(es, _e_container_shape_del);
+ es->con = con;
+ con->shapes = evas_list_append(con->shapes, es);
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_ADD);
+ return es;
+}
+
+void
+e_container_shape_show(E_Container_Shape *es)
+{
+ E_OBJECT_CHECK(es);
+ if (es->visible) return;
+ es->visible = 1;
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_SHOW);
+}
+
+void
+e_container_shape_hide(E_Container_Shape *es)
+{
+ E_OBJECT_CHECK(es);
+ if (!es->visible) return;
+ es->visible = 0;
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_HIDE);
+}
+
+void
+e_container_shape_move(E_Container_Shape *es, int x, int y)
+{
+ E_OBJECT_CHECK(es);
+ if ((es->x == x) && (es->y == y)) return;
+ es->x = x;
+ es->y = y;
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_MOVE);
+}
+
+void
+e_container_shape_resize(E_Container_Shape *es, int w, int h)
+{
+ E_OBJECT_CHECK(es);
+ if (w < 1) w = 1;
+ if (h < 1) h = 1;
+ if ((es->w == w) && (es->h == h)) return;
+ es->w = w;
+ es->h = h;
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_RESIZE);
+}
+
+Evas_List *
+e_container_shape_list_get(E_Container *con)
+{
+ E_OBJECT_CHECK_RETURN(con, NULL);
+ return con->shapes;
+}
+
+void
+e_container_shape_geometry_get(E_Container_Shape *es, int *x, int *y, int *w, int *h)
+{
+ E_OBJECT_CHECK(es);
+ if (x) *x = es->x;
+ if (y) *y = es->y;
+ if (w) *w = es->w;
+ if (h) *h = es->h;
+}
+
+E_Container *
+e_container_shape_container_get(E_Container_Shape *es)
+{
+ E_OBJECT_CHECK_RETURN(es, NULL);
+ return es->con;
+}
+
+void
+e_container_shape_change_callback_add(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data)
+{
+ E_Container_Shape_Callback *cb;
+
+ E_OBJECT_CHECK(con);
+ cb = calloc(1, sizeof(E_Container_Shape_Callback));
+ if (!cb) return;
+ cb->func = func;
+ cb->data = data;
+ con->shape_change_cb = evas_list_append(con->shape_change_cb, cb);
+}
+
+void
+e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data)
+{
+ Evas_List *l;
+
+ /* FIXME: if we call this from within a callback we are in trouble */
+ E_OBJECT_CHECK(con);
+ for (l = con->shape_change_cb; l; l = l->next)
+ {
+ E_Container_Shape_Callback *cb;
+
+ cb = l->data;
+ if ((cb->func == func) && (cb->data == data))
+ {
+ con->shape_change_cb = evas_list_remove_list(con->shape_change_cb, l);
+ free(cb);
+ return;
+ }
+ }
+}
+
+Evas_List *
+e_container_shape_rects_get(E_Container_Shape *es)
+{
+ E_OBJECT_CHECK_RETURN(es, NULL);
+ return es->shape;
+}
+
+
+
+
+
+/* local subsystem functions */
+static void
+_e_container_free(E_Container *con)
+{
+ while (con->clients) e_object_del(E_OBJECT(con->clients->data));
+ con->manager->containers = evas_list_remove(con->manager->containers, con);
+ e_canvas_del(con->bg_ecore_evas);
+ ecore_evas_free(con->bg_ecore_evas);
+ ecore_x_window_del(con->win);
+ e_object_unref(E_OBJECT(con->manager));
+ free(con);
+}
+
+static void
+_e_container_cb_bg_mouse_down(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ E_Container *con;
+ Evas_Event_Mouse_Down *ev;
+
+ ev = (Evas_Event_Mouse_Down *)event_info;
+ con = data;
+ if (ev->button == 1)
+ {
+ char buf[4096];
+ char *homedir;
+
+ homedir = e_user_homedir_get();
+ if (homedir)
+ {
+ E_Menu *m;
+
+ snprintf(buf, sizeof(buf), "%s/.e/e/applications/favorite", homedir);
+ m = e_int_menus_apps_new(buf, 1);
+ e_menu_activate_mouse(m, con, ev->output.x, ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN);
+ e_util_container_fake_mouse_up_all_later(con);
+ free(homedir);
+ }
+ }
+ else if (ev->button == 2)
+ {
+ static E_Menu *m = NULL;
+ static E_Menu *m1 = NULL;
+ static E_Menu *m2 = NULL;
+
+ if (!m)
+ {
+ E_Menu_Item *mi;
+
+ m1 = e_menu_new();
+ mi = e_menu_item_new(m1);
+ e_menu_item_label_set(mi, "Submenu 1 Item 1");
+ mi = e_menu_item_new(m1);
+ e_menu_item_label_set(mi, "Submenu 1 Item 2");
+ mi = e_menu_item_new(m1);
+ e_menu_item_label_set(mi, "Submenu 1 Item 3");
+
+ m2 = e_menu_new();
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "Flimstix");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "Shub Shub");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "Gah I thought I'd just make this long");
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "And more");
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "Getting stenchy");
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "Ich bin ein Fisch");
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "PONG");
+ mi = e_menu_item_new(m2);
+ e_menu_item_label_set(mi, "The last word");
+
+ m = e_menu_new();
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "First Menu Item");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Short");
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "A very long menu item is here to test with");
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "There is no spoon!");
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Icon: Pants On.");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "First Submenu");
+ e_menu_item_submenu_set(mi, m1);
+ mi = e_menu_item_new(m);
+ e_menu_item_separator_set(mi, 1);
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Other side of a separator");
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "A Submenu");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ e_menu_item_submenu_set(mi, m2);
+ mi = e_menu_item_new(m);
+ e_menu_item_check_set(mi, 1);
+ e_menu_item_label_set(mi, "Check 1");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m);
+ e_menu_item_check_set(mi, 1);
+ e_menu_item_label_set(mi, "Check 2");
+ mi = e_menu_item_new(m);
+ e_menu_item_check_set(mi, 1);
+ e_menu_item_label_set(mi, "Check 3");
+ mi = e_menu_item_new(m);
+ e_menu_item_separator_set(mi, 1);
+ mi = e_menu_item_new(m);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ e_menu_item_label_set(mi, "Radio 1 Group 1");
+ mi = e_menu_item_new(m);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ e_menu_item_label_set(mi, "Radio 2 Group 1");
+ mi = e_menu_item_new(m);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ e_menu_item_label_set(mi, "Radio 3 Group 1");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ mi = e_menu_item_new(m);
+ e_menu_item_separator_set(mi, 1);
+ mi = e_menu_item_new(m);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ e_menu_item_label_set(mi, "Radio 1 Group 2");
+ mi = e_menu_item_new(m);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ e_menu_item_label_set(mi, "Radio 2 Group 2");
+ }
+ e_menu_activate_mouse(m, con, ev->output.x, ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN);
+ /* fake the up event as we will now grab the mouse to the menu */
+ e_util_container_fake_mouse_up_all_later(con);
+ }
+ else if (ev->button == 3)
+ {
+ E_Menu *m;
+
+ m = e_int_menus_about_new();
+ e_menu_activate_mouse(m, con, ev->output.x, ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN);
+ e_util_container_fake_mouse_up_all_later(con);
+ }
+}
+
+static void
+_e_container_cb_bg_mouse_up(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ E_Container *con;
+ Evas_Event_Mouse_Up *ev;
+
+ ev = (Evas_Event_Mouse_Up *)event_info;
+ con = data;
+}
+
+static void
+_e_container_cb_bg_mouse_move(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ E_Container *con;
+ Evas_Event_Mouse_Move *ev;
+
+ ev = (Evas_Event_Mouse_Move *)event_info;
+ con = data;
+/* printf("move %i %i\n", ev->cur.output.x, ev->cur.output.y); */
+}
+
+static void
+_e_container_cb_bg_ecore_evas_resize(Ecore_Evas *ee)
+{
+ Evas *evas;
+ Evas_Object *o;
+ E_Container *con;
+ Evas_Coord w, h;
+
+ evas = ecore_evas_get(ee);
+ evas_output_viewport_get(evas, NULL, NULL, &w, &h);
+ o = evas_object_name_find(evas, "desktop/background");
+ con = evas_object_data_get(o, "e_container");
+ evas_object_resize(con->bg_object, w, h);
+ evas_object_resize(con->bg_event_object, w, h);
+}
+
+static void
+_e_container_shape_del(E_Container_Shape *es)
+{
+ _e_container_shape_change_call(es, E_CONTAINER_SHAPE_DEL);
+}
+
+static void
+_e_container_shape_free(E_Container_Shape *es)
+{
+ es->con->shapes = evas_list_remove(es->con->shapes, es);
+ while (es->shape)
+ {
+ E_Rect *r;
+
+ r = es->shape->data;
+ es->shape = evas_list_remove_list(es->shape, es->shape);
+ free(r);
+ }
+ free(es);
+}
+
+static void
+_e_container_shape_change_call(E_Container_Shape *es, E_Container_Shape_Change ch)
+{
+ Evas_List *l;
+
+ for (l = es->con->shape_change_cb; l; l = l->next)
+ {
+ E_Container_Shape_Callback *cb;
+
+ cb = l->data;
+ cb->func(cb->data, es, ch);
+ }
+}
--- /dev/null
+#ifndef E_CONTAINER_H
+#define E_CONTAINER_H
+
+typedef enum _E_Container_Shape_Change
+{
+ E_CONTAINER_SHAPE_ADD,
+ E_CONTAINER_SHAPE_DEL,
+ E_CONTAINER_SHAPE_SHOW,
+ E_CONTAINER_SHAPE_HIDE,
+ E_CONTAINER_SHAPE_MOVE,
+ E_CONTAINER_SHAPE_RESIZE,
+ E_CONTAINER_SHAPE_RECTS
+} E_Container_Shape_Change;
+
+typedef struct _E_Container E_Container;
+typedef struct _E_Container_Shape E_Container_Shape;
+typedef struct _E_Container_Shape_Callback E_Container_Shape_Callback;
+
+struct _E_Container
+{
+ E_Object e_obj_inherit;
+
+ Ecore_X_Window win;
+ int x, y, w, h;
+ char visible : 1;
+ E_Manager *manager;
+
+ Ecore_Evas *bg_ecore_evas;
+ Evas *bg_evas;
+ Ecore_X_Window bg_win;
+ Evas_Object *bg_blank_object;
+ Evas_Object *bg_object;
+ Evas_Object *bg_event_object;
+
+ Evas_List *shapes;
+ Evas_List *shape_change_cb;
+ Evas_List *clients;
+};
+
+struct _E_Container_Shape
+{
+ E_Object e_obj_inherit;
+
+ E_Container *con;
+ int x, y, w, h;
+ unsigned char visible : 1;
+ Evas_List *shape;
+};
+
+struct _E_Container_Shape_Callback
+{
+ void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
+ void *data;
+};
+
+int e_container_init(void);
+int e_container_shutdown(void);
+
+E_Container *e_container_new(E_Manager *man);
+void e_container_show(E_Container *con);
+void e_container_hide(E_Container *con);
+void e_container_move(E_Container *con, int x, int y);
+void e_container_resize(E_Container *con, int w, int h);
+void e_container_move_resize(E_Container *con, int x, int y, int w, int h);
+void e_container_raise(E_Container *con);
+void e_container_lower(E_Container *con);
+void e_container_bg_reconfigure(E_Container *con);
+
+E_Container_Shape *e_container_shape_add(E_Container *con);
+void e_container_shape_show(E_Container_Shape *es);
+void e_container_shape_hide(E_Container_Shape *es);
+void e_container_shape_move(E_Container_Shape *es, int x, int y);
+void e_container_shape_resize(E_Container_Shape *es, int w, int h);
+Evas_List *e_container_shape_list_get(E_Container *con);
+void e_container_shape_geometry_get(E_Container_Shape *es, int *x, int *y, int *w, int *h);
+E_Container *e_container_shape_container_get(E_Container_Shape *es);
+void e_container_shape_change_callback_add(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data);
+void e_container_shape_change_callback_del(E_Container *con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change ch), void *data);
+Evas_List *e_container_shape_rects_get(E_Container_Shape *es);
+
+#endif
--- /dev/null
+#include "e.h"
--- /dev/null
+#ifndef E_DESK_H
+#define E_DESK_H
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * edjify error dialogs if edje data can be found for them
+ * * current gui dialg needs to resize to fit contents if they are bigger
+ */
+
+/* local subsystem functions */
+static void _e_error_message_show_x(char *txt);
+
+static void _e_error_cb_ok_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _e_error_cb_ok_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _e_error_cb_job_ecore_evas_free(void *data);
+
+/* local subsystem globals */
+static int error_gui = 0;
+
+/* externally accessible functions */
+void
+e_error_message_show_internal(char *txt)
+{
+ printf("_______ _______\n"
+ "|:::::| Enlightenment Error |:::::|\n"
+ "~~~~~~~ ~~~~~~~\n"
+ "%s\n",
+ txt);
+ if (error_gui) _e_error_message_show_x(txt);
+}
+
+void
+e_error_dialog_show_internal(char *title, char *txt)
+{
+ Evas_List *l;
+ E_Manager *man;
+
+ l = e_manager_list();
+ if (!l) return;
+ man = l->data;
+ e_error_message_manager_show(man, title, txt);
+}
+
+void
+e_error_gui_set(int on)
+{
+ error_gui = on;
+}
+
+void
+e_error_message_manager_show(E_Manager *man, char *title, char *txt)
+{
+ Ecore_Evas *ee;
+ Evas *e;
+ int error_w, error_h;
+ Evas_List *l, *shapelist = NULL;
+
+ error_w = 400;
+ error_h = 200;
+ ee = ecore_evas_software_x11_new(NULL, man->win,
+ (man->w - error_w) / 2, (man->h - error_h) / 2,
+ error_w, error_h);
+ e_canvas_add(ee);
+ for (l = man->containers; l; l = l->next)
+ {
+ E_Container *con;
+ E_Container_Shape *es;
+ int x, y, w, h;
+
+ con = l->data;
+ ecore_evas_geometry_get(ee, &x, &y, &w, &h);
+ es = e_container_shape_add(con);
+ e_container_shape_move(es, x, y);
+ e_container_shape_resize(es, w, h);
+ e_container_shape_show(es);
+ shapelist = evas_list_append(shapelist, es);
+ }
+ ecore_evas_data_set(ee, "shapes", shapelist);
+ ecore_evas_name_class_set(ee, "E", "Low_Level_Dialog");
+ ecore_evas_title_set(ee, "Enlightenment: Low Level Dialog");
+ ecore_evas_show(ee);
+ e = ecore_evas_get(ee);
+ e_path_evas_append(path_fonts, e);
+ e_pointer_ecore_evas_set(ee);
+
+ {
+ Evas_Object *o;
+ Evas_Coord tw, th;
+ char *newstr;
+
+ o = evas_object_image_add(e);
+ evas_object_image_file_set(o, e_path_find(path_images, "error_bg.png"), NULL);
+ evas_object_move(o, 0, 0);
+ evas_object_image_fill_set(o, 0, 0, error_w, error_h);
+ evas_object_resize(o, error_w, error_h);
+ evas_object_image_border_set(o, 3, 3, 3, 3);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_image_add(e);
+ evas_object_image_file_set(o, e_path_find(path_images, "e.png"), NULL);
+ evas_object_move(o, 16, 16);
+ evas_object_resize(o, 64, 64);
+ evas_object_image_fill_set(o, 0, 0, 64, 64);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 255, 255, 255, 128);
+ evas_object_text_font_set(o, "Vera-Bold", 12);
+ evas_object_text_text_set(o, title);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o,
+ (16 + 64 + 16 + (((400 - (16 + 64 + 16 + 16)) - tw) / 2)) + 1,
+ (16 + ((64 - th) / 2)) + 1);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 0, 0, 0, 255);
+ evas_object_text_font_set(o, "Vera-Bold", 12);
+ evas_object_text_text_set(o, title);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o,
+ 16 + 64 + 16 + (((400 - (16 + 64 + 16 + 16)) - tw) / 2),
+ 16 + ((64 - th) / 2));
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ newstr = strdup(txt);
+ if (newstr)
+ {
+ char *p;
+ Evas_Coord y;
+
+ y = 16 + 64 + 16;
+ for (p = newstr; p;)
+ {
+ char *pp;
+
+ pp = strchr(p, '\n');
+ if (pp) *pp = 0;
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 255, 255, 255, 128);
+ evas_object_text_font_set(o, "Vera", 10);
+ evas_object_text_text_set(o, p);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o, 16 + 1, y + 1);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 0, 0, 0, 255);
+ evas_object_text_font_set(o, "Vera", 10);
+ evas_object_text_text_set(o, p);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o, 16, y);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+ y += th;
+ if (pp) p = pp + 1;
+ else p = NULL;
+ }
+ free(newstr);
+ }
+
+ o = evas_object_image_add(e);
+ evas_object_image_file_set(o, e_path_find(path_images, "button_out.png"), NULL);
+ evas_object_move(o, (error_w - 64) / 2, error_h - 16 - 32);
+ evas_object_resize(o, 64, 32);
+ evas_object_image_fill_set(o, 0, 0, 64, 32);
+ evas_object_image_border_set(o, 8, 8, 8, 8);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _e_error_cb_ok_down, ee);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _e_error_cb_ok_up, ee);
+ evas_object_show(o);
+
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 255, 255, 255, 128);
+ evas_object_text_font_set(o, "Vera-Bold", 12);
+ evas_object_text_text_set(o, "OK");
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o, ((error_w - tw) / 2) + 1, (error_h - 16 - 32 + ((32 - th) / 2)) + 1);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_text_add(e);
+ evas_object_color_set(o, 0, 0, 0, 255);
+ evas_object_text_font_set(o, "Vera-Bold", 12);
+ evas_object_text_text_set(o, "OK");
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ evas_object_move(o, (error_w - tw) / 2, error_h - 16 - 32 + ((32 - th) / 2));
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = evas_object_rectangle_add(e);
+ evas_object_name_set(o, "allocated");
+ }
+}
+
+/* local subsystem functions */
+static void
+_e_error_message_show_x(char *txt)
+{
+ e_error_dialog_show_internal("Enlightenment: Error!", txt);
+}
+
+static void
+_e_error_cb_ok_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *ev;
+ Ecore_Evas *ee;
+
+ ev = event_info;
+ if (ev->button != 1) return;
+ ee = data;
+ evas_object_image_file_set(obj, e_path_find(path_images, "button_in.png"), NULL);
+}
+
+static void
+_e_error_cb_ok_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Up *ev;
+ Ecore_Evas *ee;
+ Evas_Object *o;
+
+ ev = event_info;
+ if (ev->button != 1) return;
+ ee = data;
+ evas_object_image_file_set(obj, e_path_find(path_images, "button_out.png"), NULL);
+ o = evas_object_name_find(ecore_evas_get(ee), "allocated");
+ if (o)
+ {
+ evas_object_del(o);
+ ecore_job_add(_e_error_cb_job_ecore_evas_free, ee);
+ }
+}
+
+static void
+_e_error_cb_job_ecore_evas_free(void *data)
+{
+ Ecore_Evas *ee;
+ Evas_List *shapelist;
+
+ ee = data;
+ shapelist = ecore_evas_data_get(ee, "shapes");
+ while (shapelist)
+ {
+ E_Container_Shape *es;
+
+ es = shapelist->data;
+ shapelist = evas_list_remove_list(shapelist, shapelist);
+ e_object_del(E_OBJECT(es));
+ }
+ e_canvas_del(ee);
+ ecore_evas_free(ee);
+}
--- /dev/null
+#ifndef E_ERROR_H
+#define E_ERROR_H
+
+#define print0(x, args...) x ,print1(## args)
+#define e_error_message_show(args...) \
+{ \
+ char __tmpbuf[4096]; \
+ \
+ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
+ e_error_message_show_internal(__tmpbuf); \
+}
+
+#define e_error_dialog_show(title, args...) \
+{ \
+ char __tmpbuf[4096]; \
+ \
+ snprintf(__tmpbuf, sizeof(__tmpbuf), ##args); \
+ e_error_dialog_show_internal(title, __tmpbuf); \
+}
+
+void e_error_message_show_internal(char *txt);
+void e_error_dialog_show_internal(char *title, char *txt);
+
+void e_error_gui_set(int on);
+void e_error_message_manager_show(E_Manager *man, char *title, char *txt);
+
+#endif
--- /dev/null
+#include "e.h"
+#include <dirent.h>
+
+/* externally accessible functions */
+time_t
+e_file_mod_time(char *file)
+{
+ struct stat st;
+
+ if (stat(file, &st) < 0) return 0;
+ return st.st_mtime;
+}
+
+int
+e_file_exists(char *file)
+{
+ struct stat st;
+
+ if (stat(file, &st) < 0) return 0;
+ return 1;
+}
+
+int
+e_file_is_dir(char *file)
+{
+ struct stat st;
+
+ if (stat(file, &st) < 0) return 0;
+ if (S_ISDIR(st.st_mode)) return 1;
+ return 0;
+}
+
+static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
+
+int
+e_file_mkdir(char *dir)
+{
+ if (mkdir(dir, default_mode) < 0) return 0;
+ return 1;
+}
+
+int
+e_file_mkpath(char *path)
+{
+ char ss[PATH_MAX];
+ int i, ii;
+
+ ss[0] = 0;
+ i = 0;
+ ii = 0;
+ while (path[i])
+ {
+ if (ii == sizeof(ss) - 1) return 0;
+ ss[ii++] = path[i];
+ ss[ii] = 0;
+ if (path[i] == '/')
+ {
+ if (!e_file_is_dir(ss)) e_file_mkdir(ss);
+ else if (!e_file_is_dir(ss)) return 0;
+ }
+ i++;
+ }
+ if (!e_file_is_dir(ss)) e_file_mkdir(ss);
+ else if (!e_file_is_dir(ss)) return 0;
+ return 1;
+}
+
+int
+e_file_cp(char *src, char *dst)
+{
+ FILE *f1, *f2;
+ char buf[16384];
+ size_t num;
+
+ f1 = fopen(src, "rb");
+ if (!f1) return 0;
+ f2 = fopen(dst, "wb");
+ if (!f2)
+ {
+ fclose(f1);
+ return 0;
+ }
+ while ((num = fread(buf, 1, 16384, f1)) > 0) fwrite(buf, 1, num, f2);
+ fclose(f1);
+ fclose(f2);
+ return 1;
+}
+
+char *
+e_file_realpath(char *file)
+{
+ char buf[PATH_MAX];
+ char *f;
+ struct stat st;
+
+ if (!realpath(file, buf) || stat(buf, &st)) return strdup("");
+ return strdup(buf);
+}
+
+char *
+e_file_get_file(char *path)
+{
+ char *result = NULL;
+
+ if (!path) return NULL;
+ if ((result = strrchr(path, '/'))) result++;
+ else result = path;
+ return result;
+}
+
+char *
+e_file_get_dir(char *file)
+{
+ char *p;
+ char *f;
+ char buf[PATH_MAX];
+
+ strncpy(buf, file, PATH_MAX);
+ p = strrchr(buf, '/');
+ if (!p)
+ {
+ return strdup(file);
+ }
+ *p = 0;
+ return strdup(buf);
+}
+
+int
+e_file_can_exec(struct stat *st)
+{
+ static int have_uid = 0;
+ static uid_t uid = -1;
+ static gid_t gid = -1;
+ int ok;
+
+ if (!st) return 0;
+ ok = 0;
+ if (!have_uid) uid = getuid();
+ if (!have_uid) gid = getgid();
+ have_uid = 1;
+ if (st->st_uid == uid)
+ {
+ if (st->st_mode & S_IXUSR) ok = 1;
+ }
+ else if (st->st_gid == gid)
+ {
+ if (st->st_mode & S_IXGRP) ok = 1;
+ }
+ else
+ {
+ if (st->st_mode & S_IXOTH) ok = 1;
+ }
+ return(ok);
+}
+
+char *
+e_file_readlink(char *link)
+{
+ char buf[PATH_MAX];
+ char *f;
+ int count;
+
+ if ((count = readlink(link, buf, sizeof(buf))) < 0) return NULL;
+ buf[count] = 0;
+ return strdup(buf);
+}
+
+Evas_List *
+e_file_ls(char *dir)
+{
+ DIR *dirp;
+ struct dirent *dp;
+ Evas_List *list;
+
+ dirp = opendir(dir);
+ if (!dirp) return NULL;
+ list = NULL;
+ while ((dp = readdir(dirp)))
+ {
+ if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
+ {
+ Evas_List *l;
+ char *f;
+
+ /* insertion sort */
+ for (l = list; l; l = l->next)
+ {
+ if (strcmp(l->data, dp->d_name) > 0)
+ {
+ f = strdup(dp->d_name);
+ list = evas_list_prepend_relative(list, f, l->data);
+ break;
+ }
+ }
+ /* nowhwre to go? just append it */
+ f = strdup(dp->d_name);
+ if (!l)
+ list = evas_list_append(list, f);
+ }
+ }
+ closedir(dirp);
+
+ return list;
+}
--- /dev/null
+#ifndef E_FILE_H
+#define E_FILE_H
+
+#include <sys/time.h>
+#include <sys/stat.h>
+#include <Evas.h>
+
+time_t e_file_mod_time(char *file);
+int e_file_exists(char *file);
+int e_file_is_dir(char *file);
+int e_file_mkdir(char *dir);
+int e_file_mkpath(char *path);
+int e_file_cp(char *src, char *dst);
+char *e_file_realpath(char *file);
+char *e_file_get_file(char *path);
+char *e_file_get_dir(char *path);
+
+int e_file_can_exec(struct stat *st);
+char *e_file_readlink(char *link);
+Evas_List *e_file_ls(char *dir);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* local subsystem functions */
+static int _e_focus_cb_idle(void *data);
+static int _e_focus_cb_window_focus_in(void *data, int ev_type, void *ev);
+static int _e_focus_cb_window_focus_out(void *data, int ev_type, void *ev);
+
+/* local subsystem globals */
+static Ecore_Event_Handler *_e_focus_focus_in_handler = NULL;
+static Ecore_Event_Handler *_e_focus_focus_out_handler = NULL;
+
+/* externally accessible functions */
+int
+e_focus_init(void)
+{
+ _e_focus_focus_in_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN, _e_focus_cb_window_focus_in, NULL);
+ _e_focus_focus_out_handler = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT, _e_focus_cb_window_focus_out, NULL);
+ return 1;
+}
+
+int
+e_focus_shutdown(void)
+{
+ E_FN_DEL(ecore_event_handler_del, _e_focus_focus_in_handler);
+ E_FN_DEL(ecore_event_handler_del, _e_focus_focus_out_handler);
+ return 1;
+}
+
+void
+e_focus_idler_before(void)
+{
+ return;
+}
+
+
+
+/* local subsystem functions */
+static int
+_e_focus_cb_window_focus_in(void *data, int ev_type, void *ev)
+{
+ Ecore_X_Event_Window_Focus_In *e;
+ const char *modes[] = {
+ "ECORE_X_EVENT_MODE_NORMAL",
+ "ECORE_X_EVENT_MODE_WHILE_GRABBED",
+ "ECORE_X_EVENT_MODE_GRAB",
+ "ECORE_X_EVENT_MODE_UNGRAB"
+ };
+ const char *details[] = {
+ "ECORE_X_EVENT_DETAIL_ANCESTOR",
+ "ECORE_X_EVENT_DETAIL_VIRTUAL",
+ "ECORE_X_EVENT_DETAIL_INFERIOR",
+ "ECORE_X_EVENT_DETAIL_NON_LINEAR",
+ "ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL",
+ "ECORE_X_EVENT_DETAIL_POINTER",
+ "ECORE_X_EVENT_DETAIL_POINTER_ROOT",
+ "ECORE_X_EVENT_DETAIL_DETAIL_NONE"
+ };
+
+ e = ev;
+ printf("FI 0x%x md=%s dt=%s\n",
+ e->win,
+ modes[e->mode],
+ details[e->detail]);
+ return 1;
+}
+
+static int
+_e_focus_cb_window_focus_out(void *data, int ev_type, void *ev)
+{
+ Ecore_X_Event_Window_Focus_Out *e;
+ const char *modes[] = {
+ "ECORE_X_EVENT_MODE_NORMAL",
+ "ECORE_X_EVENT_MODE_WHILE_GRABBED",
+ "ECORE_X_EVENT_MODE_GRAB",
+ "ECORE_X_EVENT_MODE_UNGRAB"
+ };
+ const char *details[] = {
+ "ECORE_X_EVENT_DETAIL_ANCESTOR",
+ "ECORE_X_EVENT_DETAIL_VIRTUAL",
+ "ECORE_X_EVENT_DETAIL_INFERIOR",
+ "ECORE_X_EVENT_DETAIL_NON_LINEAR",
+ "ECORE_X_EVENT_DETAIL_NON_LINEAR_VIRTUAL",
+ "ECORE_X_EVENT_DETAIL_POINTER",
+ "ECORE_X_EVENT_DETAIL_POINTER_ROOT",
+ "ECORE_X_EVENT_DETAIL_DETAIL_NONE"
+ };
+
+ e = ev;
+ printf("FO 0x%x md=%s dt=%s\n",
+ e->win,
+ modes[e->mode],
+ details[e->detail]);
+ return 1;
+}
--- /dev/null
+#ifndef E_FOCUS_H
+#define E_FOCUS_H
+
+int e_focus_init(void);
+int e_focus_shutdown(void);
+void e_focus_idler_before(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+typedef struct _E_Smart_Data E_Smart_Data;
+
+struct _E_Smart_Data
+{
+ Evas_Coord x, y, w, h;
+ Evas_Object *obj;
+ char fill_inside : 1;
+};
+
+/* local subsystem functions */
+static void _e_icon_smart_reconfigure(E_Smart_Data *sd);
+static void _e_icon_smart_init(void);
+static void _e_icon_smart_add(Evas_Object *obj);
+static void _e_icon_smart_del(Evas_Object *obj);
+static void _e_icon_smart_layer_set(Evas_Object *obj, int layer);
+static void _e_icon_smart_raise(Evas_Object *obj);
+static void _e_icon_smart_lower(Evas_Object *obj);
+static void _e_icon_smart_stack_above(Evas_Object *obj, Evas_Object *above);
+static void _e_icon_smart_stack_below(Evas_Object *obj, Evas_Object *below);
+static void _e_icon_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y);
+static void _e_icon_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
+static void _e_icon_smart_show(Evas_Object *obj);
+static void _e_icon_smart_hide(Evas_Object *obj);
+static void _e_icon_smart_color_set(Evas_Object *obj, int r, int g, int b, int a);
+static void _e_icon_smart_clip_set(Evas_Object *obj, Evas_Object * clip);
+static void _e_icon_smart_clip_unset(Evas_Object *obj);
+
+/* local subsystem globals */
+static Evas_Smart *_e_smart = NULL;
+
+/* externally accessible functions */
+Evas_Object *
+e_icon_add(Evas *evas)
+{
+ _e_icon_smart_init();
+ return evas_object_smart_add(evas, _e_smart);
+}
+
+void
+e_icon_file_set(Evas_Object *obj, const char *file)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ /* smart code here */
+ evas_object_image_file_set(sd->obj, file, NULL);
+ _e_icon_smart_reconfigure(sd);
+}
+
+const char *
+e_icon_file_get(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+ char *file;
+
+ sd = evas_object_smart_data_get(obj);
+ evas_object_image_file_get(sd->obj, &file, NULL);
+ return file;
+}
+
+void
+e_icon_smooth_scale_set(Evas_Object *obj, int smooth)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ evas_object_image_smooth_scale_set(sd->obj, smooth);
+}
+
+int
+e_icon_smooth_scale_get(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_object_image_smooth_scale_get(sd->obj);
+}
+
+void
+e_icon_size_get(Evas_Object *obj, int *w, int *h)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ return evas_object_image_size_get(sd->obj, w, h);
+}
+
+int
+e_icon_fill_inside_get(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (sd->fill_inside) return 1;
+ return 0;
+}
+
+void
+e_icon_fill_inside_set(Evas_Object *obj, int fill_inside)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (((sd->fill_inside) && (fill_inside)) ||
+ ((!sd->fill_inside) && (!fill_inside))) return;
+ sd->fill_inside = fill_inside;
+ _e_icon_smart_reconfigure(sd);
+}
+
+/* local subsystem globals */
+static void
+_e_icon_smart_reconfigure(E_Smart_Data *sd)
+{
+ int iw, ih;
+ Evas_Coord x, y, w, h;
+
+ ih = 0;
+ ih = 0;
+ evas_object_image_size_get(sd->obj, &iw, &ih);
+ if (iw < 1) iw = 1;
+ if (ih < 1) ih = 1;
+
+ if (sd->fill_inside)
+ {
+ w = sd->w;
+ h = ((double)ih * w) / (double)iw;
+ if (h > sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
+ }
+ else
+ {
+ w = sd->w;
+ h = ((double)ih * w) / (double)iw;
+ if (h < sd->h)
+ {
+ h = sd->h;
+ w = ((double)iw * h) / (double)ih;
+ }
+ }
+ x = sd->x + ((sd->w - w) / 2);
+ y = sd->y + ((sd->h - h) / 2);
+ evas_object_move(sd->obj, x, y);
+ evas_object_image_fill_set(sd->obj, 0, 0, w, h);
+ evas_object_resize(sd->obj, w, h);
+}
+
+static void
+_e_icon_smart_init(void)
+{
+ if (_e_smart) return;
+ _e_smart = evas_smart_new("e_icon",
+ _e_icon_smart_add,
+ _e_icon_smart_del,
+ _e_icon_smart_layer_set,
+ _e_icon_smart_raise,
+ _e_icon_smart_lower,
+ _e_icon_smart_stack_above,
+ _e_icon_smart_stack_below,
+ _e_icon_smart_move,
+ _e_icon_smart_resize,
+ _e_icon_smart_show,
+ _e_icon_smart_hide,
+ _e_icon_smart_color_set,
+ _e_icon_smart_clip_set,
+ _e_icon_smart_clip_unset,
+ NULL);
+}
+
+static void
+_e_icon_smart_add(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = calloc(1, sizeof(E_Smart_Data));
+ if (!sd) return;
+ sd->obj = evas_object_image_add(evas_object_evas_get(obj));
+ sd->x = 0;
+ sd->y = 0;
+ sd->w = 0;
+ sd->h = 0;
+ sd->fill_inside = 1;
+ evas_object_smart_member_add(sd->obj, obj);
+ evas_object_smart_data_set(obj, sd);
+}
+
+static void
+_e_icon_smart_del(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_del(sd->obj);
+ free(sd);
+}
+
+static void
+_e_icon_smart_layer_set(Evas_Object *obj, int layer)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_layer_set(sd->obj, layer);
+}
+
+static void
+_e_icon_smart_raise(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_raise(sd->obj);
+}
+
+static void
+_e_icon_smart_lower(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_lower(sd->obj);
+}
+
+static void
+_e_icon_smart_stack_above(Evas_Object *obj, Evas_Object *above)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_stack_above(sd->obj, above);
+}
+
+static void
+_e_icon_smart_stack_below(Evas_Object *obj, Evas_Object *below)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_stack_below(sd->obj, below);
+}
+
+static void
+_e_icon_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ sd->x = x;
+ sd->y = y;
+ _e_icon_smart_reconfigure(sd);
+}
+
+static void
+_e_icon_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ sd->w = w;
+ sd->h = h;
+ _e_icon_smart_reconfigure(sd);
+}
+
+static void
+_e_icon_smart_show(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_show(sd->obj);
+}
+
+static void
+_e_icon_smart_hide(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_hide(sd->obj);
+}
+
+static void
+_e_icon_smart_color_set(Evas_Object *obj, int r, int g, int b, int a)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_color_set(sd->obj, r, g, b, a);
+}
+
+static void
+_e_icon_smart_clip_set(Evas_Object *obj, Evas_Object * clip)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_clip_set(sd->obj, clip);
+}
+
+static void
+_e_icon_smart_clip_unset(Evas_Object *obj)
+{
+ E_Smart_Data *sd;
+
+ sd = evas_object_smart_data_get(obj);
+ if (!sd) return;
+ evas_object_clip_unset(sd->obj);
+}
--- /dev/null
+#ifndef E_ICON_H
+#define E_ICON_H
+
+Evas_Object *e_icon_add (Evas *evas);
+void e_icon_file_set (Evas_Object *obj, const char *file);
+const char *e_icon_file_get (Evas_Object *obj);
+void e_icon_smooth_scale_set (Evas_Object *obj, int smooth);
+int e_icon_smooth_scale_get (Evas_Object *obj);
+void e_icon_size_get (Evas_Object *obj, int *w, int *h);
+int e_icon_fill_inside_get (Evas_Object *obj);
+void e_icon_fill_inside_set (Evas_Object *obj, int fill_inside);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* local subsystem globals */
+static Ecore_X_Window _e_init_win = 0;
+static Ecore_Evas *_e_init_ecore_evas = NULL;
+static Evas *_e_init_evas = NULL;
+static Evas_Object *_e_init_object = NULL;
+
+/* externally accessible functions */
+int
+e_init_init(void)
+{
+ int w, h;
+ Ecore_X_Window root;
+ Ecore_X_Window *roots;
+ int num, i;
+ Evas_Object *o;
+
+ num = 0;
+ roots = ecore_x_window_root_list(&num);
+ if ((!roots) || (num <= 0))
+ {
+ e_error_message_show("X reports there are no root windows and %i screens!\n",
+ num);
+ return 0;
+ }
+ root = roots[0];
+ ecore_x_window_size_get(root, &w, &h);
+ _e_init_ecore_evas = ecore_evas_software_x11_new(NULL, root, 0, 0, w, h);
+ e_canvas_add(_e_init_ecore_evas);
+ _e_init_evas = ecore_evas_get(_e_init_ecore_evas);
+ _e_init_win = ecore_evas_software_x11_window_get(_e_init_ecore_evas);
+ ecore_evas_override_set(_e_init_ecore_evas, 1);
+ ecore_evas_name_class_set(_e_init_ecore_evas, "E", "Init_Window");
+ ecore_evas_title_set(_e_init_ecore_evas, "Enlightenment Init");
+ e_path_evas_append(path_fonts, _e_init_ecore_evas);
+ e_pointer_ecore_evas_set(_e_init_ecore_evas);
+ ecore_evas_raise(_e_init_ecore_evas);
+ ecore_evas_show(_e_init_ecore_evas);
+
+ o = edje_object_add(_e_init_evas);
+ edje_object_file_set(o,
+ /* FIXME: "init.eet" needs to come from config */
+ e_path_find(path_init, "init.eet"),
+ "init/splash");
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, w, h);
+ evas_object_show(o);
+ _e_init_object = o;
+
+ for (i = 1; i < num; i++)
+ {
+ /* FIXME: do something for other screens other than screen 0 */
+ }
+
+ free(roots);
+ return 1;
+}
+
+int
+e_init_shutdown(void)
+{
+ e_init_hide();
+ e_canvas_cache_flush();
+ return 1;
+}
+
+void
+e_init_show(void)
+{
+ if (!_e_init_ecore_evas) return;
+ ecore_evas_raise(_e_init_ecore_evas);
+ ecore_evas_show(_e_init_ecore_evas);
+}
+
+void
+e_init_hide(void)
+{
+ /* FIXME: emit signal to edje and wait for it to respond or until a */
+ /* in case the edje was badly created and never responds */
+ if (!_e_init_ecore_evas) return;
+ ecore_evas_hide(_e_init_ecore_evas);
+ evas_object_del(_e_init_object);
+ e_canvas_del(_e_init_ecore_evas);
+ ecore_evas_free(_e_init_ecore_evas);
+ _e_init_ecore_evas = NULL;
+ _e_init_evas = NULL;
+ _e_init_win = 0;
+ _e_init_object = NULL;
+}
+
+void
+e_init_title_set(const char *str)
+{
+ if (!_e_init_object) return;
+ edje_object_part_text_set(_e_init_object, "title", str);
+}
+
+void
+e_init_version_set(const char *str)
+{
+ if (!_e_init_object) return;
+ edje_object_part_text_set(_e_init_object, "version", str);
+}
+
+void
+e_init_status_set(const char *str)
+{
+ if (!_e_init_object) return;
+ edje_object_part_text_set(_e_init_object, "status", str);
+}
+
+Ecore_X_Window
+e_init_window_get(void)
+{
+ return _e_init_win;
+}
--- /dev/null
+#ifndef E_INIT_H
+#define E_INIT_H
+
+int e_init_init(void);
+int e_init_shutdown(void);
+void e_init_show(void);
+void e_init_hide(void);
+void e_init_title_set(const char *str);
+void e_init_version_set(const char *str);
+void e_init_status_set(const char *str);
+Ecore_X_Window e_init_window_get(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+typedef struct _About_Data About_Data;
+
+struct _About_Data
+{
+ E_Menu *menu;
+ E_Menu *modules;
+};
+
+/* local subsystem functions */
+static void _e_int_menus_about_end (void *data, E_Menu *m);
+static void _e_int_menus_about_about (void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_int_menus_about_exit (void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_int_menus_apps_scan (E_Menu *m);
+static void _e_int_menus_apps_start (void *data, E_Menu *m);
+static void _e_int_menus_apps_end (void *data, E_Menu *m);
+static void _e_int_menus_apps_free_hook(void *obj);
+static void _e_int_menus_apps_run (void *data, E_Menu *m, E_Menu_Item *mi);
+
+/* externally accessible functions */
+E_Menu *
+e_int_menus_about_new(void)
+{
+ E_Menu *m, *subm;
+ E_Menu_Item *mi;
+ About_Data *dat;
+
+ dat = calloc(1, sizeof(About_Data));
+ m = e_menu_new();
+ dat->menu = m;
+
+ e_menu_post_deactivate_callback_set(m, _e_int_menus_about_end, dat);
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "About Enlightenment...");
+ e_menu_item_icon_file_set(mi,
+ e_path_find(path_images, "e.png"));
+ e_menu_item_callback_set(mi, _e_int_menus_about_about, NULL);
+
+ subm = e_module_menu_new();
+ dat->modules = subm;
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Modules");
+ e_menu_item_submenu_set(mi, subm);
+
+ mi = e_menu_item_new(m);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Exit Enlightement");
+ e_menu_item_callback_set(mi, _e_int_menus_about_exit, NULL);
+ return m;
+}
+
+E_Menu *
+e_int_menus_apps_new(char *dir, int top)
+{
+ E_Menu *m;
+ E_Menu_Item *mi;
+ E_App *a;
+
+ m = e_menu_new();
+ a = e_app_new(dir, 0);
+ e_object_data_set(E_OBJECT(m), a);
+ e_menu_pre_activate_callback_set(m, _e_int_menus_apps_start, NULL);
+ if (top)
+ {
+ e_menu_post_deactivate_callback_set(m, _e_int_menus_apps_end, NULL);
+ e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_apps_free_hook);
+ }
+ return m;
+}
+
+/* local subsystem functions */
+static void
+_e_int_menus_about_end(void *data, E_Menu *m)
+{
+ About_Data *dat;
+
+ dat = data;
+ e_object_unref(E_OBJECT(dat->modules));
+ e_object_unref(E_OBJECT(m));
+ free(dat);
+}
+
+static void
+_e_int_menus_about_about(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ e_error_dialog_show("About Enlightenment",
+ "This is Enlightenment "VERSION".\n"
+ "Copyright © 1999-2004, by the Enlightenment Dev Team.\n"
+ "\n"
+ "We hope you enjoy using this software as much as we enjoyed writing it.\n"
+ "Please think of the aardvarks. They need some love too."
+ );
+}
+
+static void
+_e_int_menus_about_exit(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ ecore_main_loop_quit();
+}
+
+static void
+_e_int_menus_apps_scan(E_Menu *m)
+{
+ E_Menu_Item *mi;
+ E_App *a;
+ Evas_List *l;
+
+ a = e_object_data_get(E_OBJECT(m));
+ e_app_subdir_scan(a, 0);
+ for (l = a->subapps; l; l = l->next)
+ {
+ a = l->data;
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, a->name);
+ if (a->exe)
+ {
+ e_menu_item_icon_edje_set(mi, a->path, "icon");
+ e_menu_item_callback_set(mi, _e_int_menus_apps_run, a);
+ }
+ else
+ {
+ char buf[4096];
+
+ snprintf(buf, sizeof(buf), "%s/.directory.eet", a->path);
+ e_menu_item_icon_edje_set(mi, buf, "icon");
+ e_menu_item_submenu_set(mi, e_int_menus_apps_new(a->path, 0));
+ }
+ }
+}
+
+static void
+_e_int_menus_apps_start(void *data, E_Menu *m)
+{
+ _e_int_menus_apps_scan(m);
+ e_menu_pre_activate_callback_set(m, NULL, NULL);
+}
+
+static void
+_e_int_menus_apps_end(void *data, E_Menu *m)
+{
+ Evas_List *l;
+
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+ if (mi->submenu)
+ _e_int_menus_apps_end(NULL, mi->submenu);
+ }
+ e_object_unref(E_OBJECT(m));
+}
+
+static void
+_e_int_menus_apps_free_hook(void *obj)
+{
+ E_Menu *m;
+ E_App *a;
+
+ m = obj;
+ a = e_object_data_get(E_OBJECT(m));
+ if (a) e_object_unref(E_OBJECT(a));
+}
+
+static void
+_e_int_menus_apps_run(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ E_App *a;
+
+ a = data;
+ e_app_exec(a);
+}
--- /dev/null
+#ifndef E_INT_MENUS_H
+#define E_INT_MENUS_H
+
+E_Menu *e_int_menus_about_new(void);
+E_Menu *e_int_menus_apps_new(char *dir, int top);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* local subsystem functions */
+static int _e_ipc_cb_client_add(void *data, int type, void *event);
+static int _e_ipc_cb_client_del(void *data, int type, void *event);
+static int _e_ipc_cb_client_data(void *data, int type, void *event);
+
+/* local subsystem globals */
+static Ecore_Ipc_Server *_e_ipc_server = NULL;
+
+/* externally accessible functions */
+int
+e_ipc_init(void)
+{
+ char buf[1024];
+ char *disp;
+
+ disp = getenv("DISPLAY");
+ if (!disp) disp = ":0";
+ snprintf(buf, sizeof(buf), "enlightenment-(%s)", disp);
+ _e_ipc_server = ecore_ipc_server_add(ECORE_IPC_LOCAL_USER, buf, 0, NULL);
+ if (!_e_ipc_server) return 0;
+ ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_ADD, _e_ipc_cb_client_add, NULL);
+ ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DEL, _e_ipc_cb_client_del, NULL);
+ ecore_event_handler_add(ECORE_IPC_EVENT_CLIENT_DATA, _e_ipc_cb_client_data, NULL);
+ return 1;
+}
+
+void
+e_ipc_shutdown(void)
+{
+ if (_e_ipc_server)
+ {
+ ecore_ipc_server_del(_e_ipc_server);
+ _e_ipc_server = NULL;
+ }
+}
+
+/* local subsystem globals */
+static int
+_e_ipc_cb_client_add(void *data, int type, void *event)
+{
+ Ecore_Ipc_Event_Client_Add *e;
+
+ e = event;
+ if (ecore_ipc_client_server_get(e->client) != _e_ipc_server) return 1;
+ printf("E-IPC: client %p connected to server!\n", e->client);
+ return 1;
+}
+
+static int
+_e_ipc_cb_client_del(void *data, int type, void *event)
+{
+ Ecore_Ipc_Event_Client_Del *e;
+
+ e = event;
+ if (ecore_ipc_client_server_get(e->client) != _e_ipc_server) return 1;
+ printf("E-IPC: client %p disconnected from server!\n", e->client);
+ /* delete client sruct */
+ ecore_ipc_client_del(e->client);
+ return 1;
+}
+
+static int
+_e_ipc_cb_client_data(void *data, int type, void *event)
+{
+ Ecore_Ipc_Event_Client_Data *e;
+
+ e = event;
+ if (ecore_ipc_client_server_get(e->client) != _e_ipc_server) return 1;
+ printf("E-IPC: client sent: [%i] [%i] (%i) \"%s\"\n", e->major, e->minor, e->size, e->data);
+ /* ecore_ipc_client_send(e->client, 1, 2, 7, 77, 0, "ABC", 4); */
+ /* we can disconnect a client like this: */
+ /* ecore_ipc_client_del(e->client); */
+ /* or we can end a server by: */
+ /* ecore_ipc_server_del(ecore_ipc_client_server_get(e->client)); */
+ return 1;
+}
--- /dev/null
+#ifndef E_IPC_H
+#define E_IPC_H
+
+int e_ipc_init(void);
+void e_ipc_shutdown(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+struct _E_Before_Idler
+{
+ int (*func) (void *data);
+ void *data;
+ unsigned char once : 1;
+ unsigned char delete_me : 1;
+};
+
+/* local subsystem globals */
+static void _e_main_shutdown_push(void (*func)(void));
+static void _e_main_shutdown(int errorcode);
+
+static int _e_main_dirs_init(void);
+static void _e_main_dirs_shutdown(void);
+static int _e_main_screens_init(void);
+static void _e_main_screens_shutdown(void);
+static int _e_main_path_init(void);
+static void _e_main_path_shutdown(void);
+static int _e_main_ipc_init(void);
+static void _e_main_ipc_shutdown(void);
+
+static void _e_main_cb_x_fatal(void *data);
+static int _e_main_cb_signal_exit(void *data, int ev_type, void *ev);
+static int _e_main_cb_x_flusher(void *data);
+static int _e_main_cb_idler_before(void *data);
+static int _e_main_cb_idler_after(void *data);
+
+static int _e_main_cb_startup_fake_status(void *data);
+static int _e_main_cb_startup_fake_end(void *data);
+
+E_Path *path_data = NULL;
+E_Path *path_images = NULL;
+E_Path *path_fonts = NULL;
+E_Path *path_themes = NULL;
+E_Path *path_init = NULL;
+
+/* local subsystem functions */
+#define MAX_LEVEL 32
+static void (*_e_main_shutdown_func[MAX_LEVEL]) (void);
+static int _e_main_level = 0;
+
+static Evas_List *_e_main_idler_before_list = NULL;
+
+static Ecore_Idle_Enterer *_e_main_idle_enterer_before = NULL;
+static Ecore_Idle_Enterer *_e_main_idle_enterer_after = NULL;
+static Ecore_Idle_Enterer *_e_main_idle_enterer_flusher = NULL;
+
+/* externally accessible functions */
+int
+main(int argc, char **argv)
+{
+ int ipc_failed = 0;
+ int i;
+ char *display_name = NULL;
+ int nosplash = 0;
+
+ if (getenv("NOSPLASH")) nosplash = 1;
+ /* handle some command-line parameters */
+ for (i = 1; i < argc; i++)
+ {
+ if ((!strcmp(argv[i], "-display")) && (i < (argc - 1)))
+ {
+ i++;
+ display_name = argv[i];
+ }
+ }
+
+ /* init edje and set it up in frozen mode */
+ edje_init();
+ edje_freeze();
+
+ /* basic ecore init */
+ if (!ecore_init())
+ {
+ e_error_message_show("Enlightenment cannot Initialize Ecore!\n"
+ "Perhaps you are out of memory?");
+ exit(-1);
+ }
+ _e_main_shutdown_push(ecore_shutdown);
+ /* setup my args */
+ ecore_app_args_set((int)argc, (const char **)argv);
+ /* setup a handler for when e is asked to exit via a system signal */
+ if (!ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, _e_main_cb_signal_exit, NULL))
+ {
+ e_error_message_show("Enlightenment cannot set up an exit signal handler.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+
+ /* an intle enterer to be called before all others */
+ _e_main_idle_enterer_before = ecore_idle_enterer_add(_e_main_cb_idler_before, NULL);
+
+ /* init x */
+ if (!ecore_x_init(display_name))
+ {
+ e_error_message_show("Enlightenment cannot initialize its X connection.\n"
+ "Have you set your DISPLAY variable?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(ecore_x_shutdown);
+
+ ecore_x_grab();
+
+ ecore_x_io_error_handler_set(_e_main_cb_x_fatal, NULL);
+
+ /* setup menu handlers etc. FIXME: check return value */
+ e_menu_init();
+
+ /* init generic communications */
+ if (!ecore_con_init())
+ {
+ e_error_message_show("Enlightenment cannot initialize the connections system.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(ecore_con_shutdown);
+ /* init ipc */
+ if (!ecore_ipc_init())
+ {
+ e_error_message_show("Enlightenment cannot initialize the ipc system.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(ecore_ipc_shutdown);
+ /* init the evas wrapper */
+ if (!ecore_evas_init())
+ {
+ e_error_message_show("Enlightenment cannot initialize the evas system.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(ecore_evas_shutdown);
+
+ /* setup directories we will be using for configurations sotrage etc. */
+ if (!_e_main_dirs_init())
+ {
+ e_error_message_show("Enlightenment cannot create directories in your home directory.\n"
+ "Perhaps you have no home directory or the disk is full?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(_e_main_dirs_shutdown);
+ /* setup paths for finding things */
+ if (!_e_main_path_init())
+ {
+ e_error_message_show("Enlightenment cannot set up paths for finding files.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(_e_main_path_shutdown);
+ /* init config system */
+ if (!e_config_init())
+ {
+ e_error_message_show("Enlightenment cannot set up its config system.");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_config_shutdown);
+
+ /* setup edje to animate @ e_config_val_framerate frames per sec. */
+ edje_frametime_set(1.0 / e_config_val_framerate);
+ e_canvas_recache();
+
+ /* setup init status window/screen */
+ if (!e_init_init())
+ {
+ e_error_message_show("Enlightenment cannot set up init screen.\n"
+ "Perhaps you are out of memory?");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_init_shutdown);
+ /* manage the root window */
+ if (!_e_main_screens_init())
+ {
+ e_error_message_show("Enlightenment set up window management for all the screens on your system\n"
+ "filed. Perhaps another window manager is running?\n");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(_e_main_screens_shutdown);
+ /* init border system */
+ if (!e_focus_init())
+ {
+ e_error_message_show("Enlightenment cannot set up its focus system.");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_focus_shutdown);
+ /* init border system */
+ if (!e_border_init())
+ {
+ e_error_message_show("Enlightenment cannot set up its border system.");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_border_shutdown);
+ /* init app system */
+ if (!e_app_init())
+ {
+ e_error_message_show("Enlightenment cannot set up its app system.");
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_app_shutdown);
+
+ /* tell the error system that it can use gui dialogs now */
+ e_error_gui_set(1);
+
+ /* setup e ipc service */
+ if (!_e_main_ipc_init())
+ {
+ e_error_message_show(
+ "Enlightenment cannot set up the IPC socket.\n"
+ "It likely is already in use by an exisiting copy of Enlightenment.\n"
+ "Double check to see if Enlightenment is not already on this display,\n"
+ "but if that fails try deleting all files in ~/.ecore/enlightenment-*\n"
+ "and try running again.");
+ ipc_failed = 1;
+ }
+ else
+ _e_main_shutdown_push(_e_main_ipc_shutdown);
+
+ /* setup module loading etc. FIXME: check return value */
+ e_module_init();
+
+ /* explicitly show a gui dialog */
+ e_error_dialog_show("Welcome to Enlightenment 0.17",
+ "This is program has barely been started on, so it is not complete by a long\n"
+ "shot. Please do NOT expect anything to work properly at this stage. It's\n"
+ "being worked on.\n"
+ "\n"
+ "Hit \"OK\" to dismiss this dialog and continue using Enlightenment 0.17.");
+
+ if (ipc_failed)
+ e_error_dialog_show("Enlightenment IPC setup error!",
+ "Enlightenment cannot set up the IPC socket.\n"
+ "It likely is already in use by an exisiting copy of Enlightenment.\n"
+ "Double check to see if Enlightenment is not already on this display,\n"
+ "but if that fails try deleting all files in ~/.ecore/enlightenment-*\n"
+ "and try running again.");
+
+ /* add in a handler that just before we go idle we flush x */
+ _e_main_idle_enterer_flusher = ecore_idle_enterer_add(_e_main_cb_x_flusher, NULL);
+
+ /* an intle enterer to be called after all others */
+ _e_main_idle_enterer_after = ecore_idle_enterer_add(_e_main_cb_idler_after, NULL);
+
+ ecore_x_ungrab();
+
+ e_init_title_set("Enlightenment");
+ e_init_version_set(VERSION);
+ e_init_status_set("Enlightenment Starting. Please wait.");
+ /* FIXME: "faking" startup here. normally we would now execute background */
+ /* handlers, panels, initial clients, filemanager etc. and wait till they */
+ /* all have started and are "ready to go". */
+ if (nosplash)
+ {
+ ecore_timer_add(0.0, _e_main_cb_startup_fake_end, NULL);
+ }
+ else
+ {
+ ecore_timer_add( 3.0, _e_main_cb_startup_fake_status, "Artificially slowing startup so you can see it all.");
+ ecore_timer_add( 7.5, _e_main_cb_startup_fake_status, "This is development code, so be warned.");
+ ecore_timer_add(12.0, _e_main_cb_startup_fake_status, "Most features do not work yet, and those that do are buggy.");
+ ecore_timer_add(16.0, _e_main_cb_startup_fake_end, NULL);
+ }
+
+ /* start our main loop */
+ ecore_main_loop_begin();
+
+ /* ask all modules to save their config and then shutdown */
+ e_module_save_all();
+ e_module_shutdown();
+
+ /* save our config FIXME: check return value */
+ e_config_save();
+
+ /* unroll our stack of shutdown functions with exit code of 0 */
+ _e_main_shutdown(0);
+ /* just return 0 to keep the compiler quiet */
+ return 0;
+}
+
+/* FIXME: make save to deleet within a callback */
+E_Before_Idler *
+e_main_idler_before_add(int (*func) (void *data), void *data, int once)
+{
+ E_Before_Idler *eb;
+
+ eb = calloc(1, sizeof(E_Before_Idler));
+ eb->func = func;
+ eb->data = data;
+ eb->once = once;
+ _e_main_idler_before_list = evas_list_append(_e_main_idler_before_list, eb);
+ return eb;
+}
+
+void
+e_main_idler_before_del(E_Before_Idler *eb)
+{
+ eb->delete_me = 1;
+}
+
+/* local subsystem functions */
+static void
+_e_main_shutdown_push(void (*func) (void))
+{
+ _e_main_level++;
+ if (_e_main_level > MAX_LEVEL)
+ {
+ _e_main_level--;
+ e_error_message_show("WARNING: too many init levels. MAX = %i", MAX_LEVEL);
+ return;
+ }
+ _e_main_shutdown_func[_e_main_level - 1] = func;
+}
+
+static void
+_e_main_shutdown(int errorcode)
+{
+ int i;
+
+ printf("E17: Begin shutdown procedure!\n");
+ if (_e_main_idle_enterer_before)
+ {
+ ecore_idle_enterer_del(_e_main_idle_enterer_before);
+ _e_main_idle_enterer_before = NULL;
+ }
+ if (_e_main_idle_enterer_after)
+ {
+ ecore_idle_enterer_del(_e_main_idle_enterer_after);
+ _e_main_idle_enterer_after = NULL;
+ }
+ if (_e_main_idle_enterer_flusher)
+ {
+ ecore_idle_enterer_del(_e_main_idle_enterer_flusher);
+ _e_main_idle_enterer_flusher = NULL;
+ }
+ for (i = _e_main_level - 1; i >= 0; i--)
+ (*_e_main_shutdown_func[i])();
+ exit(errorcode);
+}
+
+static int
+_e_main_dirs_init(void)
+{
+ char *homedir;
+ char buf[PATH_MAX];
+ const char *dirs[] =
+ {
+ "%s/.e",
+ "%s/.e/e",
+ "%s/.e/e/images",
+ "%s/.e/e/fonts",
+ "%s/.e/e/themes",
+ "%s/.e/e/init",
+ "%s/.e/e/backgrounds",
+ "%s/.e/e/applications",
+ "%s/.e/e/applications/all",
+ "%s/.e/e/applications/favorite",
+ "%s/.e/e/applications/bar",
+ "%s/.e/e/modules"
+ };
+ int i;
+
+ homedir = e_user_homedir_get();
+ if (!homedir) return 0;
+ for (i = 0; i < (sizeof(dirs) / sizeof(char *)); i++)
+ {
+ snprintf(buf, sizeof(buf), dirs[i], homedir);
+ if (!e_file_mkpath(buf))
+ {
+ e_error_message_show("Error creating directory:\n"
+ "%s",
+ buf);
+ free(homedir);
+ return 0;
+ }
+ }
+ /* FIXME: THIS is a hack to get people started!!! */
+/*
+ snprintf(buf, sizeof(buf), "%s/.e/e/applications/favorite/eterm.eet", homedir);
+ if (!e_file_exists(buf))
+ snprintf(buf, sizeof(buf), "tar -C %s/.e/e/applications/favorite/ zxvf %s/data/other/favorite_apps.tar.gz", homedir, PACKAGE_DATA_DIR);
+ snprintf(buf, sizeof(buf), "%s/.e/e/applications/bar/", homedir);
+ if (!e_file_exists(buf))
+ snprintf(buf, sizeof(buf), "tar -C %s/.e/e/applications/bar/ zxvf %s/data/other/favorite_apps.tar.gz", homedir, PACKAGE_DATA_DIR);
+ free(homedir);
+ */
+ return 1;
+}
+
+static void
+_e_main_dirs_shutdown(void)
+{
+}
+
+static int
+_e_main_screens_init(void)
+{
+ Ecore_X_Window *roots;
+ int num, i;
+
+ if (!e_manager_init()) return 0;
+
+ num = 0;
+ roots = ecore_x_window_root_list(&num);
+ if ((!roots) || (num <= 0))
+ {
+ e_error_message_show("X reports there are no root windows and %i screens!\n",
+ num);
+ return 0;
+ }
+ for (i = 0; i < num; i++)
+ {
+ E_Manager *man;
+ E_Container *con;
+
+ man = e_manager_new(roots[i]);
+ e_init_show();
+ if (man) e_manager_show(man);
+ else
+ {
+ e_error_message_show("Cannot create manager object for screen %i\n",
+ i);
+ return 0;
+ }
+ con = e_container_new(man);
+ if (con)
+ {
+ /* FIXME: move this to an actual function to start managing */
+ Ecore_X_Window *windows;
+ int num;
+
+ windows = ecore_x_window_children_get(con->manager->root, &num);
+ if (windows)
+ {
+ int i;
+
+ for (i = 0; i < num; i++)
+ {
+ Ecore_X_Window_Attributes att;
+
+ ecore_x_window_attributes_get(windows[i], &att);
+ if ((att.visible) && (!att.override) &&
+ (!att.input_only))
+ {
+ E_Border *bd;
+ bd = e_border_new(con, windows[i], 1);
+ if (bd) e_border_show(bd);
+ }
+ }
+ }
+ e_container_show(con);
+ }
+ else
+ {
+ e_error_message_show("Cannot create container object for manager on screen %i\n",
+ i);
+ return 0;
+ }
+ }
+ free(roots);
+ ecore_x_sync();
+ return 1;
+}
+
+static void
+_e_main_screens_shutdown(void)
+{
+ e_manager_shutdown();
+}
+
+static int
+_e_main_path_init(void)
+{
+ path_data = e_path_new();
+ if (!path_data)
+ {
+ e_error_message_show("Cannot allocate path for path_data\n");
+ return 0;
+ }
+ e_path_path_append(path_data, PACKAGE_DATA_DIR"/data");
+ path_images = e_path_new();
+ if (!path_images)
+ {
+ e_error_message_show("Cannot allocate path for path_images\n");
+ return 0;
+ }
+ e_path_path_append(path_images, "~/.e/e/images");
+ e_path_path_append(path_images, PACKAGE_DATA_DIR"/data/images");
+ path_fonts = e_path_new();
+ if (!path_fonts)
+ {
+ e_error_message_show("Cannot allocate path for path_fonts\n");
+ return 0;
+ }
+ e_path_path_append(path_fonts, "~/.e/e/fonts");
+ e_path_path_append(path_fonts, PACKAGE_DATA_DIR"/data/fonts");
+ path_themes = e_path_new();
+ if (!path_themes)
+ {
+ e_error_message_show("Cannot allocate path for path_themes\n");
+ return 0;
+ }
+ e_path_path_append(path_themes, "~/.e/e/themes");
+ e_path_path_append(path_themes, PACKAGE_DATA_DIR"/data/themes");
+ path_init = e_path_new();
+ if (!path_init)
+ {
+ e_error_message_show("Cannot allocate path for path_init\n");
+ return 0;
+ }
+ e_path_path_append(path_init, "~/.e/e/init");
+ e_path_path_append(path_init, PACKAGE_DATA_DIR"/data/init");
+ return 1;
+}
+
+static void
+_e_main_path_shutdown(void)
+{
+ if (path_data)
+ {
+ e_object_unref(E_OBJECT(path_data));
+ path_data = NULL;
+ }
+ if (path_images)
+ {
+ e_object_unref(E_OBJECT(path_images));
+ path_images = NULL;
+ }
+ if (path_fonts)
+ {
+ e_object_unref(E_OBJECT(path_fonts));
+ path_fonts = NULL;
+ }
+ if (path_themes)
+ {
+ e_object_unref(E_OBJECT(path_themes));
+ path_themes = NULL;
+ }
+ if (path_init)
+ {
+ e_object_unref(E_OBJECT(path_init));
+ path_init = NULL;
+ }
+}
+
+static int
+_e_main_ipc_init(void)
+{
+ if (!e_ipc_init())
+ {
+ e_error_message_show("Cannot init IPC subsystem!\n");
+ return 0;
+ }
+ return 1;
+}
+
+static void
+_e_main_ipc_shutdown(void)
+{
+ e_ipc_shutdown();
+}
+
+static void
+_e_main_cb_x_fatal(void *data)
+{
+ e_error_gui_set(0);
+ e_error_message_show("Lost X connection.");
+ ecore_main_loop_quit();
+ _e_main_shutdown(-1);
+}
+
+static int
+_e_main_cb_signal_exit(void *data, int ev_type, void *ev)
+{
+ /* called on ctrl-c, kill (pid) (also SIGINT, SIGTERM and SIGQIT) */
+ ecore_main_loop_quit();
+ return 1;
+}
+
+static int
+_e_main_cb_x_flusher(void *data)
+{
+ ecore_x_flush();
+ return 1;
+}
+
+static int
+_e_main_cb_idler_before(void *data)
+{
+ Evas_List *l, *pl;
+
+ e_menu_idler_before();
+ e_focus_idler_before();
+ e_border_idler_before();
+ for (l = _e_main_idler_before_list; l; l = l->next)
+ {
+ E_Before_Idler *eb;
+
+ eb = l->data;
+ if (!eb->delete_me)
+ {
+ if (!eb->func(eb->data)) eb->delete_me = 1;
+ }
+ }
+ for (l = _e_main_idler_before_list; l;)
+ {
+ E_Before_Idler *eb;
+
+ eb = l->data;
+ pl = l;
+ l = l->next;
+ if ((eb->once) || (eb->delete_me))
+ {
+ _e_main_idler_before_list =
+ evas_list_remove_list(_e_main_idler_before_list, pl);
+ free(eb);
+ }
+ }
+ edje_thaw();
+// printf("IN to idle... %3.3f\n", ecore_time_get());
+ return 1;
+}
+
+static int
+_e_main_cb_idler_after(void *data)
+{
+// printf("OUT of idle... %3.3f\n", ecore_time_get());
+ edje_freeze();
+ return 1;
+}
+
+static int
+_e_main_cb_startup_fake_status(void *data)
+{
+ e_init_status_set((const char *)data);
+ return 0;
+}
+
+static int
+_e_main_cb_startup_fake_end(void *data)
+{
+ e_init_hide();
+ return 0;
+}
--- /dev/null
+#include "e.h"
+
+/* local subsystem functions */
+static void _e_manager_free(E_Manager *man);
+
+static int _e_manager_cb_window_show_request(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_reparent(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_create(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_configure_request(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_configure(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_gravity(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_stack(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_stack_request(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_property(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_colormap(void *data, int ev_type, void *ev);
+static int _e_manager_cb_window_shape(void *data, int ev_type, void *ev);
+static int _e_manager_cb_client_message(void *data, int ev_type, void *ev);
+
+/* local subsystem globals */
+static Evas_List *managers = NULL;
+
+/* externally accessible functions */
+int
+e_manager_init(void)
+{
+ return 1;
+}
+
+int
+e_manager_shutdown(void)
+{
+ while (managers)
+ _e_manager_free((E_Manager *)(managers->data));
+ return 1;
+}
+
+Evas_List *
+e_manager_list(void)
+{
+ return managers;
+}
+
+E_Manager *
+e_manager_new(Ecore_X_Window root)
+{
+ E_Manager *man;
+ Ecore_Event_Handler *h;
+
+ if (!ecore_x_window_manage(root)) return NULL;
+ man = E_OBJECT_ALLOC(E_Manager, _e_manager_free);
+ if (!man) return NULL;
+ managers = evas_list_append(managers, man);
+ man->root = root;
+ ecore_x_window_size_get(man->root, &(man->w), &(man->h));
+ man->win = ecore_x_window_override_new(man->root, man->x, man->y, man->w, man->h);
+ ecore_x_icccm_title_set(man->win, "Enlightenment Manager");
+ h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST, _e_manager_cb_window_show_request, man);
+ if (h) man->handlers = evas_list_append(man->handlers, h);
+ return man;
+}
+
+void
+e_manager_show(E_Manager *man)
+{
+ E_OBJECT_CHECK(man);
+ if (man->visible) return;
+ ecore_x_window_show(man->win);
+ ecore_x_window_focus(man->win);
+ e_init_show();
+ man->visible = 1;
+}
+
+void
+e_manager_hide(E_Manager *man)
+{
+ E_OBJECT_CHECK(man);
+ if (!man->visible) return;
+ ecore_x_window_hide(man->win);
+ man->visible = 0;
+}
+
+void
+e_manager_move(E_Manager *man, int x, int y)
+{
+ E_OBJECT_CHECK(man);
+ if ((x == man->x) && (y == man->y)) return;
+ man->x = x;
+ man->y = y;
+ ecore_x_window_move(man->win, man->x, man->y);
+}
+
+void
+e_manager_resize(E_Manager *man, int w, int h)
+{
+ E_OBJECT_CHECK(man);
+ if ((w == man->w) && (h == man->h)) return;
+ man->w = w;
+ man->h = h;
+ ecore_x_window_resize(man->win, man->w, man->h);
+}
+
+void
+e_manager_move_resize(E_Manager *man, int x, int y, int w, int h)
+{
+ E_OBJECT_CHECK(man);
+ if ((x == man->x) && (y == man->y) && (w == man->w) && (h == man->h)) return;
+ man->x = x;
+ man->y = y;
+ man->w = w;
+ man->h = h;
+ ecore_x_window_move_resize(man->win, man->x, man->y, man->w, man->h);
+}
+
+void
+e_manager_raise(E_Manager *man)
+{
+ E_OBJECT_CHECK(man);
+ ecore_x_window_raise(man->win);
+ e_init_show();
+}
+
+void
+e_manager_lower(E_Manager *man)
+{
+ E_OBJECT_CHECK(man);
+ ecore_x_window_lower(man->win);
+}
+
+/* local subsystem functions */
+static void
+_e_manager_free(E_Manager *man)
+{
+ while (man->handlers)
+ {
+ Ecore_Event_Handler *h;
+
+ h = man->handlers->data;
+ man->handlers = evas_list_remove(man->handlers, h);
+ ecore_event_handler_del(h);
+ }
+ while (man->containers)
+ e_object_unref(E_OBJECT(man->containers->data));
+ ecore_x_window_del(man->win);
+ managers = evas_list_remove(managers, man);
+ free(man);
+}
+
+static int
+_e_manager_cb_window_show_request(void *data, int ev_type, void *ev)
+{
+ E_Manager *man;
+ Ecore_X_Event_Window_Show_Request *e;
+
+ man = data;
+ e = ev;
+ if (e->parent != man->root) return 1; /* try other handlers for this */
+
+ /* handle map request here */
+ printf("REQ for map %x\n", e->win);
+
+ /*ecore_x_window_show(e->win); */
+ {
+ E_Container *con;
+ E_Border *bd;
+
+ con = man->containers->data;
+ if (!e_border_find_by_client_window(e->win))
+ {
+ bd = e_border_new(con, e->win, 0);
+ if (bd) e_border_show(bd);
+ else ecore_x_window_show(e->win);
+ }
+ }
+ return 1;
+}
+
+static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_reparent(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_create(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_configure_request(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_configure(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_gravity(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_stack(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_stack_request(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_property(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_colormap(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_window_shape(void *data, int ev_type, void *ev){}
+static int _e_manager_cb_client_message(void *data, int ev_type, void *ev){}
--- /dev/null
+#ifndef E_MANAGER_H
+#define E_MANAGER_H
+
+typedef struct _E_Manager E_Manager;
+
+struct _E_Manager
+{
+ E_Object e_obj_inherit;
+
+ Ecore_X_Window win;
+ int x, y, w, h;
+ char visible : 1;
+ Ecore_X_Window root;
+ Evas_List *handlers;
+ Evas_List *containers;
+};
+
+int e_manager_init(void);
+int e_manager_shutdown(void);
+Evas_List *e_manager_list(void);
+
+E_Manager *e_manager_new(Ecore_X_Window root);
+void e_manager_show(E_Manager *man);
+void e_manager_hide(E_Manager *man);
+void e_manager_move(E_Manager *man, int x, int y);
+void e_manager_resize(E_Manager *man, int w, int h);
+void e_manager_move_resize(E_Manager *man, int x, int y, int w, int h);
+void e_manager_raise(E_Manager *man);
+void e_manager_lower(E_Manager *man);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * support change of menu items after realize
+ * * support add/del of menu items after realize
+ * * support text/color classes
+ * * refcount menu up while looping thru and calling other fn's
+ * * support alignment (x, y) as well as spawn direction
+ * * need different menu style support for different menus
+ * * add menu icon/title support
+ * * support shaped menu windows
+ * * use event timestamps not clock for "click and release" detect
+ * * menu icons can set if/how they will be scaled
+ * * support move/resize of "box" that spawned the menu
+ * * add image item (label is replaced by image/icon)
+ * * add generic evas object item type (label replaced by object)
+ * * allow menus to stretch width/height to fit spawner widget/box
+ * * allow menus to auto-shrink (horizontally) if forced to
+ * * support auto left/right direction spawn
+ * * support menu icons supplied as edjes, not just image files
+ * * support obscures to indicate offs-creen/not visible menu parts
+ */
+
+/* local subsystem functions */
+static void _e_menu_free (E_Menu *m);
+static void _e_menu_item_free (E_Menu_Item *mi);
+static void _e_menu_item_realize (E_Menu_Item *mi);
+static void _e_menu_realize (E_Menu *m);
+static void _e_menu_items_layout_update (E_Menu *m);
+static void _e_menu_item_unrealize (E_Menu_Item *mi);
+static void _e_menu_unrealize (E_Menu *m);
+static void _e_menu_activate_internal (E_Menu *m, E_Container *con);
+static void _e_menu_deactivate_all (void);
+static void _e_menu_deactivate_above (E_Menu *m);
+static void _e_menu_submenu_activate (E_Menu_Item *mi);
+static void _e_menu_reposition (E_Menu *m);
+static int _e_menu_active_call (void);
+static void _e_menu_item_activate_next (void);
+static void _e_menu_item_activate_previous (void);
+static void _e_menu_activate_next (void);
+static void _e_menu_activate_previous (void);
+static void _e_menu_activate_first (void);
+static void _e_menu_activate_nth (int n);
+static E_Menu *_e_menu_active_get (void);
+static E_Menu_Item *_e_menu_item_active_get (void);
+static int _e_menu_outside_bounds_get (int xdir, int ydir);
+static void _e_menu_scroll_by (int dx, int dy);
+static void _e_menu_mouse_autoscroll_check (void);
+static void _e_menu_item_ensure_onscreen (E_Menu_Item *mi);
+static void _e_menu_cb_intercept_item_move (void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
+static void _e_menu_cb_intercept_item_resize (void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
+static void _e_menu_cb_intercept_container_move (void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
+static void _e_menu_cb_intercept_container_resize (void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
+static void _e_menu_cb_ecore_evas_resize (Ecore_Evas *ee);
+static void _e_menu_cb_item_in (void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static void _e_menu_cb_item_out (void *data, Evas *evas, Evas_Object *obj, void *event_info);
+static int _e_menu_cb_key_down (void *data, int type, void *event);
+static int _e_menu_cb_key_up (void *data, int type, void *event);
+static int _e_menu_cb_mouse_down (void *data, int type, void *event);
+static int _e_menu_cb_mouse_up (void *data, int type, void *event);
+static int _e_menu_cb_mouse_move (void *data, int type, void *event);
+static int _e_menu_cb_mouse_wheel (void *data, int type, void *event);
+static int _e_menu_cb_scroll_timer (void *data);
+
+/* local subsystem globals */
+static Ecore_X_Window _e_menu_win = 0;
+static Evas_List *_e_active_menus = NULL;
+static double _e_menu_activate_time = 0.0;
+static Ecore_Timer *_e_menu_scroll_timer = NULL;
+static double _e_menu_scroll_start = 0.0;
+static int _e_menu_x = 0;
+static int _e_menu_y = 0;
+static Ecore_X_Time _e_menu_time = 0;
+static int _e_menu_autoscroll_x = 0;
+static int _e_menu_autoscroll_y = 0;
+static Ecore_Event_Handler *_e_menu_key_down_handler = NULL;
+static Ecore_Event_Handler *_e_menu_key_up_handler = NULL;
+static Ecore_Event_Handler *_e_menu_mouse_down_handler = NULL;
+static Ecore_Event_Handler *_e_menu_mouse_up_handler = NULL;
+static Ecore_Event_Handler *_e_menu_mouse_move_handler = NULL;
+static Ecore_Event_Handler *_e_menu_mouse_wheel_handler = NULL;
+
+/* externally accessible functions */
+int
+e_menu_init(void)
+{
+ _e_menu_key_down_handler = ecore_event_handler_add(ECORE_X_EVENT_KEY_DOWN, _e_menu_cb_key_down, NULL);
+ _e_menu_key_up_handler = ecore_event_handler_add(ECORE_X_EVENT_KEY_UP, _e_menu_cb_key_up, NULL);
+ _e_menu_mouse_down_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_DOWN, _e_menu_cb_mouse_down, NULL);
+ _e_menu_mouse_up_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_BUTTON_UP, _e_menu_cb_mouse_up, NULL);
+ _e_menu_mouse_move_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_MOVE, _e_menu_cb_mouse_move, NULL);
+ _e_menu_mouse_wheel_handler = ecore_event_handler_add(ECORE_X_EVENT_MOUSE_WHEEL, _e_menu_cb_mouse_wheel, NULL);
+ return 1;
+}
+
+int
+e_menu_shutdown(void)
+{
+ E_FN_DEL(ecore_event_handler_del, _e_menu_key_down_handler);
+ E_FN_DEL(ecore_event_handler_del, _e_menu_key_up_handler);
+ E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_down_handler);
+ E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_up_handler);
+
+ E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_move_handler);
+ E_FN_DEL(ecore_event_handler_del, _e_menu_mouse_wheel_handler);
+
+ if (_e_active_menus)
+ {
+ E_Menu *m;
+
+ m = _e_active_menus->data;
+ m->active = 0;
+ _e_menu_unrealize(m);
+ evas_list_free(_e_active_menus);
+ _e_active_menus = NULL;
+ }
+ return 1;
+}
+
+E_Menu *
+e_menu_new(void)
+{
+ E_Menu *m;
+
+ m = E_OBJECT_ALLOC(E_Menu, _e_menu_free);
+ if (!m) return NULL;
+ m->cur.w = 1;
+ m->cur.h = 1;
+ return m;
+}
+
+void
+e_menu_activate_key(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir)
+{
+ E_OBJECT_CHECK(m);
+ E_OBJECT_CHECK(con);
+ _e_menu_activate_time = 0.0;
+ _e_menu_activate_internal(m, con);
+ m->cur.x = 200;
+ m->cur.y = 200;
+ _e_menu_activate_first();
+}
+
+void
+e_menu_activate_mouse(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir)
+{
+ E_Menu_Item *pmi;
+
+ E_OBJECT_CHECK(m);
+ E_OBJECT_CHECK(con);
+ _e_menu_activate_time = ecore_time_get();
+ _e_menu_activate_internal(m, con);
+ m->cur.x = x;
+ m->cur.y = y;
+
+ pmi = _e_menu_item_active_get();
+ if (pmi) e_menu_item_active_set(pmi, 0);
+}
+
+void
+e_menu_activate(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir)
+{
+ E_Menu_Item *pmi;
+
+ E_OBJECT_CHECK(m);
+ E_OBJECT_CHECK(con);
+ _e_menu_activate_time = 0.0;
+ _e_menu_activate_internal(m, con);
+ m->cur.x = x;
+ m->cur.y = y;
+ pmi = _e_menu_item_active_get();
+ if (pmi) e_menu_item_active_set(pmi, 0);
+}
+
+void
+e_menu_deactivate(E_Menu *m)
+{
+ E_OBJECT_CHECK(m);
+ m->cur.visible = 0;
+ m->active = 0;
+ if (m->post_deactivate_cb.func)
+ m->post_deactivate_cb.func(m->post_deactivate_cb.data, m);
+}
+
+int
+e_menu_freeze(E_Menu *m)
+{
+ E_OBJECT_CHECK_RETURN(m, 0);
+ m->frozen++;
+ return m->frozen;
+}
+
+int
+e_menu_thaw(E_Menu *m)
+{
+ E_OBJECT_CHECK_RETURN(m, 0);
+ m->frozen--;
+ if (m->frozen < 0) m->frozen = 0;
+ return m->frozen;
+}
+
+void
+e_menu_title_set(E_Menu *m, char *title)
+{
+ E_OBJECT_CHECK(m);
+ /* FIXME: support menu titles */
+ if ((m->header.title) && (title) && (!strcmp(m->header.title, title)))
+ return;
+ if (m->header.title)
+ {
+ free(m->header.title);
+ m->header.title = NULL;
+ }
+ if (title) m->header.title = strdup(title);
+ else m->header.title = NULL;
+ m->changed = 1;
+}
+
+void
+e_menu_icon_file_set(E_Menu *m, char *icon)
+{
+ E_OBJECT_CHECK(m);
+ /* FIXME: support menu icons */
+}
+
+void
+e_menu_pre_activate_callback_set(E_Menu *m, void (*func) (void *data, E_Menu *m), void *data)
+{
+ E_OBJECT_CHECK(m);
+ m->pre_activate_cb.func = func;
+ m->pre_activate_cb.data = data;
+}
+
+void
+e_menu_post_deactivate_callback_set(E_Menu *m, void (*func) (void *data, E_Menu *m), void *data)
+{
+ E_OBJECT_CHECK(m);
+ m->post_deactivate_cb.func = func;
+ m->post_deactivate_cb.data = data;
+}
+
+
+E_Menu_Item *
+e_menu_item_new(E_Menu *m)
+{
+ E_Menu_Item *mi;
+
+ E_OBJECT_CHECK_RETURN(m, NULL);
+ mi = E_OBJECT_ALLOC(E_Menu_Item, _e_menu_item_free);
+ mi->menu = m;
+ mi->menu->items = evas_list_append(mi->menu->items, mi);
+ return mi;
+}
+
+E_Menu_Item *
+e_menu_item_nth(E_Menu *m, int n)
+{
+ E_OBJECT_CHECK_RETURN(m, NULL);
+ return (E_Menu_Item *)evas_list_nth(m->items, n);
+}
+
+int
+e_menu_item_num_get(E_Menu_Item *mi)
+{
+ Evas_List *l;
+ int i;
+
+ E_OBJECT_CHECK_RETURN(mi, -1);
+ for (i = 0, l = mi->menu->items; l; l = l->next, i++)
+ {
+ E_Menu_Item *mi2;
+
+ mi2 = l->data;
+ if (mi2 == mi) return i;
+ }
+ return -1;
+}
+
+void
+e_menu_item_icon_file_set(E_Menu_Item *mi, char *icon)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->icon) && (icon) && (!strcmp(icon, mi->icon))) ||
+ ((!mi->icon) && (!icon)))
+ return;
+ if (mi->icon) free(mi->icon);
+ if (mi->icon_key) free(mi->icon_key);
+ mi->icon = NULL;
+ mi->icon_key = NULL;
+ if (icon) mi->icon = strdup(icon);
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_icon_edje_set(E_Menu_Item *mi, char *icon, char *key)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->icon) && (icon) && (!strcmp(icon, mi->icon))) ||
+ ((!mi->icon) && (!icon)) ||
+ ((key) && (mi->icon_key) && (!strcmp(key, mi->icon_key))))
+ return;
+ if (mi->icon) free(mi->icon);
+ if (mi->icon_key) free(mi->icon_key);
+ mi->icon = NULL;
+ mi->icon_key = NULL;
+ if (icon) mi->icon = strdup(icon);
+ if (key) mi->icon_key = strdup(key);
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_label_set(E_Menu_Item *mi, char *label)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->label) && (label) && (!strcmp(label, mi->label))) ||
+ ((!mi->label) && (!label)))
+ return;
+ if (mi->label) free(mi->label);
+ mi->label = NULL;
+ if (label) mi->label = strdup(label);
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub)
+{
+ E_OBJECT_CHECK(mi);
+ if (mi->submenu) e_object_unref(E_OBJECT(mi->submenu));
+ e_object_ref(E_OBJECT(sub));
+ mi->submenu = sub;
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_separator_set(E_Menu_Item *mi, int sep)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->separator) && (sep)) ||
+ (!mi->separator) && (!sep)) return;
+ mi->separator = sep;
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_check_set(E_Menu_Item *mi, int chk)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->check) && (chk)) ||
+ (!mi->check) && (!chk)) return;
+ mi->check = chk;
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_radio_set(E_Menu_Item *mi, int rad)
+{
+ E_OBJECT_CHECK(mi);
+ if (((mi->radio) && (rad)) ||
+ (!mi->radio) && (!rad)) return;
+ mi->radio = rad;
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_radio_group_set(E_Menu_Item *mi, int radg)
+{
+ E_OBJECT_CHECK(mi);
+ if ((mi->radio_group) == (radg)) return;
+ mi->radio_group = radg;
+ mi->changed = 1;
+ mi->menu->changed = 1;
+}
+
+void
+e_menu_item_toggle_set(E_Menu_Item *mi, int tog)
+{
+ E_OBJECT_CHECK(mi);
+ if (mi->separator) return;
+ if (tog)
+ {
+ mi->toggle = 1;
+ if (mi->bg_object)
+ edje_object_signal_emit(mi->bg_object, "toggle_on", "");
+ if (mi->icon_bg_object)
+ edje_object_signal_emit(mi->icon_bg_object, "toggle_on", "");
+ if (mi->label_object)
+ edje_object_signal_emit(mi->label_object, "toggle_on", "");
+ if (mi->submenu_object)
+ edje_object_signal_emit(mi->submenu_object, "toggle_on", "");
+ if (mi->toggle_object)
+ edje_object_signal_emit(mi->toggle_object, "toggle_on", "");
+ edje_object_signal_emit(mi->menu->bg_object, "toggle_on", "");
+ }
+ else
+ {
+ mi->toggle = 0;
+ if (mi->bg_object)
+ edje_object_signal_emit(mi->bg_object, "toggle_off", "");
+ if (mi->icon_bg_object)
+ edje_object_signal_emit(mi->icon_bg_object, "toggle_off", "");
+ if (mi->label_object)
+ edje_object_signal_emit(mi->label_object, "toggle_off", "");
+ if (mi->submenu_object)
+ edje_object_signal_emit(mi->submenu_object, "toggle_off", "");
+ if (mi->toggle_object)
+ edje_object_signal_emit(mi->toggle_object, "toggle_off", "");
+ edje_object_signal_emit(mi->menu->bg_object, "toggle_off", "");
+ }
+ if (tog)
+ {
+ if (mi->radio)
+ {
+ Evas_List *l;
+
+ for (l = mi->menu->items; l; l = l->next)
+ {
+ E_Menu_Item *mi2;
+
+ mi2 = l->data;
+ if ((mi2 != mi) &&
+ (mi2->radio) &&
+ (mi2->radio_group == mi->radio_group))
+ e_menu_item_toggle_set(mi2, 0);
+ }
+ }
+ }
+}
+
+int
+e_menu_item_toggle_get(E_Menu_Item *mi)
+{
+ E_OBJECT_CHECK_RETURN(mi, 0);
+ return mi->toggle;
+}
+
+void
+e_menu_item_callback_set(E_Menu_Item *mi, void (*func) (void *data, E_Menu *m, E_Menu_Item *mi), void *data)
+{
+ E_OBJECT_CHECK(mi);
+ mi->cb.func = func;
+ mi->cb.data = data;
+}
+
+void
+e_menu_item_active_set(E_Menu_Item *mi, int active)
+{
+ E_OBJECT_CHECK(mi);
+ if (mi->separator) return;
+ if (active)
+ {
+ E_Menu_Item *pmi;
+
+ pmi = _e_menu_item_active_get();
+ if (pmi) e_menu_item_active_set(pmi, 0);
+ mi->active = 1;
+ if (mi->bg_object)
+ edje_object_signal_emit(mi->bg_object, "active", "");
+ if (mi->icon_bg_object)
+ edje_object_signal_emit(mi->icon_bg_object, "active", "");
+ if (mi->label_object)
+ edje_object_signal_emit(mi->label_object, "active", "");
+ if (mi->submenu_object)
+ edje_object_signal_emit(mi->submenu_object, "active", "");
+ if (mi->toggle_object)
+ edje_object_signal_emit(mi->toggle_object, "active", "");
+ edje_object_signal_emit(mi->menu->bg_object, "active", "");
+ _e_menu_submenu_activate(mi);
+ }
+ else
+ {
+ mi->active = 0;
+ if (mi->bg_object)
+ edje_object_signal_emit(mi->bg_object, "passive", "");
+ if (mi->icon_bg_object)
+ edje_object_signal_emit(mi->icon_bg_object, "passive", "");
+ if (mi->label_object)
+ edje_object_signal_emit(mi->label_object, "passive", "");
+ if (mi->submenu_object)
+ edje_object_signal_emit(mi->submenu_object, "passive", "");
+ if (mi->toggle_object)
+ edje_object_signal_emit(mi->toggle_object, "passive", "");
+ edje_object_signal_emit(mi->menu->bg_object, "passive", "");
+ }
+}
+
+void
+e_menu_idler_before(void)
+{
+ /* when e goes "idle" this gets called so leave all our hard work till */
+ /* idle time to avoid falling behind the user. just evaluate the high */
+ /* level state machine */
+ Evas_List *l, *removals = NULL, *tmp = NULL;
+
+ /* add refcount to all menus we will work with */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ tmp = evas_list_append(tmp, l->data);
+ e_object_ref(E_OBJECT(l->data));
+ }
+ /* phase 1. hide all the menus that want to be hidden */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if ((!m->cur.visible) && (m->prev.visible))
+ {
+ m->prev.visible = m->cur.visible;
+ ecore_evas_hide(m->ecore_evas);
+ e_container_shape_hide(m->shape);
+ }
+ }
+ /* phase 2. move & reisze all the menus that want to moves/resized */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if (!m->realized) _e_menu_realize(m);
+ if (m->realized)
+ {
+ if (((m->cur.w) != (m->prev.w)) ||
+ ((m->cur.h) != (m->prev.h)))
+ {
+ m->prev.w = m->cur.w;
+ m->prev.h = m->cur.h;
+ ecore_evas_resize(m->ecore_evas, m->cur.w, m->cur.h);
+ e_container_shape_resize(m->shape, m->cur.w, m->cur.h);
+// evas_obscured_clear(m->evas);
+// evas_obscured_rectangle_add(m->evas, 0, 0, m->cur.w, m->cur.h);
+ }
+ if (((m->cur.x) != (m->prev.x)) ||
+ ((m->cur.y) != (m->prev.y)))
+ {
+ m->prev.x = m->cur.x;
+ m->prev.y = m->cur.y;
+ ecore_evas_move(m->ecore_evas, m->cur.x, m->cur.y);
+ e_container_shape_move(m->shape, m->cur.x, m->cur.y);
+ }
+ }
+ }
+ /* phase 3. show all the menus that want to be shown */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if ((m->cur.visible) && (!m->prev.visible))
+ {
+ m->prev.visible = m->cur.visible;
+ ecore_evas_raise(m->ecore_evas);
+ ecore_evas_show(m->ecore_evas);
+ e_container_shape_show(m->shape);
+ }
+ }
+ /* phase 4. de-activate... */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if (!m->active)
+ {
+ _e_menu_unrealize(m);
+ removals = evas_list_append(removals, m);
+ }
+ }
+ while (removals)
+ {
+ E_Menu *m;
+
+ m = removals->data;
+ removals = evas_list_remove(removals, m);
+ if (m->in_active_list)
+ {
+ _e_active_menus = evas_list_remove(_e_active_menus, m);
+ m->in_active_list = 0;
+ e_object_unref(E_OBJECT(m));
+ }
+ }
+ /* del refcount to all menus we worked with */
+ while (tmp)
+ {
+ e_object_unref(E_OBJECT(tmp->data));
+ tmp = evas_list_remove_list(tmp, tmp);
+ }
+ if (!_e_active_menus)
+ {
+ ecore_x_window_del(_e_menu_win);
+ _e_menu_win = 0;
+ }
+}
+
+/* local subsystem functions */
+static void
+_e_menu_free(E_Menu *m)
+{
+ _e_menu_unrealize(m);
+ while (m->items)
+ {
+ E_Menu_Item *mi;
+
+ mi = m->items->data;
+ e_object_unref(E_OBJECT(mi));
+ }
+ if (m->in_active_list)
+ {
+ _e_active_menus = evas_list_remove(_e_active_menus, m);
+ m->in_active_list = 0;
+ e_object_unref(E_OBJECT(m));
+ }
+ free(m);
+}
+
+static void
+_e_menu_item_free(E_Menu_Item *mi)
+{
+ if (mi->submenu)
+ {
+ mi->submenu->parent_item = NULL;
+ e_object_unref(E_OBJECT(mi->submenu));
+ }
+ if (mi->menu->realized) _e_menu_item_unrealize(mi);
+ mi->menu->items = evas_list_remove(mi->menu->items, mi);
+ if (mi->icon) free(mi->icon);
+ if (mi->label) free(mi->label);
+ free(mi);
+}
+
+static void
+_e_menu_cb_intercept_item_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
+{
+ E_Menu_Item *mi;
+
+ mi = data;
+ mi->x = x;
+ mi->y = y;
+ evas_object_move(mi->event_object, x, y);
+ evas_object_move(o, x, y);
+ if ((mi->submenu) && (mi->submenu->parent_item))
+ _e_menu_reposition(mi->submenu);
+}
+
+static void
+_e_menu_cb_intercept_item_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
+{
+ E_Menu_Item *mi;
+
+ mi = data;
+ mi->w = w;
+ mi->h = h;
+ evas_object_resize(mi->event_object, w, h);
+ evas_object_resize(o, w, h);
+ if ((mi->submenu) && (mi->submenu->parent_item))
+ _e_menu_reposition(mi->submenu);
+}
+
+static void
+_e_menu_cb_intercept_container_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
+{
+ E_Menu *m;
+
+ m = data;
+ m->container_x = x;
+ m->container_y = y;
+ if (m->parent_item) _e_menu_reposition(m);
+ evas_object_move(o, x, y);
+}
+
+static void
+_e_menu_cb_intercept_container_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
+{
+ E_Menu *m;
+
+ m = data;
+ m->container_w = w;
+ m->container_h = h;
+ if (m->parent_item) _e_menu_reposition(m);
+ evas_object_resize(o, w, h);
+}
+
+static void
+_e_menu_item_realize(E_Menu_Item *mi)
+{
+ Evas_Object *o;
+ Evas_Coord ww, hh;
+
+ /* and set up initial item state */
+ if (mi->separator)
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->separator_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/separator");
+ evas_object_show(o);
+ edje_object_size_min_calc(mi->separator_object, &ww, &hh);
+ mi->separator_w = ww;
+ mi->separator_h = hh;
+ e_box_pack_end(mi->menu->container_object, mi->separator_object);
+ }
+ else
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->bg_object = o;
+ evas_object_intercept_move_callback_add (o, _e_menu_cb_intercept_item_move, mi);
+ evas_object_intercept_resize_callback_add(o, _e_menu_cb_intercept_item_resize, mi);
+
+ if (mi->submenu)
+ {
+ if (!edje_object_file_set(mi->bg_object,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/submenu_bg"))
+ goto no_submenu_item;
+ }
+ else
+ {
+ no_submenu_item:
+ edje_object_file_set(mi->bg_object,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/item_bg");
+ }
+ evas_object_show(o);
+
+ o = e_box_add(mi->menu->evas);
+ e_box_homogenous_set(o, 0);
+ mi->container_object = o;
+ e_box_orientation_set(o, 1);
+ evas_object_show(o);
+
+ e_box_freeze(mi->container_object);
+
+ if (mi->check)
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->toggle_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/check");
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+ e_box_pack_end(mi->container_object, o);
+ edje_object_size_min_calc(mi->toggle_object, &ww, &hh);
+ mi->toggle_w = ww;
+ mi->toggle_h = hh;
+ }
+ else if (mi->radio)
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->toggle_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/radio");
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+ e_box_pack_end(mi->container_object, o);
+ edje_object_size_min_calc(mi->toggle_object, &ww, &hh);
+ mi->toggle_w = ww;
+ mi->toggle_h = hh;
+ }
+ else
+ {
+ o = evas_object_rectangle_add(mi->menu->evas);
+ mi->toggle_object = o;
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_pass_events_set(o, 1);
+ e_box_pack_end(mi->container_object, o);
+ }
+ if (mi->icon)
+ {
+ int icon_w, icon_h;
+
+ o = edje_object_add(mi->menu->evas);
+ if (edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/icon"))
+ {
+ mi->icon_bg_object = o;
+ evas_object_show(o);
+ }
+ else
+ evas_object_del(o);
+
+ if (!mi->icon_key)
+ {
+ o = e_icon_add(mi->menu->evas);
+ mi->icon_object = o;
+ e_icon_file_set(o, mi->icon);
+ e_icon_fill_inside_set(o, 1);
+ e_icon_size_get(mi->icon_object, &icon_w, &icon_h);
+ }
+ else
+ {
+ Evas_Coord iww, ihh;
+
+ o = edje_object_add(mi->menu->evas);
+ mi->icon_object = o;
+ edje_object_file_set(o, mi->icon, mi->icon_key);
+ edje_object_size_max_get(o, &iww, &ihh);
+ icon_w = iww;
+ icon_h = ihh;
+ }
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ if (mi->icon_bg_object)
+ {
+ edje_extern_object_min_size_set(mi->icon_object,
+ icon_w, icon_h);
+ edje_object_part_swallow(mi->icon_bg_object, "item",
+ mi->icon_object);
+ edje_object_size_min_calc(mi->icon_bg_object, &ww, &hh);
+ mi->icon_w = ww;
+ mi->icon_h = hh;
+
+ edje_extern_object_min_size_set(mi->icon_object, 0, 0);
+ edje_object_part_swallow(mi->icon_bg_object, "item",
+ mi->icon_object);
+ e_box_pack_end(mi->container_object, mi->icon_bg_object);
+ }
+ else
+ {
+ e_icon_size_get(mi->icon_object, &icon_w, &icon_h);
+ mi->icon_w = icon_w;
+ mi->icon_h = icon_h;
+ e_box_pack_end(mi->container_object, o);
+ }
+ }
+ else
+ {
+ o = evas_object_rectangle_add(mi->menu->evas);
+ mi->icon_object = o;
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_pass_events_set(o, 1);
+ e_box_pack_end(mi->container_object, o);
+ }
+
+ if (mi->label)
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->label_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/label");
+ /* default label */
+ edje_object_part_text_set(o, "label", mi->label);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+ e_box_pack_end(mi->container_object, o);
+ edje_object_size_min_calc(mi->label_object, &ww, &hh);
+ mi->label_w = ww;
+ mi->label_h = hh;
+ }
+ else
+ {
+ o = evas_object_rectangle_add(mi->menu->evas);
+ mi->label_object = o;
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_pass_events_set(o, 1);
+ e_box_pack_end(mi->container_object, o);
+ }
+ if (mi->submenu)
+ {
+ o = edje_object_add(mi->menu->evas);
+ mi->submenu_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/submenu");
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+ e_box_pack_end(mi->container_object, o);
+ edje_object_size_min_calc(mi->submenu_object, &ww, &hh);
+ mi->submenu_w = ww;
+ mi->submenu_h = hh;
+ }
+ else
+ {
+ o = evas_object_rectangle_add(mi->menu->evas);
+ mi->submenu_object = o;
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_pass_events_set(o, 1);
+ e_box_pack_end(mi->container_object, o);
+ }
+
+ edje_object_part_swallow(mi->bg_object, "item", mi->container_object);
+
+ o = evas_object_rectangle_add(mi->menu->evas);
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_layer_set(o, 1);
+ evas_object_repeat_events_set(o, 1);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _e_menu_cb_item_in, mi);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _e_menu_cb_item_out, mi);
+ evas_object_show(o);
+ mi->event_object = o;
+
+ e_box_thaw(mi->container_object);
+
+ e_box_pack_end(mi->menu->container_object, mi->bg_object);
+ }
+ if (mi->active) e_menu_item_active_set(mi, 1);
+ if (mi->toggle) e_menu_item_toggle_set(mi, 1);
+}
+
+static void
+_e_menu_realize(E_Menu *m)
+{
+ Evas_Object *o;
+ Evas_List *l;
+
+ if (m->realized) return;
+ m->realized = 1;
+ m->ecore_evas = ecore_evas_software_x11_new(NULL, m->con->win,
+ m->cur.x, m->cur.y,
+ m->cur.w, m->cur.h);
+ e_canvas_add(m->ecore_evas);
+ m->shape = e_container_shape_add(m->con);
+ e_container_shape_move(m->shape, m->cur.x, m->cur.y);
+ e_container_shape_resize(m->shape, m->cur.w, m->cur.h);
+
+ ecore_evas_callback_resize_set(m->ecore_evas, _e_menu_cb_ecore_evas_resize);
+ m->evas = ecore_evas_get(m->ecore_evas);
+ /* move cursor out to avoid event cycles during setup */
+ evas_event_feed_mouse_in(m->evas);
+ evas_event_feed_mouse_move(m->evas, -1000000, -1000000);
+ m->evas_win = ecore_evas_software_x11_window_get(m->ecore_evas);
+ ecore_evas_name_class_set(m->ecore_evas, "E", "_e_menu_window");
+ ecore_evas_title_set(m->ecore_evas, "E Menu");
+ ecore_evas_show(m->ecore_evas);
+
+ e_path_evas_append(path_fonts, m->evas);
+
+ o = edje_object_add(m->evas);
+ m->bg_object = o;
+ evas_object_name_set(o, "menu/background");
+ evas_object_data_set(o, "e_menu", m);
+ evas_object_move(o, 0, 0);
+ evas_object_resize(o, m->cur.w, m->cur.h);
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "widgets/menu/default/background");
+ evas_object_show(o);
+
+ o = e_box_add(m->evas);
+ m->container_object = o;
+ evas_object_intercept_move_callback_add (o, _e_menu_cb_intercept_container_move, m);
+ evas_object_intercept_resize_callback_add(o, _e_menu_cb_intercept_container_resize, m);
+ e_box_freeze(o);
+ evas_object_show(o);
+ e_box_homogenous_set(o, 0);
+ edje_object_part_swallow(m->bg_object, "items", m->container_object);
+
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+ _e_menu_item_realize(mi);
+ }
+
+ o = m->container_object;
+ _e_menu_items_layout_update(m);
+ e_box_thaw(o);
+ evas_object_resize(m->bg_object, m->cur.w, m->cur.h);
+}
+
+static void
+_e_menu_items_layout_update(E_Menu *m)
+{
+ Evas_List *l;
+ Evas_Coord bw, bh, mw, mh, ww, hh;
+ int toggles_on = 0;
+ int icons_on = 0;
+ int labels_on = 0;
+ int submenus_on = 0;
+ int min_icon_w = 0, min_icon_h = 0;
+ int min_label_w = 0, min_label_h = 0;
+ int min_submenu_w = 0, min_submenu_h = 0;
+ int min_toggle_w = 0, min_toggle_h = 0;
+ int min_w = 0, min_h = 0;
+
+ e_box_freeze(m->container_object);
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+
+ if (mi->icon) icons_on = 1;
+ if (mi->label) labels_on = 1;
+ if (mi->submenu) submenus_on = 1;
+ if (mi->check) toggles_on = 1;
+ if (mi->radio) toggles_on = 1;
+
+ if (mi->icon_w > min_icon_w) min_icon_w = mi->icon_w;
+ if (mi->icon_h > min_icon_h) min_icon_h = mi->icon_h;
+ if (mi->label_w > min_label_w) min_label_w = mi->label_w;
+ if (mi->label_h > min_label_h) min_label_h = mi->label_h;
+ if (mi->submenu_w > min_submenu_w) min_submenu_w = mi->submenu_w;
+ if (mi->submenu_h > min_submenu_h) min_submenu_h = mi->submenu_h;
+ if (mi->toggle_w > min_toggle_w) min_toggle_w = mi->toggle_w;
+ if (mi->toggle_h > min_toggle_h) min_toggle_h = mi->toggle_h;
+ }
+ if (labels_on)
+ {
+ if (submenus_on)
+ {
+ if (min_label_h < min_submenu_h)
+ min_label_h = min_submenu_h;
+ }
+ if (toggles_on)
+ {
+ if (min_label_h < min_toggle_h)
+ min_label_h = min_toggle_h;
+ }
+ if ((icons_on) && (min_icon_h > 0))
+ {
+ min_icon_w = (min_icon_w * min_label_h) / min_icon_h;
+ min_icon_h = min_label_h;
+ }
+ min_w = min_label_w + min_icon_w + min_submenu_w + min_toggle_w;
+ min_h = min_label_h;
+ }
+ else if (icons_on)
+ {
+ if (submenus_on)
+ {
+ if (min_icon_h < min_submenu_h)
+ min_icon_h = min_submenu_h;
+ }
+ if (toggles_on)
+ {
+ if (min_icon_h < min_toggle_h)
+ min_icon_h = min_toggle_h;
+ }
+ min_w = min_icon_w + min_toggle_w + min_submenu_w;
+ min_h = min_icon_h;
+ }
+ else if (toggles_on)
+ {
+ if (submenus_on)
+ {
+ if (min_toggle_h < min_submenu_h)
+ min_toggle_h = min_submenu_h;
+ }
+ min_w = min_toggle_w + min_submenu_w;
+ min_h = min_toggle_h;
+ }
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+ if (mi->separator)
+ {
+ e_box_pack_options_set(mi->separator_object,
+ 1, 1, /* fill */
+ 1, 0, /* expand */
+ 0.5, 0.5, /* align */
+ mi->separator_w, mi->separator_h, /* min */
+ -1, mi->separator_h /* max */
+ );
+ }
+ else
+ {
+ e_box_freeze(mi->container_object);
+ if (toggles_on)
+ e_box_pack_options_set(mi->toggle_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ min_toggle_w, min_toggle_h, /* min */
+ -1, -1 /* max */
+ );
+ else
+ e_box_pack_options_set(mi->toggle_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ 0, 0, /* min */
+ 0, 0 /* max */
+ );
+ if (icons_on)
+ {
+ if (mi->icon_bg_object)
+ e_box_pack_options_set(mi->icon_bg_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ min_icon_w, min_icon_h, /* min */
+ -1, -1 /* max */
+ );
+ else
+ e_box_pack_options_set(mi->icon_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ min_icon_w, min_icon_h, /* min */
+ -1, -1 /* max */
+ );
+ }
+ else
+ e_box_pack_options_set(mi->icon_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ 0, 0, /* min */
+ 0, 0 /* max */
+ );
+ if (labels_on)
+ e_box_pack_options_set(mi->label_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ min_label_w, min_label_h, /* min */
+ -1, -1 /* max */
+ );
+ else
+ e_box_pack_options_set(mi->label_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ 0, 0, /* min */
+ 0, 0 /* max */
+ );
+ if (submenus_on)
+ e_box_pack_options_set(mi->submenu_object,
+ 1, 1, /* fill */
+ 0, 1, /* expand */
+ 0.5, 0.5, /* align */
+ min_submenu_w, min_submenu_h, /* min */
+ -1, -1 /* max */
+ );
+ else
+ e_box_pack_options_set(mi->submenu_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ 0, 0, /* min */
+ 0, 0 /* max */
+ );
+ edje_extern_object_min_size_set(mi->container_object, min_w, min_h);
+ edje_object_part_swallow(mi->bg_object, "item", mi->container_object);
+ edje_object_size_min_calc(mi->bg_object, &mw, &mh);
+ e_box_pack_options_set(mi->bg_object,
+ 1, 1, /* fill */
+ 1, 0, /* expand */
+ 0.5, 0.5, /* align */
+ mw, mh, /* min */
+ -1, -1 /* max */
+ );
+ e_box_thaw(mi->container_object);
+ }
+ }
+ e_box_min_size_get(m->container_object, &bw, &bh);
+ edje_extern_object_min_size_set(m->container_object, bw, bh);
+ edje_extern_object_max_size_set(m->container_object, bw, bh);
+ edje_object_part_swallow(m->bg_object, "items", m->container_object);
+ edje_object_size_min_calc(m->bg_object, &mw, &mh);
+ e_box_thaw(m->container_object);
+ m->cur.w = mw;
+ m->cur.h = mh;
+}
+
+static void
+_e_menu_item_unrealize(E_Menu_Item *mi)
+{
+ if (mi->separator_object) evas_object_del(mi->separator_object);
+ mi->separator_object = NULL;
+ if (mi->bg_object) evas_object_del(mi->bg_object);
+ mi->bg_object = NULL;
+ if (mi->container_object) evas_object_del(mi->container_object);
+ mi->container_object = NULL;
+ if (mi->toggle_object) evas_object_del(mi->toggle_object);
+ mi->toggle_object = NULL;
+ if (mi->icon_bg_object) evas_object_del(mi->icon_bg_object);
+ mi->icon_bg_object = NULL;
+ if (mi->icon_object) evas_object_del(mi->icon_object);
+ mi->icon_object = NULL;
+ if (mi->label_object) evas_object_del(mi->label_object);
+ mi->label_object = NULL;
+ if (mi->submenu_object) evas_object_del(mi->submenu_object);
+ mi->submenu_object = NULL;
+ if (mi->event_object) evas_object_del(mi->event_object);
+ mi->event_object = NULL;
+}
+
+static void
+_e_menu_unrealize(E_Menu *m)
+{
+ Evas_List *l;
+
+ if (!m->realized) return;
+ e_container_shape_hide(m->shape);
+ e_object_del(E_OBJECT(m->shape));
+ m->shape = NULL;
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+ _e_menu_item_unrealize(mi);
+ }
+ if (m->header.icon) evas_object_del(m->header.icon);
+ m->header.icon = NULL;
+ if (m->bg_object) evas_object_del(m->bg_object);
+ m->bg_object = NULL;
+ if (m->container_object) evas_object_del(m->container_object);
+ m->container_object = NULL;
+ m->cur.visible = 0;
+ m->prev.visible = 0;
+ m->realized = 0;
+ m->con = NULL;
+ e_canvas_del(m->ecore_evas);
+ ecore_evas_free(m->ecore_evas);
+ m->ecore_evas = NULL;
+ m->evas = NULL;
+ m->evas_win = 0;
+}
+
+static void
+_e_menu_activate_internal(E_Menu *m, E_Container *con)
+{
+ if (m->pre_activate_cb.func)
+ m->pre_activate_cb.func(m->pre_activate_cb.data, m);
+ m->fast_mouse = 0;
+ m->pending_new_submenu = 0;
+ if (!_e_menu_win)
+ {
+ _e_menu_win = ecore_x_window_input_new(con->win, 0, 0, con->w, con->h);
+ ecore_x_window_show(_e_menu_win);
+ /* need menu event win (input win) and grab to that */
+ ecore_x_pointer_grab(_e_menu_win);
+ ecore_x_keyboard_grab(_e_menu_win);
+ }
+ if ((m->con) && (m->con != con))
+ {
+ printf("FIXME: cannot move menus between containers yet\n");
+ return;
+ }
+ if (!m->active)
+ {
+ /* this remove is in case the menu is marked as inactive but hasnt */
+ /* been removed from the list yet */
+ if (m->in_active_list)
+ {
+ _e_active_menus = evas_list_remove(_e_active_menus, m);
+ m->in_active_list = 0;
+ e_object_unref(E_OBJECT(m));
+ }
+ _e_active_menus = evas_list_append(_e_active_menus, m);
+ m->in_active_list = 1;
+ m->active = 1;
+ e_object_ref(E_OBJECT(m));
+ }
+ m->cur.visible = 1;
+ m->con = con;
+}
+
+static void
+_e_menu_deactivate_all(void)
+{
+ Evas_List *l, *tmp = NULL;
+
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ e_object_ref(E_OBJECT(l->data));
+ tmp = evas_list_append(tmp, l->data);
+ }
+ while (tmp)
+ {
+ E_Menu *m;
+
+ m = tmp->data;
+ tmp = evas_list_remove_list(tmp, tmp);
+ e_menu_deactivate(m);
+ m->parent_item = NULL;
+ e_object_unref(E_OBJECT(m));
+ }
+}
+
+static void
+_e_menu_deactivate_above(E_Menu *ma)
+{
+ Evas_List *l, *tmp = NULL;
+ int above = 0;
+
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ e_object_ref(E_OBJECT(l->data));
+ tmp = evas_list_append(tmp, l->data);
+ }
+ while (tmp)
+ {
+ E_Menu *m;
+
+ m = tmp->data;
+ tmp = evas_list_remove_list(tmp, tmp);
+ if (above)
+ {
+ e_menu_deactivate(m);
+ m->parent_item = NULL;
+ }
+ if (ma == m) above = 1;
+ e_object_unref(E_OBJECT(m));
+ }
+}
+
+static void
+_e_menu_submenu_activate(E_Menu_Item *mi)
+{
+ if (!mi->menu->active) return;
+ if (mi->menu->fast_mouse)
+ {
+ mi->menu->pending_new_submenu = 1;
+ return;
+ }
+ mi->menu->pending_new_submenu = 0;
+ _e_menu_deactivate_above(mi->menu);
+ if (mi->submenu)
+ {
+ E_Menu *m;
+
+ m = mi->submenu;
+ e_object_ref(E_OBJECT(m));
+ m->parent_item = mi;
+ _e_menu_activate_internal(m, mi->menu->con);
+ _e_menu_reposition(m);
+ e_object_unref(E_OBJECT(m));
+ }
+}
+
+static void
+_e_menu_reposition(E_Menu *m)
+{
+ Evas_List *l, *tmp = NULL;
+
+ if (!m->parent_item) return;
+ m->cur.x = m->parent_item->menu->cur.x + m->parent_item->menu->cur.w;
+ m->cur.y = m->parent_item->menu->cur.y + m->parent_item->y - m->container_y;
+ /* FIXME: this will suck for big menus */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ tmp = evas_list_append(tmp, l->data);
+ e_object_ref(E_OBJECT(l->data));
+ }
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = l->data;
+ if ((mi->active) && (mi->submenu)) _e_menu_reposition(mi->submenu);
+ }
+ while (tmp)
+ {
+ e_object_unref(E_OBJECT(tmp->data));
+ tmp = evas_list_remove_list(tmp, tmp);
+ }
+}
+
+static int
+_e_menu_active_call(void)
+{
+ Evas_List *l, *ll;
+
+ /* FIXME: inefficient. should track current menu and active item */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ for (ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (mi->active)
+ {
+ if (mi->submenu) return 0;
+ if (mi->check)
+ e_menu_item_toggle_set(mi, !mi->toggle);
+ if ((mi->radio) && (!e_menu_item_toggle_get(mi)))
+ e_menu_item_toggle_set(mi, 1);
+ if (mi->cb.func)
+ mi->cb.func(mi->cb.data, m, mi);
+ return 1;
+ }
+ }
+ }
+ return -1;
+}
+
+static void
+_e_menu_item_activate_next(void)
+{
+ E_Menu *m;
+
+ /* FIXME: inefficient. should track current menu and active item */
+ m = _e_menu_active_get();
+ if (m)
+ {
+ Evas_List *ll;
+
+ for (ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (mi->active)
+ {
+ if (ll->next)
+ {
+ ll = ll->next;
+ mi = ll->data;
+ while ((mi->separator) && (ll->next))
+ {
+ ll = ll->next;
+ mi = ll->data;
+ }
+ if ((mi->separator) && (!ll->next))
+ {
+ ll = m->items;
+ mi = ll->data;
+ while ((mi->separator) && (ll->next))
+ {
+ ll = ll->next;
+ mi = ll->data;
+ }
+ }
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ else
+ {
+ ll = m->items;
+ mi = ll->data;
+ while ((mi->separator) && (ll->next))
+ {
+ ll = ll->next;
+ mi = ll->data;
+ }
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ return;
+ }
+ }
+ }
+ _e_menu_activate_first();
+}
+
+static void
+_e_menu_item_activate_previous(void)
+{
+ E_Menu *m;
+
+ /* FIXME: inefficient. should track current menu and active item */
+ m = _e_menu_active_get();
+ if (m)
+ {
+ Evas_List *ll;
+
+ for (ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (mi->active)
+ {
+ if (ll->prev)
+ {
+ ll = ll->prev;
+ mi = ll->data;
+ while ((mi->separator) && (ll->prev))
+ {
+ ll = ll->prev;
+ mi = ll->data;
+ }
+ if ((mi->separator) && (!ll->prev))
+ {
+ ll = m->items;
+ mi = ll->data;
+ while ((mi->separator) && (ll->prev))
+ {
+ ll = ll->prev;
+ mi = ll->data;
+ }
+ }
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ else
+ {
+ ll = m->items->last;
+ mi = ll->data;
+ while ((mi->separator) && (ll->prev))
+ {
+ ll = ll->prev;
+ mi = ll->data;
+ }
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ return;
+ }
+ }
+ }
+ _e_menu_activate_first();
+}
+
+static void
+_e_menu_activate_next(void)
+{
+ E_Menu_Item *mi;
+
+ mi = _e_menu_item_active_get();
+ if (mi)
+ {
+ if (mi->submenu)
+ {
+ if (mi->submenu->items)
+ {
+ mi = mi->submenu->items->data;
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ }
+ return;
+ }
+ _e_menu_activate_first();
+}
+
+static void
+_e_menu_activate_previous(void)
+{
+ E_Menu_Item *mi;
+
+ mi = _e_menu_item_active_get();
+ if (mi)
+ {
+ if (mi->menu->parent_item)
+ {
+ mi = mi->menu->parent_item;
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ }
+ return;
+ }
+ _e_menu_activate_first();
+}
+
+static void
+_e_menu_activate_first(void)
+{
+ E_Menu *m;
+ E_Menu_Item *mi;
+ Evas_List *ll;
+
+ if (!_e_active_menus) return;
+ m = _e_active_menus->data;
+ if (!m->items) return;
+ ll = m->items;
+ mi = ll->data;
+ while ((mi->separator) && (ll->next))
+ {
+ ll = ll->next;
+ mi = ll->data;
+ }
+ if (mi->separator) return;
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+}
+
+static void
+_e_menu_activate_nth(int n)
+{
+ E_Menu *m;
+ E_Menu_Item *mi;
+ Evas_List *ll;
+ int i;
+
+ mi = _e_menu_item_active_get();
+ if (!mi)
+ {
+ _e_menu_activate_first();
+ mi = _e_menu_item_active_get();
+ if (!mi) return;
+ }
+ m = mi->menu;
+ for (i = -1, ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (!mi->separator) i++;
+ if (i == n)
+ {
+ e_menu_item_active_set(mi, 1);
+ _e_menu_item_ensure_onscreen(mi);
+ return;
+ }
+ }
+}
+
+static E_Menu *
+_e_menu_active_get(void)
+{
+ Evas_List *l, *ll;
+
+ /* FIXME: inefficient. should track current menu and active item */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ for (ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (mi->active) return m;
+ }
+ }
+ return NULL;
+}
+
+static E_Menu_Item *
+_e_menu_item_active_get(void)
+{
+ Evas_List *l, *ll;
+
+ /* FIXME: inefficient. should track current menu and active item */
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ for (ll = m->items; ll; ll = ll->next)
+ {
+ E_Menu_Item *mi;
+
+ mi = ll->data;
+ if (mi->active) return mi;
+ }
+ }
+ return NULL;
+}
+
+static int
+_e_menu_outside_bounds_get(int xdir, int ydir)
+{
+ Evas_List *l;
+ int outl = 0;
+ int outr = 0;
+ int outt = 0;
+ int outb = 0;
+ int i;
+
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if (m->cur.x < 0)
+ {
+ i = -m->cur.x;
+ if (i > outl) outl = i;
+ }
+ if (m->cur.y < 0)
+ {
+ i = -m->cur.y;
+ if (i > outt) outt = i;
+ }
+ if ((m->cur.x + m->cur.w) > (m->con->w))
+ {
+ i = m->cur.x + m->cur.w - m->con->w;
+ if (i > outr) outr = i;
+ }
+ if ((m->cur.y + m->cur.h) > (m->con->h))
+ {
+ i = m->cur.y + m->cur.h - m->con->h;
+ if (i > outb) outb = i;
+ }
+ }
+ if (xdir == -1)
+ {
+ if (outl) return outl;
+ }
+ else if (xdir == 1)
+ {
+ if (outr) return outr;
+ }
+ else if (ydir == -1)
+ {
+ if (outt) return outt;
+ }
+ else if (ydir == 1)
+ {
+ if (outb) return outb;
+ }
+ return 0;
+}
+
+static void
+_e_menu_scroll_by(int dx, int dy)
+{
+ Evas_List *l;
+
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ m->cur.x += dx;
+ m->cur.y += dy;
+ }
+}
+
+static void
+_e_menu_mouse_autoscroll_check(void)
+{
+ int autoscroll_x = 0;
+ int autoscroll_y = 0;
+
+ if (_e_menu_x == 0)
+ {
+ if (_e_menu_outside_bounds_get(-1, 0)) autoscroll_x = -1;
+ }
+ if (_e_menu_y == 0)
+ {
+ if (_e_menu_outside_bounds_get(0, -1)) autoscroll_y = -1;
+ }
+ if ((!autoscroll_x) && (!autoscroll_y))
+ {
+ if (_e_active_menus)
+ {
+ E_Menu *m;
+
+ m = _e_active_menus->data;
+ if (_e_menu_x == (m->con->w - 1))
+ {
+ if (_e_menu_outside_bounds_get(1, 0)) autoscroll_x = 1;
+ }
+ if (_e_menu_y == (m->con->h - 1))
+ {
+ if (_e_menu_outside_bounds_get(0, 1)) autoscroll_y = 1;
+ }
+ }
+ }
+ _e_menu_autoscroll_x = autoscroll_x;
+ _e_menu_autoscroll_y = autoscroll_y;
+ if ((!autoscroll_x) && (!autoscroll_y)) return;
+ if (_e_menu_scroll_timer) return;
+ _e_menu_scroll_timer = ecore_timer_add(1.0 / 60.0,
+ _e_menu_cb_scroll_timer, NULL);
+ _e_menu_scroll_start = ecore_time_get();
+}
+
+static void
+_e_menu_item_ensure_onscreen(E_Menu_Item *mi)
+{
+ int x, y, w, h;
+ int dx, dy;
+
+ x = mi->x + mi->menu->cur.x;
+ y = mi->y + mi->menu->cur.y;
+ w = mi->w;
+ h = mi->h;
+ dx = 0;
+ dy = 0;
+ if ((x + w) > mi->menu->con->w) dx = mi->menu->con->w - (x + w);
+ if ((y + h) > mi->menu->con->h) dy = mi->menu->con->h - (y + h);
+ if (x < 0) dx = x;
+ if (y < 0) dy = y;
+ if ((dx != 0) || (dy != 0))
+ _e_menu_scroll_by(dx, dy);
+}
+
+static void
+_e_menu_cb_ecore_evas_resize(Ecore_Evas *ee)
+{
+ Evas *evas;
+ Evas_Object *o;
+ E_Menu *m;
+ Evas_Coord w, h;
+
+ evas = ecore_evas_get(ee);
+ evas_output_viewport_get(evas, NULL, NULL, &w, &h);
+ o = evas_object_name_find(evas, "menu/background");
+ m = evas_object_data_get(o, "e_menu");
+ evas_object_resize(o, w, h);
+}
+
+static void
+_e_menu_cb_item_in(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ E_Menu_Item *mi;
+
+ mi = data;
+ e_menu_item_active_set(mi, 1);
+}
+
+static void
+_e_menu_cb_item_out(void *data, Evas *evas, Evas_Object *obj, void *event_info)
+{
+ E_Menu_Item *mi;
+
+ mi = data;
+ e_menu_item_active_set(mi, 0);
+}
+
+static int
+_e_menu_cb_key_down(void *data, int type, void *event)
+{
+ Ecore_X_Event_Key_Down *ev;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ if (!strcmp(ev->keysymbol, "Up"))
+ _e_menu_item_activate_previous();
+ else if (!strcmp(ev->keysymbol, "Down"))
+ _e_menu_item_activate_next();
+ else if (!strcmp(ev->keysymbol, "Left"))
+ _e_menu_activate_previous();
+ else if (!strcmp(ev->keysymbol, "Right"))
+ _e_menu_activate_next();
+ else if (!strcmp(ev->keysymbol, "space"))
+ {
+ _e_menu_active_call();
+ }
+ else if (!strcmp(ev->keysymbol, "Return"))
+ {
+ _e_menu_active_call();
+ _e_menu_deactivate_all();
+ }
+ else if (!strcmp(ev->keysymbol, "Escape"))
+ _e_menu_deactivate_all();
+ else if (!strcmp(ev->keysymbol, "1"))
+ _e_menu_activate_nth(0);
+ else if (!strcmp(ev->keysymbol, "2"))
+ _e_menu_activate_nth(1);
+ else if (!strcmp(ev->keysymbol, "3"))
+ _e_menu_activate_nth(2);
+ else if (!strcmp(ev->keysymbol, "4"))
+ _e_menu_activate_nth(3);
+ else if (!strcmp(ev->keysymbol, "5"))
+ _e_menu_activate_nth(4);
+ else if (!strcmp(ev->keysymbol, "6"))
+ _e_menu_activate_nth(5);
+ else if (!strcmp(ev->keysymbol, "7"))
+ _e_menu_activate_nth(6);
+ else if (!strcmp(ev->keysymbol, "8"))
+ _e_menu_activate_nth(7);
+ else if (!strcmp(ev->keysymbol, "9"))
+ _e_menu_activate_nth(8);
+ else if (!strcmp(ev->keysymbol, "0"))
+ _e_menu_activate_nth(9);
+ printf("kdn \"%s\" \"%s\"\n", ev->keyname, ev->keysymbol);
+ return 1;
+}
+
+static int
+_e_menu_cb_key_up(void *data, int type, void *event)
+{
+ Ecore_X_Event_Key_Up *ev;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ return 1;
+}
+
+/* we need all of these because menus are special and grab the mouse and
+ * keyboard and thus the normal event mechanism doesnt work, so we feed
+ * events directly to the canvases from our grab window
+ */
+
+static int
+_e_menu_cb_mouse_down(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Button_Down *ev;
+ Evas_List *l;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ return 1;
+}
+
+static int
+_e_menu_cb_mouse_up(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Button_Up *ev;
+ Evas_List *l;
+ double t;
+ int ret;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ t = ecore_time_get();
+ if ((_e_menu_activate_time != 0.0) &&
+ ((t - _e_menu_activate_time) < e_config_val_menus_click_drag_timeout))
+ return 1;
+ ret = _e_menu_active_call();
+ if (ret == 1)
+ {
+ if (_e_menu_activate_time != 0.0)
+ _e_menu_deactivate_all();
+ }
+ else if (ret == -1)
+ _e_menu_deactivate_all();
+ return 1;
+}
+
+static int
+_e_menu_cb_mouse_move(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Move *ev;
+ Evas_List *l, *tmp = NULL;
+ int dx, dy, d;
+ double dt;
+ double fast_move_threshold;
+ int is_fast = 0;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ fast_move_threshold = e_config_val_menus_fast_mouse_move_thresthold;
+ dx = ev->x - _e_menu_x;
+ dy = ev->y - _e_menu_y;
+ d = (dx * dx) + (dy * dy);
+ dt = (double)(ev->time - _e_menu_time) / 1000.0;
+ dt = dt * dt;
+ if ((dt > 0.0) && ((d / dt) >= (fast_move_threshold * fast_move_threshold)))
+ is_fast = 1;
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ tmp = evas_list_append(tmp, l->data);
+ e_object_ref(E_OBJECT(l->data));
+ }
+ for (l = _e_active_menus; l; l = l->next)
+ {
+ E_Menu *m;
+
+ m = l->data;
+ if ((m->realized) && (m->cur.visible))
+ {
+ if (is_fast)
+ m->fast_mouse = 1;
+ else
+ {
+ m->fast_mouse = 0;
+ if (m->pending_new_submenu)
+ {
+ E_Menu_Item *mi;
+
+ mi = _e_menu_item_active_get();
+ if (mi)
+ _e_menu_submenu_activate(mi);
+ }
+ }
+ evas_event_feed_mouse_move(m->evas,
+ ev->x - m->cur.x,
+ ev->y - m->cur.y);
+ }
+ }
+ while (tmp)
+ {
+ e_object_unref(E_OBJECT(tmp->data));
+ tmp = evas_list_remove_list(tmp, tmp);
+ }
+
+ _e_menu_x = ev->x;
+ _e_menu_y = ev->y;
+ _e_menu_time = ev->time;
+ _e_menu_mouse_autoscroll_check();
+ return 1;
+}
+
+static int
+_e_menu_cb_mouse_wheel(void *data, int type, void *event)
+{
+ Ecore_X_Event_Mouse_Wheel *ev;
+
+ ev = event;
+ if (ev->win != _e_menu_win) return 1;
+ if (ev->z < 0) /* up */
+ {
+ int i;
+
+ for (i = ev->z; i < 0; i++)
+ _e_menu_item_activate_previous();
+ }
+ else if (ev->z > 0) /* down */
+ {
+ int i;
+
+ for (i = ev->z; i > 0; i--)
+ _e_menu_item_activate_next();
+ }
+ return 1;
+}
+
+static int
+_e_menu_cb_scroll_timer(void *data)
+{
+ double t, dt;
+ double dx, dy;
+ int out;
+ double spd;
+
+ t = ecore_time_get();
+ spd = e_config_val_menus_scroll_speed;
+ dt = t - _e_menu_scroll_start;
+ _e_menu_scroll_start = t;
+ dx = 0;
+ dy = 0;
+ if (_e_menu_autoscroll_x)
+ {
+ out = _e_menu_outside_bounds_get(_e_menu_autoscroll_x, 0);
+ dx = (-_e_menu_autoscroll_x) * spd * dt;
+ if (_e_menu_autoscroll_x == -1)
+ {
+ if (dx > out) dx = out;
+ }
+ else
+ {
+ if (dx < -out) dx = -out;
+ }
+ }
+ if (_e_menu_autoscroll_y)
+ {
+ out = _e_menu_outside_bounds_get(0, _e_menu_autoscroll_y);
+ dy = (-_e_menu_autoscroll_y) * spd * dt;
+ if (_e_menu_autoscroll_y == -1)
+ {
+ if (dy > out) dy = out;
+ }
+ else
+ {
+ if (dy < -out) dy = -out;
+ }
+ }
+ _e_menu_scroll_by(dx, dy);
+ _e_menu_mouse_autoscroll_check();
+ if ((_e_menu_autoscroll_x == 0) && (_e_menu_autoscroll_y == 0))
+ {
+ _e_menu_scroll_timer = NULL;
+ return 0;
+ }
+ return 1;
+}
--- /dev/null
+#ifndef E_MENU_H
+#define E_MENU_H
+
+typedef struct _E_Menu E_Menu;
+typedef struct _E_Menu_Item E_Menu_Item;
+
+struct _E_Menu
+{
+ E_Object e_obj_inherit;
+
+ struct {
+ char visible : 1;
+ int x, y, w, h;
+ } cur, prev;
+
+ int frozen;
+
+ struct {
+ char *title;
+ char *icon_file;
+ Evas_Object *icon;
+ } header;
+
+ Evas_List *items;
+
+ /* the container it belongs to */
+ E_Container *con;
+
+ /* if a menu item spawned this menu, what item is it? */
+ E_Menu_Item *parent_item;
+
+ /* only useful if realized != 0 (ie menu is ACTUALLY realized) */
+ Ecore_Evas *ecore_evas;
+ Evas *evas;
+ Ecore_X_Window evas_win;
+ Evas_Object *bg_object;
+ Evas_Object *container_object;
+ Evas_Coord container_x, container_y, container_w, container_h;
+ E_Container_Shape *shape;
+
+ struct {
+ void *data;
+ void (*func) (void *data, E_Menu *m);
+ } pre_activate_cb, post_deactivate_cb;
+
+ unsigned char realized : 1; /* 1 if it is realized */
+ unsigned char active : 1; /* 1 if it is in active list */
+ unsigned char changed : 1;
+ unsigned char fast_mouse : 1;
+ unsigned char pending_new_submenu : 1;
+ unsigned char have_submenu : 1;
+ unsigned char in_active_list : 1;
+};
+
+struct _E_Menu_Item
+{
+ E_Object e_obj_inherit;
+ E_Menu *menu;
+ char *icon;
+ char *icon_key;
+ char *label;
+ E_Menu *submenu;
+
+ Evas_Object *separator_object;
+
+ Evas_Object *bg_object;
+
+ Evas_Object *container_object;
+
+ Evas_Object *toggle_object;
+ Evas_Object *icon_bg_object;
+ Evas_Object *icon_object;
+ Evas_Object *label_object;
+ Evas_Object *submenu_object;
+
+ Evas_Object *event_object;
+
+ int label_w, label_h;
+ int icon_w, icon_h;
+ int separator_w, separator_h;
+ int submenu_w, submenu_h;
+ int toggle_w, toggle_h;
+ int radio_group;
+ int x, y, w, h;
+
+ struct {
+ void *data;
+ void (*func) (void *data, E_Menu *m, E_Menu_Item *mi);
+ } cb;
+
+ unsigned char separator : 1;
+ unsigned char radio : 1;
+ unsigned char check : 1;
+ unsigned char toggle : 1;
+ unsigned char changed : 1;
+ unsigned char active : 1;
+};
+
+#define E_MENU_POP_DIRECTION_NONE 0
+#define E_MENU_POP_DIRECTION_LEFT 1
+#define E_MENU_POP_DIRECTION_RIGHT 2
+#define E_MENU_POP_DIRECTION_UP 3
+#define E_MENU_POP_DIRECTION_DOWN 4
+#define E_MENU_POP_DIRECTION_AUTO 5
+#define E_MENU_POP_DIRECTION_LAST 6
+
+int e_menu_init(void);
+int e_menu_shutdown(void);
+
+E_Menu *e_menu_new(void);
+void e_menu_activate_key(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir);
+void e_menu_activate_mouse(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir);
+void e_menu_activate(E_Menu *m, E_Container *con, int x, int y, int w, int h, int dir);
+void e_menu_deactivate(E_Menu *m);
+int e_menu_freeze(E_Menu *m);
+int e_menu_thaw(E_Menu *m);
+void e_menu_title_set(E_Menu *m, char *title);
+void e_menu_icon_file_set(E_Menu *m, char *icon);
+void e_menu_pre_activate_callback_set(E_Menu *m, void (*func) (void *data, E_Menu *m), void *data);
+void e_menu_post_deactivate_callback_set(E_Menu *m, void (*func) (void *data, E_Menu *m), void *data);
+
+E_Menu_Item *e_menu_item_new(E_Menu *m);
+E_Menu_Item *e_menu_item_nth(E_Menu *m, int n);
+int e_menu_item_num_get(E_Menu_Item *mi);
+void e_menu_item_icon_file_set(E_Menu_Item *mi, char *icon);
+void e_menu_item_icon_edje_set(E_Menu_Item *mi, char *icon, char *key);
+void e_menu_item_label_set(E_Menu_Item *mi, char *label);
+void e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub);
+void e_menu_item_separator_set(E_Menu_Item *mi, int sep);
+void e_menu_item_check_set(E_Menu_Item *mi, int chk);
+void e_menu_item_radio_set(E_Menu_Item *mi, int rad);
+void e_menu_item_radio_group_set(E_Menu_Item *mi, int radg);
+void e_menu_item_toggle_set(E_Menu_Item *mi, int tog);
+int e_menu_item_toggle_get(E_Menu_Item *mi);
+void e_menu_item_callback_set(E_Menu_Item *mi, void (*func) (void *data, E_Menu *m, E_Menu_Item *mi), void *data);
+void e_menu_item_active_set(E_Menu_Item *mi, int active);
+
+void e_menu_idler_before(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * load and save list of modules to load or ban from loading
+ * * add module types/classes
+ * * add list of exclusions that a mdoule cant work with
+ * * hook ipc calls to load module/unload, enable and disable a module etc.
+ *
+ */
+
+typedef struct _Module_Menu_Data Module_Menu_Data;
+
+struct _Module_Menu_Data
+{
+ Evas_List *submenus;
+};
+
+/* local subsystem functions */
+static void _e_module_free(E_Module *m);
+static E_Menu *_e_module_control_menu_new(E_Module *mod);
+static void _e_module_menu_free(void *obj);
+static void _e_module_control_menu_about(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _e_module_control_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi);
+
+/* local subsystem globals */
+static Evas_List *_e_modules = NULL;
+static E_Path *_e_path_modules = NULL;
+
+static E_Module_Api _e_module_api =
+{
+ E_MODULE_API_VERSION
+};
+
+/* externally accessible functions */
+int
+e_module_init(void)
+{
+ _e_path_modules = e_path_new();
+ if (!_e_path_modules) return 0;
+ e_path_path_append(_e_path_modules, "~/.e/e/modules");
+ e_path_path_append(_e_path_modules, PACKAGE_LIB_DIR"/enlightenment/modules");
+
+ /* FIXME: this is crap. need to have a separate call to load a list of */
+ /* modules that the user wants loaded */
+ {
+ E_Module *m;
+
+ m = e_module_new("test");
+ e_module_enable(m);
+ m = e_module_new("ibar");
+ e_module_enable(m);
+ m = e_module_new("dropshadow");
+ e_module_enable(m);
+ }
+
+ return 1;
+}
+
+int
+e_module_shutdown(void)
+{
+ while (_e_modules)
+ {
+ E_Module *m;
+
+ m = _e_modules->data;
+ e_object_unref(E_OBJECT(m));
+ }
+ e_object_unref(E_OBJECT(_e_path_modules));
+ _e_path_modules = NULL;
+ return 1;
+}
+
+E_Module *
+e_module_new(char *name)
+{
+ E_Module *m;
+ char buf[4096];
+ const char *modpath, *tmp, *p;
+
+ if (!name) return NULL;
+ m = E_OBJECT_ALLOC(E_Module, _e_module_free);
+ m->api = &_e_module_api;
+ if (name[0] != '/')
+ {
+ snprintf(buf, sizeof(buf), "%s/module.so", name);
+ modpath = e_path_find(_e_path_modules, buf);
+ }
+ else
+ modpath = name;
+ if (!modpath)
+ {
+ e_error_dialog_show("Error loading Module",
+ "There was an error loading module named: %s\n"
+ "No module named %s could be found in the\n"
+ "module search directories\n",
+ name, buf);
+ free(m);
+ return NULL;
+ }
+ m->handle = dlopen(modpath, RTLD_NOW | RTLD_LOCAL);
+ if (!m->handle)
+ {
+ e_error_dialog_show("Error loading Module",
+ "There was an error loading module named: %s\n"
+ "The full path to this module is:\n"
+ "%s\n"
+ "The error reported was:\n"
+ "%s",
+ name, buf, dlerror());
+ free(m);
+ return NULL;
+ }
+ m->func.init = dlsym(m->handle, "init");
+ m->func.shutdown = dlsym(m->handle, "shutdown");
+ m->func.save = dlsym(m->handle, "save");
+ m->func.info = dlsym(m->handle, "info");
+ m->func.about = dlsym(m->handle, "about");
+ if ((!m->func.init) ||
+ (!m->func.shutdown) ||
+ (!m->func.save) ||
+ (!m->func.info) ||
+ (!m->func.about)
+ )
+ {
+ e_error_dialog_show("Error loading Module",
+ "There was an error loading module named: %s\n"
+ "The full path to this module is:\n"
+ "%s\n"
+ "The error reported was:\n"
+ "%s",
+ name, buf, dlerror());
+ dlclose(m->handle);
+ free(m);
+ return NULL;
+ }
+ _e_modules = evas_list_append(_e_modules, m);
+ m->name = strdup(name);
+ m->dir = e_file_get_dir(modpath);
+ m->func.info(m);
+ return m;
+}
+
+int
+e_module_save(E_Module *m)
+{
+ E_OBJECT_CHECK_RETURN(m, 0);
+ return m->func.save(m);
+}
+
+const char *
+e_module_dir_get(E_Module *m)
+{
+ E_OBJECT_CHECK_RETURN(m, NULL);
+ return m->dir;
+}
+
+int
+e_module_enable(E_Module *m)
+{
+ E_OBJECT_CHECK_RETURN(m, 0);
+ if (m->enabled) return 0;
+ m->data = m->func.init(m);
+ if (m->data) m->enabled = 1;
+}
+
+int
+e_module_disable(E_Module *m)
+{
+ int ret;
+
+ E_OBJECT_CHECK_RETURN(m, 0);
+ if (!m->enabled) return 0;
+ ret = m->func.shutdown(m);
+ m->data = NULL;
+ m->enabled = 0;
+ return ret;
+}
+
+int
+e_module_enabled_get(E_Module *m)
+{
+ E_OBJECT_CHECK_RETURN(m, 0);
+ return m->enabled;
+}
+
+int
+e_module_save_all(void)
+{
+ Evas_List *l;
+ int ret = 1;
+
+ for (l = _e_modules; l; l = l->next) e_object_ref(E_OBJECT(l->data));
+ for (l = _e_modules; l; l = l->next)
+ {
+ E_Module *m;
+
+ m = l->data;
+ if (m->enabled)
+ {
+ if (!m->func.save(m)) ret = 0;
+ }
+ }
+ for (l = _e_modules; l; l = l->next) e_object_unref(E_OBJECT(l->data));
+ return ret;
+}
+
+E_Module *
+e_module_find(char *name)
+{
+ Evas_List *l;
+
+ if (!name) return NULL;
+ for (l = _e_modules; l; l = l->next)
+ {
+ E_Module *m;
+
+ m = l->data;
+ if (!strcmp(name, m->name)) return m;
+ }
+ return NULL;
+}
+
+Evas_List *
+e_module_list(void)
+{
+ return _e_modules;
+}
+
+E_Menu *
+e_module_menu_new(void)
+{
+ E_Menu *m, *subm;
+ E_Menu_Item *mi;
+ Evas_List *l;
+ Module_Menu_Data *dat;
+
+ dat = calloc(1, sizeof(Module_Menu_Data));
+ m = e_menu_new();
+ e_object_data_set(E_OBJECT(m), dat);
+ e_object_free_attach_func_set(E_OBJECT(m), _e_module_menu_free);
+ for (l = _e_modules; l; l = l->next)
+ {
+ E_Module *mod;
+
+ mod = l->data;
+ mi = e_menu_item_new(m);
+ if (mod->label) e_menu_item_label_set(mi, mod->label);
+ else e_menu_item_label_set(mi, mod->name);
+ if (mod->edje_icon_file)
+ {
+ if (mod->edje_icon_key)
+ e_menu_item_icon_edje_set(mi, mod->edje_icon_file, mod->edje_icon_key);
+ else
+ e_menu_item_icon_edje_set(mi, mod->edje_icon_file, "icon");
+ }
+ else if (mod->icon_file)
+ e_menu_item_icon_file_set(mi, mod->icon_file);
+ subm = _e_module_control_menu_new(mod);
+ e_menu_item_submenu_set(mi, subm);
+ dat->submenus = evas_list_append(dat->submenus, subm);
+ }
+ return m;
+}
+
+/* local subsystem functions */
+
+static void
+_e_module_free(E_Module *m)
+{
+ if (m->enabled) m->func.shutdown(m);
+ if (m->name) free(m->name);
+ if (m->dir) free(m->dir);
+ dlclose(m->handle);
+ _e_modules = evas_list_remove(_e_modules, m);
+ if (m->label) free(m->label);
+ if (m->icon_file) free(m->icon_file);
+ if (m->edje_icon_file) free(m->edje_icon_file);
+ if (m->edje_icon_key) free(m->edje_icon_key);
+ free(m);
+}
+
+static E_Menu *
+_e_module_control_menu_new(E_Module *mod)
+{
+ E_Menu *m, *subm;
+ E_Menu_Item *mi;
+
+ m = e_menu_new();
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "About...");
+ e_menu_item_callback_set(mi, _e_module_control_menu_about, mod);
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Enabled");
+ e_menu_item_check_set(mi, 1);
+ if (mod->enabled) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _e_module_control_menu_enabled, mod);
+
+ if (mod->config_menu)
+ {
+ mi = e_menu_item_new(m);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Configuration");
+ e_menu_item_submenu_set(mi, mod->config_menu);
+ }
+ return m;
+}
+
+static void
+_e_module_menu_free(void *obj)
+{
+ Module_Menu_Data *dat;
+
+ dat = e_object_data_get(E_OBJECT(obj));
+ while (dat->submenus)
+ {
+ E_Menu *subm;
+
+ subm = dat->submenus->data;
+ dat->submenus = evas_list_remove_list(dat->submenus, dat->submenus);
+ e_object_unref(E_OBJECT(subm));
+ }
+ free(dat);
+}
+
+static void
+_e_module_control_menu_about(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ E_Module *mod;
+
+ mod = data;
+ mod->func.about(mod);
+}
+
+static void
+_e_module_control_menu_enabled(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ E_Module *mod;
+ int enabled;
+
+ mod = data;
+ enabled = e_menu_item_toggle_get(mi);
+ if ((mod->enabled) && (!enabled))
+ {
+ e_module_save(mod);
+ e_module_disable(mod);
+ }
+ else if ((!mod->enabled) && (enabled))
+ {
+ e_module_enable(mod);
+ }
+ e_menu_item_toggle_set(mi, e_module_enabled_get(mod));
+}
--- /dev/null
+#ifndef E_MODULE_H
+#define E_MODULE_H
+
+#define E_MODULE_API_VERSION 1
+
+typedef struct _E_Module E_Module;
+typedef struct _E_Module_Api E_Module_Api;
+
+struct _E_Module
+{
+ E_Object e_obj_inherit;
+
+ E_Module_Api *api;
+
+ char *name;
+ char *dir;
+ void *handle;
+
+ struct {
+ void * (*init) (E_Module *m);
+ int (*shutdown) (E_Module *m);
+ int (*save) (E_Module *m);
+ int (*info) (E_Module *m);
+ int (*about) (E_Module *m);
+ } func;
+
+ unsigned char enabled : 1;
+
+ /* the module is allowed to modify these */
+ void *data;
+ E_Menu *config_menu;
+
+ /* modify these but only set them up when the info func is called */
+ /* e_module will free them when the module is freed. */
+ /* note you will need to malloc (strdup) these fields due to the free */
+ char *label;
+ char *icon_file;
+ char *edje_icon_file;
+ char *edje_icon_key;
+};
+
+struct _E_Module_Api
+{
+ int version;
+};
+
+int e_module_init(void);
+int e_module_shutdown(void);
+
+E_Module *e_module_new(char *name);
+int e_module_save(E_Module *m);
+const char *e_module_dir_get(E_Module *m);
+int e_module_enable(E_Module *m);
+int e_module_disable(E_Module *m);
+int e_module_enabled_get(E_Module *m);
+int e_module_save_all(void);
+E_Module *e_module_find(char *name);
+Evas_List *e_module_list(void);
+E_Menu *e_module_menu_new(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* TODO List:
+ *
+ * * fix a lot of parts of e17's code to use e_object_del NOT e_object_unref.
+ * there is a subtle difference. unref means u had a reference and you stop
+ * referencing the object - thats ALL. if you created it and now literally
+ * want to destroy it - del is the way to go. there is a separate handler for
+ * this so on del it can go and clean up objects that may reference this one
+ * etc.
+ *
+ */
+
+/* yes - i know. glibc specific... but i like being able to do my own */
+/* backtraces! NB: you need CFLAGS="-rdynamic -g" LDFLAGS="-rdynamic -g" */
+#ifdef OBJECT_PARANOIA_CHECK
+#include <execinfo.h>
+#include <stdio.h>
+#include <signal.h>
+#include <setjmp.h>
+
+/* local subsystem functions */
+static void _e_object_segv(int sig);
+
+/* local subsystem globals */
+static sigjmp_buf _e_object_segv_buf;
+#endif
+
+/* externally accessible functions */
+void *
+e_object_alloc(int size, E_Object_Cleanup_Func cleanup_func)
+{
+ E_Object *obj;
+
+ obj = calloc(1, size);
+ if (!obj) return;
+ obj->magic = E_OBJECT_MAGIC;
+ obj->references = 1;
+ obj->cleanup_func = cleanup_func;
+ return obj;
+}
+
+void
+e_object_del(E_Object *obj)
+{
+ E_OBJECT_CHECK(obj);
+ obj->deleted = 1;
+ if (obj->del_func) obj->del_func(obj);
+ e_object_unref(obj);
+}
+
+int
+e_object_del_get(E_Object *obj)
+{
+ E_OBJECT_CHECK_RETURN(obj, 1);
+ return obj->deleted;
+}
+
+void
+e_object_del_func_set(E_Object *obj, E_Object_Cleanup_Func del_func)
+{
+ E_OBJECT_CHECK(obj);
+ obj->del_func = del_func;
+}
+
+void
+e_object_free(E_Object *obj)
+{
+ E_OBJECT_CHECK(obj);
+ if (obj->func) obj->func(obj);
+ obj->magic = E_OBJECT_MAGIC_FREED;
+ obj->cleanup_func(obj);
+}
+
+int
+e_object_ref(E_Object *obj)
+{
+ E_OBJECT_CHECK(obj);
+ obj->references++;
+}
+
+int
+e_object_unref(E_Object *obj)
+{
+ E_OBJECT_CHECK(obj);
+ obj->references--;
+ if (obj->references <= 0) e_object_free(obj);
+}
+
+int
+e_object_ref_get(E_Object *obj)
+{
+ E_OBJECT_CHECK_RETURN(obj, 0);
+ return obj->references;
+}
+
+int
+e_object_error(E_Object *obj)
+{
+#ifdef OBJECT_PARANOIA_CHECK
+ char buf[4096];
+ char bt[8192];
+ void *trace[128];
+ char **messages = NULL;
+ int i, trace_num;
+
+ /* fetch stacktrace */
+ trace_num = backtrace(trace, 128);
+ messages = backtrace_symbols(trace, trace_num);
+
+ /* build stacktrace */
+ bt[0] = 0;
+ if (messages)
+ {
+ for (i = 1; i < trace_num; i++)
+ {
+ strcat(bt, messages[i]);
+ strcat(bt, "\n");
+ }
+ free(messages);
+ }
+ /* if NULL obj then dump stacktrace */
+ if (!obj)
+ {
+ snprintf(buf, sizeof(buf),
+ "Object is NULL.\n"
+ "%s",
+ bt);
+ }
+ /* if obj pointer is non NULL, actually try an access and see if we segv */
+ else if (obj)
+ {
+ struct sigaction act, oact;
+ int magic = 0, segv = 0;
+
+ /* setup segv handler */
+ act.sa_handler = _e_object_segv;
+ act.sa_flags = SA_RESETHAND;
+ sigemptyset(&act.sa_mask);
+ sigaction(SIGSEGV, &act, &oact);
+ /* set a longjump to be within this if statement. only called if we */
+ /* segfault */
+ if (sigsetjmp(_e_object_segv_buf, 1))
+ {
+ sigaction(SIGSEGV, &oact, NULL);
+ segv = 1;
+ }
+ else
+ {
+ /* try access magic value */
+ magic = obj->magic;
+ /* if pointer is bogus we'd segv and so jump to the if() above */
+ /* contents, and thus reset segv handler and set segv flag. */
+ /* if not we just continue moving along here and reset handler */
+ sigaction(SIGSEGV, &oact, NULL);
+ }
+ /* if we segfaulted above... */
+ if (segv)
+ snprintf(buf, sizeof(buf),
+ "Object [%p] is an invalid/garbage pointer.\n"
+ "Segfault successfully avoided.\n"
+ "%s",
+ obj,
+ bt);
+ else
+ {
+ /* valid ram then... if we freed this object before */
+ if (magic == E_OBJECT_MAGIC_FREED)
+ snprintf(buf, sizeof(buf),
+ "Object [%p] is already freed.\n"
+ "%s",
+ obj,
+ bt);
+ /* garbage magic value - pointer to non object */
+ else if (magic != E_OBJECT_MAGIC)
+ snprintf(buf, sizeof(buf),
+ "Object [%p] has garbage magic (%x).\n"
+ "%s",
+ obj, magic,
+ bt);
+ /* it's all ok! */
+ else
+ {
+ return 0;
+ }
+ }
+ }
+ /* display actual error message */
+ e_error_message_show("%s", buf);
+// abort();
+ return 1;
+#else
+ return 0;
+#endif
+}
+
+void
+e_object_data_set(E_Object *obj, void *data)
+{
+ E_OBJECT_CHECK(obj);
+ obj->data = data;
+}
+
+void *
+e_object_data_get(E_Object *obj)
+{
+ E_OBJECT_CHECK_RETURN(obj, NULL);
+ return obj->data;
+}
+
+void
+e_object_free_attach_func_set(E_Object *obj, void (*func) (void *obj))
+{
+ E_OBJECT_CHECK(obj);
+ obj->func = func;
+}
+
+#ifdef OBJECT_PARANOIA_CHECK
+/* local subsystem functions */
+static void
+_e_object_segv(int sig)
+{
+ siglongjmp(_e_object_segv_buf, 1);
+}
+#endif
--- /dev/null
+#ifndef E_OBJECT_H
+#define E_OBJECT_H
+
+/* Object safety/debugging checks */
+/* */
+/* OBJECT_PARANOIA_CHECK is paranoid and checkes pointers and traps segv's */
+/* incase they dont work... very paranoid and slow. NB for backtrace to */
+/* work you need gcc, glibc and you need to compile with compile options of */
+/* -g -rdynamic and link with them too */
+/* OBJECT_CHECK is a simple null pointer and magic number check with no */
+/* debug output */
+
+//#define OBJECT_PARANOIA_CHECK
+//#define OBJECT_CHECK
+
+#ifndef __GLIBC__
+# ifdef OBJECT_PARANOIA_CHECK
+# warning "Your system doesn't have glibc. Paranoid object checking disabled."
+# undef OBJECT_PARANOIA_CHECK
+# endif
+#endif
+
+#define E_OBJECT_MAGIC 0xe0b9ec75
+#define E_OBJECT_MAGIC_FREED 0xe0bf6eed
+#define E_OBJECT(x) ((E_Object *)(x))
+#define E_OBJECT_CLEANUP_FUNC(x) ((E_Object_Cleanup_Func)(x))
+#define E_OBJECT_ALLOC(x, cleanup_func) e_object_alloc(sizeof(x), E_OBJECT_CLEANUP_FUNC(cleanup_func))
+#define E_OBJECT_DEL_SET(x, del_func) e_object_del_func_set(E_OBJECT(x), E_OBJECT_CLEANUP_FUNC(del_func))
+
+#ifdef OBJECT_PARANOIA_CHECK
+# define E_OBJECT_CHECK(x) {if (e_object_error(E_OBJECT(x))) return;}
+# define E_OBJECT_CHECK_RETURN(x, ret) {if (e_object_error(E_OBJECT(x))) return ret;}
+#else
+# ifdef OBJECT_CHECK
+# define E_OBJECT_CHECK(x) {if ((!x) || (x->magic != E_OBJECT_MAGIC)) return;}
+# define E_OBJECT_CHECK_RETURN(x, ret) {if ((!x) || (x->magic != E_OBJECT_MAGIC)) return ret;}
+# else
+# define E_OBJECT_CHECK(x)
+# define E_OBJECT_CHECK_RETURN(x, ret)
+# endif
+#endif
+
+typedef void (*E_Object_Cleanup_Func) (void *obj);
+
+typedef struct _E_Object E_Object;
+
+struct _E_Object
+{
+ int magic;
+ int references;
+ E_Object_Cleanup_Func del_func;
+ E_Object_Cleanup_Func cleanup_func;
+ void (*func) (void *obj);
+ void *data;
+ unsigned char deleted : 1;
+};
+
+void *e_object_alloc (int size, E_Object_Cleanup_Func cleanup_func);
+void e_object_del (E_Object *obj);
+int e_object_del_get (E_Object *obj);
+void e_object_del_func_set (E_Object *obj, E_Object_Cleanup_Func del_func);
+void e_object_free (E_Object *obj);
+int e_object_ref (E_Object *obj);
+int e_object_unref (E_Object *obj);
+int e_object_ref_get (E_Object *obj);
+int e_object_error (E_Object *obj);
+void e_object_data_set (E_Object *obj, void *data);
+void *e_object_data_get (E_Object *obj);
+void e_object_free_attach_func_set(E_Object *obj, void (*func) (void *obj));
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* local subsystem functions */
+static void _e_path_free(E_Path *ep);
+static void _e_path_cache_free(E_Path *ep);
+static Evas_Bool _e_path_cache_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata);
+
+/* local subsystem globals */
+static char _e_path_buf[PATH_MAX] = "";
+
+/* externally accessible functions */
+E_Path *
+e_path_new(void)
+{
+ E_Path *ep;
+
+ ep = E_OBJECT_ALLOC(E_Path, _e_path_free);
+ return ep;
+}
+
+void
+e_path_path_append(E_Path *ep, const char *path)
+{
+ E_OBJECT_CHECK(ep);
+ if (!path) return;
+ if (path[0] == '~')
+ {
+ char *new_path;
+ char *home_dir;
+ int len1, len2;
+
+ home_dir = e_user_homedir_get();
+ if (!home_dir) return;
+ len1 = strlen(home_dir);
+ len2 = strlen(path);
+ new_path = malloc(len1 + len2 + 1);
+ if (!new_path)
+ {
+ free(home_dir);
+ return;
+ }
+ strcpy(new_path, home_dir);
+ strcat(new_path, path + 1);
+ free(home_dir);
+ ep->dir_list = evas_list_append(ep->dir_list, new_path);
+ }
+ else
+ ep->dir_list = evas_list_append(ep->dir_list, strdup(path));
+ _e_path_cache_free(ep);
+}
+
+void
+e_path_path_prepend(E_Path *ep, const char *path)
+{
+ E_OBJECT_CHECK(ep);
+ if (!path) return;
+ if (path[0] == '~')
+ {
+ char *new_path;
+ char *home_dir;
+ int len1, len2;
+
+ home_dir = e_user_homedir_get();
+ if (!home_dir) return;
+ len1 = strlen(home_dir);
+ len2 = strlen(path);
+ new_path = malloc(len1 + len2 + 1);
+ if (!new_path)
+ {
+ free(home_dir);
+ return;
+ }
+ strcpy(new_path, home_dir);
+ strcat(new_path, path + 1);
+ free(home_dir);
+ ep->dir_list = evas_list_prepend(ep->dir_list, new_path);
+ }
+ else
+ ep->dir_list = evas_list_prepend(ep->dir_list, strdup(path));
+ _e_path_cache_free(ep);
+}
+
+void
+e_path_path_remove(E_Path *ep, const char *path)
+{
+ Evas_List *l;
+
+ E_OBJECT_CHECK(ep);
+ if (!path) return;
+ if (path[0] == '~')
+ {
+ char *new_path;
+ char *home_dir;
+ int len1, len2;
+
+ home_dir = e_user_homedir_get();
+ if (!home_dir) return;
+ len1 = strlen(home_dir);
+ len2 = strlen(path);
+ new_path = malloc(len1 + len2 + 1);
+ if (!new_path)
+ {
+ free(home_dir);
+ return;
+ }
+ strcpy(new_path, home_dir);
+ strcat(new_path, path + 1);
+ free(home_dir);
+ for (l = ep->dir_list; l; l = l->next)
+ {
+ char *p;
+
+ p = l->data;
+ if (p)
+ {
+ if (!strcmp(p, new_path))
+ {
+ ep->dir_list = evas_list_prepend(ep->dir_list, l->data);
+ free(new_path);
+ _e_path_cache_free(ep);
+ return;
+ }
+ }
+ }
+ free(new_path);
+ }
+ else
+ {
+ for (l = ep->dir_list; l; l = l->next)
+ {
+ char *p;
+
+ p = l->data;
+ if (p)
+ {
+ if (!strcmp(p, path))
+ {
+ ep->dir_list = evas_list_prepend(ep->dir_list, l->data);
+ _e_path_cache_free(ep);
+ return;
+ }
+ }
+ }
+ }
+}
+
+const char *
+e_path_find(E_Path *ep, const char *file)
+{
+ Evas_List *l;
+ char *str;
+
+ E_OBJECT_CHECK_RETURN(ep, NULL);
+ if (!file) return NULL;
+ _e_path_buf[0] = 0;
+ str = evas_hash_find(ep->hash, file);
+ if (str)
+ {
+ strcpy(_e_path_buf, str);
+ return _e_path_buf;
+ }
+ for (l = ep->dir_list; l; l = l->next)
+ {
+ char *p, *rp;
+
+ p = l->data;
+ if (p)
+ {
+ snprintf(_e_path_buf, sizeof(_e_path_buf), "%s/%s", p, file);
+ rp = e_file_realpath(_e_path_buf);
+ if ((rp) && (rp[0] != 0))
+ {
+ strcpy(_e_path_buf, rp);
+ free(rp);
+ if (evas_hash_size(ep->hash) >= 512)
+ _e_path_cache_free(ep);
+ ep->hash = evas_hash_add(ep->hash, file, strdup(_e_path_buf));
+ return _e_path_buf;
+ }
+ if (rp) free(rp);
+ }
+ }
+ return _e_path_buf;
+}
+
+void
+e_path_evas_append(E_Path *ep, Evas *evas)
+{
+ Evas_List *l;
+
+ E_OBJECT_CHECK(ep);
+ if (!evas) return;
+ for (l = ep->dir_list; l; l = l->next)
+ {
+ char *p, *rp;
+
+ p = l->data;
+ if (p) evas_font_path_append(evas, p);
+ }
+}
+
+/* local subsystem functions */
+static void
+_e_path_free(E_Path *ep)
+{
+ _e_path_cache_free(ep);
+ while (ep->dir_list)
+ {
+ free(ep->dir_list->data);
+ ep->dir_list = evas_list_remove(ep->dir_list, ep->dir_list->data);
+ }
+ free(ep);
+}
+
+static void
+_e_path_cache_free(E_Path *ep)
+{
+ if (!ep->hash) return;
+ while (evas_hash_size(ep->hash) > 0)
+ evas_hash_foreach(ep->hash, _e_path_cache_free_cb, ep);
+}
+
+static Evas_Bool
+_e_path_cache_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata)
+{
+ E_Path *ep;
+
+ ep = fdata;
+ free(data);
+ ep->hash = evas_hash_del(ep->hash, key, data);
+ return 0;
+}
--- /dev/null
+#ifndef E_PATH_H
+#define E_PATH_H
+
+typedef struct _E_Path E_Path;
+
+struct _E_Path
+{
+ E_Object e_obj_inherit;
+
+ Evas_Hash *hash;
+
+ Evas_List *dir_list;
+};
+
+E_Path *e_path_new(void);
+void e_path_path_append(E_Path *ep, const char *path);
+void e_path_path_prepend(E_Path *ep, const char *path);
+void e_path_path_remove(E_Path *ep, const char *path);
+const char *e_path_find(E_Path *ep, const char *file);
+
+void e_path_evas_append(E_Path *ep, Evas *evas);
+#endif
--- /dev/null
+#include "e.h"
+
+int
+e_place_container_region_smart(E_Container *con, Evas_List *skiplist, int x, int y, int w, int h, int *rx, int *ry)
+{
+ int a_w = 0, a_h = 0;
+ int *a_x = NULL, *a_y = NULL;
+ Evas_List *l, *ll;
+
+ a_w = 2;
+ a_h = 2;
+ a_x = E_NEW(int, 2);
+ a_y = E_NEW(int, 2);
+
+ a_x[0] = 0;
+ a_x[1] = con->w;
+ a_y[0] = 0;
+ a_y[1] = con->h;
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+ int ok;
+
+ ok = 1;
+ bd = l->data;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if ((ok) && (bd->visible))
+ {
+ if (E_INTERSECTS(bd->x, bd->y, bd->w, bd->h,
+ 0, 0, con->w, con->h))
+ {
+ int i, j;
+
+ for (i = 0; i < a_w; i++)
+ {
+ int ok = 1;
+
+ if (bd->x > 0)
+ {
+ if (a_x[i] == bd->x)
+ ok = 0;
+ else if (a_x[i] > bd->x)
+ {
+ a_w++;
+ E_REALLOC(a_x, int, a_w);
+
+ for (j = a_w - 1; j > i; j--)
+ a_x[j] = a_x[j - 1];
+ a_x[i] = bd->x;
+ ok = 0;
+ }
+ }
+ if (!ok)
+ break;
+ }
+ for (i = 0; i < a_w; i++)
+ {
+ int ok = 1;
+
+ if (bd->x + bd->w < con->w)
+ {
+ if (a_x[i] == bd->x + bd->w)
+ ok = 0;
+ else if (a_x[i] > bd->x + bd->w)
+ {
+ a_w++;
+ E_REALLOC(a_x, int, a_w);
+
+ for (j = a_w - 1; j > i; j--)
+ a_x[j] = a_x[j - 1];
+ a_x[i] = bd->x + bd->w;
+ ok = 0;
+ }
+ }
+ if (!ok)
+ break;
+ }
+ for (i = 0; i < a_h; i++)
+ {
+ int ok = 1;
+
+ if (bd->y > 0)
+ {
+ if (a_y[i] == bd->y)
+ ok = 0;
+ else if (a_y[i] > bd->y)
+ {
+ a_h++;
+ E_REALLOC(a_y, int, a_h);
+
+ for (j = a_h - 1; j > i; j--)
+ a_y[j] = a_y[j - 1];
+ a_y[i] = bd->y;
+ ok = 0;
+ }
+ }
+ if (!ok)
+ break;
+ }
+ for (i = 0; i < a_h; i++)
+ {
+ int ok = 1;
+
+ if (bd->y + bd->h < con->h)
+ {
+ if (a_y[i] == bd->y + bd->h)
+ ok = 0;
+ else if (a_y[i] > bd->y + bd->h)
+ {
+ a_h++;
+ E_REALLOC(a_y, int, a_h);
+
+ for (j = a_h - 1; j > i; j--)
+ a_y[j] = a_y[j - 1];
+ a_y[i] = bd->y + bd->h;
+ ok = 0;
+ }
+ }
+ if (!ok)
+ break;
+ }
+ }
+ }
+ }
+ {
+ int i, j;
+ int area = 0x7fffffff;
+
+ for (j = 0; j < a_h - 1; j++)
+ {
+ for (i = 0; i < a_w - 1; i++)
+ {
+ if ((a_x[i] < (con->w - w)) &&
+ (a_y[j] < (con->h - h)))
+ {
+ int ar = 0;
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+ int x1, y1, w1, h1, x2, y2, w2, h2;
+ int ok;
+
+ ok = 1;
+ bd = l->data;
+ x1 = a_x[i];
+ y1 = a_y[j];
+ w1 = w;
+ h1 = h;
+ x2 = bd->x;
+ y2 = bd->y;
+ w2 = bd->w;
+ h2 = bd->h;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if ((ok) && (bd->visible) &&
+ E_INTERSECTS(x1, y1, w1, h1, x2, y2, w2, h2))
+ {
+ int iw, ih;
+ int x0, x00, y0, y00;
+
+ x0 = x1;
+ if (x1 < x2)
+ x0 = x2;
+ x00 = (x1 + w1);
+ if ((x2 + w2) < (x1 + w1))
+ x00 = (x2 + w2);
+
+ y0 = y1;
+ if (y1 < y2)
+ y0 = y2;
+ y00 = (y1 + h1);
+ if ((y2 + h2) < (y1 + h1))
+ y00 = (y2 + h2);
+
+ iw = x00 - x0;
+ ih = y00 - y0;
+ ar += (iw * ih);
+ }
+ }
+ if (ar < area)
+ {
+ area = ar;
+ *rx = a_x[i];
+ *ry = a_y[j];
+ if (ar == 0)
+ goto done;
+ }
+ }
+ if ((a_x[i + 1] - w > 0) && (a_y[j] < (con->h - h)))
+ {
+ int ar = 0;
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+ int x1, y1, w1, h1, x2, y2, w2, h2;
+ int ok;
+
+ ok = 1;
+ bd = l->data;
+ x1 = a_x[i + 1] - w;
+ y1 = a_y[j];
+ w1 = w;
+ h1 = h;
+ x2 = bd->x;
+ y2 = bd->y;
+ w2 = bd->w;
+ h2 = bd->h;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if ((ok) && (bd->visible) &&
+ E_INTERSECTS(x1, y1, w1, h1, x2, y2, w2, h2))
+ {
+ int iw, ih;
+ int x0, x00, y0, y00;
+
+ x0 = x1;
+ if (x1 < x2)
+ x0 = x2;
+ x00 = (x1 + w1);
+ if ((x2 + w2) < (x1 + w1))
+ x00 = (x2 + w2);
+
+ y0 = y1;
+ if (y1 < y2)
+ y0 = y2;
+ y00 = (y1 + h1);
+ if ((y2 + h2) < (y1 + h1))
+ y00 = (y2 + h2);
+
+ iw = x00 - x0;
+ ih = y00 - y0;
+ ar += (iw * ih);
+ }
+ }
+ if (ar < area)
+ {
+ area = ar;
+ *rx = a_x[i + 1] - w;
+ *ry = a_y[j];
+ if (ar == 0)
+ goto done;
+ }
+ }
+ if ((a_x[i + 1] - w > 0) && (a_y[j + 1] - h > 0))
+ {
+ int ar = 0;
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+ int x1, y1, w1, h1, x2, y2, w2, h2;
+ int ok;
+
+ ok = 1;
+ bd = l->data;
+ x1 = a_x[i + 1] - w;
+ y1 = a_y[j + 1] - h;
+ w1 = w;
+ h1 = h;
+ x2 = bd->x;
+ y2 = bd->y;
+ w2 = bd->w;
+ h2 = bd->h;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if ((ok) && (bd->visible) &&
+ E_INTERSECTS(x1, y1, w1, h1, x2, y2, w2, h2))
+ {
+ int iw, ih;
+ int x0, x00, y0, y00;
+
+ x0 = x1;
+ if (x1 < x2)
+ x0 = x2;
+ x00 = (x1 + w1);
+ if ((x2 + w2) < (x1 + w1))
+ x00 = (x2 + w2);
+
+ y0 = y1;
+ if (y1 < y2)
+ y0 = y2;
+ y00 = (y1 + h1);
+ if ((y2 + h2) < (y1 + h1))
+ y00 = (y2 + h2);
+
+ iw = x00 - x0;
+ ih = y00 - y0;
+ ar += (iw * ih);
+ }
+ }
+ if (ar < area)
+ {
+ area = ar;
+ *rx = a_x[i + 1] - w;
+ *ry = a_y[j + 1] - h;
+ if (ar == 0)
+ goto done;
+ }
+ }
+ if ((a_x[i] < (con->w - w)) && (a_y[j + 1] - h > 0))
+ {
+ int ar = 0;
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+ int x1, y1, w1, h1, x2, y2, w2, h2;
+ int ok;
+
+ ok = 1;
+ bd = l->data;
+ x1 = a_x[i];
+ y1 = a_y[j + 1] - h;
+ w1 = w;
+ h1 = h;
+ x2 = bd->x;
+ y2 = bd->y;
+ w2 = bd->w;
+ h2 = bd->h;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if ((ok) && (bd->visible) &&
+ E_INTERSECTS(x1, y1, w1, h1, x2, y2, w2, h2))
+ {
+ int iw, ih;
+ int x0, x00, y0, y00;
+
+ x0 = x1;
+ if (x1 < x2)
+ x0 = x2;
+ x00 = (x1 + w1);
+ if ((x2 + w2) < (x1 + w1))
+ x00 = (x2 + w2);
+
+ y0 = y1;
+ if (y1 < y2)
+ y0 = y2;
+ y00 = (y1 + h1);
+ if ((y2 + h2) < (y1 + h1))
+ y00 = (y2 + h2);
+
+ iw = x00 - x0;
+ ih = y00 - y0;
+ ar += (iw * ih);
+ }
+ }
+ if (ar < area)
+ {
+ area = ar;
+ *rx = a_x[i];
+ *ry = a_y[j + 1] - h;
+ if (ar == 0)
+ goto done;
+ }
+ }
+ }
+ }
+ }
+ done:
+ E_FREE(a_x);
+ E_FREE(a_y);
+ return 1;
+}
--- /dev/null
+#ifndef E_PLACE_H
+#define E_PLACE_H
+
+int e_place_container_region_smart(E_Container *con, Evas_List *skiplist, int x, int y, int w, int h, int *rx, int *ry);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* externally accessible functions */
+void
+e_pointer_container_set(E_Container *con)
+{
+ Ecore_X_Cursor cur;
+ int w, h;
+ Evas_Object *o;
+ int *pix;
+
+ o = evas_object_image_add(con->bg_evas);
+ evas_object_image_file_set(o, e_path_find(path_images, "pointer.png"), NULL);
+ evas_object_image_size_get(o, &w, &h);
+ pix = evas_object_image_data_get(o, 0);
+ cur = ecore_x_cursor_new(con->win, pix, w, h, 0, 0);
+ evas_object_image_data_set(o, pix);
+ evas_object_del(o);
+ ecore_x_window_cursor_set(con->manager->root, cur);
+ ecore_x_window_cursor_set(con->win, cur);
+ ecore_x_cursor_free(cur);
+}
+
+void
+e_pointer_ecore_evas_set(Ecore_Evas *ee)
+{
+ Ecore_X_Window win;
+ Ecore_X_Cursor cur;
+ int w, h;
+ Evas_Object *o;
+ int *pix;
+ Evas *e;
+
+ e = ecore_evas_get(ee);
+ win = ecore_evas_software_x11_window_get(ee);
+ o = evas_object_image_add(e);
+ evas_object_image_file_set(o, e_path_find(path_images, "pointer.png"), NULL);
+ evas_object_image_size_get(o, &w, &h);
+ pix = evas_object_image_data_get(o, 0);
+ cur = ecore_x_cursor_new(win, pix, w, h, 0, 0);
+ evas_object_image_data_set(o, pix);
+ evas_object_del(o);
+ ecore_x_window_cursor_set(win, cur);
+ ecore_x_cursor_free(cur);
+}
--- /dev/null
+#ifndef E_POINTER_H
+#define E_POINTER_H
+
+void e_pointer_container_set(E_Container *con);
+void e_pointer_ecore_evas_set(Ecore_Evas *ee);
+
+#endif
--- /dev/null
+#include "e.h"
+
+typedef struct _E_Resist_Rect E_Resist_Rect;
+
+struct _E_Resist_Rect
+{
+ int x, y, w, h;
+ int v1, v2, v3, v4;
+};
+
+int
+e_resist_container_position(E_Container *con, Evas_List *skiplist,
+ int px, int py, int pw, int ph,
+ int x, int y, int w, int h,
+ int *rx, int *ry)
+{
+ int resist = 1;
+ int desk_resist = 32;
+ int win_resist = 12;
+ int dx, dy, d, pd;
+ int resist_x = 0, resist_y = 0;
+ Evas_List *l, *ll, *rects = NULL;
+ E_Resist_Rect *r;
+
+ /* FIXME: get resist values from config */
+
+ if (!resist)
+ {
+ *rx = x;
+ *ry = y;
+ return 0;
+ }
+ dx = x - px;
+ dy = y - py;
+ /* edges of screen */
+#define OBSTACLE(_x, _y, _w, _h, _resist) \
+ { \
+ r = E_NEW(E_Resist_Rect, 1); \
+ r->x = _x; r->y = _y; r->w = _w; r->h = _h; r->v1 = _resist; \
+ rects = evas_list_append(rects, r); \
+ }
+ OBSTACLE(-1000000, -1000000, 2000000 + con->w, 1000000,
+ desk_resist);
+ OBSTACLE(-1000000, -1000000, 1000000, 2000000 + con->h,
+ desk_resist);
+ OBSTACLE(-1000000, con->h, 2000000 + con->w, 1000000,
+ desk_resist);
+ OBSTACLE(con->w, -1000000, 1000000, 2000000 + con->h,
+ desk_resist);
+ /* FIXME: need to add resist or complete BLOCKS for things like ibar */
+ /* can add code here to add more fake obstacles with custom resist values */
+ /* here if need be - ie xinerama middle between screens and panels etc. */
+
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *bd;
+
+ bd = l->data;
+ if (bd->visible)
+ {
+ int ok;
+
+ ok = 1;
+ for (ll = skiplist; ll; ll = ll->next)
+ {
+ if (ll->data == bd)
+ {
+ ok = 0;
+ break;
+ }
+ }
+ if (ok)
+ {
+ r = E_NEW(E_Resist_Rect, 1);
+
+ r->x = bd->x;
+ r->y = bd->y;
+ r->w = bd->w;
+ r->h = bd->h;
+ r->v1 = win_resist;
+ rects = evas_list_append(rects, r);
+ }
+ }
+ }
+
+ for (l = rects; l; l = l->next)
+ {
+ r = l->data;
+ if (E_SPANS_COMMON(r->y, r->h, y, h))
+ {
+ if (dx > 0)
+ {
+ /* moving right - check left edge of windows against right */
+ d = r->x - (x + w);
+ pd = r->x - (px + pw);
+ if ((d < 0) && (pd >= 0) && (d >= -r->v1))
+ {
+ if (resist_x > d)
+ resist_x = d;
+ }
+ }
+ else if (dx < 0)
+ {
+ /* moving left - check right edge of windows against left */
+ d = x - (r->x + r->w);
+ pd = px - (r->x + r->w);
+ if ((d < 0) && (pd >= 0) && (d >= -r->v1))
+ {
+ if (-resist_x > d)
+ resist_x = -d;
+ }
+ }
+ }
+ if (E_SPANS_COMMON(r->x, r->w, x, w))
+ {
+ if (dy > 0)
+ {
+ /* moving down - check top edge of windows against bottom */
+ d = r->y - (y + h);
+ pd = r->y - (py + ph);
+ if ((d < 0) && (pd >= 0) && (d >= -r->v1))
+ {
+ if (resist_y > d)
+ resist_y = d;
+ }
+ }
+ else if (dy < 0)
+ {
+ /* moving up - check bottom edge of windows against top */
+ d = y - (r->y + r->h);
+ pd = py - (r->y + r->h);
+ if ((d < 0) && (pd >= 0) && (d >= -r->v1))
+ {
+ if (-resist_y > d)
+ resist_y = -d;
+ }
+ }
+ }
+ }
+ if (rects)
+ {
+ for (l = rects; l; l = l->next)
+ {
+ E_FREE(l->data);
+ }
+ evas_list_free(rects);
+ }
+ if (dx != 0)
+ *rx = x + resist_x;
+ else
+ *rx = x;
+ if (dy != 0)
+ *ry = y + resist_y;
+ else
+ *ry = y;
+ return 1;
+}
--- /dev/null
+#ifndef E_RESIST_H
+#define E_RESIST_H
+
+int e_resist_container_position(E_Container *con, Evas_List *skiplist, int px, int py, int pw, int ph, int x, int y, int w, int h, int *rx, int *ry);
+
+#endif
--- /dev/null
+#include "e.h"
+
+/* externally accessible functions */
+char *
+e_user_homedir_get(void)
+{
+ char *homedir;
+
+ homedir = getenv("HOME");
+ if (!homedir) return strdup("/tmp");
+ return strdup(homedir);
+}
--- /dev/null
+#ifndef E_USER_H
+#define E_USER_H
+
+char *e_user_homedir_get(void);
+
+#endif
--- /dev/null
+#include "e.h"
+
+typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info;
+
+struct _E_Util_Fake_Mouse_Up_Info
+{
+ E_Container *con;
+ int button;
+};
+
+/* local subsystem functions */
+static void _e_util_container_fake_mouse_up_cb(void *data);
+static int _e_util_wakeup_cb(void *data);
+
+/* local subsystem globals */
+static Ecore_Timer *_e_util_dummy_timer = NULL;
+
+/* externally accessible functions */
+void
+e_util_container_fake_mouse_up_later(E_Container *con, int button)
+{
+ E_Util_Fake_Mouse_Up_Info *info;
+
+ info = calloc(1, sizeof(E_Util_Fake_Mouse_Up_Info));
+ if (info)
+ {
+ info->con = con;
+ info->button = button;
+ e_object_ref(E_OBJECT(info->con));
+ ecore_job_add(_e_util_container_fake_mouse_up_cb, info);
+ }
+}
+
+void
+e_util_container_fake_mouse_up_all_later(E_Container *con)
+{
+ e_util_container_fake_mouse_up_later(con, 1);
+ e_util_container_fake_mouse_up_later(con, 2);
+ e_util_container_fake_mouse_up_later(con, 3);
+}
+
+void
+e_util_wakeup(void)
+{
+ if (_e_util_dummy_timer) return;
+ _e_util_dummy_timer = ecore_timer_add(0.0, _e_util_wakeup_cb, NULL);
+}
+
+/* local subsystem functions */
+static void
+_e_util_container_fake_mouse_up_cb(void *data)
+{
+ E_Util_Fake_Mouse_Up_Info *info;
+
+ info = data;
+ if (info)
+ {
+ evas_event_feed_mouse_up(info->con->bg_evas, info->button);
+ e_object_unref(E_OBJECT(info->con));
+ free(info);
+ }
+}
+
+static int
+_e_util_wakeup_cb(void *data)
+{
+ _e_util_dummy_timer = NULL;
+ return 0;
+}
--- /dev/null
+#ifndef E_UTILS_H
+#define E_UTILS_H
+
+void e_util_container_fake_mouse_up_later(E_Container *con, int button);
+void e_util_container_fake_mouse_up_all_later(E_Container *con);
+void e_util_wakeup(void);
+
+#endif
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+INCLUDES = -I/usr/local/include \
+ -I$(includedir)
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = \
+test \
+ibar \
+dropshadow
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = dropshadow
+
+# data files for the module
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)
+files_DATA = \
+module_icon.png \
+menu_icon_close.png \
+menu_icon_dark.png \
+menu_icon_far.png \
+menu_icon_fuzzy.png \
+menu_icon_light.png \
+menu_icon_medium.png \
+menu_icon_sharp.png \
+menu_icon_underneath.png \
+menu_icon_very_dark.png \
+menu_icon_very_far.png \
+menu_icon_very_fuzzy.png \
+menu_icon_very_light.png \
+menu_icon_very_sharp.png
+EXTRA_DIST = $(files_DATA)
+
+# the module .so file
+INCLUDES = -I. \
+ -I$(top_srcdir) \
+ -I$(includedir) \
+ -I$(top_srcdir)$(MODULE) \
+ -I$(top_srcdir)/src/bin \
+ -I$(top_srcdir)/src/lib \
+ -I$(top_srcdir)/src/modules \
+ @e_cflags@
+pkgdir = $(libdir)/enlightenment/modules/$(MODULE)
+pkg_LTLIBRARIES = module.la
+module_la_SOURCES = e_mod_main.c \
+ e_mod_main.h
+module_la_LIBADD = @e_libs@ @dlopen_libs@
+module_la_LDFLAGS = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
--- /dev/null
+#include "e.h"
+#include "e_mod_main.h"
+
+/* TODO List:
+ *
+ * * bug in shadow_x < 0 and shadow_y < 0 needs to be fixed (not urgent though)
+ * * bug in ecore_config ? when we change shadow darkness in examine, _ds_config_listen_shadow_darkness does not get called - only when we change other values like x, y, blur and when it gets called we are not getting the value set in examine - always getting 0.5
+ * * add alpha-pixel only pixel space to image objects in evas and make use of it to save cpu and ram
+ * * when blurring ALSO cut out the overlayed rect frrom the blur algorithm
+ * * handle shaped windows efficiently (as possible).
+ *
+ */
+
+/* module private routines */
+static Dropshadow *_ds_init(E_Module *m);
+static void _ds_shutdown(Dropshadow *ds);
+static int _ds_config_listen_shadow_x(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _ds_config_listen_shadow_y(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _ds_config_listen_blur(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static int _ds_config_listen_shadow_darkness(const char *key, const Ecore_Config_Type type, const int tag, void *data);
+static E_Menu *_ds_config_menu_new(Dropshadow *ds);
+static void _ds_menu_very_fuzzy(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_fuzzy(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_medium(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_sharp(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_very_sharp(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_very_dark(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_dark(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_light(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_very_light(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_very_far(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_far(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_close(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_very_close(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_extremely_close(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_menu_under(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ds_container_shapes_add(Dropshadow *ds, E_Container *con);
+static void _ds_shape_change(void *data, E_Container_Shape *es, E_Container_Shape_Change ch);
+static Shadow *_ds_shadow_find(Dropshadow *ds, E_Container_Shape *es);
+static Shadow *_ds_shadow_add(Dropshadow *ds, E_Container_Shape *es);
+static void _ds_shadow_obj_init(Shadow *sh);
+static void _ds_shadow_obj_shutdown(Shadow *sh);
+static void _ds_shadow_del(Shadow *sh);
+static void _ds_shadow_show(Shadow *sh);
+static void _ds_shadow_hide(Shadow *sh);
+static void _ds_shadow_move(Shadow *sh, int x, int y);
+static void _ds_shadow_resize(Shadow *sh, int w, int h);
+static void _ds_shadow_shaperects(Shadow *sh);
+static int _ds_shadow_reshape(void *data);
+static void _ds_shadow_recalc(Shadow *sh);
+static void _ds_shadow_object_pixels_set(Evas_Object *o, unsigned char *pix, int pix_w, int pix_h, int sx, int sy, int sw, int sh);
+static void _ds_config_darkness_set(Dropshadow *ds, double v);
+static void _ds_config_shadow_xy_set(Dropshadow *ds, int x, int y);
+static void _ds_config_blur_set(Dropshadow *ds, int blur);
+static void _ds_blur_init(Dropshadow *ds);
+static double _ds_gauss_int(double x);
+static void _ds_gauss_blur_h(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, unsigned char *lut, int blur, int rx, int ry, int rxx, int ryy);
+static void _ds_gauss_blur_v(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, unsigned char *lut, int blur, int rx, int ry, int rxx, int ryy);
+static void _ds_gauss_fill(unsigned char *pix, int pix_w, int pix_h, unsigned char v, int rx, int ry, int rxx, int ryy);
+static void _ds_gauss_copy(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, int rx, int ry, int rxx, int ryy);
+static void _ds_gauss_blur(unsigned char *pix, int pix_w, int pix_h, unsigned char *lut, int blur, int sx, int sy, int sw, int sh);
+
+/* public module routines. all modules must have these */
+void *
+init(E_Module *m)
+{
+ Dropshadow *ds;
+
+ if (m->api->version < E_MODULE_API_VERSION)
+ {
+ e_error_dialog_show("Module API Error",
+ "Error initializing Module: dropshadow\n"
+ "It requires a minimum module API version of: %i.\n"
+ "The module API advertized by Enlightenment is: %i.\n"
+ "Aborting module.",
+ E_MODULE_API_VERSION,
+ m->api->version);
+ return NULL;
+ }
+ ds = _ds_init(m);
+ m->config_menu = _ds_config_menu_new(ds);
+ return ds;
+}
+
+int
+shutdown(E_Module *m)
+{
+ Dropshadow *ds;
+
+ ds = m->data;
+ if (ds)
+ {
+ if (m->config_menu)
+ {
+ e_menu_deactivate(m->config_menu);
+ e_object_del(E_OBJECT(m->config_menu));
+ m->config_menu = NULL;
+ }
+ _ds_shutdown(ds);
+ }
+ return 1;
+}
+
+int
+save(E_Module *m)
+{
+ Dropshadow *ds;
+
+ ds = m->data;
+ if (!ds) return;
+ ecore_config_int_set("e.module.dropshadow.shadow.x", ds->conf.shadow_x);
+ ecore_config_int_set("e.module.dropshadow.shadow.y", ds->conf.shadow_y);
+ ecore_config_int_set("e.module.dropshadow.blur", ds->conf.blur_size);
+ ecore_config_float_set("e.module.dropshadow.shadow.darkness", ds->conf.shadow_darkness);
+ return 1;
+}
+
+int
+info(E_Module *m)
+{
+ char buf[4096];
+
+ m->label = strdup("Dropshadow");
+ snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
+ m->icon_file = strdup(buf);
+ return 1;
+}
+
+int
+about(E_Module *m)
+{
+ e_error_dialog_show("Enlightenment Dropshadow Module",
+ "This is the dropshadow module that allows dropshadows to be cast\n"
+ "on the desktop background - without an special X-Server extensions\n"
+ "or hardware acceleration.");
+ return 1;
+}
+
+/* module private routines */
+static Dropshadow *
+_ds_init(E_Module *m)
+{
+ Dropshadow *ds;
+ Evas_List *managers, *l, *l2;
+
+ ds = calloc(1, sizeof(Dropshadow));
+ if (!ds) return NULL;
+
+ ds->module = m;
+ ecore_config_int_create_bound
+ ("e.module.dropshadow.shadow.x",
+ 4, -200, 200, 1,
+ 0, "",
+ "Dropshadow module: Shadow X offset");
+ ecore_config_int_create_bound
+ ("e.module.dropshadow.shadow.y",
+ 4, -200, 200, 1,
+ 0, "",
+ "Dropshadow module: Shadow Y offset");
+ ecore_config_int_create_bound
+ ("e.module.dropshadow.blur",
+ 10, 1, 120, 1,
+ 0, "",
+ "Dropshadow module: Shadow blur radius");
+ ecore_config_float_create_bound
+ ("e.module.dropshadow.shadow.darkness",
+ 0.5, 0.0, 1.0, 0.001,
+ 0, "",
+ "Dropshadow module: Shadow darkness");
+
+ ecore_config_load();
+
+ ds->conf.shadow_x = ecore_config_int_get("e.module.dropshadow.shadow.x");
+ ecore_config_listen("e.module.dropshadow.shadow.x",
+ "e.module.dropshadow.shadow.x",
+ _ds_config_listen_shadow_x,
+ 0, ds);
+ ds->conf.shadow_y = ecore_config_int_get("e.module.dropshadow.shadow.y");
+ ecore_config_listen("e.module.dropshadow.shadow.y",
+ "e.module.dropshadow.shadow.y",
+ _ds_config_listen_shadow_y,
+ 0, ds);
+ ds->conf.blur_size = ecore_config_int_get("e.module.dropshadow.blur");
+ ecore_config_listen("e.module.dropshadow.blur",
+ "e.module.dropshadow.blur",
+ _ds_config_listen_blur,
+ 0, ds);
+ ds->conf.shadow_darkness = ecore_config_float_get("e.module.dropshadow.shadow.darkness");
+ ecore_config_listen("e.module.dropshadow.shadow.darkness",
+ "e.module.dropshadow.shadow.darkness",
+ _ds_config_listen_shadow_darkness,
+ 0, ds);
+
+ _ds_blur_init(ds);
+
+ managers = e_manager_list();
+ for (l = managers; l; l = l->next)
+ {
+ E_Manager *man;
+
+ man = l->data;
+ for (l2 = man->containers; l2; l2 = l2->next)
+ {
+ E_Container *con;
+
+ con = l2->data;
+ ds->cons = evas_list_append(ds->cons, con);
+ e_container_shape_change_callback_add(con, _ds_shape_change, ds);
+ _ds_container_shapes_add(ds, con);
+ }
+ }
+ ds->idler_before = e_main_idler_before_add(_ds_shadow_reshape, ds, 0);
+ return ds;
+}
+
+static void
+_ds_shutdown(Dropshadow *ds)
+{
+ ecore_config_deaf("e.module.dropshadow.shadow.x",
+ "e.module.dropshadow.shadow.x",
+ _ds_config_listen_shadow_x);
+ ecore_config_deaf("e.module.dropshadow.shadow.y",
+ "e.module.dropshadow.shadow.y",
+ _ds_config_listen_shadow_y);
+ ecore_config_deaf("e.module.dropshadow.blur",
+ "e.module.dropshadow.blur",
+ _ds_config_listen_blur);
+ ecore_config_deaf("e.module.dropshadow.shadow.darkness",
+ "e.module.dropshadow.shadow.darkness",
+ _ds_config_listen_shadow_darkness);
+ while (ds->cons)
+ {
+ E_Container *con;
+
+ con = ds->cons->data;
+ ds->cons = evas_list_remove_list(ds->cons, ds->cons);
+ e_container_shape_change_callback_del(con, _ds_shape_change, ds);
+ }
+ while (ds->shadows)
+ {
+ Shadow *sh;
+
+ sh = ds->shadows->data;
+ _ds_shadow_del(sh);
+ }
+ if (ds->idler_before) e_main_idler_before_del(ds->idler_before);
+ if (ds->table.gauss) free(ds->table.gauss);
+ free(ds);
+}
+
+static int
+_ds_config_listen_shadow_x(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ Dropshadow *ds;
+ int v;
+
+ ds = data;
+ v = ecore_config_int_get("e.module.dropshadow.shadow.x");
+ if (v < -200) v = -200;
+ else if (v > 200) v = 200;
+ _ds_config_shadow_xy_set(ds, v, ds->conf.shadow_y);
+ return 1;
+}
+
+static int
+_ds_config_listen_shadow_y(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ Dropshadow *ds;
+ int v;
+
+ ds = data;
+ v = ecore_config_int_get("e.module.dropshadow.shadow.y");
+ if (v < -200) v = -200;
+ else if (v > 200) v = 200;
+ _ds_config_shadow_xy_set(ds, ds->conf.shadow_x, v);
+ return 1;
+}
+
+static int
+_ds_config_listen_blur(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ Dropshadow *ds;
+ int v;
+
+ ds = data;
+ v = ecore_config_int_get("e.module.dropshadow.blur");
+ if (v < 1) v = 1;
+ else if (v > 120) v= 120;
+ _ds_config_blur_set(ds, v);
+ return 1;
+}
+
+static int
+_ds_config_listen_shadow_darkness(const char *key, const Ecore_Config_Type type, const int tag, void *data)
+{
+ Dropshadow *ds;
+ double v;
+
+ ds = data;
+ v = ecore_config_float_get("e.module.dropshadow.shadow.darkness");
+ if (v < 0.0) v = 0.0;
+ else if (v > 1.0) v = 1.0;
+ _ds_config_darkness_set(ds, v);
+ return 1;
+}
+
+static E_Menu *
+_ds_config_menu_new(Dropshadow *ds)
+{
+ E_Menu *mn;
+ E_Menu_Item *mi;
+ char buf[4096];
+
+ mn = e_menu_new();
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Fuzzy");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_fuzzy.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ if (ds->conf.blur_size == 80) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_fuzzy, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Fuzzy");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_fuzzy.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ if (ds->conf.blur_size == 40) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_fuzzy, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Medium");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_medium.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ if (ds->conf.blur_size == 20) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_medium, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Sharp");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_sharp.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ if (ds->conf.blur_size == 10) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_sharp, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Sharp");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_sharp.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 1);
+ if (ds->conf.blur_size == 5) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_sharp, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Dark");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_dark.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ds->conf.shadow_darkness == 1.0) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_dark, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Dark");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_dark.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ds->conf.shadow_darkness == 0.75) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_dark, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Light");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_light.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ds->conf.shadow_darkness == 0.5) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_light, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Light");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_light.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ds->conf.shadow_darkness == 0.25) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_light, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Far");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_far.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 32) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_far, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Far");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_very_far.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 16) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_far, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Close");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_far.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 8) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_close, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Very Close");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_close.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 4) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_very_close, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Extremely Close");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_underneath.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 2) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_extremely_close, ds);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Immediately Underneath");
+ snprintf(buf, sizeof(buf), "%s/menu_icon_underneath.png", e_module_dir_get(ds->module));
+ e_menu_item_icon_file_set(mi, buf);
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 3);
+ if (ds->conf.shadow_x == 0) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ds_menu_under, ds);
+ return mn;
+}
+
+static void
+_ds_menu_very_fuzzy(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_blur_set(ds, 80);
+}
+
+static void
+_ds_menu_fuzzy(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_blur_set(ds, 40);
+}
+
+static void
+_ds_menu_medium(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_blur_set(ds, 20);
+}
+
+static void
+_ds_menu_sharp(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_blur_set(ds, 10);
+}
+
+static void
+_ds_menu_very_sharp(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_blur_set(ds, 5);
+}
+
+static void
+_ds_menu_very_dark(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_darkness_set(ds, 1.0);
+}
+
+static void
+_ds_menu_dark(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_darkness_set(ds, 0.75);
+}
+
+static void
+_ds_menu_light(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_darkness_set(ds, 0.5);
+}
+
+static void
+_ds_menu_very_light(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_darkness_set(ds, 0.25);
+}
+
+static void
+_ds_menu_very_far(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 32, 32);
+}
+
+static void
+_ds_menu_far(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 16, 16);
+}
+
+static void
+_ds_menu_close(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 8, 8);
+}
+
+static void
+_ds_menu_very_close(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 4, 4);
+}
+
+static void
+_ds_menu_extremely_close(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 2, 2);
+}
+
+static void
+_ds_menu_under(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ Dropshadow *ds;
+
+ ds = data;
+ _ds_config_shadow_xy_set(ds, 0, 0);
+}
+
+static void
+_ds_container_shapes_add(Dropshadow *ds, E_Container *con)
+{
+ Evas_List *shapes, *l;
+
+ shapes = e_container_shape_list_get(con);
+ for (l = shapes; l; l = l->next)
+ {
+ E_Container_Shape *es;
+ Shadow *sh;
+ int x, y, w, h;
+
+ es = l->data;
+ sh = _ds_shadow_add(ds, es);
+ e_container_shape_geometry_get(es, &x, &y, &w, &h);
+ _ds_shadow_move(sh, x, y);
+ _ds_shadow_resize(sh, w, h);
+ if (es->visible) _ds_shadow_show(sh);
+ }
+}
+
+static void
+_ds_shape_change(void *data, E_Container_Shape *es, E_Container_Shape_Change ch)
+{
+ Dropshadow *ds;
+ Shadow *sh;
+ int x, y, w, h;
+
+ ds = data;
+ switch (ch)
+ {
+ case E_CONTAINER_SHAPE_ADD:
+ _ds_shadow_add(ds, es);
+ break;
+ case E_CONTAINER_SHAPE_DEL:
+ sh = _ds_shadow_find(ds, es);
+ if (sh) _ds_shadow_del(sh);
+ break;
+ case E_CONTAINER_SHAPE_SHOW:
+ sh = _ds_shadow_find(ds, es);
+ if (sh) _ds_shadow_show(sh);
+ break;
+ case E_CONTAINER_SHAPE_HIDE:
+ sh = _ds_shadow_find(ds, es);
+ if (sh) _ds_shadow_hide(sh);
+ break;
+ case E_CONTAINER_SHAPE_MOVE:
+ sh = _ds_shadow_find(ds, es);
+ e_container_shape_geometry_get(es, &x, &y, &w, &h);
+ if (sh) _ds_shadow_move(sh, x, y);
+ break;
+ case E_CONTAINER_SHAPE_RESIZE:
+ sh = _ds_shadow_find(ds, es);
+ e_container_shape_geometry_get(es, &x, &y, &w, &h);
+ if (sh) _ds_shadow_resize(sh, w, h);
+ break;
+ case E_CONTAINER_SHAPE_RECTS:
+ sh = _ds_shadow_find(ds, es);
+ if (sh) _ds_shadow_shaperects(sh);
+ break;
+ default:
+ break;
+ }
+}
+
+static Shadow *
+_ds_shadow_find(Dropshadow *ds, E_Container_Shape *es)
+{
+ Evas_List *l;
+
+ for (l = ds->shadows; l; l = l->next)
+ {
+ Shadow *sh;
+
+ sh = l->data;
+ if (sh->shape == es) return sh;
+ }
+ return NULL;
+}
+
+static Shadow *
+_ds_shadow_add(Dropshadow *ds, E_Container_Shape *es)
+{
+ Shadow *sh;
+
+ sh = calloc(1, sizeof(Shadow));
+ ds->shadows = evas_list_append(ds->shadows, sh);
+ sh->ds = ds;
+ sh->shape = es;
+ e_object_ref(E_OBJECT(sh->shape));
+ _ds_shadow_obj_init(sh);
+ return sh;
+}
+
+static void
+_ds_shadow_obj_init(Shadow *sh)
+{
+ E_Container *con;
+ int i;
+
+ con = e_container_shape_container_get(sh->shape);
+ for (i = 0; i < 4; i++)
+ {
+ sh->object[i] = evas_object_image_add(con->bg_evas);
+ evas_object_layer_set(sh->object[i], 10);
+ evas_object_pass_events_set(sh->object[i], 1);
+ evas_object_move(sh->object[i], 0, 0);
+ evas_object_resize(sh->object[i], 0, 0);
+ evas_object_color_set(sh->object[i],
+ 255, 255, 255,
+ 255 * sh->ds->conf.shadow_darkness);
+ }
+}
+
+static void
+_ds_shadow_obj_shutdown(Shadow *sh)
+{
+ evas_object_del(sh->object[0]);
+ evas_object_del(sh->object[1]);
+ evas_object_del(sh->object[2]);
+ evas_object_del(sh->object[3]);
+ sh->object[0] = NULL;
+ sh->object[1] = NULL;
+ sh->object[2] = NULL;
+ sh->object[3] = NULL;
+}
+
+static void
+_ds_shadow_del(Shadow *sh)
+{
+ sh->ds->shadows = evas_list_remove(sh->ds->shadows, sh);
+ _ds_shadow_obj_shutdown(sh);
+ e_object_unref(E_OBJECT(sh->shape));
+ free(sh);
+}
+
+static void
+_ds_shadow_show(Shadow *sh)
+{
+ if (sh->square)
+ {
+ evas_object_show(sh->object[0]);
+ evas_object_show(sh->object[1]);
+ evas_object_show(sh->object[2]);
+ evas_object_show(sh->object[3]);
+ }
+ else
+ {
+ evas_object_show(sh->object[0]);
+ }
+}
+
+static void
+_ds_shadow_hide(Shadow *sh)
+{
+ if (sh->square)
+ {
+ evas_object_hide(sh->object[0]);
+ evas_object_hide(sh->object[1]);
+ evas_object_hide(sh->object[2]);
+ evas_object_hide(sh->object[3]);
+ }
+ else
+ {
+ evas_object_hide(sh->object[0]);
+ }
+}
+
+static void
+_ds_shadow_move(Shadow *sh, int x, int y)
+{
+ sh->x = x;
+ sh->y = y;
+ if (sh->square)
+ {
+ evas_object_move(sh->object[0],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->ds->conf.shadow_y - sh->ds->conf.blur_size);
+ evas_object_move(sh->object[1],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y);
+ evas_object_move(sh->object[2],
+ sh->x + sh->w,
+ sh->y);
+ evas_object_move(sh->object[3],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->h);
+ }
+ else
+ {
+ evas_object_move(sh->object[0],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->ds->conf.shadow_y - sh->ds->conf.blur_size);
+ }
+}
+
+static void
+_ds_shadow_resize(Shadow *sh, int w, int h)
+{
+ sh->w = w;
+ sh->h = h;
+ sh->reshape = 1;
+}
+
+static void
+_ds_shadow_shaperects(Shadow *sh)
+{
+ sh->reshape = 1;
+}
+
+static int
+_ds_shadow_reshape(void *data)
+{
+ Dropshadow *ds;
+ Evas_List *l;
+
+ ds = data;
+ for (l = ds->shadows; l; l = l->next)
+ {
+ Shadow *sh;
+
+ sh = l->data;
+ if (sh->reshape)
+ {
+ sh->reshape = 0;
+ _ds_shadow_recalc(sh);
+ }
+ }
+ return 1;
+}
+
+static void
+_ds_shadow_recalc(Shadow *sh)
+{
+ Evas_List *rects;
+ unsigned char *pix;
+ int pix_w, pix_h;
+ int sx, sy, sxx, syy, ssw, ssh;
+
+ rects = e_container_shape_rects_get(sh->shape);
+ if (rects)
+ {
+ Evas_List *l;
+
+ sh->square = 0;
+ pix_w = sh->w + (sh->ds->conf.blur_size * 2);
+ pix_h = sh->h + (sh->ds->conf.blur_size * 2);
+ pix = calloc(1, pix_w * pix_h * sizeof(unsigned char));
+
+ /* for every rect in the shape - fill it */
+ for (l = rects; l; l = l->next)
+ {
+ E_Rect *r;
+
+ r = l->data;
+ _ds_gauss_fill(pix, pix_w, pix_h, 255, r->x, r->y, r->x + r->w, r->y + r->h);
+ }
+ /* FIXME: need to find an optimal "inner rect" fromt he above rect list */
+/*
+ sx = sh->ds->conf.blur_size;
+ sy = sh->ds->conf.blur_size;
+ sxx = pix_w - sh->ds->conf.blur_size;
+ syy = pix_h - sh->ds->conf.blur_size;
+*/
+ sx = 0;
+ sy = 0;
+ sxx = 0;
+ syy = 0;
+
+ _ds_gauss_blur(pix, pix_w, pix_h,
+ sh->ds->table.gauss, sh->ds->conf.blur_size,
+ sx, sy, sxx, syy);
+ evas_object_move(sh->object[0],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->ds->conf.shadow_y - sh->ds->conf.blur_size);
+ sx = 0;
+ sy = 0;
+ ssw = sh->w + (sh->ds->conf.blur_size * 2);
+ ssh = sh->h + (sh->ds->conf.blur_size * 2);
+ _ds_shadow_object_pixels_set(sh->object[0], pix, pix_w, pix_h,
+ sx, sy, ssw, ssh);
+ if (evas_object_visible_get(sh->object[0]))
+ {
+ evas_object_hide(sh->object[1]);
+ evas_object_hide(sh->object[2]);
+ evas_object_hide(sh->object[3]);
+ }
+ free(pix);
+ }
+ else
+ {
+ sh->square = 1;
+ pix_w = sh->w + (sh->ds->conf.blur_size * 2);
+ pix_h = sh->h + (sh->ds->conf.blur_size * 2);
+ pix = calloc(1, pix_w * pix_h * sizeof(unsigned char));
+ sx = sh->ds->conf.blur_size;
+ sy = sh->ds->conf.blur_size;
+ sxx = pix_w - sh->ds->conf.blur_size;
+ syy = pix_h - sh->ds->conf.blur_size;
+ _ds_gauss_fill(pix, pix_w, pix_h, 255, sx, sy, sxx, syy);
+ sx = sh->ds->conf.blur_size * 2;
+ sy = sh->ds->conf.blur_size * 2;
+ ssw = pix_w - (sh->ds->conf.blur_size * 4);
+ ssh = pix_h - (sh->ds->conf.blur_size * 4);
+ _ds_gauss_blur(pix, pix_w, pix_h,
+ sh->ds->table.gauss, sh->ds->conf.blur_size,
+ sx, sy, ssw, ssh);
+ evas_object_move(sh->object[0],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->ds->conf.shadow_y - sh->ds->conf.blur_size);
+ evas_object_move(sh->object[1],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y);
+ evas_object_move(sh->object[2],
+ sh->x + sh->w,
+ sh->y);
+ evas_object_move(sh->object[3],
+ sh->x + sh->ds->conf.shadow_x - sh->ds->conf.blur_size,
+ sh->y + sh->h);
+ sx = 0;
+ sy = 0;
+ ssw = sh->w + (sh->ds->conf.blur_size * 2);
+ ssh = sh->ds->conf.blur_size - sh->ds->conf.shadow_y;
+ _ds_shadow_object_pixels_set(sh->object[0], pix, pix_w, pix_h,
+ sx, sy, ssw, ssh);
+ sx = 0;
+ sy = sh->ds->conf.blur_size - sh->ds->conf.shadow_y;
+ ssw = sh->ds->conf.blur_size - sh->ds->conf.shadow_x;
+ ssh = sh->h;
+ _ds_shadow_object_pixels_set(sh->object[1], pix, pix_w, pix_h,
+ sx, sy, ssw, ssh);
+ sx = sh->ds->conf.blur_size - sh->ds->conf.shadow_y + sh->w;
+ sy = sh->ds->conf.blur_size - sh->ds->conf.shadow_y;
+ ssw = sh->ds->conf.blur_size + sh->ds->conf.shadow_x;
+ ssh = sh->h;
+ _ds_shadow_object_pixels_set(sh->object[2], pix, pix_w, pix_h,
+ sx, sy, ssw, ssh);
+ sx = 0;
+ sy = sh->ds->conf.blur_size - sh->ds->conf.shadow_y + sh->h;
+ ssw = sh->w + (sh->ds->conf.blur_size * 2);
+ ssh = sh->ds->conf.blur_size + sh->ds->conf.shadow_y;
+ _ds_shadow_object_pixels_set(sh->object[3], pix, pix_w, pix_h,
+ sx, sy, ssw, ssh);
+ if (evas_object_visible_get(sh->object[0]))
+ {
+ evas_object_show(sh->object[1]);
+ evas_object_show(sh->object[2]);
+ evas_object_show(sh->object[3]);
+ }
+ free(pix);
+ }
+}
+
+static void
+_ds_shadow_object_pixels_set(Evas_Object *o, unsigned char *pix, int pix_w, int pix_h, int sx, int sy, int sw, int sh)
+{
+ unsigned char *p;
+ unsigned int *pix2, *p2;
+ int x, y;
+
+ if (sw < 0) sw = 0;
+ if (sh < 0) sh = 0;
+ evas_object_image_size_set(o, sw, sh);
+ evas_object_resize(o, sw, sh);
+ evas_object_image_fill_set(o, 0, 0, sw, sh);
+ evas_object_image_alpha_set(o, 1);
+ evas_object_image_smooth_scale_set(o, 0);
+ pix2 = evas_object_image_data_get(o, 1);
+ if (pix2)
+ {
+ if ((sy >= 0) && (sx >= 0))
+ {
+ p2 = pix2;
+ for (y = 0; y < sh; y++)
+ {
+ p = pix + ((y + sy) * pix_w) + sx;
+ for (x = 0; x < sw; x++)
+ {
+ *p2 = ((*p) << 24);
+ p2++;
+ p++;
+ }
+ }
+ }
+ else if (sy < 0)
+ {
+ p2 = pix2;
+ for (y = 0; y < (-sy); y++)
+ {
+ for (x = 0; x < sw; x++)
+ {
+ *p2 = 0;
+ p2++;
+ }
+ }
+ sh += sy;
+ sy = 0;
+ for (y = 0; y < sh; y++)
+ {
+ p = pix + ((y + sy) * pix_w) + sx;
+ for (x = 0; x < sw; x++)
+ {
+ *p2 = ((*p) << 24);
+ p2++;
+ p++;
+ }
+ }
+ }
+ else if (sx < 0)
+ {
+ int ox;
+
+ ox = 0;
+ for (y = 0; y < sh; y++)
+ {
+ p2 = pix2 + (y * sw);
+ for (x = 0; x < (-sx); x++)
+ {
+ *p2 = 0;
+ p2++;
+ }
+ }
+ sw += sx;
+ ox = -sx;
+ sx = 0;
+ for (y = 0; y < sh; y++)
+ {
+ p2 = pix2 + (y * sw) + ox;
+ p = pix + ((y + sy) * pix_w) + sx;
+ for (x = 0; x < sw; x++)
+ {
+ *p2 = ((*p) << 24);
+ p2++;
+ p++;
+ }
+ }
+ }
+ evas_object_image_data_set(o, pix2);
+ evas_object_image_data_update_add(o, 0, 0, sw, sh);
+ }
+}
+
+static void
+_ds_config_darkness_set(Dropshadow *ds, double v)
+{
+ Evas_List *l;
+
+ if (v < 0.0) v = 0.0;
+ else if (v > 1.0) v = 1.0;
+ if (ds->conf.shadow_darkness == v) return;
+ ds->conf.shadow_darkness = v;
+ for (l = ds->shadows; l; l = l->next)
+ {
+ Shadow *sh;
+ int i;
+
+ sh = l->data;
+ for (i = 0; i < 4; i++)
+ evas_object_color_set(sh->object[i],
+ 255, 255, 255,
+ 255 * ds->conf.shadow_darkness);
+ }
+ e_config_save_queue();
+}
+
+static void
+_ds_config_shadow_xy_set(Dropshadow *ds, int x, int y)
+{
+ Evas_List *l;
+
+ if ((ds->conf.shadow_x == x) && (ds->conf.shadow_y == y)) return;
+ ds->conf.shadow_x = x;
+ ds->conf.shadow_y = y;
+ for (l = ds->shadows; l; l = l->next)
+ {
+ Shadow *sh;
+
+ sh = l->data;
+ _ds_shadow_shaperects(sh);
+ }
+ e_config_save_queue();
+}
+
+static void
+_ds_config_blur_set(Dropshadow *ds, int blur)
+{
+ Evas_List *l;
+
+ if (blur < 0) blur = 0;
+ if (ds->conf.blur_size == blur) return;
+ ds->conf.blur_size = blur;
+
+ _ds_blur_init(ds);
+ for (l = ds->shadows; l; l = l->next)
+ {
+ Shadow *sh;
+
+ sh = l->data;
+ _ds_shadow_shaperects(sh);
+ }
+ e_config_save_queue();
+}
+
+static void
+_ds_blur_init(Dropshadow *ds)
+{
+ int i;
+
+ if (ds->table.gauss) free(ds->table.gauss);
+ ds->table.gauss_size = (ds->conf.blur_size * 2) - 1;
+ ds->table.gauss = calloc(1, ds->table.gauss_size * sizeof(unsigned char));
+
+ ds->table.gauss[ds->conf.blur_size - 1] = 255;
+ for (i = 1; i < (ds->conf.blur_size - 1); i++)
+ {
+ double v;
+
+ v = (double)i / (ds->conf.blur_size - 2);
+ ds->table.gauss[ds->conf.blur_size - 1 + i] =
+ ds->table.gauss[ds->conf.blur_size - 1 - i] =
+ _ds_gauss_int(-1.5 + (v * 3.0)) * 255.0;
+ }
+}
+
+static double
+_ds_gauss_int(double x)
+{
+ double x2;
+ double x3;
+
+ if (x > 1.5) return 0.0;
+ if (x < -1.5) return 1.0;
+
+ x2 = x * x;
+ x3 = x2 * x;
+
+ if (x > 0.5)
+ return .5625 - ( x3 * (1.0 / 6.0) - 3 * x2 * (1.0 / 4.0) + 1.125 * x);
+
+ if (x > -0.5)
+ return 0.5 - (0.75 * x - x3 * (1.0 / 3.0));
+
+ return 0.4375 + (-x3 * (1.0 / 6.0) - 3 * x2 * (1.0 / 4.0) - 1.125 * x);
+}
+
+static void
+_ds_gauss_blur_h(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, unsigned char *lut, int blur, int rx, int ry, int rxx, int ryy)
+{
+ int x, y;
+ int i, sum, weight, x1, x2, l, l1, l2, wt, y1, y2;
+ unsigned char *p1, *p2, *pp;
+ int full, usefull;
+
+ full = 0;
+ for (i = 0; i < (blur * 2) - 1; i++)
+ full += lut[i];
+ for (x = rx; x < rxx; x++)
+ {
+ usefull = 1;
+
+ x1 = x - (blur - 1);
+ l1 = 0;
+ x2 = x + (blur - 1);
+ l2 = (blur * 2) - 2;
+ if (x1 < 0)
+ {
+ usefull = 0;
+ l1 -= x1;
+ x1 = 0;
+ }
+ if (x2 >= pix_w)
+ {
+ usefull = 0;
+ l2 -= x2 - pix_w + 1;
+ x2 = pix_w - 1;
+ }
+
+ pp = pix + x1 + (ry * pix_w);
+ p2 = pix_dst + x + (ry * pix_w);
+ if (usefull)
+ {
+ for (y = ry; y < ryy; y++)
+ {
+ p1 = pp;
+ sum = 0;
+ for (l = 0; l <= l2; l++)
+ {
+ sum += (*p1) * lut[l];
+ p1++;
+ }
+ *p2 = sum / full;
+ p2 += pix_w;
+ pp += pix_w;
+ }
+ }
+ else
+ {
+ for (y = ry; y < ryy; y++)
+ {
+ p1 = pp;
+ sum = 0;
+ weight = 0;
+ for (l = l1; l <= l2; l++)
+ {
+ wt = lut[l];
+ weight += wt;
+ sum += (*p1) * wt;
+ p1++;
+ }
+ *p2 = sum / weight;
+ p2 += pix_w;
+ pp += pix_w;
+ }
+ }
+ }
+}
+
+static void
+_ds_gauss_blur_v(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, unsigned char *lut, int blur, int rx, int ry, int rxx, int ryy)
+{
+ int x, y;
+ int i, sum, weight, x1, x2, l, l1, l2, wt, y1, y2;
+ unsigned char *p1, *p2, *pp;
+ int full, usefull;
+
+ full = 0;
+ for (i = 0; i < (blur * 2) - 1; i++)
+ full += lut[i];
+ for (y = ry; y < ryy; y++)
+ {
+ usefull = 1;
+
+ y1 = y - (blur - 1);
+ l1 = 0;
+ y2 = y + (blur - 1);
+ l2 = (blur * 2) - 2;
+ if (y1 < 0)
+ {
+ usefull = 0;
+ l1 -= y1;
+ y1 = 0;
+ }
+ if (y2 >= pix_h)
+ {
+ usefull = 0;
+ l2 -= y2 - pix_h + 1;
+ y2 = pix_h - 1;
+ }
+
+ pp = pix + (y1 * pix_w) + rx;
+ p2 = pix_dst + (y * pix_w) + rx;
+ if (usefull)
+ {
+ for (x = rx; x < rxx; x++)
+ {
+ p1 = pp;
+ sum = 0;
+ for (l = 0; l <= l2; l++)
+ {
+ sum += (*p1) * lut[l];
+ p1 += pix_w;
+ }
+ *p2 = sum / full;
+ p2++;
+ pp++;
+ }
+ }
+ else
+ {
+ for (x = rx; x < rxx; x++)
+ {
+ p1 = pp;
+ sum = 0;
+ weight = 0;
+ for (l = l1; l <= l2; l++)
+ {
+ wt = lut[l];
+ weight += wt;
+ sum += (*p1) * wt;
+ p1 += pix_w;
+ }
+ *p2 = sum / weight;
+ p2++;
+ pp++;
+ }
+ }
+ }
+}
+
+static void
+_ds_gauss_fill(unsigned char *pix, int pix_w, int pix_h, unsigned char v, int rx, int ry, int rxx, int ryy)
+{
+ int y;
+ char *p1;
+
+ p1 = pix + rx + (ry * pix_w);
+ for (y = ry; y < ryy; y++)
+ {
+ memset(p1, v, (rxx - rx));
+ p1 += pix_w;
+ }
+}
+
+static void
+_ds_gauss_copy(unsigned char *pix, unsigned char *pix_dst, int pix_w, int pix_h, int rx, int ry, int rxx, int ryy)
+{
+ int y;
+ char *p1, *p2;
+
+ p1 = pix + rx + (ry * pix_w);
+ p2 = pix_dst + rx + (ry * pix_w);
+ for (y = ry; y < ryy; y++)
+ {
+ memcpy(p2, p1, (rxx - rx));
+ p2 += pix_w;
+ p1 += pix_w;
+ }
+}
+
+static void
+_ds_gauss_blur(unsigned char *pix, int pix_w, int pix_h, unsigned char *lut, int blur, int sx, int sy, int sw, int sh)
+{
+ unsigned char *pix2;
+
+ pix2 = malloc(pix_w * pix_h * sizeof(unsigned char *));
+ if ((sw <= 0) || (sh <= 0))
+ {
+ _ds_gauss_blur_h(pix, pix2, pix_w, pix_h, lut, blur, 0, 0, pix_w, pix_h);
+ _ds_gauss_blur_v(pix2, pix, pix_w, pix_h, lut, blur, 0, 0, pix_w, pix_h);
+ }
+ else
+ {
+ int x, y, w, h;
+
+ x = 0; y = 0; w = pix_w; h = sy;
+ if (h > 0) _ds_gauss_blur_h(pix, pix2, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = 0; y = sy; w = sx; h = sh;
+ if (w > 0) _ds_gauss_blur_h(pix, pix2, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = sx + sw; y = sy; w = pix_w - x; h = sh;
+ if (w > 0) _ds_gauss_blur_h(pix, pix2, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = 0; y = sy + sh; w = pix_w; h = pix_h - y;
+ if (h > 0) _ds_gauss_blur_h(pix, pix2, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ _ds_gauss_copy(pix, pix2, pix_w, pix_h,
+ sx, sy, sx + sw, sy + sh);
+ x = 0; y = 0; w = pix_w; h = sy;
+ if (h > 0) _ds_gauss_blur_v(pix2, pix, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = 0; y = sy; w = sx; h = sh;
+ if (w > 0) _ds_gauss_blur_v(pix2, pix, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = sx + sw; y = sy; w = pix_w - x; h = sh;
+ if (w > 0) _ds_gauss_blur_v(pix2, pix, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ x = 0; y = sy + sh; w = pix_w; h = pix_h - y;
+ if (h > 0) _ds_gauss_blur_v(pix2, pix, pix_w, pix_h, lut, blur,
+ x, y, x + w, y + h);
+ _ds_gauss_copy(pix2, pix, pix_w, pix_h,
+ sx, sy, sx + sw, sy + sh);
+ }
+ free(pix2);
+}
--- /dev/null
+#ifndef E_MOD_MAIN_H
+#define E_MOD_MAIN_H
+
+typedef struct _Dropshadow Dropshadow;
+typedef struct _Shadow Shadow;
+
+struct _Dropshadow
+{
+ E_Module *module;
+ Evas_List *shadows;
+ Evas_List *cons;
+ E_Before_Idler *idler_before;
+
+ struct {
+ int shadow_x, shadow_y;
+ int blur_size;
+ double shadow_darkness;
+ } conf;
+
+ struct {
+ unsigned char *gauss;
+ int gauss_size;
+ } table;
+};
+
+struct _Shadow
+{
+ Dropshadow *ds;
+ int x, y, w, h;
+ E_Container_Shape *shape;
+
+ Evas_Object *object[4];
+
+ unsigned char reshape : 1;
+ unsigned char square : 1;
+};
+
+#endif
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = ibar
+
+# data files for the module
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)
+files_DATA = \
+module_icon.png
+
+EXTRA_DIST = $(files_DATA)
+
+# the module .so file
+INCLUDES = -I. \
+ -I$(top_srcdir) \
+ -I$(includedir) \
+ -I$(top_srcdir)$(MODULE) \
+ -I$(top_srcdir)/src/bin \
+ -I$(top_srcdir)/src/lib \
+ -I$(top_srcdir)/src/modules \
+ @e_cflags@
+pkgdir = $(libdir)/enlightenment/modules/$(MODULE)
+pkg_LTLIBRARIES = module.la
+module_la_SOURCES = e_mod_main.c \
+ e_mod_main.h
+module_la_LIBADD = @e_libs@ @dlopen_libs@
+module_la_LDFLAGS = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
--- /dev/null
+#include "e.h"
+#include "e_mod_main.h"
+
+/* TODO List:
+ *
+ * * icon labels & label tooltips supported for the name of the app
+ * * use part list to know how many icons & where to put in the overlay of an icon
+ * * description bubbles/tooltips for icons
+ * * support dynamic iconsize change on the fly
+ * * app subdirs - need to somehow handle these...
+ * * use overlay object and repeat events for doing auto hide/show
+ * * emit signals on hide/show due to autohide/show
+ * * virtualise autoshow/hide to later allow for key bindings, mouse events elsewhere, ipc and other singals to show/hide
+ * * save and load config
+ *
+ * BONUS Features (maybe do this later):
+ *
+ * * allow ibar icons to be dragged around to re-order/delete
+ *
+ */
+
+/* const strings */
+static const char *_ibar_main_orientation[] =
+{"bottom", "top", "left", "right"};
+
+/* module private routines */
+static IBar *_ibar_init(E_Module *m);
+static void _ibar_shutdown(IBar *ib);
+static void _ibar_app_change(void *data, E_App *a, E_App_Change ch);
+static E_Menu *_ibar_config_menu_new(IBar *ib);
+static void _ibar_config_menu_del(IBar *ib, E_Menu *m);
+static void _ibar_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi);
+static void _ibar_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi);
+static IBar_Icon *_ibar_bar_icon_find(IBar_Bar *ibb, E_App *a);
+static void _ibar_bar_icon_del(IBar_Icon *ic);
+static IBar_Icon *_ibar_bar_icon_new(IBar_Bar *ibb, E_App *a);
+static void _ibar_bar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before);
+static void _ibar_bar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after);
+static void _ibar_bar_frame_resize(IBar_Bar *ibb);
+static void _ibar_bar_init(IBar_Bar *ibb);
+static void _ibar_bar_free(IBar_Bar *ibb);
+static void _ibar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my);
+static void _ibar_timer_handle(IBar_Bar *ibb);
+static void _ibar_bar_reconfigure(IBar_Bar *ibb);
+static void _ibar_bar_follower_reset(IBar_Bar *ibb);
+static void _ibar_bar_convert_move_resize_to_config(IBar_Bar *ibb);
+static void _ibar_bar_edge_change(IBar_Bar *ibb, int edge);
+static void _ibar_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
+static void _ibar_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
+static void _ibar_cb_intercept_bar_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y);
+static void _ibar_cb_intercept_bar_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h);
+static void _ibar_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_bar_in(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_bar_out(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_bar_down(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_bar_up(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _ibar_cb_bar_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static int _ibar_cb_bar_timer(void *data);
+static int _ibar_cb_bar_animator(void *data);
+static void _ibar_cb_bar_move_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_resize1_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_resize1_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_resize2_start(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_resize2_stop(void *data, Evas_Object *obj, const char *emission, const char *source);
+static void _ibar_cb_bar_move_go(void *data, Evas_Object *obj, const char *emission, const char *source);
+
+/* public module routines. all modules must have these */
+void *
+init(E_Module *m)
+{
+ IBar *ib;
+
+ /* check module api version */
+ if (m->api->version < E_MODULE_API_VERSION)
+ {
+ e_error_dialog_show("Module API Error",
+ "Error initializing Module: IBar\n"
+ "It requires a minimum module API version of: %i.\n"
+ "The module API advertized by Enlightenment is: %i.\n"
+ "Aborting module.",
+ E_MODULE_API_VERSION,
+ m->api->version);
+ return NULL;
+ }
+ /* actually init ibar */
+ ib = _ibar_init(m);
+ m->config_menu = _ibar_config_menu_new(ib);
+ return ib;
+}
+
+int
+shutdown(E_Module *m)
+{
+ IBar *ib;
+
+ ib = m->data;
+ if (ib)
+ {
+ if (m->config_menu)
+ {
+ _ibar_config_menu_del(ib, m->config_menu);
+ m->config_menu = NULL;
+ }
+ _ibar_shutdown(ib);
+ }
+ return 1;
+}
+
+int
+save(E_Module *m)
+{
+ /* FIXME: save config */
+ return 1;
+}
+
+int
+info(E_Module *m)
+{
+ char buf[4096];
+
+ m->label = strdup("IBar");
+ snprintf(buf, sizeof(buf), "%s/module_icon.png", e_module_dir_get(m));
+ m->icon_file = strdup(buf);
+ return 1;
+}
+
+int
+about(E_Module *m)
+{
+ e_error_dialog_show("Enlightenment IBar Module",
+ "This is the IBar Application Launcher bar module for Enlightenment.\n"
+ "It is a first example module and is being used to flesh out several\n"
+ "Interfaces in Enlightenment 0.17.0. It is under heavy development,\n"
+ "so expect it to break often and change as it improves.");
+ return 1;
+}
+
+/* module private routines */
+static
+IBar *_ibar_init(E_Module *m)
+{
+ IBar *ib;
+ char buf[4096];
+ Evas_List *managers, *l, *l2;
+
+ ib = calloc(1, sizeof(IBar));
+ if (!ib) return NULL;
+
+ ib->conf.appdir = strdup("bar");
+ ib->conf.width = 400;
+ ib->conf.iconsize = 32;
+ ib->conf.follow_speed = 0.9;
+ ib->conf.autoscroll_speed = 0.95;
+ ib->conf.edge = EDGE_BOTTOM;
+ ib->conf.anchor = 0.5;
+ ib->conf.handle = 0.5;
+
+ if (ib->conf.appdir[0] != '/')
+ {
+ char *homedir;
+
+ homedir = e_user_homedir_get();
+ if (homedir)
+ {
+ snprintf(buf, sizeof(buf), "%s/.e/e/applications/%s", homedir, ib->conf.appdir);
+ free(homedir);
+ }
+ }
+ else
+ strcpy(buf, ib->conf.appdir);
+
+ ib->apps = e_app_new(buf, 0);
+ if (ib->apps) e_app_subdir_scan(ib->apps, 0);
+ e_app_change_callback_add(_ibar_app_change, ib);
+
+ managers = e_manager_list();
+ for (l = managers; l; l = l->next)
+ {
+ E_Manager *man;
+
+ man = l->data;
+ for (l2 = man->containers; l2; l2 = l2->next)
+ {
+ E_Container *con;
+ IBar_Bar *ibb;
+
+ con = l2->data;
+ ibb = calloc(1, sizeof(IBar_Bar));
+ if (ibb)
+ {
+ ibb->ibar = ib;
+ ibb->con = con;
+ ibb->evas = con->bg_evas;
+ ib->bars = evas_list_append(ib->bars, ibb);
+ _ibar_bar_init(ibb);
+ }
+ }
+ }
+ return ib;
+}
+
+static void
+_ibar_shutdown(IBar *ib)
+{
+ e_app_change_callback_del(_ibar_app_change, ib);
+ while (ib->bars)
+ {
+ IBar_Bar *ibb;
+
+ ibb = ib->bars->data;
+ ib->bars = evas_list_remove_list(ib->bars, ib->bars);
+ _ibar_bar_free(ibb);
+ }
+ e_object_unref(E_OBJECT(ib->apps));
+ if (ib->conf.appdir) free(ib->conf.appdir);
+ free(ib);
+}
+
+static void
+_ibar_app_change(void *data, E_App *a, E_App_Change ch)
+{
+ IBar *ib;
+ Evas_List *l, *ll;
+
+ ib = data;
+
+ for (l = ib->bars; l; l = l->next)
+ {
+ IBar_Bar *ibb;
+
+ ibb = l->data;
+ switch (ch)
+ {
+ case E_APP_ADD:
+ if (a->parent == ib->apps)
+ {
+ IBar_Icon *ic;
+
+ e_box_freeze(ibb->box_object);
+ ic = _ibar_bar_icon_new(ibb, a);
+ if (ic)
+ {
+ for (ll = ib->apps->subapps; ll; ll = ll->next)
+ {
+ E_App *a2;
+
+ a2 = ll->data;
+ ic = _ibar_bar_icon_find(ibb, a2);
+ if (ic) _ibar_bar_icon_reorder_after(ic, NULL);
+ }
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ _ibar_bar_frame_resize(ibb);
+ }
+ e_box_thaw(ibb->box_object);
+ }
+ break;
+ case E_APP_DEL:
+ if (a->parent == ib->apps)
+ {
+ IBar_Icon *ic;
+
+ ic = _ibar_bar_icon_find(ibb, a);
+ if (ic) _ibar_bar_icon_del(ic);
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ _ibar_bar_frame_resize(ibb);
+ }
+ break;
+ case E_APP_CHANGE:
+ if (a->parent == ib->apps)
+ {
+ IBar_Icon *ic;
+
+ e_box_freeze(ibb->box_object);
+ ic = _ibar_bar_icon_find(ibb, a);
+ if (ic) _ibar_bar_icon_del(ic);
+ evas_image_cache_flush(ibb->evas);
+ evas_image_cache_reload(ibb->evas);
+ ic = _ibar_bar_icon_new(ibb, a);
+ if (ic)
+ {
+ for (ll = ib->apps->subapps; ll; ll = ll->next)
+ {
+ E_App *a2;
+
+ a2 = ll->data;
+ ic = _ibar_bar_icon_find(ibb, a2);
+ if (ic) _ibar_bar_icon_reorder_after(ic, NULL);
+ }
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ _ibar_bar_frame_resize(ibb);
+ }
+ e_box_thaw(ibb->box_object);
+ }
+ break;
+ case E_APP_ORDER:
+ if (a == ib->apps)
+ {
+ e_box_freeze(ibb->box_object);
+ for (ll = ib->apps->subapps; ll; ll = ll->next)
+ {
+ IBar_Icon *ic;
+ E_App *a2;
+
+ a2 = ll->data;
+ ic = _ibar_bar_icon_find(ibb, a2);
+ if (ic) _ibar_bar_icon_reorder_after(ic, NULL);
+ }
+ e_box_thaw(ibb->box_object);
+ }
+ break;
+ case E_APP_EXEC:
+ break;
+ case E_APP_READY:
+ break;
+ case E_APP_EXIT:
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+static E_Menu *
+_ibar_config_menu_new(IBar *ib)
+{
+ E_Menu *mn;
+ E_Menu_Item *mi;
+
+ /* FIXME: hook callbacks to each menu item */
+ mn = e_menu_new();
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Fixed width");
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ib->conf.width > 0) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ibar_cb_width_fixed, ib);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Auto fit icons");
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ib->conf.width < 0) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ibar_cb_width_auto, ib);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Fill edge");
+ e_menu_item_radio_set(mi, 1);
+ e_menu_item_radio_group_set(mi, 2);
+ if (ib->conf.width == 0) e_menu_item_toggle_set(mi, 1);
+ e_menu_item_callback_set(mi, _ibar_cb_width_fill, ib);
+
+/*
+ mi = e_menu_item_new(mn);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Auto hide");
+ e_menu_item_check_set(mi, 1);
+ if (ib->conf.autohide == 0) e_menu_item_toggle_set(mi, 1);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_separator_set(mi, 1);
+
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "More Options...");
+*/
+ ib->config_menu = mn;
+
+ return mn;
+}
+
+static void
+_ibar_config_menu_del(IBar *ib, E_Menu *m)
+{
+ e_object_del(E_OBJECT(m));
+}
+
+static void
+_ibar_cb_width_fixed(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ IBar *ib;
+
+ ib = data;
+ if (ib->conf.width <= 0)
+ {
+ Evas_List *l;
+
+ ib->conf.width = 400;
+ for (l = ib->bars; l; l = l->next)
+ {
+ IBar_Bar *ibb;
+
+ ibb = l->data;
+ _ibar_bar_edge_change(ibb, ib->conf.edge);
+ }
+ }
+}
+
+static void
+_ibar_cb_width_auto(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ IBar *ib;
+
+ ib = data;
+ if (ib->conf.width >= 0)
+ {
+ Evas_List *l;
+
+ ib->conf.width = -1;
+ for (l = ib->bars; l; l = l->next)
+ {
+ IBar_Bar *ibb;
+
+ ibb = l->data;
+ _ibar_bar_edge_change(ibb, ib->conf.edge);
+ }
+ }
+}
+
+static void
+_ibar_cb_width_fill(void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ IBar *ib;
+
+ ib = data;
+ if (ib->conf.width != 0)
+ {
+ Evas_List *l;
+
+ ib->conf.width = 0;
+ ib->conf.anchor = 0.5;
+ ib->conf.handle = 0.5;
+ for (l = ib->bars; l; l = l->next)
+ {
+ IBar_Bar *ibb;
+
+ ibb = l->data;
+ _ibar_bar_edge_change(ibb, ib->conf.edge);
+ }
+ }
+}
+
+static IBar_Icon *
+_ibar_bar_icon_find(IBar_Bar *ibb, E_App *a)
+{
+ Evas_List *l;
+
+ for (l = ibb->icons; l; l = l->next)
+ {
+ IBar_Icon *ic;
+
+ ic = l->data;
+ if (ic->app == a) return ic;
+ }
+ return NULL;
+}
+
+static void
+_ibar_bar_icon_del(IBar_Icon *ic)
+{
+ ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
+ if (ic->bg_object) evas_object_del(ic->bg_object);
+ if (ic->overlay_object) evas_object_del(ic->overlay_object);
+ if (ic->icon_object) evas_object_del(ic->icon_object);
+ if (ic->event_object) evas_object_del(ic->event_object);
+ while (ic->extra_icons)
+ {
+ Evas_Object *o;
+
+ o = ic->extra_icons->data;
+ ic->extra_icons = evas_list_remove_list(ic->extra_icons, ic->extra_icons);
+ evas_object_del(o);
+ }
+ e_object_unref(E_OBJECT(ic->app));
+ free(ic);
+}
+
+static IBar_Icon *
+_ibar_bar_icon_new(IBar_Bar *ibb, E_App *a)
+{
+ IBar_Icon *ic;
+ char *str;
+ Evas_Object *o;
+ Evas_Coord bw, bh;
+
+ ic = calloc(1, sizeof(IBar_Icon));
+ if (!ic) return NULL;
+ ic->ibb = ibb;
+ ic->app = a;
+ ibb->icons = evas_list_append(ibb->icons, ic);
+
+ o = evas_object_rectangle_add(ibb->evas);
+ ic->event_object = o;
+ evas_object_layer_set(o, 1);
+ evas_object_clip_set(o, evas_object_clip_get(ibb->box_object));
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_repeat_events_set(o, 1);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_cb_icon_in, ic);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_cb_icon_out, ic);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_cb_icon_down, ic);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_icon_up, ic);
+ evas_object_show(o);
+
+ o = edje_object_add(ibb->evas);
+ ic->bg_object = o;
+ evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_icon_move, ic);
+ evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_icon_resize, ic);
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "modules/ibar/icon");
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+ evas_object_show(o);
+
+ o = edje_object_add(ibb->evas);
+ ic->icon_object = o;
+ edje_object_file_set(o, ic->app->path, "icon");
+ edje_extern_object_min_size_set(o, ibb->ibar->conf.iconsize, ibb->ibar->conf.iconsize);
+ edje_object_part_swallow(ic->bg_object, "item", o);
+ edje_object_size_min_calc(ic->bg_object, &bw, &bh);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ o = edje_object_add(ibb->evas);
+ ic->overlay_object = o;
+ evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_icon_move, ic);
+ evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_icon_resize, ic);
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "modules/ibar/icon_overlay");
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+ evas_object_show(o);
+
+ o = edje_object_add(ibb->evas);
+ ic->extra_icons = evas_list_append(ic->extra_icons, o);
+ edje_object_file_set(o, ic->app->path, "icon");
+ edje_object_part_swallow(ic->overlay_object, "item", o);
+ evas_object_pass_events_set(o, 1);
+ evas_object_show(o);
+
+ evas_object_raise(ic->event_object);
+
+ e_box_pack_end(ibb->box_object, ic->bg_object);
+ e_box_pack_options_set(ic->bg_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ bw, bh, /* min */
+ bw, bh /* max */
+ );
+
+ str = edje_object_data_get(ic->icon_object, "raise_on_hilight");
+ if (str)
+ {
+ if (atoi(str) == 1) ic->raise_on_hilight = 1;
+ }
+
+ edje_object_signal_emit(ic->bg_object, "passive", "");
+ edje_object_signal_emit(ic->overlay_object, "passive", "");
+ return ic;
+}
+
+static void
+_ibar_bar_icon_reorder_before(IBar_Icon *ic, IBar_Icon *before)
+{
+ Evas_Coord bw, bh;
+
+ e_box_freeze(ic->ibb->box_object);
+ e_box_unpack(ic->bg_object);
+ ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
+ if (before)
+ {
+ ic->ibb->icons = evas_list_prepend_relative(ic->ibb->icons, ic, before);
+ e_box_pack_before(ic->ibb->box_object, ic->bg_object, before->bg_object);
+ }
+ else
+ {
+ ic->ibb->icons = evas_list_prepend(ic->ibb->icons, ic);
+ e_box_pack_start(ic->ibb->box_object, ic->bg_object);
+ }
+ edje_object_size_min_calc(ic->bg_object, &bw, &bh);
+ e_box_pack_options_set(ic->bg_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ bw, bh, /* min */
+ bw, bh /* max */
+ );
+ e_box_thaw(ic->ibb->box_object);
+}
+
+static void
+_ibar_bar_icon_reorder_after(IBar_Icon *ic, IBar_Icon *after)
+{
+ Evas_Coord bw, bh;
+
+ e_box_freeze(ic->ibb->box_object);
+ e_box_unpack(ic->bg_object);
+ ic->ibb->icons = evas_list_remove(ic->ibb->icons, ic);
+ if (after)
+ {
+ ic->ibb->icons = evas_list_append_relative(ic->ibb->icons, ic, after);
+ e_box_pack_after(ic->ibb->box_object, ic->bg_object, after->bg_object);
+ }
+ else
+ {
+ ic->ibb->icons = evas_list_append(ic->ibb->icons, ic);
+ e_box_pack_end(ic->ibb->box_object, ic->bg_object);
+ }
+ edje_object_size_min_calc(ic->bg_object, &bw, &bh);
+ e_box_pack_options_set(ic->bg_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ bw, bh, /* min */
+ bw, bh /* max */
+ );
+ e_box_thaw(ic->ibb->box_object);
+}
+
+static void
+_ibar_bar_frame_resize(IBar_Bar *ibb)
+{
+ Evas_Coord ww, hh, bw, bh;
+ Evas_Object *o;
+
+ evas_event_freeze(ibb->evas);
+ e_box_freeze(ibb->box_object);
+
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+
+ o = ibb->bar_object;
+ if (ibb->ibar->conf.width < 0)
+ {
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ e_box_orientation_set(ibb->box_object, 1);
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ e_box_orientation_set(ibb->box_object, 0);
+
+ e_box_min_size_get(ibb->box_object, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, bw, bh);
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ edje_object_size_min_calc(o, &bw, &bh);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ if (bw > ww) bw = ww;
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ if (bh > hh) bh = hh;
+ }
+ }
+ else if (ibb->ibar->conf.width == 0)
+ {
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ e_box_orientation_set(ibb->box_object, 1);
+ e_box_min_size_get(ibb->box_object, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, ww, bh);
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ e_box_orientation_set(ibb->box_object, 0);
+ e_box_min_size_get(ibb->box_object, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, bw, hh);
+ }
+
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ edje_object_size_min_calc(o, &bw, &bh);
+ }
+ else
+ {
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ e_box_orientation_set(ibb->box_object, 1);
+ e_box_min_size_get(ibb->box_object, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, ibb->ibar->conf.width, bh);
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ edje_object_size_min_calc(o, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, 0, 0);
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ e_box_orientation_set(ibb->box_object, 0);
+ e_box_min_size_get(ibb->box_object, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, bw, ibb->ibar->conf.width);
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ edje_object_size_min_calc(o, &bw, &bh);
+ edje_extern_object_min_size_set(ibb->box_object, 0, 0);
+ edje_object_part_swallow(o, "items", ibb->box_object);
+ }
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ if (bw > ww) bw = bw;
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ if (bh > hh) bh = hh;
+ }
+ }
+
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ ibb->maxsize = bh;
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ ibb->maxsize = bw;
+
+ ibb->w = bw;
+ ibb->h = bh;
+ if (ibb->ibar->conf.edge == EDGE_BOTTOM)
+ {
+ ibb->x = (ww * ibb->ibar->conf.anchor) - (bw * ibb->ibar->conf.handle);
+ ibb->y = hh - bh;
+ }
+ else if (ibb->ibar->conf.edge == EDGE_TOP)
+ {
+ ibb->x = (ww * ibb->ibar->conf.anchor) - (bw * ibb->ibar->conf.handle);
+ ibb->y = 0;
+ }
+ else if (ibb->ibar->conf.edge == EDGE_LEFT)
+ {
+ ibb->y = (hh * ibb->ibar->conf.anchor) - (bh * ibb->ibar->conf.handle);
+ ibb->x = 0;
+ }
+ else if (ibb->ibar->conf.edge == EDGE_RIGHT)
+ {
+ ibb->y = (hh * ibb->ibar->conf.anchor) - (bh * ibb->ibar->conf.handle);
+ ibb->x = ww - bw;
+ }
+
+ _ibar_bar_reconfigure(ibb);
+
+ e_box_thaw(ibb->box_object);
+
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+
+ evas_event_thaw(ibb->evas);
+}
+
+static void
+_ibar_bar_init(IBar_Bar *ibb)
+{
+ Evas_List *l;
+ Evas_Coord ww, hh, bw, bh;
+ Evas_Object *o;
+
+ evas_event_freeze(ibb->evas);
+ o = edje_object_add(ibb->evas);
+ ibb->bar_object = o;
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "modules/ibar/main");
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+ edje_object_signal_callback_add(o, "move_start", "", _ibar_cb_bar_move_start, ibb);
+ edje_object_signal_callback_add(o, "move_stop", "", _ibar_cb_bar_move_stop, ibb);
+ edje_object_signal_callback_add(o, "resize1_start", "", _ibar_cb_bar_resize1_start, ibb);
+ edje_object_signal_callback_add(o, "resize1_stop", "", _ibar_cb_bar_resize1_stop, ibb);
+ edje_object_signal_callback_add(o, "resize2_start", "", _ibar_cb_bar_resize2_start, ibb);
+ edje_object_signal_callback_add(o, "resize2_stop", "", _ibar_cb_bar_resize2_stop, ibb);
+ edje_object_signal_callback_add(o, "mouse,move", "*", _ibar_cb_bar_move_go, ibb);
+ evas_object_show(o);
+
+ o = edje_object_add(ibb->evas);
+ ibb->overlay_object = o;
+ evas_object_layer_set(o, 1);
+ edje_object_file_set(o,
+ /* FIXME: "default.eet" needs to come from conf */
+ e_path_find(path_themes, "default.eet"),
+ "modules/ibar/follower");
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+ evas_object_show(o);
+
+ o = evas_object_rectangle_add(ibb->evas);
+ ibb->event_object = o;
+ evas_object_layer_set(o, 2);
+ evas_object_repeat_events_set(o, 1);
+ evas_object_color_set(o, 0, 0, 0, 0);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_IN, _ibar_cb_bar_in, ibb);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_OUT, _ibar_cb_bar_out, ibb);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN, _ibar_cb_bar_down, ibb);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_UP, _ibar_cb_bar_up, ibb);
+ evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_MOVE, _ibar_cb_bar_move, ibb);
+ evas_object_show(o);
+
+ o = e_box_add(ibb->evas);
+ ibb->box_object = o;
+ evas_object_intercept_move_callback_add(o, _ibar_cb_intercept_bar_move, ibb);
+ evas_object_intercept_resize_callback_add(o, _ibar_cb_intercept_bar_resize, ibb);
+ e_box_freeze(o);
+ edje_object_part_swallow(ibb->bar_object, "items", o);
+ evas_object_show(o);
+
+ edje_object_size_min_calc(ibb->bar_object, &bw, &bh);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ ibb->minsize = bh;
+ else if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ ibb->minsize = bw;
+
+ if (ibb->ibar->apps)
+ {
+ for (l = ibb->ibar->apps->subapps; l; l = l->next)
+ {
+ E_App *a;
+ IBar_Icon *ic;
+ char *str;
+
+ a = l->data;
+ ic = _ibar_bar_icon_new(ibb, a);
+ }
+ }
+ ibb->align_req = 0.5;
+ ibb->align = 0.5;
+ e_box_align_set(ibb->box_object, 0.5, 0.5);
+
+ _ibar_bar_frame_resize(ibb);
+
+ e_box_thaw(ibb->box_object);
+
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+
+ evas_event_thaw(ibb->evas);
+
+// edje_object_signal_emit(ibb->bar_object, "passive", "");
+// edje_object_signal_emit(ibb->overlay_object, "passive", "");
+}
+
+static void
+_ibar_bar_free(IBar_Bar *ibb)
+{
+ while (ibb->icons)
+ {
+ IBar_Icon *ic;
+
+ ic = ibb->icons->data;
+ _ibar_bar_icon_del(ic);
+ }
+ if (ibb->timer) ecore_timer_del(ibb->timer);
+ if (ibb->animator) ecore_animator_del(ibb->animator);
+ evas_object_del(ibb->bar_object);
+ evas_object_del(ibb->overlay_object);
+ evas_object_del(ibb->box_object);
+ evas_object_del(ibb->event_object);
+ free(ibb);
+}
+
+static void
+_ibar_motion_handle(IBar_Bar *ibb, Evas_Coord mx, Evas_Coord my)
+{
+ Evas_Coord x, y, w, h;
+ double relx, rely;
+
+ evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
+ if (w > 0) relx = (double)(mx - x) / (double)w;
+ else relx = 0.0;
+ if (h > 0) rely = (double)(my - y) / (double)h;
+ else rely = 0.0;
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ ibb->align_req = 1.0 - relx;
+ ibb->follow_req = relx;
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ ibb->align_req = 1.0 - rely;
+ ibb->follow_req = rely;
+ }
+}
+
+static void
+_ibar_timer_handle(IBar_Bar *ibb)
+{
+ if (!ibb->timer)
+ ibb->timer = ecore_timer_add(0.01, _ibar_cb_bar_timer, ibb);
+ if (!ibb->animator)
+ ibb->animator = ecore_animator_add(_ibar_cb_bar_animator, ibb);
+}
+
+static void
+_ibar_bar_reconfigure(IBar_Bar *ibb)
+{
+ evas_object_move(ibb->bar_object, ibb->x, ibb->y);
+ evas_object_resize(ibb->bar_object, ibb->w, ibb->h);
+ _ibar_timer_handle(ibb);
+}
+
+static void
+_ibar_bar_follower_reset(IBar_Bar *ibb)
+{
+ Evas_Coord ww, hh, bx, by, bw, bh, d1, d2, mw, mh;
+
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+ evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh);
+ edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ d1 = bx;
+ d2 = ww - (bx + bw);
+ if (bw > 0)
+ {
+ if (d1 < d2)
+ ibb->follow_req = -((double)(d1 + (mw * 4)) / (double)bw);
+ else
+ ibb->follow_req = 1.0 + ((double)(d2 + (mw * 4)) / (double)bw);
+ }
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ d1 = by;
+ d2 = hh - (by + bh);
+ if (bh > 0)
+ {
+ if (d1 < d2)
+ ibb->follow_req = -((double)(d1 + (mh * 4)) / (double)bh);
+ else
+ ibb->follow_req = 1.0 + ((double)(d2 + (mh * 4)) / (double)bh);
+ }
+ }
+}
+
+static void
+_ibar_bar_convert_move_resize_to_config(IBar_Bar *ibb)
+{
+ Evas_Coord bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh;
+
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+ evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh);
+ evas_object_geometry_get(ibb->bar_object, &bbx, &bby, &bbw, &bbh);
+
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ double a = 0.5;
+
+ if (ibb->ibar->conf.width < 0) /* auto size to fit */
+ {
+ if ((ww - ibb->w) != 0)
+ a = (double)ibb->x / (double)(ww - ibb->w);
+ else
+ a = 0.5;
+ }
+ else if (ibb->ibar->conf.width == 0) /* full width */
+ {
+ }
+ else
+ {
+ ibb->ibar->conf.width = ibb->w - (bbw - bw);
+ if ((ww - ibb->w) != 0)
+ a = (double)ibb->x / (double)(ww - ibb->w);
+ else
+ a = 0.5;
+ }
+ ibb->ibar->conf.anchor = a;
+ ibb->ibar->conf.handle = a;
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ double a = 0.5;
+
+ if (ibb->ibar->conf.width < 0) /* auto size to fit */
+ {
+ if ((hh - ibb->h) != 0)
+ a = (double)ibb->y / (double)(hh - ibb->h);
+ else
+ a = 0.5;
+ }
+ else if (ibb->ibar->conf.width == 0) /* full width */
+ {
+ }
+ else
+ {
+ ibb->ibar->conf.width = ibb->h - (bbh - bh);
+ if ((hh - ibb->h) != 0)
+ a = (double)ibb->y / (double)(hh - ibb->h);
+ else
+ a = 0.5;
+ }
+ ibb->ibar->conf.anchor = a;
+ ibb->ibar->conf.handle = a;
+ }
+}
+
+static void
+_ibar_bar_edge_change(IBar_Bar *ibb, int edge)
+{
+ Evas_List *l;
+ Evas_Coord ww, hh, bw, bh;
+ Evas_Object *o;
+
+ ibb->ibar->conf.edge = edge;
+
+ evas_event_freeze(ibb->evas);
+ o = ibb->bar_object;
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+
+ o = ibb->overlay_object;
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+
+ e_box_freeze(ibb->box_object);
+
+ edje_object_size_min_calc(ibb->bar_object, &bw, &bh);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ ibb->minsize = bh;
+ else if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ ibb->minsize = bw;
+
+ for (l = ibb->icons; l; l = l->next)
+ {
+ IBar_Icon *ic;
+
+ ic = l->data;
+ o = ic->bg_object;
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+ edje_object_size_min_calc(ic->bg_object, &bw, &bh);
+
+ o = ic->overlay_object;
+ edje_object_signal_emit(o, "set_orientation", _ibar_main_orientation[ibb->ibar->conf.edge]);
+ edje_object_message_signal_process(o);
+
+ e_box_pack_options_set(ic->bg_object,
+ 1, 1, /* fill */
+ 0, 0, /* expand */
+ 0.5, 0.5, /* align */
+ bw, bh, /* min */
+ bw, bh /* max */
+ );
+ }
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+
+ ibb->align_req = 0.5;
+ ibb->align = 0.5;
+ e_box_align_set(ibb->box_object, 0.5, 0.5);
+
+ _ibar_bar_frame_resize(ibb);
+
+ e_box_thaw(ibb->box_object);
+
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+
+ evas_event_thaw(ibb->evas);
+}
+
+static void
+_ibar_cb_intercept_icon_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
+{
+ IBar_Icon *ic;
+
+ ic = data;
+ evas_object_move(o, x, y);
+ evas_object_move(ic->event_object, x, y);
+ evas_object_move(ic->overlay_object, x, y);
+}
+
+static void
+_ibar_cb_intercept_icon_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
+{
+ IBar_Icon *ic;
+
+ ic = data;
+ evas_object_resize(o, w, h);
+ evas_object_resize(ic->event_object, w, h);
+ evas_object_resize(ic->overlay_object, w, h);
+}
+
+static void
+_ibar_cb_intercept_bar_move(void *data, Evas_Object *o, Evas_Coord x, Evas_Coord y)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ evas_object_move(o, x, y);
+ evas_object_move(ibb->event_object, x, y);
+}
+
+static void
+_ibar_cb_intercept_bar_resize(void *data, Evas_Object *o, Evas_Coord w, Evas_Coord h)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ evas_object_resize(o, w, h);
+ evas_object_resize(ibb->event_object, w, h);
+}
+
+static void
+_ibar_cb_icon_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_In *ev;
+ IBar_Icon *ic;
+
+ ev = event_info;
+ ic = data;
+ evas_event_freeze(ic->ibb->evas);
+ evas_object_raise(ic->event_object);
+ if (ic->raise_on_hilight)
+ evas_object_stack_below(ic->bg_object, ic->event_object);
+ evas_object_stack_below(ic->overlay_object, ic->event_object);
+ evas_event_thaw(ic->ibb->evas);
+ edje_object_signal_emit(ic->bg_object, "active", "");
+ edje_object_signal_emit(ic->overlay_object, "active", "");
+ edje_object_signal_emit(ic->ibb->overlay_object, "active", "");
+}
+
+static void
+_ibar_cb_icon_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Out *ev;
+ IBar_Icon *ic;
+
+ ev = event_info;
+ ic = data;
+ edje_object_signal_emit(ic->bg_object, "passive", "");
+ edje_object_signal_emit(ic->overlay_object, "passive", "");
+ edje_object_signal_emit(ic->ibb->overlay_object, "passive", "");
+}
+
+static void
+_ibar_cb_icon_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *ev;
+ IBar_Icon *ic;
+
+ ev = event_info;
+ ic = data;
+ if (ev->button == 1)
+ {
+ edje_object_signal_emit(ic->bg_object, "start", "");
+ edje_object_signal_emit(ic->overlay_object, "start", "");
+ edje_object_signal_emit(ic->ibb->overlay_object, "start", "");
+ e_app_exec(ic->app);
+ }
+}
+
+static void
+_ibar_cb_icon_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Up *ev;
+ IBar_Icon *ic;
+
+ ev = event_info;
+ ic = data;
+ if (ev->button == 1)
+ {
+ edje_object_signal_emit(ic->bg_object, "start_end", "");
+ edje_object_signal_emit(ic->overlay_object, "start_end", "");
+ edje_object_signal_emit(ic->ibb->overlay_object, "start_end", "");
+ }
+}
+
+static void
+_ibar_cb_bar_in(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_In *ev;
+ IBar_Bar *ibb;
+
+ ev = event_info;
+ ibb = data;
+ edje_object_signal_emit(ibb->overlay_object, "active", "");
+ _ibar_motion_handle(ibb, ev->canvas.x, ev->canvas.y);
+ _ibar_timer_handle(ibb);
+}
+
+static void
+_ibar_cb_bar_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Out *ev;
+ IBar_Bar *ibb;
+
+ ev = event_info;
+ ibb = data;
+ edje_object_signal_emit(ibb->overlay_object, "passive", "");
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+}
+
+static void
+_ibar_cb_bar_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Down *ev;
+ IBar_Bar *ibb;
+
+ ev = event_info;
+ ibb = data;
+ if (ev->button == 3)
+ {
+ e_menu_activate_mouse(ibb->ibar->config_menu, ibb->con,
+ ev->output.x, ev->output.y, 1, 1,
+ E_MENU_POP_DIRECTION_DOWN);
+ e_util_container_fake_mouse_up_all_later(ibb->con);
+ }
+}
+
+static void
+_ibar_cb_bar_up(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Up *ev;
+ IBar_Bar *ibb;
+
+ ev = event_info;
+ ibb = data;
+}
+
+static void
+_ibar_cb_bar_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Evas_Event_Mouse_Move *ev;
+ IBar_Bar *ibb;
+
+ ev = event_info;
+ ibb = data;
+ _ibar_motion_handle(ibb, ev->cur.canvas.x, ev->cur.canvas.y);
+ _ibar_timer_handle(ibb);
+}
+
+static int
+_ibar_cb_bar_timer(void *data)
+{
+ IBar_Bar *ibb;
+ double dif, dif2;
+ Evas_Coord x, y, w, h, mw, mh;
+ double v;
+
+ ibb = data;
+ v = ibb->ibar->conf.autoscroll_speed;
+ ibb->align = (ibb->align_req * (1.0 - v)) + (ibb->align * v);
+ v = ibb->ibar->conf.follow_speed;
+ ibb->follow = (ibb->follow_req * (1.0 - v)) + (ibb->follow * v);
+
+ dif = ibb->align - ibb->align_req;
+ if (dif < 0) dif = -dif;
+ if (dif < 0.001) ibb->align = ibb->align_req;
+
+ dif2 = ibb->follow - ibb->follow_req;
+ if (dif2 < 0) dif2 = -dif2;
+ if (dif2 < 0.001) ibb->follow = ibb->follow_req;
+
+ if ((dif < 0.001) && (dif2 < 0.001))
+ {
+ ibb->timer = NULL;
+ return 0;
+ }
+ return 1;
+}
+
+static int
+_ibar_cb_bar_animator(void *data)
+{
+ IBar_Bar *ibb;
+ Evas_Coord x, y, w, h, mw, mh;
+
+ ibb = data;
+
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ e_box_align_set(ibb->box_object, ibb->align, 0.5);
+
+ evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
+ edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
+ evas_object_resize(ibb->overlay_object, mw, h);
+ evas_object_move(ibb->overlay_object, x + (w * ibb->follow) - (mw / 2), y);
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ e_box_align_set(ibb->box_object, 0.5, ibb->align);
+
+ evas_object_geometry_get(ibb->box_object, &x, &y, &w, &h);
+ edje_object_size_min_get(ibb->overlay_object, &mw, &mh);
+ evas_object_resize(ibb->overlay_object, w, mh);
+ evas_object_move(ibb->overlay_object, x, y + (h * ibb->follow) - (mh / 2));
+ }
+ if (ibb->timer) return 1;
+ ibb->animator = NULL;
+ return 0;
+}
+
+static void
+_ibar_cb_bar_move_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->ibar->conf.width == 0) return;
+ ibb->move = 1;
+ evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y);
+ ibb->start_bx = ibb->x;
+ ibb->start_by = ibb->y;
+ ibb->start_bw = ibb->w;
+ ibb->start_bh = ibb->h;
+}
+
+static void
+_ibar_cb_bar_move_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->move)
+ {
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ ibb->move = 0;
+ }
+}
+
+static void
+_ibar_cb_bar_resize1_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->ibar->conf.width <= 0) return;
+ ibb->resize1 = 1;
+ evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y);
+ ibb->start_bx = ibb->x;
+ ibb->start_by = ibb->y;
+ ibb->start_bw = ibb->w;
+ ibb->start_bh = ibb->h;
+}
+
+static void
+_ibar_cb_bar_resize1_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->resize1)
+ {
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ ibb->resize1 = 0;
+ }
+}
+
+static void
+_ibar_cb_bar_resize2_start(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->ibar->conf.width <= 0) return;
+ ibb->resize2 = 1;
+ evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &ibb->start_x, &ibb->start_y);
+ ibb->start_bx = ibb->x;
+ ibb->start_by = ibb->y;
+ ibb->start_bw = ibb->w;
+ ibb->start_bh = ibb->h;
+}
+
+static void
+_ibar_cb_bar_resize2_stop(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->resize2)
+ {
+ _ibar_bar_convert_move_resize_to_config(ibb);
+ ibb->resize2 = 0;
+ }
+}
+
+static void
+_ibar_cb_bar_move_go(void *data, Evas_Object *obj, const char *emission, const char *source)
+{
+ IBar_Bar *ibb;
+
+ ibb = data;
+ if (ibb->move)
+ {
+ Evas_Coord x, y, bx, by, bw, bh, ww, hh;
+ int edge;
+ double xr, yr;
+ int edge_done;
+
+ edge_done = 0;
+ do_pos:
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+ evas_object_geometry_get(ibb->bar_object, &bx, &by, &bw, &bh);
+ evas_pointer_canvas_xy_get(ibb->evas, &x, &y);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ Evas_Coord d;
+
+ d = x - ibb->start_x;
+ ibb->x = ibb->start_bx + d;
+ if (ibb->x < 0) ibb->x = 0;
+ else if ((ibb->x + ibb->w) > ww) ibb->x = ww - ibb->w;
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ Evas_Coord d;
+
+ d = y - ibb->start_y;
+ ibb->y = ibb->start_by + d;
+ if (ibb->y < 0) ibb->y = 0;
+ else if ((ibb->y + ibb->h) > hh) ibb->y = hh - ibb->h;
+ }
+
+ if (!edge_done)
+ {
+ edge = ibb->ibar->conf.edge;
+ xr = (double)x / (double)ww;
+ yr = (double)y / (double)hh;
+ if ((xr + yr) <= 1.0) /* top or left */
+ {
+ if (((1.0 - yr) + xr) <= 1.0) edge = EDGE_LEFT;
+ else edge = EDGE_TOP;
+ }
+ else /* bottom or right */
+ {
+ if (((1.0 - yr) + xr) <= 1.0) edge = EDGE_BOTTOM;
+ else edge = EDGE_RIGHT;
+ }
+ if (edge != ibb->ibar->conf.edge)
+ {
+ _ibar_bar_edge_change(ibb, edge);
+ edge_done = 1;
+ goto do_pos;
+ }
+ }
+ _ibar_bar_reconfigure(ibb);
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+ return;
+ }
+ else if (ibb->resize1)
+ {
+ Evas_Coord x, y, bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh;
+
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+ evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh);
+ evas_object_geometry_get(ibb->bar_object, &bbx, &bby, &bbw, &bbh);
+ evas_pointer_canvas_xy_get(ibb->evas, &x, &y);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ Evas_Coord d;
+
+ d = x - ibb->start_x;
+ ibb->x = ibb->start_bx + d;
+ ibb->w = ibb->start_bw - d;
+ if (ibb->w < (bbw - bw + ibb->ibar->conf.iconsize))
+ {
+ ibb->x += ibb->w - (bbw - bw + ibb->ibar->conf.iconsize);
+ ibb->w = bbw - bw + ibb->ibar->conf.iconsize;
+ }
+ else if (ibb->w > ww)
+ {
+ ibb->x += (ibb->w - ww);
+ ibb->w = ww;
+ }
+ if (ibb->x < 0)
+ {
+ ibb->w += ibb->x;
+ ibb->x = 0;
+ }
+ else if ((ibb->x + ibb->w) > ww)
+ {
+ ibb->x = ww - ibb->w;
+ }
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ Evas_Coord d;
+
+ d = y - ibb->start_y;
+ ibb->y = ibb->start_by + d;
+ ibb->h = ibb->start_bh - d;
+ if (ibb->h < (bbh - bh + ibb->ibar->conf.iconsize))
+ {
+ ibb->y += ibb->h - (bbh - bh + ibb->ibar->conf.iconsize);
+ ibb->h = bbh - bh + ibb->ibar->conf.iconsize;
+ }
+ else if (ibb->h > hh)
+ {
+ ibb->y += (ibb->h - hh);
+ ibb->h = hh;
+ }
+ if (ibb->y < 0)
+ {
+ ibb->h += ibb->y;
+ ibb->y = 0;
+ }
+ else if ((ibb->y + ibb->h) > hh)
+ {
+ ibb->y = hh - ibb->h;
+ }
+ }
+ _ibar_bar_reconfigure(ibb);
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+ return;
+ }
+ else if (ibb->resize2)
+ {
+ Evas_Coord x, y, bx, by, bw, bh, bbx, bby, bbw, bbh, ww, hh;
+
+ evas_output_viewport_get(ibb->evas, NULL, NULL, &ww, &hh);
+ evas_object_geometry_get(ibb->box_object, &bx, &by, &bw, &bh);
+ evas_object_geometry_get(ibb->bar_object, &bbx, &bby, &bbw, &bbh);
+ evas_pointer_canvas_xy_get(ibb->evas, &x, &y);
+ if ((ibb->ibar->conf.edge == EDGE_BOTTOM) ||
+ (ibb->ibar->conf.edge == EDGE_TOP))
+ {
+ Evas_Coord d;
+
+ d = x - ibb->start_x;
+ ibb->w = ibb->start_bw + d;
+ if (ibb->w < (bbw - bw + ibb->ibar->conf.iconsize))
+ {
+ ibb->w = bbw - bw + ibb->ibar->conf.iconsize;
+ }
+ else if (ibb->w > ww)
+ {
+ ibb->w = ww;
+ }
+ if ((ibb->x + ibb->w) > ww)
+ {
+ ibb->w = ww - ibb->x;
+ }
+ }
+ else if ((ibb->ibar->conf.edge == EDGE_LEFT) ||
+ (ibb->ibar->conf.edge == EDGE_RIGHT))
+ {
+ Evas_Coord d;
+
+ d = y - ibb->start_y;
+ ibb->h = ibb->start_bh + d;
+ if (ibb->h < (bbh - bh + ibb->ibar->conf.iconsize))
+ {
+ ibb->h = bbh - bh + ibb->ibar->conf.iconsize;
+ }
+ else if (ibb->h > hh)
+ {
+ ibb->h = hh;
+ }
+ if ((ibb->y + ibb->h) > hh)
+ {
+ ibb->h = hh - ibb->y;
+ }
+ }
+ _ibar_bar_reconfigure(ibb);
+ _ibar_bar_follower_reset(ibb);
+ _ibar_timer_handle(ibb);
+ return;
+ }
+}
--- /dev/null
+#ifndef E_MOD_MAIN_H
+#define E_MOD_MAIN_H
+
+typedef struct _IBar IBar;
+typedef struct _IBar_Bar IBar_Bar;
+typedef struct _IBar_Icon IBar_Icon;
+
+struct _IBar
+{
+ E_App *apps;
+ Evas_List *bars;
+ E_Menu *config_menu;
+ struct {
+ char *appdir;
+ double follow_speed;
+ double autoscroll_speed;
+ int width;
+ int iconsize;
+ int edge;
+ double anchor;
+ double handle;
+ unsigned char autohide : 1;
+ } conf;
+};
+
+struct _IBar_Bar
+{
+ IBar *ibar;
+ E_Container *con;
+ Evas *evas;
+
+ Evas_Object *bar_object;
+ Evas_Object *overlay_object;
+ Evas_Object *box_object;
+ Evas_Object *event_object;
+
+ Evas_List *icons;
+
+ Evas_Coord minsize, maxsize;
+
+ double align, align_req;
+ double follow, follow_req;
+ Ecore_Timer *timer;
+ Ecore_Animator *animator;
+
+ Evas_Coord x, y, w, h;
+
+ unsigned char move : 1;
+ unsigned char resize1 : 1;
+ unsigned char resize2 : 1;
+ Evas_Coord start_x, start_y;
+ Evas_Coord start_bx, start_by, start_bw, start_bh;
+};
+
+struct _IBar_Icon
+{
+ IBar_Bar *ibb;
+ E_App *app;
+ Evas_Object *bg_object;
+ Evas_Object *overlay_object;
+ Evas_Object *icon_object;
+ Evas_Object *event_object;
+ Evas_List *extra_icons;
+
+ unsigned char raise_on_hilight : 1;
+};
+
+#define EDGE_BOTTOM 0
+#define EDGE_TOP 1
+#define EDGE_LEFT 2
+#define EDGE_RIGHT 3
+
+#endif
--- /dev/null
+MAINTAINERCLEANFILES = Makefile.in
+MODULE = test
+
+# data files for the module
+filesdir = $(libdir)/enlightenment/modules/$(MODULE)
+files_DATA =
+EXTRA_DIST = $(files_DATA)
+
+# the module .so file
+INCLUDES = -I. \
+ -I$(top_srcdir) \
+ -I$(includedir) \
+ -I$(top_srcdir)$(MODULE) \
+ -I$(top_srcdir)/src/bin \
+ -I$(top_srcdir)/src/lib \
+ -I$(top_srcdir)/src/modules \
+ @e_cflags@
+pkgdir = $(libdir)/enlightenment/modules/$(MODULE)
+pkg_LTLIBRARIES = module.la
+module_la_SOURCES = e_mod_main.c \
+ e_mod_main.h
+module_la_LIBADD = @e_libs@ @dlopen_libs@
+module_la_LDFLAGS = -module -avoid-version
+module_la_DEPENDENCIES = $(top_builddir)/config.h
+
--- /dev/null
+#include "e.h"
+#include "e_mod_main.h"
+
+void *
+init(E_Module *m)
+{
+ if (m->api->version < E_MODULE_API_VERSION)
+ {
+ e_error_dialog_show("Module API Error",
+ "Error initializing Module: test\n"
+ "It requires a minimum module API version of: %i.\n"
+ "The module API advertized by Enlightenment is: %i.\n"
+ "Aborting module.",
+ E_MODULE_API_VERSION,
+ m->api->version);
+ return NULL;
+ }
+ {
+ E_Menu *mn;
+ E_Menu_Item *mi;
+
+ mn = e_menu_new();
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Module Config Menu Item 1");
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Module Config Menu Item 2");
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Module Config Menu Item 3");
+ mi = e_menu_item_new(mn);
+ e_menu_item_separator_set(mi, 1);
+ mi = e_menu_item_new(mn);
+ e_menu_item_label_set(mi, "Something Else");
+ m->config_menu = mn;
+ }
+ return init; /* bogus pointer - just to say we worked */
+}
+
+int
+shutdown(E_Module *m)
+{
+ if (m->config_menu)
+ {
+ e_menu_deactivate(m->config_menu);
+ e_object_unref(E_OBJECT(m->config_menu));
+ m->config_menu = NULL;
+ }
+ return 1;
+}
+
+int
+save(E_Module *m)
+{
+ return 1;
+}
+
+int
+info(E_Module *m)
+{
+ m->label = strdup("Test!!!");
+ return 1;
+}
+
+int
+about(E_Module *m)
+{
+ e_error_dialog_show("Enlightenment Test Module",
+ "This module is VERY simple and is only used to test the basic\n"
+ "interface of the Enlightenment 0.17.0 module system. Please\n"
+ "Ignore this module unless you are working on the module system.");
+ return 1;
+}
--- /dev/null
+#ifndef E_MOD_MAIN_H
+#define E_MOD_MAIN_H
+
+#endif