+++ /dev/null
-ABOUT-NLS
-mkinstalldirs
-missing
-install-sh
-aclocal.m4
-Makefile.in
-configure
-config.log
-intl
-config.status
-config.cache
-Makefile
-stamp-h
-config.h
-po
-stamp-h.in
-ltmain.sh
-ltconfig
-libtool
-config.sub
-config.guess
+++ /dev/null
-The Rasterman <raster@rasterman.com>
-Christian Kreibich <cK@whoop.org>
-Burra <burra@colorado.edu>
-Graham MacDonald <macdonag@lineone.net>
-Alan Schmitt <alan.schmitt@inria.fr>
-Kevin Brosius <cobra@compuserve.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, its documentation and marketing & publicity
-materials, and acknowledgment shall be given in the documentation, materials
-and software packages that this Software was used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++ /dev/null
-Sun Mar 10 18:13:04 2002 Till Adam <till@adam-lilienthal.de>
- * add E_View_Look class
- * move view <-> dir and view <-> look <-> layout_dir to observer/observee
- * re-enable iconbar throbber
- * fix various small issues
-
-Wed Mar 06 21:41:07 2002 Till Adam <till@adam-lilienthal.de>
- * change name of E_View_Model to E_Dir
-
-Fri Mar 01 17:27:18 2002 Till Adam <till@adam-lilienthal.de>
- * dnd operations now only affect the currently focused view
-
-Thu Feb 28 18:45:12 CST 2002 Corey Donohoe <atmos@atmos.org>
- * Free bgs in e_view_cleanup, it might still be leaking elsewhere though
-
-Mon Feb 25 18:56:35 2002 Till Adam <till@adam-lilienthal.de>
- * start of ChangeLog ;)
- * several views of the same dir are now possible
- * added class E_File representing a file with stat and icon info
- * added class E_View_Model representing a dir with list of E_Files
- * added singleton E_View_Machine holding global lists of Views and
- View_Models
- * seperation of icon and file concepts
- * various small fixes and cleanups
+++ /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
-## Process this file with automake to produce Makefile.in
-
-SUBDIRS = src lib client tools doc
-
-MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
- config.h.in config.sub configure install-sh \
- ltconfig ltmain.sh missing mkinstalldirs \
- stamp-h.in
-
-install-data-local:
- @$(NORMAL_INSTALL)
- if test -d $(srcdir)/data; then \
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir); \
- (cd $(srcdir); tar -cf - data) | (cd $(DESTDIR)$(pkgdatadir); tar -xf -) \
- fi
-
-dist-hook:
- if test -d data; then \
- (cd $(srcdir); tar -cf - data) | (cd $(distdir); tar -xf -) \
- fi
-
-EXTRA_DIST = README AUTHORS COPYING e.spec
-
-docs:
- $(MAKE) -C $(top_srcdir)/doc docs
-
-if HAVE_JADE
-html-docs:
- $(MAKE) -C $(top_srcdir)/doc html-docs
-endif
-
+++ /dev/null
-###############################################################################
-
-NOTE: THIS WILL NOT COMPILE. DO NOT EVEN TRY.
-
-This is only here for historical reasons while we are busy putting together a
-new codebase (outside of CVS for now). It will come into CVS just as soon as
-it is sufficiently functional enough to manage windows at the most basic
-level. It already has a lot of functionality, but this is not considered
-"good enough" to hit CVS yet.
-
-###############################################################################
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Additional notes
-
-todo
- entry.c - check 'todo' entries (although nobody uses entries except for
- me in med, do they?)
- guides.c - imlib parts that aren't converted yet.
- text.c
- menu.c
- menubuild.c - e_observer_init() call.
- border.c - use e_evas_new_all in place of the inlined code. cleanup.
-
-
-+-----------------------------------------------------------------------------+
-| Enlightenment 0.17.pre CVS Code.... |
-+-----------------------------------------------------------------------------+
- The Rasterman - raster@rasterman.com
-
-*******************************************************************************
-**************** READ THIS! It is of the UTMOST IMPORTANCE! *******************
-*******************************************************************************
-
-This is the source code for Enlightenment 0.17 - If you got this you got it
-from Enlightenment's CVS repository - or from someone who took it out of the
-CVS repository.
-
-The CVS repository is full of code *IN DEVELOPMENT* - that often means it's
-in the middle of being worked on and may install strange things in strange
-places, make a mess, and may not even be compatible with a final release. If
-you at all use this code, you are HEAVILY URGED, when it is finally released,
-to remove all traces of anything this CVS code base has installed on your
-system (it is COMPLETELY up to you to keep track of that - do NOT expect any
-help), and then install the full release on a cleaned system. Don't come
-asking "can I just keep using CVS" once things are released - that is the
-reason I put this paragraph here - so you don't ask. The answer is the same
-as above - if there is a proper final release use that. CVS is really only
-for those heavily hacking on the code, or whose curiosity is too much to resist
-not giving it a look and try.
-
-Now we have that warning over and done with. How to build and install from
-CVS?
-
-$ ./autogen.sh && make
-$ su
-Password:
-<- as root ->
-# make install
-
-You should be able to use the binary of enlightenment as a window manager.
-
-you might be advised for cleanliness to do
-$ ./autogen.sh --prefix=/usr/local/e-17
-
-so it installs relative to the /usr/local/e-17 directory and keeps all the
-e-17 development code and data in that tree so it is easily removed when the
-time comes.
-
--------------------------------------------------------------------------------
-
-NOTES: Read these carefully!
-
-Enlightenment only handles a small subset of ICCCM and thus will have bugs -
-some applications will not behave correctly and may appear in odd spots or
-not resize or place themselves properly etc. Expect this - it's code being
-worked on. Just be happy it does as much as it already does.
-
-Enlightenment RELIES on lots of libraires that have been written. Ecore,
-Ebits, Evas, Edb, Imlib2, Efsd just to mention a few. Especially Ebits,
-Ecore, Efsd, Ferite, and Evas change in CVS often - you will need the absolute
-latest of these if you wish Enlightenment 0.17 code to run properly or compile.
-If you update Enlightenment from CVS update these too to get any changes they
-have in their trees.
-
-If you want to compile & install E 0.17 you probably install the packages
-Enlightenment needs in this order:
-
- (*) imlib2
- (*) edb
- (*) imlib2_loaders
- (*) evas
- (*) ebits
- (*) ecore
- (*) efsd
- (*) ferite (optional for now, but recommended)
- (*) e17
-
-since you got Enlightenment from CVS (if you didn't you should have) you must
-get all of the above from CVS - because the libraries Enlightenment depends on
-keep being updated as bugs are found and new features needed - and often they
-are not released for a while until things settle down, so make sure you get
-the latest of these from CVS.
-
-before you start installing the some of the above, some of the packages you
-will need - if you don't already have them, are:
-
- (*) freetype (1.1, 1.2 or 1.3 ... NOT 2.0)
- (*) libxml2
- (*) libpcre
- (*) fam
-
-and possibly ...
-
- (*) libjpeg
- (*) libpng
- (*) zlib
- (*) libtiff
- (*) libungif
+++ /dev/null
-#undef ENLIGHTENMENT_VERSION
-#undef ENLIGHTENMENT_MAJOR
-#undef ENLIGHTENMENT_MINOR
-#undef ENLIGHTENMENT_MICRO
-#undef ENABLE_NLS
-#undef HAVE_CATGETS
-#undef HAVE_GETTEXT
-#undef HAVE_LC_MESSAGES
-#undef HAVE_STPCPY
-#undef HAVE_LIBSM
-#undef PACKAGE_LOCALE_DIR
-#undef PACKAGE_DATA_DIR
-#undef PACKAGE_SOURCE_DIR
-#undef PACKAGE_BIN_DIR
-#undef PACKAGE_LIB_DIR
-#undef USE_FERITE
+++ /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>
-dnl @version $Id$
-
-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
-#!/bin/sh
-# Run this to generate all the initial makefiles, etc.
-
-abort () {
- echo "$1 not found or command failed. Aborting!"
- exit 1
-}
-
-srcdir=`dirname $0`
-PKG_NAME="the package."
-
-DIE=0
-
-(autoconf --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "**Error**: You must have \`autoconf' installed to."
- echo "Download the appropriate package for your distribution,"
- echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
- DIE=1
-}
-
-(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
- (libtool --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "**Error**: You must have \`libtool' installed."
- echo "Get ftp://ftp.gnu.org/pub/gnu/libtool-1.2d.tar.gz"
- echo "(or a newer version if it is available)"
- DIE=1
- }
-}
-
-(automake --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "**Error**: You must have \`automake' installed."
- echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
- echo "(or a newer version if it is available)"
- DIE=1
- NO_AUTOMAKE=yes
-}
-
-
-# if no automake, don't bother testing for aclocal
-test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
- echo
- echo "**Error**: Missing \`aclocal'. The version of \`automake'"
- echo "installed doesn't appear recent enough."
- echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
- echo "(or a newer version if it is available)"
- DIE=1
-}
-
-if test "$DIE" -eq 1; then
- exit 1
-fi
-
-if test -z "$*"; then
- echo "**Warning**: I am going to run \`configure' with no arguments."
- echo "If you wish to pass any to it, please specify them on the"
- echo \`$0\'" command line."
- echo
-fi
-
-case $CC in
-xlc )
- am_opt=--include-deps;;
-esac
-
-for coin in `find $srcdir -name configure.in -print`
-do
- dr=`dirname $coin`
- if test -f $dr/NO-AUTO-GEN; then
- echo skipping $dr -- flagged as no auto-gen
- else
- echo processing $dr
- macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
- ( cd $dr
- aclocalinclude="$ACLOCAL_FLAGS"
- for k in $macrodirs; do
- if test -d $k; then
- aclocalinclude="$aclocalinclude -I $k"
- ##else
- ## echo "**Warning**: No such directory \`$k'. Ignored."
- fi
- done
- if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
- echo "Running libtoolize..."
- libtoolize --force --copy || abort "libtoolize"
- fi
- echo "Running aclocal $aclocalinclude ..."
- aclocal $aclocalinclude || abort "aclocal"
- if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
- echo "Running autoheader..."
- autoheader || abort "autoheader"
- fi
- echo "Running automake --gnu $am_opt ..."
- automake --add-missing --gnu $am_opt || abort "automake"
- echo "Running autoconf ..."
- autoconf || abort "autoconf"
- )
- fi
-done
-
-#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
-
-if test x$NOCONFIGURE = x; then
- echo Running $srcdir/configure $conf_flags "$@" ...
- $srcdir/configure $conf_flags "$@" \
- && echo Now type \`make\' to compile $PKG_NAME || abort "configure"
-else
- echo Skipping configure process.
-fi
-
-
-cd data/borders/
-cd borderless
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-0.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
-cd ..
-cd default
-#ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-0.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-0.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-0.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-1.sticky-1.shaded-1.bits.db
-ln -sf selected-0.sticky-0.shaded-0.bits.db selected-0.sticky-1.shaded-1.bits.db
-cd ../../fonts
-ln -sf borzoib.ttf menu.ttf
-ln -sf borzoib.ttf text.ttf
+++ /dev/null
-#!/bin/bash
-# E17 checker script. Makes sure the user has the required programs, and
-# abort if not.
-# By Lyle (term) Kempler; same license applies to this as does the source
-# code it accompanies.
-
-# TODO:
-# - Make it check the actual version, and abort if too old.
-# - Make autogen.sh call it.
-
-# Base programs.
-M4=`which m4`
-AUTOMAKE=`which automake`
-AUTOCONF=`which autoconf`
-LIBTOOL=`which libtool`
-GETTEXT=`which gettext`
-
-# Our libraries.
-IMLIB2_CONFIG=`which imlib2-config`
-EDB_CONFIG=`which edb-config`
-EVAS_CONFIG=`which evas-config`
-EFSD_CONFIG=`which efsd-config`
-ECORE_CONFIG=`which ecore-config`
-EBITS_CONFIG=`which ebits-config`
-EWL_CONFIG=`which ewl-config`
-
-if [ -n "$M4" ]
-then
- echo -n "m4 : "
- $M4 --version
-else
- echo "No m4 found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$AUTOMAKE" ]
-then
- echo -n "automake: "
- $AUTOMAKE --version | grep automake
-else
- echo "No automake found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$AUTOCONF" ]
-then
- echo -n "autoconf: "
- $AUTOCONF --version | grep utoconf
-else
- echo "No autoconf found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$LIBTOOL" ]
-then
- echo -n "libtool : "
- $LIBTOOL --version
-else
- echo "No libtool found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$GETTEXT" ]
-then
- echo -n "gettext : "
- $GETTEXT --version | grep gettext
-else
- echo "No gettext found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-echo
-
-if [ -n "$IMLIB2_CONFIG" ]
-then
- echo -n "imlib2-config: "
- $IMLIB2_CONFIG --version
-else
- echo "No imlib2-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$EDB_CONFIG" ]
-then
- echo -n "edb-config : "
- $EDB_CONFIG --version
-else
- echo "No edb-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$EVAS_CONFIG" ]
-then
- echo -n "evas-config : "
- $EVAS_CONFIG --version
-else
- echo "No evas-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$EFSD_CONFIG" ]
-then
- echo -n "efsd-config : "
- $EFSD_CONFIG --version
-else
- echo "No efsd-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$ECORE_CONFIG" ]
-then
- echo -n "ecore-config : "
- $ECORE_CONFIG --version
-else
- echo "No ecore-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-if [ -n "$EBITS_CONFIG" ]
-then
- echo -n "ebits-config : "
- $EBITS_CONFIG --version
-else
- echo "No ebits-config found! This is a requirement for building Enlightenment 0.17."
- # Information on where to get it goes here.
- echo
- exit 1
-fi
-
-#if [ -n "$EWL_CONFIG" ]
-#then
-# echo -n "ewl-config : "
-# $EWL_CONFIG --version
-#else
-# echo "No ewl-config found! This is a requirement for building Enlightenment 0.17."
-# # Information on where to get it goes here.
-# echo
-# exit 1
-#fi
-
-if [ "$1" != "autogen" ]
-then
- echo
- echo "All requirements have been met! Happy building."
- echo
- exit 0
-fi
+++ /dev/null
-e_ipc_client
-Makefile.in
-Makefile
-.libs
-.deps
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-INCLUDES =
-
-bin_PROGRAMS = e_ipc_client
-
-e_ipc_client_SOURCES = \
-client.c
-
-e_ipc_client_LDADD =
-
+++ /dev/null
-#include <stdio.h>
-int main(void)
-{
- return(0);
-}
+++ /dev/null
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT
-AC_CONFIG_SRCDIR([configure.in])
-
-ENLIGHTENMENT_MAJOR=0
-ENLIGHTENMENT_MINOR=17
-ENLIGHTENMENT_MICRO=pre_0
-ENLIGHTENMENT_VERSION=$ENLIGHTENMENT_MAJOR.$ENLIGHTENMENT_MINOR.$ENLIGHTENMENT_MICRO
-
-VERSION=$ENLIGHTENMENT_VERSION
-
-AM_INIT_AUTOMAKE(enlightenment, $VERSION)
-AM_CONFIG_HEADER(config.h)
-
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_VERSION, "$ENLIGHTENMENT_VERSION")
-AC_SUBST(ENLIGHTENMENT_VERSION)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MAJOR, "$ENLIGHTENMENT_MAJOR")
-AC_SUBST(ENLIGHTENMENT_MAJOR)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MINOR, "$ENLIGHTENMENT_MINOR")
-AC_SUBST(ENLIGHTENMENT_MINOR)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MICRO, "$ENLIGHTENMENT_MICRO")
-AC_SUBST(ENLIGHTENMENT_MICRO)
-
-AC_ISC_POSIX
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_HEADER_STDC
-AC_C_CONST
-AM_ENABLE_SHARED
-AM_PROG_LIBTOOL
-
-AM_WITH_DMALLOC
-
-dnl Add the languages which your application supports here.
-ALL_LINGUAS=""
-
-dnl Set PACKAGE_LOCALE_DIR in config.h.
-if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
-else
- AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
-fi
-
-dnl Set PACKAGE_DATA_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/share'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
-fi
-
-dnl Set PACKAGE_BIN_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/bin'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
-fi
-
-dnl Set PACKAGE_LIB_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/lib'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
-fi
-
-dnl Set PACKAGE_SOURCE_DIR in config.h.
-packagesrcdir=`cd $srcdir && pwd`
-AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
-
-dnl Use -Wall if we have gcc.
-changequote(,)dnl
-if test "x$GCC" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wall" ;;
- esac
-fi
-changequote([,])dnl
-
-dnl Check for Imlib2.
-AC_ARG_WITH(imlib2,
- [ --with-imlib2=DIR use imlib2 in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(imlib2,, [
- AC_SUBST(imlib2_libs)
- AC_SUBST(imlib2_cflags)],
- AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in path?))
-imlib2_libs=`imlib2-config --libs`
-imlib2_cflags=`imlib2-config --cflags`
-
-dnl Check for Evas.
-AC_ARG_WITH(evas,
- [ --with-evas=DIR use evas in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(evas,, [
- AC_SUBST(evas_libs)
- AC_SUBST(evas_cflags)],
- AC_MSG_ERROR(Cannot find evas: Is evas-config in path?))
-evas_libs=`evas-config --libs`
-evas_cflags=`evas-config --cflags`
-
-dnl Check for Edb.
-AC_ARG_WITH(edb,
- [ --with-edb=DIR use edb in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(edb,, [
- AC_SUBST(edb_libs)
- AC_SUBST(edb_cflags)],
- AC_MSG_ERROR(Cannot find edb: Is edb-config in path?))
-edb_libs=`edb-config --libs`
-edb_cflags=`edb-config --cflags`
-
-dnl Check for Ebits.
-AC_ARG_WITH(ebits,
- [ --with-ebits=DIR use ebits in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ebits,, [
- AC_SUBST(ebits_libs)
- AC_SUBST(ebits_cflags)],
- AC_MSG_ERROR(Cannot find ebits: Is ebits-config in path?))
-ebits_libs=`ebits-config --libs`
-ebits_cflags=`ebits-config --cflags`
-
-dnl Check for Ecore.
-AC_ARG_WITH(ecore,
- [ --with-ecore=DIR use ecore in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ecore,, [
- AC_SUBST(ecore_libs)
- AC_SUBST(ecore_cflags)],
- AC_MSG_ERROR(Cannot find ecore: Is ecore-config in path?))
-ecore_libs=`ecore-config --libs`
-ecore_cflags=`ecore-config --cflags`
-
-dnl Check for Efsd.
-AC_ARG_WITH(efsd,
- [ --with-efsd=DIR use efsd in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(efsd,, [
- AC_SUBST(efsd_libs)
- AC_SUBST(efsd_cflags)],
- AC_MSG_ERROR(Cannot find efsd: Is efsd-config in path?))
-efsd_libs=`efsd-config --libs`
-efsd_cflags=`efsd-config --cflags`
-
-dnl Check for Edb.
-AC_ARG_WITH(ebg,
- [ --with-ebg=DIR use ebg in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ebg,, [
- AC_SUBST(ebg_libs)
- AC_SUBST(ebg_cflags)],
- AC_MSG_ERROR(Cannot find ebg: Is ebg-config in path?))
-ebg_libs=`ebg-config --libs`
-ebg_cflags=`ebg-config --cflags`
-
-CFLAGS=$imlib2_cflags
-LIBS=$imlib2_libs
-dnl Check for db loader.
-AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <X11/Xlib.h>
-#include <Imlib2.h>
-
-int main(int argc, char **argv) {
-Imlib_Image im;
-int width;
-
-im = imlib_load_image("$packagesrcdir/data/test/test.db:/test/image");
-if (!im) exit(-1);
-imlib_context_set_image(im);
-width = imlib_image_get_width();
-if (width != 7) exit(-1);
-exit(0);
-return 0;
-argv=NULL;
-argc=0;
-}
-],
-[echo "checking for imlib2 db loader... yes"],
-[
-echo "checking for imlib2 db loader... no"
-AC_MSG_ERROR(Cannot detect db loader: Have you installed imlib2_loaders?)
-],
-AC_MSG_ERROR(Sorry. Enlightenment cannot be cross-compiled.))
-
-
-dnl Checking for Perl:
-AC_PATH_PROG(PERL,perl,0)
-AC_SUBST(PERL)
-
-
-dnl Look for jade for sgml translations.
-AC_ARG_WITH(dbsheets,
- [ --with-dbsheets=DIR use DIR to specify your DocBook stylesheets installation path.],
- DB_STYLESHEETS="$withval", DB_STYLESHEETS="/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh")
-AC_SUBST(DB_STYLESHEETS)
-AC_PATH_PROG(JADE, jade)
-AM_CONDITIONAL(HAVE_JADE, test "x$JADE" != "x" && test -d "$DB_STYLESHEETS")
-AC_CHECK_LIB(c, dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
-AC_SUBST(LIBDL)
-
-AC_CONFIG_FILES([
-Makefile
-src/Makefile
-lib/Makefile
-client/Makefile
-tools/Makefile
-doc/Makefile
-doc/kernel-doc
-doc/html-customizations.dsl
-data/scripts/build_iconbar_db.sh
-])
-AC_CONFIG_COMMANDS([default],[[
-chmod +x doc/kernel-doc
-]],[[]])
-AC_OUTPUT
-
+++ /dev/null
-dnl Process this file with autoconf to produce a configure script.
-
-AC_INIT
-
-ENLIGHTENMENT_MAJOR=0
-ENLIGHTENMENT_MINOR=17
-ENLIGHTENMENT_MICRO=pre_0
-ENLIGHTENMENT_VERSION=$ENLIGHTENMENT_MAJOR.$ENLIGHTENMENT_MINOR.$ENLIGHTENMENT_MICRO
-
-VERSION=$ENLIGHTENMENT_VERSION
-
-AM_INIT_AUTOMAKE(enlightenment, $VERSION)
-AM_CONFIG_HEADER(config.h)
-
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_VERSION, "$ENLIGHTENMENT_VERSION")
-AC_SUBST(ENLIGHTENMENT_VERSION)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MAJOR, "$ENLIGHTENMENT_MAJOR")
-AC_SUBST(ENLIGHTENMENT_MAJOR)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MINOR, "$ENLIGHTENMENT_MINOR")
-AC_SUBST(ENLIGHTENMENT_MINOR)
-AC_DEFINE_UNQUOTED(ENLIGHTENMENT_MICRO, "$ENLIGHTENMENT_MICRO")
-AC_SUBST(ENLIGHTENMENT_MICRO)
-
-AC_ISC_POSIX
-AC_PROG_CC
-AM_PROG_CC_STDC
-AC_HEADER_STDC
-AC_C_CONST
-AM_ENABLE_SHARED
-AM_PROG_LIBTOOL
-
-AM_WITH_DMALLOC
-
-dnl Add the languages which your application supports here.
-ALL_LINGUAS=""
-
-dnl Set PACKAGE_LOCALE_DIR in config.h.
-if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
-else
- AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
-fi
-
-dnl Set PACKAGE_DATA_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/share'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
-fi
-
-dnl Set PACKAGE_BIN_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/bin'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
-fi
-
-dnl Set PACKAGE_LIB_DIR in config.h.
-if test "x${datadir}" = 'x${prefix}/lib'; then
- if test "x${prefix}" = "xNONE"; then
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
- else
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
- fi
-else
- AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
-fi
-
-dnl Set PACKAGE_SOURCE_DIR in config.h.
-packagesrcdir=`cd $srcdir && pwd`
-AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
-
-dnl Use -Wall if we have gcc.
-changequote(,)dnl
-if test "x$GCC" = "xyes"; then
- case " $CFLAGS " in
- *[\ \ ]-Wall[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wall" ;;
- esac
-fi
-changequote([,])dnl
-
-dnl Check for Imlib2.
-AC_ARG_WITH(imlib2,
- [ --with-imlib2=DIR use imlib2 in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(imlib2,, [
- AC_SUBST(imlib2_libs)
- AC_SUBST(imlib2_cflags)],
- AC_MSG_ERROR(Cannot find imlib2: Is imlib2-config in path?))
-imlib2_libs=`imlib2-config --libs`
-imlib2_cflags=`imlib2-config --cflags`
-
-dnl Check for Evas.
-AC_ARG_WITH(evas,
- [ --with-evas=DIR use evas in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(evas,, [
- AC_SUBST(evas_libs)
- AC_SUBST(evas_cflags)],
- AC_MSG_ERROR(Cannot find evas: Is evas-config in path?))
-evas_libs=`evas-config --libs`
-evas_cflags=`evas-config --cflags`
-
-dnl Check for Edb.
-AC_ARG_WITH(edb,
- [ --with-edb=DIR use edb in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(edb,, [
- AC_SUBST(edb_libs)
- AC_SUBST(edb_cflags)],
- AC_MSG_ERROR(Cannot find edb: Is edb-config in path?))
-edb_libs=`edb-config --libs`
-edb_cflags=`edb-config --cflags`
-
-dnl Check for Ebits.
-AC_ARG_WITH(ebits,
- [ --with-ebits=DIR use ebits in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ebits,, [
- AC_SUBST(ebits_libs)
- AC_SUBST(ebits_cflags)],
- AC_MSG_ERROR(Cannot find ebits: Is ebits-config in path?))
-ebits_libs=`ebits-config --libs`
-ebits_cflags=`ebits-config --cflags`
-
-dnl Check for Ecore.
-AC_ARG_WITH(ecore,
- [ --with-ecore=DIR use ecore in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ecore,, [
- AC_SUBST(ecore_libs)
- AC_SUBST(ecore_cflags)],
- AC_MSG_ERROR(Cannot find ecore: Is ecore-config in path?))
-ecore_libs=`ecore-config --libs`
-ecore_cflags=`ecore-config --cflags`
-
-dnl Check for Efsd.
-AC_ARG_WITH(efsd,
- [ --with-efsd=DIR use efsd in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(efsd,, [
- AC_SUBST(efsd_libs)
- AC_SUBST(efsd_cflags)],
- AC_MSG_ERROR(Cannot find efsd: Is efsd-config in path?))
-efsd_libs=`efsd-config --libs`
-efsd_cflags=`efsd-config --cflags`
-
-dnl Check for Edb.
-AC_ARG_WITH(ebg,
- [ --with-ebg=DIR use ebg in <DIR>],
- [CFLAGS="$CFLAGS -I$withval/include"
- LIBS="-L$withval/lib $LIBS"])
-
-AC_PATH_GENERIC(ebg,, [
- AC_SUBST(ebg_libs)
- AC_SUBST(ebg_cflags)],
- AC_MSG_ERROR(Cannot find ebg: Is ebg-config in path?))
-ebg_libs=`ebg-config --libs`
-ebg_cflags=`ebg-config --cflags`
-
-CFLAGS=$imlib2_cflags
-LIBS=$imlib2_libs
-dnl Check for db loader.
-AC_TRY_RUN([
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <X11/Xlib.h>
-#include <Imlib2.h>
-
-int main(int argc, char **argv) {
-Imlib_Image im;
-int width;
-
-im = imlib_load_image("$packagesrcdir/data/test/test.db:/test/image");
-if (!im) exit(-1);
-imlib_context_set_image(im);
-width = imlib_image_get_width();
-if (width != 7) exit(-1);
-exit(0);
-return 0;
-argv=NULL;
-argc=0;
-}
-],
-[echo "checking for imlib2 db loader... yes"],
-[
-echo "checking for imlib2 db loader... no"
-AC_MSG_ERROR(Cannot detect db loader: Have you installed imlib2_loaders?)
-],
-AC_MSG_ERROR(Sorry. Enlightenment cannot be cross-compiled.))
-
-
-dnl Checking for Perl:
-AC_PATH_PROG(PERL,perl,0)
-AC_SUBST(PERL)
-
-
-dnl Look for jade for sgml translations.
-AC_ARG_WITH(dbsheets,
- [ --with-dbsheets=DIR use DIR to specify your DocBook stylesheets installation path.],
- DB_STYLESHEETS="$withval", DB_STYLESHEETS="/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh")
-AC_SUBST(DB_STYLESHEETS)
-AC_PATH_PROG(JADE, jade)
-AM_CONDITIONAL(HAVE_JADE, test "x$JADE" != "x" && test -d "$DB_STYLESHEETS")
-AC_CHECK_LIB(c, dlopen, LIBDL="",[AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
-AC_SUBST(LIBDL)
-
-AC_OUTPUT([
-Makefile
-src/Makefile
-lib/Makefile
-client/Makefile
-tools/Makefile
-doc/Makefile
-doc/kernel-doc
-doc/html-customizations.dsl
-data/scripts/build_iconbar_db.sh
-], [
-chmod +x doc/kernel-doc
-])
+++ /dev/null
-This directory contains the following epplets:
- - clock.fe
- - large time-only display
- - clock2.fe
- - more graphical clock display with date as well as time
-
-To use these epplets, simply copy this directory to ~/.e/desktop/default/.e_epplets. This will show clock.fe by default. In order to use clock2.fe, simply rename clock2.fe to clock.fe.
-
-Thanks to:
- - Brian Mattern for helping me get started
- - Thibaud for the clock2 background graphic
- - The graphic is from his Saona theme (http://www.deviantart.com/deviation.php?id=73252) for HoverDesk
+++ /dev/null
-/*-------------------------------------------------------*
- * Simple clock epplet *
- * by Brendon Davidson *
- * Thanks to Brian Mattern for helping me understand *
- * how epplets work. *
- *-------------------------------------------------------*/
-
-uses String, Time;
-
-/* global vars */
-global {
- object epp;
- object dateObj;
- string theDay = "";
-}
-
-/* function to update time display */
-function time_update(object data, number val){
- string date = Time.ctime(Time.time());
- string month = String.copySection(date,4,7);
- string day = String.copySection(date,8,10);
- string year = String.copySection(date,20,24);
- string time = String.copySection(date,11,20);
- number hour = String.toLong(String.copySection(time,0,2));
- string min = String.copySection(time,3,5);
- string seconds = String.copySection(time,6,8);
- string timeofday = "AM";
-
- if(hour>12||hour==12){
- timeofday = "PM";
- hour = hour - 12;
- }
- if(hour==0) hour = 12;
-
-
- /* Is it time to update the date? */
- if(day!=theDay){
- theDay = day;
- switch(month){
- case "Jan":
- month = "January";
- break;
- case "Feb":
- month = "February";
- break;
- case "Mar":
- month = "March";
- break;
- case "Apr":
- month = "April";
- break;
- case "Jun":
- month = "June";
- break;
- case "Jul":
- month = "July";
- break;
- case "Aug":
- month = "August";
- break;
- case "Sep":
- month = "September";
- break;
- case "Oct":
- month = "October";
- break;
- case "Nov":
- month = "November";
- break;
- case "Dec":
- month = "December";
- break;
- }
- dateObj.setText("$month $day, $year");
- }
-
-
- data.setText("$hour:$min:$seconds $timeofday");
- epp.addTimer("clockTimer",0.5,"time_update",0,data);
-}
-
-/* main function */
-
-/* declare vars */
-object timeObj;
-object backgroundObj;
-
-/* create a new epplet */
-epp = new Epplet();
-
-/* move the epplet to desired position*/
-epp.resize(100, 30);
-
-/* create background image object for clock */
-backgroundObj = new EvasObject(epp);
-backgroundObj.addImage(epp.getEppletDir()+"clock.png");
-backgroundObj.move(epp.getX(),epp.getY());
-backgroundObj.setLayer(9998);
-backgroundObj.show();
-
-/* create text object for clock display */
-timeObj = new EvasObject(epp);
-timeObj.addText("borzoib",6,"Hi");
-timeObj.move(epp.getX()+epp.getW()-40, epp.getY()+4);
-timeObj.setLayer(9999);
-timeObj.setColor(0,0,0,140);
-timeObj.show();
-
-/* create text object for date display */
-dateObj = new EvasObject(epp);
-dateObj.addText("borzoib",6,"Hello");
-dateObj.move(epp.getX()+epp.getW()-60,epp.getY()+12);
-dateObj.setLayer(9999);
-dateObj.setColor(0,0,0,140);
-dateObj.show();
-
-/* update clock display */
-time_update(timeObj,0);
-
-
-
-
-
+++ /dev/null
-/*-------------------------------------------------------*
- * Simple clock epplet *
- * by Brendon Davidson *
- * Thanks to Brian Mattern for helping me understand *
- * how epplets work. *
- *-------------------------------------------------------*/
-
-uses String, Time;
-
-/* global vars */
-global {
- object epp;
- object dateObj;
- string theDay = "";
-}
-
-/* function to update time display */
-function time_update(object data, number val){
- string date = Time.ctime(Time.time());
- string month = String.copySection(date,4,7);
- string day = String.copySection(date,8,10);
- string year = String.copySection(date,20,24);
- string time = String.copySection(date,11,20);
- number hour = String.toLong(String.copySection(time,0,2));
- string min = String.copySection(time,3,5);
- string seconds = String.copySection(time,6,8);
- string timeofday = "AM";
-
- if(hour>12||hour==12){
- timeofday = "PM";
- hour = hour - 12;
- }
- if(hour==0) hour = 12;
-
-
- /* Is it time to update the date? */
- if(day!=theDay){
- theDay = day;
- switch(month){
- case "Jan":
- month = "January";
- break;
- case "Feb":
- month = "February";
- break;
- case "Mar":
- month = "March";
- break;
- case "Apr":
- month = "April";
- break;
- case "Jun":
- month = "June";
- break;
- case "Jul":
- month = "July";
- break;
- case "Aug":
- month = "August";
- break;
- case "Sep":
- month = "September";
- break;
- case "Oct":
- month = "October";
- break;
- case "Nov":
- month = "November";
- break;
- case "Dec":
- month = "December";
- break;
- }
- dateObj.setText("$month $day, $year");
- }
-
-
- data.setText("$hour:$min:$seconds $timeofday");
- epp.addTimer("clockTimer",0.5,"time_update",0,data);
-}
-
-/* main function */
-
-/* declare vars */
-object timeObj;
-object backgroundObj;
-
-/* create a new epplet */
-epp = new Epplet();
-
-epp.resize(100, 30);
-
-/* create background image object for clock */
-backgroundObj = new EvasObject(epp);
-backgroundObj.addImage(epp.getEppletDir()+"clock.png");
-backgroundObj.move(epp.getX(),epp.getY());
-backgroundObj.setLayer(9998);
-backgroundObj.show();
-
-/* create text object for clock display */
-timeObj = new EvasObject(epp);
-timeObj.addText("borzoib",8,"");
-timeObj.move(epp.getX()+epp.getW()-33, epp.getY()+6);
-timeObj.setLayer(9999);
-timeObj.setColor(0,0,0,140);
-timeObj.show();
-
-/* create text object for date display */
-dateObj = new EvasObject(epp);
-dateObj.addText("borzoib",8,"");
-dateObj.move(epp.getX()+epp.getW()-60,epp.getY()+35);
-dateObj.setLayer(9999);
-dateObj.setColor(0,0,0,140);
-dateObj.show();
-
-/* update clock display */
-time_update(timeObj,0);
-
-
-
-
-
+++ /dev/null
-/*
- An ebits version of the desktop switcher.
- Written by James Carscadden and Brian Mattern
-
- Use bits named Changer_# where # is 0 - 7 for the buttons. The disabled state
- is used for the current desktop.
-*/
-
-uses Console, String;
-
-/* define observer function */
-function changerObserver(object data, number desk)
-{
- number i, n;
- /* get the desktop number as an int. n is passed as a float (0.000000, 1.00000000, ...) and i just want (0, 1, ...) */
- n = String.toLong(String.copySection("" + desk, 0, 1));
- Console.println("in changerObserver: " + desk + ", " + n);
-
- for (i = 0; i < 8; i++)
- data.setState("Changer_" + i, "normal");
- data.setState("Changer_" + n, "disabled");
-}
-
-/* define callback function */
-function changer_button_cb(object ev, string c, number b, number x, number y, number ox, number oy, number ow, number oh)
-{
- number n, i;
-
- Console.println("in changer_button_cb: " + c);
- /* the '+ " "' is included to make it work with broken ferite .99.4 String.copySection() func */
- n = String.toLong(String.copySection(c + " ", 8, 9));
- e.flip_to_desktop(n);
-}
-
-/* ---------------------main func-------------------------- */
-
-/* declare vars */
-object epp;
-object ebits;
-number i;
-
-/* create a new epplet, required */
-epp = new Epplet();
-
-/* add an ebits object to the epplet */
-ebits = new Ebits("changer.bits.db", epp);
-
-/* move the epplet to the top right corner */
-epp.move(epp.getViewW() - 100, 0);
-
-/* set the ebits object as the main epplet bits */
-epp.setBits(ebits);
-
-/* display the epplet. this resizes / moves the main epplet bits to the geometry of the epplet */
-epp.display();
-
-/* set up callbacks for when button is pressed */
-ebits.setCallback("Changer_0", "changer_button_cb", ebits);
-ebits.setCallback("Changer_1", "changer_button_cb", ebits);
-ebits.setCallback("Changer_2", "changer_button_cb", ebits);
-ebits.setCallback("Changer_3", "changer_button_cb", ebits);
-ebits.setCallback("Changer_4", "changer_button_cb", ebits);
-ebits.setCallback("Changer_5", "changer_button_cb", ebits);
-ebits.setCallback("Changer_6", "changer_button_cb", ebits);
-ebits.setCallback("Changer_7", "changer_button_cb", ebits);
-
-/* e starts on desktop 0, so set it disabled */
-ebits.setState("Changer_0", "disabled");
-
-/* add observer, when the desktop is switched, the function "deskSwitchObserver is called, and ebits is passed
- along with it (although it isn't used);*/
-epp.addDesktopObserver("changerObserver", ebits);
-
+++ /dev/null
-/*
- An simple example epplet that uses evas objects.
- Shows 8 buttons in the top right corner. Click on one to go to that deskop.
- Currently it won't notice if you change desktops by other methods, so it
- won't update.
-*/
-
-uses Console, Array;
-
-global {
- array desks;
-}
-
-/* set up observer functions */
-function deskSwitchObserver(object data, number desk)
-{
- number i;
- Console.println("in deskSwitchObserver: " + desk);
-
- for(i = 0; i < Array.size(desks); i++)
- {
- if (i != desk)
- {
- desks[i].obj.setColor(255,255,255,128);
- }
- }
- desks[desk].obj.setColor(255,255,255,255);
-}
-
-
-
-/* set up callback function */
-function downCB(object d, object ev, number b, number x, number y)
-{
- d.obj.setColor(255,255,255,255);
-}
-
-function upCB(object d, object ev, number b, number x, number y)
-{
- number i;
-
- e.flip_to_desktop(d.num);
-
- /* dim all buttons that aren't this one */
- for(i = 0; i < Array.size(desks); i++)
- {
- if (i != d.num)
- {
- desks[i].obj.setColor(255,255,255,128);
- }
- }
-}
-
-class DesktopButton
-{
- object epp, obj;
- number num;
-
- function DesktopButton(object e, number n)
- {
- self.epp = e;
- self.num = n;
- }
-
- function setup()
- {
-
- self.obj = new EvasObject(self.epp);
- self.obj.addImage(self.epp.getEppletDir() + "desktop.png");
-
- self.obj.move(self.epp.getX() + (self.num % 4) * (self.obj.getW() + 5),
- self.epp.getY() + (self.num / 4) * (self.obj.getH() + 5));
- self.obj.setLayer(10000);
- self.obj.setColor(255, 255, 255, 128);
- self.obj.show();
-
- self.obj.setCallback("CALLBACK_MOUSE_DOWN", "downCB", self);
- self.obj.setCallback("CALLBACK_MOUSE_UP", "upCB", self);
-
- }
-}
-
-
-/* main func */
-
-/* declare vars */
-object epp;
-object bg;
-number i;
-
-/* create a new epplet, required */
-epp = new Epplet();
-
-/* move the epplet to the top right corner */
-epp.move(epp.getViewW() - 100, 0);
-epp.resize(200, 45);
-
-
-/* set up a transparent background to prevent menu popup */
-bg = new EvasObject(epp);
-bg.addRectangle();
-bg.move(epp.getX(), epp.getY());
-bg.resize(epp.getW(), epp.getH());
-bg.setLayer(9999);
-bg.setColor(255, 255, 255, 0);
-bg.show();
-
-/* build DesktopButton's */
-for (i = 0; i < 8; i++)
-{
- Console.println("in loop");
- desks[] = new DesktopButton(epp, i);
- desks[i].setup();
-}
-
-/* add observer, when the desktop is switched, the function "deskSwitchObserver is called, and passed epp along with it (although it isn't used);*/
-
-epp.addDesktopObserver("deskSwitchObserver", epp);
-
-/* start out by highlighting the current desktop */
-desks[e.get_current_desktop()].obj.setColor(255, 255, 255, 255);
-
+++ /dev/null
-
-uses String, File, Console;
-
-global
-{
- object epplet;
- object eppletBackground;
- object uptimeLabel;
- object loadLabel;
-}
-
-function create_epplet()
-{
- epplet = new Epplet();
- epplet.resize(127, 24);
- eppletBackground = new EvasObject(epplet);
- eppletBackground.addImage(epplet.getEppletDir() + "uptime.png");
- eppletBackground.move(epplet.getX(), epplet.getY());
- eppletBackground.setLayer(9998);
- eppletBackground.show();
-
- uptimeLabel = new EvasObject(epplet);
- uptimeLabel.addText("borzoib", 6, "");
- uptimeLabel.move(epplet.getX() + epplet.getW() - 12 - uptimeLabel.getW(), epplet.getY()+4);
- uptimeLabel.setLayer(9999);
- uptimeLabel.setColor(0, 0, 0, 140);
- uptimeLabel.show();
-
- loadLabel = new EvasObject(epplet);
- loadLabel.addText("borzoib", 6,"");
- loadLabel.move(epplet.getX() + epplet.getW() - 12 - loadLabel.getW(), epplet.getY()+12);
- loadLabel.setLayer(9999);
- loadLabel.setColor(0, 0, 0, 140);
- loadLabel.show();
-}
-
-function update_uptime(object data, number val)
-{
- object file;
- number uptime_num, udays, uhours, uminutes;
- string uptime_str;
-
- file = new File();
-
- file->open("/proc/uptime", "r", "");
-
- uptime_str = file->readln(1024);
- uptime_str =~ s/ .+//;
-
- uptime_num = String.toLong(uptime_str);
-
- file->close();
-
- udays = uptime_num / 86400;
- uhours = (uptime_num % 86400) / 3600;
- uminutes = ((uptime_num % 86400) % 3600) / 60;
-
- uptime_str = "" + udays + "day";
-
- if (udays != 1)
- uptime_str += "s";
-
- uptime_str += " " + uhours + "hour";
-
- if (uhours != 1)
- uptime_str += "s";
-
- uptime_str += " " + uminutes + "min";
-
- if (uminutes != 1)
- uptime_str += "s";
-
-/* Console.println(uptime_str);*/
- uptimeLabel.setText(uptime_str);
- uptimeLabel.move(epplet.getX() + epplet.getW() - 12 - uptimeLabel.getW(), epplet.getY()+4);
-
- epplet.addTimer("update_uptimeTimer",0.5,"update_uptime",0,data);
-}
-
-function update_sysload(object data, number val)
-{
- object file;
- number uptime_num, load_1, load_5, load_15;
- string load_avg, tmp;
-
- file = new File();
-
- file->open("/proc/loadavg", "r", "");
-
- load_avg = file->readln(1024);
-
- load_avg = String.copySection(load_avg, 0, 14);
-
- load_avg =~ s/^([^ ]*) ([^ ]*)/\1, \2,/;
-
- load_avg = "Load: " + load_avg;
-
- loadLabel.setText(load_avg);
-
- loadLabel.move(epplet.getX() + epplet.getW() - 12 - loadLabel.getW(), epplet.getY()+12);
- epplet.addTimer("update_sysloadTimer",0.5,"update_sysload",0,data);
-}
-
-create_epplet();
-
-update_uptime(epplet, 0);
-update_sysload(epplet, 0);
+++ /dev/null
-#!/bin/sh
-
-# this is the databse to create
-DB="./apps_menu.db"
-
-# shell function calls that setup, cleanup and build menus in a menus database
-setup ()
-{
- NUM=0
- ENTRYNUM=0
- MENUNUM=0
- rm -f $DB
-}
-
-finish ()
-{
- N=$[ $MENUNUM + 1 ];
- edb_ed $DB add "/menu/count" int $N
-}
-
-menu ()
-{
- ENTRYNUM=0
- MENUNUM=$1;
- M1=$[ $MENUNUM + 1 ];
- if [ $M1 -gt $NUM ]; then
- NUM=$M1;
- fi
-}
-
-end_menu ()
-{
- edb_ed $DB add "/menu/"$MENUNUM"/count" int $ENTRYNUM
-}
-
-entry ()
-{
- if [ $1 = "text" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/text" str "$2"
- if [ "$3" = "sub" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/submenu" int $4
- else
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/command" str "$3"
- fi
-
-
- else if [ $1 = "icon" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/icon" str "$2"
- if [ "$3" = "sub" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/submenu" int $4
- else
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/command" str "$3"
- fi
-
-
- else if [ $1 = "both" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/text" str "$2"
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/icon" str "$3"
- if [ "$4" = "sub" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/submenu" int $5
- else
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/command" str "$4"
- fi
-
-
- else if [ $1 = "separator" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/separator" int 1
-
-
- else if [ $1 = "script" ]; then
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/text" str "$2"
- edb_ed $DB add "/menu/"$MENUNUM"/"$ENTRYNUM"/script" str "$3"
-
- fi; fi; fi; fi; fi
- ENTRYNUM=$[ $ENTRYNUM + 1 ];
-}
-
-
-
-
-###############################################################################
-##
-## Menus are defined here
-##
-## IF you want to edit anything - edit this - it's REALLY simple.
-
-setup
-
-menu 0
-entry both 'Eterm' '/usr/share/pixmaps/gnome-eterm.png' 'Eterm'
-entry both 'Netscape' '/usr/share/pixmaps/netscape.png' 'netscape'
-entry both 'TkRat' '/usr/share/pixmaps/gnome-ccdesktop.png' 'tkrat'
-entry both 'X Chat' '/usr/share/pixmaps/gnome-irc.png' 'xchat'
-entry both 'XMMS' '/usr/share/pixmaps/mc/gnome-audio.png' 'xmms'
-entry both 'The GIMP' '/usr/share/pixmaps/gimp.png' 'gimp'
-entry separator
-entry both 'XTerm' '/usr/share/pixmaps/gnome-term.png' 'xterm'
-entry both 'XMag' '/usr/share/pixmaps/gnome-applets.png' 'xmag'
-entry separator
-entry text 'Network' 'sub' 1
-entry text 'System' 'sub' 2
-entry text 'Desktop' 'sub' 3
-entry script 'Exit' 'e.shutdown();'
-end_menu
-
-menu 1
-entry text 'Ethernet On' '/sbin/ifup eth0'
-entry text 'Ethernet Off' '/sbin/ifdown eth0'
-end_menu
-
-menu 2
-entry text 'Shut Down' 'sudo -S /sbin/shutdown -h now'
-entry text 'Reboot' 'sudo -S /sbin/shutdown -r now'
-end_menu
-
-menu 3
-entry script 'Goto Desktop 0' 'e.flip_to_desktop(0);'
-entry script 'Goto Desktop 1' 'e.flip_to_desktop(1);'
-entry script 'Goto Desktop 2' 'e.flip_to_desktop(2);'
-entry script 'Goto Desktop 3' 'e.flip_to_desktop(3);'
-end_menu
-
-finish
+++ /dev/null
-# enumerated variables - don't touch these
-ACT_MOUSE_IN=0
-ACT_MOUSE_OUT=1
-ACT_MOUSE_CLICK=2
-ACT_MOUSE_DOUBLE=3
-ACT_MOUSE_TRIPLE=4
-ACT_MOUSE_UP=5
-ACT_MOUSE_CLICKED=6
-ACT_MOUSE_MOVE=7
-ACT_KEY_DOWN=8
-ACT_KEY_UP=9
-
-MOD_ANY=-1
-MOD_NONE=0
-MOD_SHIFT=1
-MOD_CTRL=2
-MOD_ALT=4
-MOD_WIN=8
-MOD_CTRL_ALT=$[ $MOD_CTRL + $MOD_ALT ];
-
-FOCUS_POINTER=0
-FOCUS_SLOPPY=1
-FOCUS_CLICK=2
-
-WINDOW_MODE_OPAQUE=0
-WINDOW_MODE_BORDER=1
-WINDOW_MODE_BOX=2
-WINDOW_MODE_TECHNICAL=3
-
-WINDOW_PLACE_MANUAL=0
-WINDOW_PLACE_SMART=1
-WINDOW_PLACE_MIDDLE=2
-WINDOW_PLACE_CASCADE=3
-WINDOW_PLACE_RANDOM=4
-
-DESKTOP_COUNT=8
-DESKTOP_SCROLL=0
-DESKTOP_SCROLL_STICKY=0
-DESKTOP_RESIST=3
-DESKTOP_SPEED=30
-DESKTOP_WIDTH=2
-DESKTOP_HEIGHT=2
-
-GUIDES_LOC_WIN=0
-GUIDES_LOC_SCR=1
-
-DB="./behavior.db"
-
-# actions defining how to react to things
-NUM=0
-edb_ed $DB add "/actions/"$NUM"/name" str "Title_Bar"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Raise"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Title_Bar"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Title_Bar"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Shade"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_DOUBLE
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Resize"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize_Horizontal"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Resize_Horizontal"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize_Vertical"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Resize_Vertical"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Window_Grab"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Raise"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Window_Grab"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Window_Grab"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Resize"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 2
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Window_Grab"
-edb_ed $DB add "/actions/"$NUM"/action" str "Menu"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 3
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 3
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize_Horizontal"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 3
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Resize_Vertical"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 3
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Close"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Close"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICKED
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Close"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Kill"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICKED
-edb_ed $DB add "/actions/"$NUM"/button" int 3
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Max_Size"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Max_Size"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICKED
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Iconify"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Iconify"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICKED
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Menu"
-edb_ed $DB add "/actions/"$NUM"/action" str "Menu"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICKED
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Window_Place"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Move"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_MOUSE_CLICK
-edb_ed $DB add "/actions/"$NUM"/button" int 1
-edb_ed $DB add "/actions/"$NUM"/key" str ""
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_NONE
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Restart"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "End"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Exit"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Delete"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Max_Size"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "m"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Close"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "x"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Shade"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "r"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Raise"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Up"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Lower"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Down"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Stick"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "a"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "0"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F1"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "1"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F2"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "2"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F3"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "3"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F4"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "4"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F5"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "5"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F6"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "6"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F7"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop"
-edb_ed $DB add "/actions/"$NUM"/params" str "7"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "F8"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop_Relative"
-edb_ed $DB add "/actions/"$NUM"/params" str "1"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Right"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Desktop_Relative"
-edb_ed $DB add "/actions/"$NUM"/params" str "-1"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Left"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Execute"
-edb_ed $DB add "/actions/"$NUM"/params" str "Eterm"
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Insert"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
-edb_ed $DB add "/actions/"$NUM"/action" str "Window_Next"
-edb_ed $DB add "/actions/"$NUM"/params" str ""
-edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
-edb_ed $DB add "/actions/"$NUM"/button" int 0
-edb_ed $DB add "/actions/"$NUM"/key" str "Tab"
-edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/actions/count" int $NUM
-
-edb_ed $DB add "/desktops/count" int $DESKTOP_COUNT
-edb_ed $DB add "/desktops/scroll" int $DESKTOP_SCROLL
-edb_ed $DB add "/desktops/scroll_sticky" int $DESKTOP_SCROLL_STICKY
-edb_ed $DB add "/desktops/resist" int $DESKTOP_RESIST
-edb_ed $DB add "/desktops/speed" int $DESKTOP_SPEED
-edb_ed $DB add "/desktops/width" int $DESKTOP_WIDTH
-edb_ed $DB add "/desktops/height" int $DESKTOP_HEIGHT
-
-# basic settings
-edb_ed $DB add "/move/resist" int 1
-edb_ed $DB add "/move/resist/desk" int 24
-edb_ed $DB add "/move/resist/win" int 12
-edb_ed $DB add "/menu/scroll/resist" int 5
-edb_ed $DB add "/menu/scroll/speed" int 12
-edb_ed $DB add "/window/focus/mode" int $FOCUS_POINTER
-edb_ed $DB add "/window/raise/auto" int 0
-edb_ed $DB add "/window/raise/delay" float 0.5
-edb_ed $DB add "/window/move/mode" int $WINDOW_MODE_OPAQUE
-edb_ed $DB add "/window/resize/mode" int $WINDOW_MODE_BOX
-edb_ed $DB add "/window/place/mode" int $WINDOW_PLACE_SMART
-edb_ed $DB add "/guides/display/x" float 0.5
-edb_ed $DB add "/guides/display/y" float 0.5
-edb_ed $DB add "/guides/display/location" int $GUIDES_LOC_SCR
-
-# what events on windows are "grabbed" by the window manager
-NUM=0
-edb_ed $DB add "/grabs/"$NUM"/button" int 1
-edb_ed $DB add "/grabs/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/grabs/"$NUM"/button" int 2
-edb_ed $DB add "/grabs/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/grabs/"$NUM"/button" int 3
-edb_ed $DB add "/grabs/"$NUM"/modifiers" int $MOD_ALT
-NUM=$[ $NUM + 1 ];
-edb_ed $DB add "/grabs/count" int $NUM
-
+++ /dev/null
-#!/bin/sh
-
-DB=$1"/iconbar.db"
-BIT=$1"/iconbar.bits.db"
-
-setup ()
-{
- PREFIX="/usr/local"
- SYSIC="/usr/share/pixmaps"
- USRIC=$HOME"/stuff/icons"
- NUM=0
- rm -f $DB
-}
-
-finish ()
-{
- edb_ed $DB add "/icons/count" int $NUM
-}
-
-icon ()
-{
- e_img_import "$1" $DB":""/icons/"$NUM"/image"
- edb_ed $DB add "/icons/"$NUM"/exec" str "$2"
- NUM=$[ $NUM + 1 ];
-}
-
-setup
-
-icon $SYSIC"/gnome-term.png" "Eterm"
-icon $SYSIC"/gnome-ccdesktop.png" "sylpheed"
-icon $SYSIC"/netscape.png" "netscape"
-icon $USRIC"/mozilla.png" "mozilla"
-icon $SYSIC"/gnome-irc.png" "xchat"
-icon $SYSIC"/gnome-gimp.png" "gimp"
-icon $SYSIC"/gnome-mixer.png" "/home/raster/.desktop/FixMix"
-icon $SYSIC"/mc/gnome-audio.png" "xmms"
-icon $USRIC"star_office.png" "/home/raster/.desktop/Office"
-
-finish
-
-cp -f $PREFIX"/share/enlightenment/data/iconbar/iconbar_left.bits.db" $BIT
+++ /dev/null
-#!/bin/sh
-
-DB=$1"/iconbar.db"
-BIT=$1"/iconbar.bits.db"
-
-setup ()
-{
- PREFIX="@prefix@"
- SYSIC="/usr/share/pixmaps"
- USRIC=$HOME"/stuff/icons"
- NUM=0
- rm -f $DB
-}
-
-finish ()
-{
- edb_ed $DB add "/icons/count" int $NUM
-}
-
-icon ()
-{
- e_img_import "$1" $DB":""/icons/"$NUM"/image"
- edb_ed $DB add "/icons/"$NUM"/exec" str "$2"
- NUM=$[ $NUM + 1 ];
-}
-
-setup
-
-icon $SYSIC"/gnome-term.png" "Eterm"
-icon $SYSIC"/gnome-ccdesktop.png" "sylpheed"
-icon $SYSIC"/netscape.png" "netscape"
-icon $USRIC"/mozilla.png" "mozilla"
-icon $SYSIC"/gnome-irc.png" "xchat"
-icon $SYSIC"/gnome-gimp.png" "gimp"
-icon $SYSIC"/gnome-mixer.png" "/home/raster/.desktop/FixMix"
-icon $SYSIC"/mc/gnome-audio.png" "xmms"
-icon $USRIC"star_office.png" "/home/raster/.desktop/Office"
-
-finish
-
-cp -f $PREFIX"/share/enlightenment/data/iconbar/iconbar_left.bits.db" $BIT
+++ /dev/null
-e17 (0.17.pre_0-0cvs2001103101) unstable; urgency=low
-
- * a CVS release
-
- -- Laurence J. Lane <ljlane@debian.org> Mon, 29 Oct 2001 04:24:58 +0000
+++ /dev/null
-Source: e17
-Section: x11
-Priority: optional
-Maintainer: Laurence J. Lane <ljlane@debian.org>
-Standards-Version: 3.2.1.0
-
-Package: e17
-Section: x11
-Architecture: any
-Depends: ${shlibs:Depends}, imlib2-loaders
-Description: e17 description
- e17 extended description
+++ /dev/null
-This package was debianized by Laurence J. Lane <ljlane@debian.org> on
-Sat, 28 Oct 2000 17:56:46 -0400.
-
-The source is downloaded from the e17/apps/e module of the enlightenment CVS
-tree. For more information, see:
-
- http://www.enlightenment.org/cvs.html
-
-Upstream Author: Carsten Haitzler <raster@rasterman.com>
-
-Copyright:
-
-Copyright (C) 2000 Carsten Haitzler and various contributors (see AUTHORS)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies of the Software, its documentation and marketing & publicity
-materials, and acknowledgment shall be given in the documentation, materials
-and software packages that this Software was used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++ /dev/null
-#!/bin/sh -e
-
-if test "$1" = "configure"; then
- ldconfig
-fi
-
-#DEBHELPER#
+++ /dev/null
-#!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
-
-export DH_COMPAT=3
-
-INSTALL = /usr/bin/install
-package = e17
-pwd:=$(CURDIR)
-cfg:=--prefix=/usr --datadir=/usr/share/e17
-INSTALL=/usr/bin/install
-
-build: build-stamp
-build-stamp:
- dh_testdir
- test -x autogen.sh && ./autogen.sh $(cfg) || ./configure $(cfg)
- $(MAKE)
- touch $@
-
-clean:
- dh_testdir
- rm -f build-stamp
- -$(MAKE) distclean
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # change enlightenment to e17 to co-exist with e16
- $(MAKE) install DESTDIR=$(CURDIR)/debian/e17
- mv debian/e17/usr/bin/enlightenment debian/e17/usr/bin/e17
-
-binary-indep: build install
-
-binary-arch: build install
- dh_testversion 3
- dh_testdir
- dh_testroot
- dh_installdocs AUTHORS README
- dh_installchangelogs
- dh_strip
- dh_compress
- dh_fixperms
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-MAINTAINERCLEANFILES = Makefile.in
-
-EXTRA_DIST = \
-manual.raw \
-kernel-doc.in \
-stylesheet.css \
-figures/*.gif # Add any images you create here
-
-
-## Fill in all source files that you documented
-## with extractable comments here:
-##
-SOURCEDOC = $(top_srcdir)/src/e.h
-
-## For details on what can be specified in the
-## comments, see the beginning of kernel-doc
-## in this directory! -- cK.
-
-
-SGMLFILE = $(PACKAGE)-manual.sgml
-
-docs: manual.raw $(SOURCEDOC)
- ./kernel-doc -docbook <manual.raw >$(SGMLFILE)
-
-if HAVE_JADE
-
-FULLNAME = $(PACKAGE)-manual-$(VERSION)
-
-html-docs: docs html-customizations.dsl
- $(mkinstalldirs) ./$(FULLNAME)/figures
- cd $(FULLNAME) && @JADE@ -t sgml -d ../html-customizations.dsl ../$(SGMLFILE)
- - cd figures && cp -f *.gif ../$(FULLNAME)/figures
- - cd figures && cp -f *.png ../$(FULLNAME)/figures
- - cd figures && cp -f *.jpg ../$(FULLNAME)/figures
- cp -f stylesheet.css $(FULLNAME)/stylesheet.css
- tar cfvz $(FULLNAME).tar.gz $(FULLNAME)
-
-endif
-
+++ /dev/null
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: architecture.eps
-%%Creator: fig2dev Version 3.2 Patchlevel 3d
-%%CreationDate: Thu Nov 8 01:31:58 2001
-%%For: elwood@Gonzo (Elwood Blues,,,)
-%%BoundingBox: 0 0 689 403
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-/col32 {0.816 0.816 0.816 srgb} bind def
-/col33 {0.878 0.878 0.878 srgb} bind def
-
-end
-save
-newpath 0 403 moveto 0 0 lineto 689 0 lineto 689 403 lineto closepath clip newpath
--32.6 542.8 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
- 0.06299 0.06299 sc
-%
-% Fig objects follow
-%
-% Polyline
-15.000 slw
-n 3300 7020 m 3195 7020 3195 7455 105 arcto 4 {pop} repeat
- 3195 7560 4170 7560 105 arcto 4 {pop} repeat
- 4275 7560 4275 7125 105 arcto 4 {pop} repeat
- 4275 7020 3300 7020 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 4515 7020 m 4410 7020 4410 7455 105 arcto 4 {pop} repeat
- 4410 7560 9615 7560 105 arcto 4 {pop} repeat
- 9720 7560 9720 7125 105 arcto 4 {pop} repeat
- 9720 7020 4515 7020 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 4515 5985 m 4410 5985 4410 6420 105 arcto 4 {pop} repeat
- 4410 6525 7545 6525 105 arcto 4 {pop} repeat
- 7650 6525 7650 6090 105 arcto 4 {pop} repeat
- 7650 5985 4515 5985 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 7890 5985 m 7785 5985 7785 6420 105 arcto 4 {pop} repeat
- 7785 6525 9615 6525 105 arcto 4 {pop} repeat
- 9720 6525 9720 6090 105 arcto 4 {pop} repeat
- 9720 5985 7890 5985 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 4515 4950 m 4410 4950 4410 5385 105 arcto 4 {pop} repeat
- 4410 5490 6915 5490 105 arcto 4 {pop} repeat
- 7020 5490 7020 5055 105 arcto 4 {pop} repeat
- 7020 4950 4515 4950 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 1365 2295 m 1260 2295 1260 3225 105 arcto 4 {pop} repeat
- 1260 3330 9660 3330 105 arcto 4 {pop} repeat
- 9765 3330 9765 2400 105 arcto 4 {pop} repeat
- 9765 2295 1365 2295 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 1365 7020 m 1260 7020 1260 7455 105 arcto 4 {pop} repeat
- 1260 7560 2235 7560 105 arcto 4 {pop} repeat
- 2340 7560 2340 7125 105 arcto 4 {pop} repeat
- 2340 7020 1365 7020 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 1365 8055 m 1260 8055 1260 8490 105 arcto 4 {pop} repeat
- 1260 8595 9615 8595 105 arcto 4 {pop} repeat
- 9720 8595 9720 8160 105 arcto 4 {pop} repeat
- 9720 8055 1365 8055 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 3930 3870 m 3825 3870 3825 4305 105 arcto 4 {pop} repeat
- 3825 4410 6240 4410 105 arcto 4 {pop} repeat
- 6345 4410 6345 3975 105 arcto 4 {pop} repeat
- 6345 3870 3930 3870 105 arcto 4 {pop} repeat
- cp gs col32 1.00 shd ef gr gs col32 s gr
-% Polyline
-n 3255 6975 m 3150 6975 3150 7410 105 arcto 4 {pop} repeat
- 3150 7515 4125 7515 105 arcto 4 {pop} repeat
- 4230 7515 4230 7080 105 arcto 4 {pop} repeat
- 4230 6975 3255 6975 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-3465 7335 m
-gs 1 -1 sc (Edb) col0 sh gr
-% Polyline
-n 4470 6975 m 4365 6975 4365 7410 105 arcto 4 {pop} repeat
- 4365 7515 9570 7515 105 arcto 4 {pop} repeat
- 9675 7515 9675 7080 105 arcto 4 {pop} repeat
- 9675 6975 4470 6975 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-5985 7335 m
-gs 1 -1 sc (X Window System) col0 sh gr
-% Polyline
-n 4470 5940 m 4365 5940 4365 6375 105 arcto 4 {pop} repeat
- 4365 6480 7500 6480 105 arcto 4 {pop} repeat
- 7605 6480 7605 6045 105 arcto 4 {pop} repeat
- 7605 5940 4470 5940 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-5670 6300 m
-gs 1 -1 sc (Imlib2) col0 sh gr
-% Polyline
-n 7845 5940 m 7740 5940 7740 6375 105 arcto 4 {pop} repeat
- 7740 6480 9570 6480 105 arcto 4 {pop} repeat
- 9675 6480 9675 6045 105 arcto 4 {pop} repeat
- 9675 5940 7845 5940 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-8325 6300 m
-gs 1 -1 sc (Ecore) col0 sh gr
-% Polyline
-n 4470 4905 m 4365 4905 4365 5340 105 arcto 4 {pop} repeat
- 4365 5445 6870 5445 105 arcto 4 {pop} repeat
- 6975 5445 6975 5010 105 arcto 4 {pop} repeat
- 6975 4905 4470 4905 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-5355 5265 m
-gs 1 -1 sc (Evas) col0 sh gr
-% Polyline
-n 1320 2250 m 1215 2250 1215 3180 105 arcto 4 {pop} repeat
- 1215 3285 9615 3285 105 arcto 4 {pop} repeat
- 9720 3285 9720 2355 105 arcto 4 {pop} repeat
- 9720 2250 1320 2250 105 arcto 4 {pop} repeat
- cp gs col7 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 300.00 scf sf
-5130 2610 m
-gs 1 -1 sc (E 17) col0 sh gr
-% Polyline
-n 1320 6975 m 1215 6975 1215 7410 105 arcto 4 {pop} repeat
- 1215 7515 2190 7515 105 arcto 4 {pop} repeat
- 2295 7515 2295 7080 105 arcto 4 {pop} repeat
- 2295 6975 1320 6975 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-/Helvetica ff 240.00 scf sf
-1485 7335 m
-gs 1 -1 sc (Efsd) col0 sh gr
-% Polyline
-n 540 7740 m
- 11430 7740 l gs col33 1.00 shd ef gr gs col32 s gr
-% Polyline
-gs clippath
-1710 7035 m 1800 7035 l 1800 6878 l 1755 6998 l 1710 6878 l cp
-1800 3270 m 1710 3270 l 1710 3427 l 1755 3307 l 1800 3427 l cp
-eoclip
-n 1755 3285 m
- 1755 7020 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 1800 3427 m 1755 3307 l 1710 3427 l 1800 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 1710 6878 m 1755 6998 l 1800 6878 l 1710 6878 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-2655 7980 m 2745 7980 l 2745 7823 l 2700 7943 l 2655 7823 l cp
-2745 3270 m 2655 3270 l 2655 3427 l 2700 3307 l 2745 3427 l cp
-eoclip
-n 2700 3285 m
- 2700 7965 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 2745 3427 m 2700 3307 l 2655 3427 l 2745 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 2655 7823 m 2700 7943 l 2745 7823 l 2655 7823 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-3645 8070 m 3735 8070 l 3735 7913 l 3690 8033 l 3645 7913 l cp
-3735 7500 m 3645 7500 l 3645 7657 l 3690 7537 l 3735 7657 l cp
-eoclip
-n 3690 7515 m
- 3690 8055 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 3735 7657 m 3690 7537 l 3645 7657 l 3735 7657 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 3645 7913 m 3690 8033 l 3735 7913 l 3645 7913 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-5805 7035 m 5895 7035 l 5895 6878 l 5850 6998 l 5805 6878 l cp
-5895 6465 m 5805 6465 l 5805 6622 l 5850 6502 l 5895 6622 l cp
-eoclip
-n 5850 6480 m
- 5850 7020 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 5895 6622 m 5850 6502 l 5805 6622 l 5895 6622 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 5805 6878 m 5850 6998 l 5895 6878 l 5805 6878 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-8595 7035 m 8685 7035 l 8685 6878 l 8640 6998 l 8595 6878 l cp
-8685 6465 m 8595 6465 l 8595 6622 l 8640 6502 l 8685 6622 l cp
-eoclip
-n 8640 6480 m
- 8640 7020 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 8685 6622 m 8640 6502 l 8595 6622 l 8685 6622 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 8595 6878 m 8640 6998 l 8685 6878 l 8595 6878 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-8595 5955 m 8685 5955 l 8685 5798 l 8640 5918 l 8595 5798 l cp
-8685 3270 m 8595 3270 l 8595 3427 l 8640 3307 l 8685 3427 l cp
-eoclip
-n 8640 3285 m
- 8640 5940 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 8685 3427 m 8640 3307 l 8595 3427 l 8685 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 8595 5798 m 8640 5918 l 8685 5798 l 8595 5798 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-5805 6000 m 5895 6000 l 5895 5843 l 5850 5963 l 5805 5843 l cp
-5895 5430 m 5805 5430 l 5805 5587 l 5850 5467 l 5895 5587 l cp
-eoclip
-n 5850 5445 m
- 5850 5985 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 5895 5587 m 5850 5467 l 5805 5587 l 5895 5587 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 5805 5843 m 5850 5963 l 5895 5843 l 5805 5843 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-7200 5955 m 7290 5955 l 7290 5798 l 7245 5918 l 7200 5798 l cp
-7290 3270 m 7200 3270 l 7200 3427 l 7245 3307 l 7290 3427 l cp
-eoclip
-n 7245 3285 m
- 7245 5940 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 7290 3427 m 7245 3307 l 7200 3427 l 7290 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 7200 5798 m 7245 5918 l 7290 5798 l 7200 5798 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-4455 3840 m 4545 3840 l 4545 3683 l 4500 3803 l 4455 3683 l cp
-4545 3270 m 4455 3270 l 4455 3427 l 4500 3307 l 4545 3427 l cp
-eoclip
-n 4500 3285 m
- 4500 3825 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 4545 3427 m 4500 3307 l 4455 3427 l 4545 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 4455 3683 m 4500 3803 l 4545 3683 l 4455 3683 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-6570 4920 m 6660 4920 l 6660 4763 l 6615 4883 l 6570 4763 l cp
-6660 3270 m 6570 3270 l 6570 3427 l 6615 3307 l 6660 3427 l cp
-eoclip
-n 6615 3285 m
- 6615 4905 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 6660 3427 m 6615 3307 l 6570 3427 l 6660 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 6570 4763 m 6615 4883 l 6660 4763 l 6570 4763 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-5535 4920 m 5625 4920 l 5625 4763 l 5580 4883 l 5535 4763 l cp
-5625 4350 m 5535 4350 l 5535 4507 l 5580 4387 l 5625 4507 l cp
-eoclip
-n 5580 4365 m
- 5580 4905 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 5625 4507 m 5580 4387 l 5535 4507 l 5625 4507 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 5535 4763 m 5580 4883 l 5625 4763 l 5535 4763 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-1710 8025 m 1800 8025 l 1800 7868 l 1755 7988 l 1710 7868 l cp
-1800 7455 m 1710 7455 l 1710 7612 l 1755 7492 l 1800 7612 l cp
-eoclip
-n 1755 7470 m
- 1755 8010 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 1800 7612 m 1755 7492 l 1710 7612 l 1800 7612 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 1710 7868 m 1755 7988 l 1800 7868 l 1710 7868 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-n 1320 8010 m 1215 8010 1215 8445 105 arcto 4 {pop} repeat
- 1215 8550 9570 8550 105 arcto 4 {pop} repeat
- 9675 8550 9675 8115 105 arcto 4 {pop} repeat
- 9675 8010 1320 8010 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-% Polyline
-n 3885 3825 m 3780 3825 3780 4260 105 arcto 4 {pop} repeat
- 3780 4365 6195 4365 105 arcto 4 {pop} repeat
- 6300 4365 6300 3930 105 arcto 4 {pop} repeat
- 6300 3825 3885 3825 105 arcto 4 {pop} repeat
- cp gs col33 1.00 shd ef gr gs col0 s gr
-% Polyline
-gs clippath
-3420 7035 m 3510 7035 l 3510 6878 l 3465 6998 l 3420 6878 l cp
-3510 3270 m 3420 3270 l 3420 3427 l 3465 3307 l 3510 3427 l cp
-eoclip
-n 3465 3285 m
- 3465 7020 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 3510 3427 m 3465 3307 l 3420 3427 l 3510 3427 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 3420 6878 m 3465 6998 l 3510 6878 l 3420 6878 l cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-3960 7035 m 4050 7035 l 4050 6878 l 4005 6998 l 3960 6878 l cp
-4050 4350 m 3960 4350 l 3960 4507 l 4005 4387 l 4050 4507 l cp
-eoclip
-n 4005 4365 m
- 4005 7020 l gs col33 1.00 shd ef gr gs col0 s gr gr
-
-% arrowhead
-n 4050 4507 m 4005 4387 l 3960 4507 l 4050 4507 l cp gs 0.00 setgray ef gr col0 s
-% arrowhead
-n 3960 6878 m 4005 6998 l 4050 6878 l 3960 6878 l cp gs 0.00 setgray ef gr col0 s
-/Helvetica ff 240.00 scf sf
-4950 8370 m
-gs 1 -1 sc (Filesystem) col0 sh gr
-/Helvetica ff 240.00 scf sf
-10080 7560 m
-gs 1 -1 sc (User Space) col0 sh gr
-/Helvetica ff 240.00 scf sf
-10305 8100 m
-gs 1 -1 sc (Kernel) col0 sh gr
-/Helvetica ff 240.00 scf sf
-4725 4185 m
-gs 1 -1 sc (Ebits) col0 sh gr
-$F2psEnd
-rs
+++ /dev/null
-#FIG 3.2
-Landscape
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-0 32 #d0d0d0
-0 33 #e0e0e0
-6 3105 6930 4320 7605
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 4230 7515 3150 7515 3150 6975 4230 6975 4230 7515
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 4275 7560 3195 7560 3195 7020 4275 7020 4275 7560
-4 0 0 50 0 16 16 0.0000 4 180 435 3465 7335 Edb\001
--6
-6 4320 6930 9765 7605
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 9720 7560 4410 7560 4410 7020 9720 7020 9720 7560
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 9675 7515 4365 7515 4365 6975 9675 6975 9675 7515
-4 0 0 50 0 16 16 0.0000 4 225 1950 5985 7335 X Window System\001
--6
-6 4320 5895 7695 6570
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 7605 6480 4365 6480 4365 5940 7605 5940 7605 6480
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 7650 6525 4410 6525 4410 5985 7650 5985 7650 6525
-4 0 0 50 0 16 16 0.0000 4 180 645 5670 6300 Imlib2\001
--6
-6 7695 5895 9765 6570
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 9675 6480 7740 6480 7740 5940 9675 5940 9675 6480
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 9720 6525 7785 6525 7785 5985 9720 5985 9720 6525
-4 0 0 50 0 16 16 0.0000 4 180 630 8325 6300 Ecore\001
--6
-6 4320 4860 7065 5535
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 6975 5445 4365 5445 4365 4905 6975 4905 6975 5445
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 7020 5490 4410 5490 4410 4950 7020 4950 7020 5490
-4 0 0 50 0 16 16 0.0000 4 180 540 5355 5265 Evas\001
--6
-6 1170 2205 9810 3375
-2 4 0 2 0 7 50 0 20 0.000 0 0 7 0 0 5
- 9720 3285 9720 2250 1215 2250 1215 3285 9720 3285
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 9765 3330 1260 3330 1260 2295 9765 2295 9765 3330
-4 0 0 50 0 16 20 0.0000 4 210 570 5130 2610 E 17\001
--6
-6 1170 6930 2385 7605
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 2295 7515 1215 7515 1215 6975 2295 6975 2295 7515
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 2340 7560 1260 7560 1260 7020 2340 7020 2340 7560
-4 0 0 50 0 16 16 0.0000 4 180 480 1485 7335 Efsd\001
--6
-2 1 0 2 32 33 50 0 20 0.000 0 0 -1 0 0 2
- 540 7740 11430 7740
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 1755 3285 1755 7020
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 2700 3285 2700 7965
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 3690 7515 3690 8055
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 5850 6480 5850 7020
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 8640 6480 8640 7020
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 8640 3285 8640 5940
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 5850 5445 5850 5985
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 7245 3285 7245 5940
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 4500 3285 4500 3825
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 6615 3285 6615 4905
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 5580 4365 5580 4905
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 1755 7470 1755 8010
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 9675 8550 1215 8550 1215 8010 9675 8010 9675 8550
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 9720 8595 1260 8595 1260 8055 9720 8055 9720 8595
-2 4 0 2 32 32 100 0 20 0.000 0 0 7 0 0 5
- 6345 4410 3825 4410 3825 3870 6345 3870 6345 4410
-2 4 0 2 0 33 50 0 20 0.000 0 0 7 0 0 5
- 6300 4365 3780 4365 3780 3825 6300 3825 6300 4365
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 3465 3285 3465 7020
-2 1 0 2 0 33 50 0 20 0.000 0 0 -1 1 1 2
- 1 1 2.00 90.00 120.00
- 1 1 2.00 90.00 120.00
- 4005 4365 4005 7020
-4 0 0 50 0 16 16 0.0000 4 225 1155 4950 8370 Filesystem\001
-4 0 0 50 0 16 16 0.0000 4 240 1260 10080 7560 User Space\001
-4 0 0 50 0 16 16 0.0000 4 180 705 10305 8100 Kernel\001
-4 0 0 50 0 16 16 0.0000 4 180 540 4725 4185 Ebits\001
+++ /dev/null
-<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
-<!ENTITY dbstyle SYSTEM "@DB_STYLESHEETS@/html/docbook.dsl" CDATA DSSSL>
-]>
-
-<style-sheet>
-<style-specification use="docbook">
-<style-specification-body>
-
-;; my own customizations for HTML output:
-
-(define %admon-graphics-path%
- ;; Path to admonition graphics
- "figures/")
-
-(define %admon-graphics%
- ;; Use graphics in admonitions?
- #t)
-
-(define %indent-programlisting-lines%
- ;; Indent lines in a 'ProgramListing'?
- " ")
-
-(define %shade-verbatim%
- ;; Should verbatim environments be shaded?
- #t)
-
-(define ($shade-verbatim-attr$)
- ;; Attributes used to create a shaded verbatim environment.
- (list
- (list "BORDER" "0")
- (list "BGCOLOR" "#f0f0f0")))
-
-(define %root-filename%
- ;; Name for the root HTML document
- "index")
-
-(define %body-attr%
- ;; What attributes should be hung off of BODY?
- (list
- (list "BGCOLOR" "#FFFFFF")
- (list "TEXT" "#0000A0")
- (list "LINK" "#2020D0")
- (list "VLINK" "#000060")
- (list "ALINK" "#5050F0")))
-
-(define %css-decoration%
- ;; Enable CSS decoration of elements
- #t)
-
-(define %stylesheet%
- ;; Name of the stylesheet to use
- "stylesheet.css")
-
-(define biblio-number
- ;; Enumerate bibliography entries
- #t)
-
-</style-specification-body>
-</style-specification>
-<external-specification id="docbook" document="dbstyle">
-</style-sheet>
+++ /dev/null
-#!@PERL@
-
-## This script is based on the script shipped with ##
-## 2.4 Linux kernel sources. All copyright notices etc ##
-## remain unchanged. --cK. ##
-
-## Copyright (c) 1998 Michael Zucchi, All Rights Reserved ##
-## Copyright (C) 2000 Tim Waugh <twaugh@redhat.com> ##
-## ##
-## #define enhancements by Armin Kuster <akuster@mvista.com> ##
-## Copyright (c) 2000 MontaVista Software, Inc. ##
-## ##
-## This software falls under the GNU General Public License. ##
-## Please read the COPYING file for more information ##
-
-# w.o. 03-11-2000: added the '-filelist' option.
-
-#
-# This will read a 'c' file and scan for embedded comments in the
-# style of gnome comments (+minor extensions - see below).
-#
-
-# Note: This only supports 'c'.
-
-# usage:
-# kerneldoc [ -docbook | -html | -text | -man ]
-# [ -function funcname [ -function funcname ...] ] c file(s)s > outputfile
-# or
-# [ -nofunction funcname [ -function funcname ...] ] c file(s)s > outputfile
-#
-# Set output format using one of -docbook -html -text or -man. Default is man.
-#
-# -function funcname
-# If set, then only generate documentation for the given function(s). All
-# other functions are ignored.
-#
-# -nofunction funcname
-# If set, then only generate documentation for the other function(s). All
-# other functions are ignored. Cannot be used with -function together
-# (yes thats a bug - perl hackers can fix it 8))
-#
-# c files - list of 'c' files to process
-#
-# All output goes to stdout, with errors to stderr.
-
-#
-# format of comments.
-# In the following table, (...)? signifies optional structure.
-# (...)* signifies 0 or more structure elements
-# /**
-# * function_name(:)? (- short description)?
-# (* @parameterx: (description of parameter x)?)*
-# (* a blank line)?
-# * (Description:)? (Description of function)?
-# * (section header: (section description)? )*
-# (*)?*/
-#
-# So .. the trivial example would be:
-#
-# /**
-# * my_function
-# **/
-#
-# If the Description: header tag is ommitted, then there must be a blank line
-# after the last parameter specification.
-# e.g.
-# /**
-# * my_function - does my stuff
-# * @my_arg: its mine damnit
-# *
-# * Does my stuff explained.
-# */
-#
-# or, could also use:
-# /**
-# * my_function - does my stuff
-# * @my_arg: its mine damnit
-# * Description: Does my stuff explained.
-# */
-# etc.
-#
-# All descriptions can be multiline, apart from the short function description.
-#
-# All descriptive text is further processed, scanning for the following special
-# patterns, which are highlighted appropriately.
-#
-# 'funcname()' - function
-# '$ENVVAR' - environmental variable
-# '&struct_name' - name of a structure (up to two words including 'struct')
-# '@parameter' - name of a parameter
-# '%CONST' - name of a constant.
-
-# match expressions used to find embedded type information
-$type_constant = "\\\%([-_\\w]+)";
-$type_func = "(\\w+)\\(\\)";
-$type_param = "\\\@(\\w+)";
-$type_struct = "\\\&((struct\\s*)?[_\\w]+)";
-$type_env = "(\\\$\\w+)";
-
-
-# Output conversion substitutions.
-# One for each output format
-
-# these work fairly well
-%highlights_html = ( $type_constant, "<i>\$1</i>",
- $type_func, "<b>\$1</b>",
- $type_struct, "<i>\$1</i>",
- $type_param, "<tt><b>\$1</b></tt>" );
-$blankline_html = "<p>";
-
-# sgml, docbook format
-%highlights_sgml = ( "([^=])\\\"([^\\\"<]+)\\\"", "\$1<quote>\$2</quote>",
- $type_constant, "<constant>\$1</constant>",
- $type_func, "<function>\$1</function>",
- $type_struct, "<structname>\$1</structname>",
- $type_env, "<envar>\$1</envar>",
- $type_param, "<parameter>\$1</parameter>" );
-$blankline_sgml = "</para><para>\n";
-
-# gnome, docbook format
-%highlights_gnome = ( $type_constant, "<replaceable class=\"option\">\$1</replaceable>",
- $type_func, "<function>\$1</function>",
- $type_struct, "<structname>\$1</structname>",
- $type_env, "<envar>\$1</envar>",
- $type_param, "<parameter>\$1</parameter>" );
-$blankline_gnome = "</para><para>\n";
-
-# these are pretty rough
-%highlights_man = ( $type_constant, "\$1",
- $type_func, "\\\\fB\$1\\\\fP",
- $type_struct, "\\\\fI\$1\\\\fP",
- $type_param, "\\\\fI\$1\\\\fP" );
-$blankline_man = "";
-
-# text-mode
-%highlights_text = ( $type_constant, "\$1",
- $type_func, "\$1",
- $type_struct, "\$1",
- $type_param, "\$1" );
-$blankline_text = "";
-
-
-sub usage {
- print "Usage: $0 [ -v ] [ -docbook | -html | -text | -man ]\n";
- print " [ -function funcname [ -function funcname ...] ]\n";
- print " [ -nofunction funcname [ -nofunction funcname ...] ]\n";
- print " < inputfile > outputfile\n";
- exit 1;
-}
-
-# read arguments
-if ($#ARGV==-1) {
- usage();
-}
-
-$verbose = 0;
-$output_mode = "man";
-%highlights = %highlights_man;
-$blankline = $blankline_man;
-$modulename = "API Documentation";
-$function_only = 0;
-$filelist = '';
-
-while ($ARGV[0] =~ m/^-(.*)/) {
- $cmd = shift @ARGV;
- if ($cmd eq "-html") {
- $output_mode = "html";
- %highlights = %highlights_html;
- $blankline = $blankline_html;
- } elsif ($cmd eq "-man") {
- $output_mode = "man";
- %highlights = %highlights_man;
- $blankline = $blankline_man;
- } elsif ($cmd eq "-text") {
- $output_mode = "text";
- %highlights = %highlights_text;
- $blankline = $blankline_text;
- } elsif ($cmd eq "-docbook") {
- $output_mode = "sgml";
- %highlights = %highlights_sgml;
- $blankline = $blankline_sgml;
- } elsif ($cmd eq "-gnome") {
- $output_mode = "gnome";
- %highlights = %highlights_gnome;
- $blankline = $blankline_gnome;
- } elsif ($cmd eq "-module") { # not needed for sgml, inherits from calling document
- $modulename = shift @ARGV;
- } elsif ($cmd eq "-function") { # to only output specific functions
- $function_only = 1;
- $function = shift @ARGV;
- $function_table{$function} = 1;
- } elsif ($cmd eq "-nofunction") { # to only output specific functions
- $function_only = 2;
- $function = shift @ARGV;
- $function_table{$function} = 1;
- } elsif ($cmd eq "-v") {
- $verbose = 1;
- } elsif (($cmd eq "-h") || ($cmd eq "--help")) {
- usage();
- }
-}
-
-
-# generate a sequence of code that will splice in highlighting information
-# using the s// operator.
-$dohighlight = "";
-foreach $pattern (keys %highlights) {
-# print "scanning pattern $pattern ($highlights{$pattern})\n";
- $dohighlight .= "\$contents =~ s:$pattern:$highlights{$pattern}:gs;\n";
-}
-
-##
-# dumps section contents to arrays/hashes intended for that purpose.
-#
-sub dump_section {
- my $name = shift @_;
- my $contents = join "\n", @_;
-
- if ($name =~ m/$type_constant/) {
- $name = $1;
-# print STDERR "constant section '$1' = '$contents'\n";
- $constants{$name} = $contents;
- } elsif ($name =~ m/$type_param/) {
-# print STDERR "parameter def '$1' = '$contents'\n";
- $name = $1;
- $parameters{$name} = $contents;
- } else {
-# print STDERR "other section '$name' = '$contents'\n";
- $sections{$name} = $contents;
- push @sectionlist, $name;
- }
-}
-
-##
-# output function
-#
-# parameters, a hash.
-# function => "function name"
-# parameterlist => @list of parameters
-# parameters => %parameter descriptions
-# sectionlist => @list of sections
-# sections => %descriont descriptions
-#
-
-sub output_highlight {
- my $contents = join "\n", @_;
- my $line;
-
- eval $dohighlight;
- foreach $line (split "\n", $contents) {
- if ($line eq ""){
- print $lineprefix, $blankline;
- } else {
- $line =~ s/\\\\\\/\&/g;
- print $lineprefix, $line;
- }
- print "\n";
- }
-}
-
-
-# output in html
-sub output_html {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
- print "<h2>Function</h2>\n";
-
- print "<i>".$args{'functiontype'}."</i>\n";
- print "<b>".$args{'function'}."</b>\n";
- print "(";
- $count = 0;
- foreach $parameter (@{$args{'parameterlist'}}) {
- $type = $args{'parametertypes'}{$parameter};
- if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
- # pointer-to-function
- print "<i>$1</i><b>$parameter</b>) <i>($2)</i>";
- } else {
- print "<i>".$type."</i> <b>".$parameter."</b>";
- }
- if ($count != $#{$args{'parameterlist'}}) {
- $count++;
- print ",\n";
- }
- }
- print ")\n";
-
- print "<h3>Arguments</h3>\n";
- print "<dl>\n";
- foreach $parameter (@{$args{'parameterlist'}}) {
- print "<dt><b>".$parameter."</b>\n";
- print "<dd>";
- output_highlight($args{'parameters'}{$parameter});
- }
- print "</dl>\n";
- foreach $section (@{$args{'sectionlist'}}) {
- print "<h3>$section</h3>\n";
- print "<blockquote>\n";
- output_highlight($args{'sections'}{$section});
- print "</blockquote>\n";
- }
- print "<hr>\n";
-}
-
-
-# output in html
-sub output_intro_html {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
-
- foreach $section (@{$args{'sectionlist'}}) {
- print "<h3>$section</h3>\n";
- print "<ul>\n";
- output_highlight($args{'sections'}{$section});
- print "</ul>\n";
- }
- print "<hr>\n";
-}
-
-
-
-# output in sgml DocBook
-sub output_sgml {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
- my $id;
-
- $id = "API-".$args{'function'};
- $id =~ s/[^A-Za-z0-9]/-/g;
-
- print "<refentry>\n";
- print "<refmeta>\n";
- print "<refentrytitle><phrase id=\"$id\">".$args{'function'}."</phrase></refentrytitle>\n";
- print "</refmeta>\n";
- print "<refnamediv>\n";
- print " <refname>".$args{'function'}."</refname>\n";
- print " <refpurpose>\n";
- print " ";
- output_highlight ($args{'purpose'});
- print " </refpurpose>\n";
- print "</refnamediv>\n";
-
- print "<refsynopsisdiv>\n";
- print " <title>Synopsis</title>\n";
- print " <funcsynopsis>\n";
- print " <funcdef>".$args{'functiontype'}." ";
- print "<function>".$args{'function'}." ";
- print "</function></funcdef>\n";
-
-# print "<refsect1>\n";
-# print " <title>Synopsis</title>\n";
-# print " <funcsynopsis>\n";
-# print " <funcdef>".$args{'functiontype'}." ";
-# print "<function>".$args{'function'}." ";
-# print "</function></funcdef>\n";
-
- $count = 0;
- if ($#{$args{'parameterlist'}} >= 0) {
- foreach $parameter (@{$args{'parameterlist'}}) {
- $type = $args{'parametertypes'}{$parameter};
- if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
- # pointer-to-function
- print " <paramdef>$1<parameter>$parameter</parameter>)\n";
- print " <funcparams>$2</funcparams></paramdef>\n";
- } else {
- print " <paramdef>".$type;
- print " <parameter>$parameter</parameter></paramdef>\n";
- }
- }
- } else {
- print " <void>\n";
- }
- print " </funcsynopsis>\n";
- print "</refsynopsisdiv>\n";
-# print "</refsect1>\n";
-
- # print parameters
- print "<refsect1>\n <title>Arguments</title>\n";
-# print "<para>\nArguments\n";
- if ($#{$args{'parameterlist'}} >= 0) {
- print " <variablelist>\n";
- foreach $parameter (@{$args{'parameterlist'}}) {
- print " <varlistentry>\n <term><parameter>$parameter</parameter></term>\n";
- print " <listitem>\n <para>\n";
- $lineprefix=" ";
- output_highlight($args{'parameters'}{$parameter});
- print " </para>\n </listitem>\n </varlistentry>\n";
- }
- print " </variablelist>\n";
- } else {
- print " <para>\n None\n </para>\n";
- }
- print "</refsect1>\n";
-
- # print out each section
- $lineprefix=" ";
- foreach $section (@{$args{'sectionlist'}}) {
- print "<refsect1>\n <title>$section</title>\n <para>\n";
-# print "<para>\n$section\n";
- if ($section =~ m/EXAMPLE/i) {
- print "<example><para>\n";
- }
- output_highlight($args{'sections'}{$section});
-# print "</para>";
- if ($section =~ m/EXAMPLE/i) {
- print "</para></example>\n";
- }
- print " </para>\n</refsect1>\n";
- }
-
- print "</refentry>\n\n";
-}
-
-# output in sgml DocBook
-sub output_intro_sgml {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
- my $id;
-
- $id = $args{'module'};
- $id =~ s/[^A-Za-z0-9]/-/g;
-
- # print out each section
- $lineprefix=" ";
- foreach $section (@{$args{'sectionlist'}}) {
- print "<refsect1>\n <title>$section</title>\n <para>\n";
-# print "<para>\n$section\n";
- if ($section =~ m/EXAMPLE/i) {
- print "<example><para>\n";
- }
- output_highlight($args{'sections'}{$section});
-# print "</para>";
- if ($section =~ m/EXAMPLE/i) {
- print "</para></example>\n";
- }
- print " </para>\n</refsect1>\n";
- }
-
- print "\n\n";
-}
-
-# output in sgml DocBook
-sub output_gnome {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
- my $id;
-
- $id = $args{'module'}."-".$args{'function'};
- $id =~ s/[^A-Za-z0-9]/-/g;
-
- print "<sect2>\n";
- print " <title id=\"$id\">".$args{'function'}."</title>\n";
-
-# print "<simplesect>\n";
-# print " <title>Synopsis</title>\n";
- print " <funcsynopsis>\n";
- print " <funcdef>".$args{'functiontype'}." ";
- print "<function>".$args{'function'}." ";
- print "</function></funcdef>\n";
-
- $count = 0;
- if ($#{$args{'parameterlist'}} >= 0) {
- foreach $parameter (@{$args{'parameterlist'}}) {
- $type = $args{'parametertypes'}{$parameter};
- if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
- # pointer-to-function
- print " <paramdef>$1 <parameter>$parameter</parameter>)\n";
- print " <funcparams>$2</funcparams></paramdef>\n";
- } else {
- print " <paramdef>".$type;
- print " <parameter>$parameter</parameter></paramdef>\n";
- }
- }
- } else {
- print " <void>\n";
- }
- print " </funcsynopsis>\n";
-# print "</simplesect>\n";
-# print "</refsect1>\n";
-
- # print parameters
-# print "<simplesect>\n <title>Arguments</title>\n";
-# if ($#{$args{'parameterlist'}} >= 0) {
-# print " <variablelist>\n";
-# foreach $parameter (@{$args{'parameterlist'}}) {
-# print " <varlistentry>\n <term><parameter>$parameter</parameter></term>\n";
-# print " <listitem>\n <para>\n";
-# $lineprefix=" ";
-# output_highlight($args{'parameters'}{$parameter});
-# print " </para>\n </listitem>\n </varlistentry>\n";
-# }
-# print " </variablelist>\n";
-# } else {
-# print " <para>\n None\n </para>\n";
-# }
-# print "</simplesect>\n";
-
-# print "<simplesect>\n <title>Arguments</title>\n";
- if ($#{$args{'parameterlist'}} >= 0) {
- print " <informaltable pgwide=\"1\" frame=\"none\" role=\"params\">\n";
- print "<tgroup cols=\"2\">\n";
- print "<colspec colwidth=\"2*\">\n";
- print "<colspec colwidth=\"8*\">\n";
- print "<tbody>\n";
- foreach $parameter (@{$args{'parameterlist'}}) {
- print " <row><entry align=\"right\"><parameter>$parameter</parameter></entry>\n";
- print " <entry>\n";
- $lineprefix=" ";
- output_highlight($args{'parameters'}{$parameter});
- print " </entry></row>\n";
- }
- print " </tbody></tgroup></informaltable>\n";
- } else {
- print " <para>\n None\n </para>\n";
- }
-# print "</simplesect>\n";
-
- # print out each section
- $lineprefix=" ";
- foreach $section (@{$args{'sectionlist'}}) {
- print "<simplesect>\n <title>$section</title>\n";
-# print "<para>\n$section\n";
- if ($section =~ m/EXAMPLE/i) {
- print "<example><programlisting>\n";
- } else {
- }
- print "<para>\n";
- output_highlight($args{'sections'}{$section});
-# print "</para>";
- print "</para>\n";
- if ($section =~ m/EXAMPLE/i) {
- print "</programlisting></example>\n";
- } else {
- }
- print " </simplesect>\n";
- }
-
- print "</sect2>\n\n";
-}
-
-##
-# output in man
-sub output_man {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
-
- print ".TH \"$args{'module'}\" 4 \"$args{'function'}\" \"25 May 1998\" \"API Manual\" LINUX\n";
-
- print ".SH NAME\n";
- print $args{'function'}." \\- ".$args{'purpose'}."\n";
-
- print ".SH SYNOPSIS\n";
- print ".B \"".$args{'functiontype'}."\" ".$args{'function'}."\n";
- $count = 0;
- $parenth = "(";
- $post = ",";
- foreach $parameter (@{$args{'parameterlist'}}) {
- if ($count == $#{$args{'parameterlist'}}) {
- $post = ");";
- }
- $type = $args{'parametertypes'}{$parameter};
- if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
- # pointer-to-function
- print ".BI \"".$parenth.$1."\" ".$parameter." \") (".$2.")".$post."\"\n";
- } else {
- $type =~ s/([^\*])$/\1 /;
- print ".BI \"".$parenth.$type."\" ".$parameter." \"".$post."\"\n";
- }
- $count++;
- $parenth = "";
- }
-
- print ".SH Arguments\n";
- foreach $parameter (@{$args{'parameterlist'}}) {
- print ".IP \"".$parameter."\" 12\n";
- output_highlight($args{'parameters'}{$parameter});
- }
- foreach $section (@{$args{'sectionlist'}}) {
- print ".SH \"$section\"\n";
- output_highlight($args{'sections'}{$section});
- }
-}
-
-sub output_intro_man {
- my %args = %{$_[0]};
- my ($parameter, $section);
- my $count;
-
- print ".TH \"$args{'module'}\" 4 \"$args{'module'}\" \"25 May 1998\" \"API Manual\" LINUX\n";
-
- foreach $section (@{$args{'sectionlist'}}) {
- print ".SH \"$section\"\n";
- output_highlight($args{'sections'}{$section});
- }
-}
-
-##
-# output in text
-sub output_text {
- my %args = %{$_[0]};
- my ($parameter, $section);
-
- print "Function:\n\n";
- $start=$args{'functiontype'}." ".$args{'function'}." (";
- print $start;
- $count = 0;
- foreach $parameter (@{$args{'parameterlist'}}) {
- if ($type =~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) {
- # pointer-to-function
- print $1.$parameter.") (".$2;
- } else {
- print $type." ".$parameter;
- }
- if ($count != $#{$args{'parameterlist'}}) {
- $count++;
- print ",\n";
- print " " x length($start);
- } else {
- print ");\n\n";
- }
- }
-
- print "Arguments:\n\n";
- foreach $parameter (@{$args{'parameterlist'}}) {
- print $parameter."\n\t".$args{'parameters'}{$parameter}."\n";
- }
- foreach $section (@{$args{'sectionlist'}}) {
- print "$section:\n\n";
- output_highlight($args{'sections'}{$section});
- }
- print "\n\n";
-}
-
-sub output_intro_text {
- my %args = %{$_[0]};
- my ($parameter, $section);
-
- foreach $section (@{$args{'sectionlist'}}) {
- print " $section:\n";
- print " -> ";
- output_highlight($args{'sections'}{$section});
- }
-}
-
-##
-# generic output function - calls the right one based
-# on current output mode.
-sub output_function {
-# output_html(@_);
- eval "output_".$output_mode."(\@_);";
-}
-
-##
-# generic output function - calls the right one based
-# on current output mode.
-sub output_intro {
-# output_html(@_);
- eval "output_intro_".$output_mode."(\@_);";
-}
-
-
-##
-# takes a function prototype and spits out all the details
-# stored in the global arrays/hashes.
-sub dump_function {
- my $prototype = shift @_;
-
- $prototype =~ s/^static +//;
- $prototype =~ s/^extern +//;
- $prototype =~ s/^inline +//;
- $prototype =~ s/^__inline__ +//;
- $prototype =~ s/^#define +//; #ak added
-
- # Yes, this truly is vile. We are looking for:
- # 1. Return type (may be nothing if we're looking at a macro)
- # 2. Function name
- # 3. Function parameters.
- #
- # All the while we have to watch out for function pointer parameters
- # (which IIRC is what the two sections are for), C types (these
- # regexps don't even start to express all the possibilities), and
- # so on.
- #
- # If you mess with these regexps, it's a good idea to check that
- # the following functions' documentation still comes out right:
- # - parport_register_device (function pointer parameters)
- # - atomic_set (macro)
- # - pci_match_device (long return type)
-
- if ($prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\(]*)\)/ ||
- $prototype =~ m/^()([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s+\w+)\s+([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/ ||
- $prototype =~ m/^(\w+\s+\w+\s+\w+\s*\*+)\s*([a-zA-Z0-9_~:]+)\s*\(([^\{]*)\)/) {
- $return_type = $1;
- $function_name = $2;
- $args = $3;
-
- # allow for up to fours args to function pointers
- $args =~ s/(\([^\),]+),/\1#/g;
- $args =~ s/(\([^\),]+),/\1#/g;
- $args =~ s/(\([^\),]+),/\1#/g;
-# print STDERR "ARGS = '$args'\n";
-
- foreach $arg (split ',', $args) {
- # strip leading/trailing spaces
- $arg =~ s/^\s*//;
- $arg =~ s/\s*$//;
-
- if ($arg =~ m/\(/) {
- # pointer-to-function
- $arg =~ tr/#/,/;
- $arg =~ m/[^\(]+\(\*([^\)]+)\)/;
- $param = $1;
- $type = $arg;
- $type =~ s/([^\(]+\(\*)$param/\1/;
- } else {
- # evil magic to get fixed array parameters to work
- $arg =~ s/(.+\s+)(.+)\[.*/\1* \2/;
-# print STDERR "SCAN ARG: '$arg'\n";
- @args = split('\s', $arg);
-
-# print STDERR " -> @args\n";
- $param = pop @args;
-# print STDERR " -> @args\n";
- if ($param =~ m/^(\*+)(.*)/) {
- $param = $2;
- push @args, $1;
- }
- $type = join " ", @args;
- }
-
- if ($type eq "" && $param eq "...")
- {
- $type="...";
- $param="...";
- $parameters{"..."} = "variable arguments";
- }
- elsif ($type eq "" && $param eq "")
- {
- $type="";
- $param="void";
- $parameters{void} = "no arguments";
- }
- if ($type ne "" && $parameters{$param} eq "") {
- $parameters{$param} = "-- undescribed --";
- print STDERR "Warning($file:$lineno): Function parameter '$param' not described in '$function_name'\n";
- }
-
- push @parameterlist, $param;
- $parametertypes{$param} = $type;
-# print STDERR "param = '$param', type = '$type'\n";
- }
- } else {
- print STDERR "Error($lineno): cannot understand prototype: '$prototype'\n";
- return;
- }
-
- if ($function_only==0 ||
- ( $function_only == 1 && defined($function_table{$function_name})) ||
- ( $function_only == 2 && !defined($function_table{$function_name})))
- {
- output_function({'function' => $function_name,
- 'module' => $modulename,
- 'functiontype' => $return_type,
- 'parameterlist' => \@parameterlist,
- 'parameters' => \%parameters,
- 'parametertypes' => \%parametertypes,
- 'sectionlist' => \@sectionlist,
- 'sections' => \%sections,
- 'purpose' => $function_purpose
- });
- }
-}
-
-######################################################################
-# main
-# states
-# 0 - normal code
-# 1 - looking for function name
-# 2 - scanning field start.
-# 3 - scanning prototype.
-$state = 0;
-$section = "";
-
-$doc_special = "\@\%\$\&";
-
-$doc_start = "^/\\*\\*\\s*\$";
-$doc_end = "\\*/";
-$doc_com = "\\s*\\*\\s*";
-$doc_func = $doc_com."(\\w+):?";
-$doc_sect = $doc_com."([".$doc_special."]?[\\w ]+):(.*)";
-$doc_content = $doc_com."(.*)";
-$doc_block = $doc_com."DOC:\\s*(.*)?";
-
-%constants = ();
-%parameters = ();
-@parameterlist = ();
-%sections = ();
-@sectionlist = ();
-
-$contents = "";
-$section_default = "Description"; # default section
-$section_intro = "Introduction";
-$section = $section_default;
-
-while (<STDIN>)
- {
- if (/^!I(.*)/)
- {
- process_file("@top_srcdir@" . "/" . $1);
- }
- else
- {
- print;
- }
- }
-
-exit;
-
-sub process_file($) {
- my ($file) = @_;
-
- if (!open(IN,"<$file")) {
- print STDERR "Error: Cannot open file $file\n";
- return;
- }
-
- $lineno = 0;
- while (<IN>) {
- $lineno++;
-
- if ($state == 0) {
- if (/$doc_start/o) {
- $state = 1; # next line is always the function name
- }
- } elsif ($state == 1) { # this line is the function name (always)
- if (/$doc_block/o) {
- $state = 4;
- $contents = "";
- if ( $1 eq "" ) {
- $section = $section_intro;
- } else {
- $section = $1;
- }
- }
- elsif (/$doc_func/o) {
- $function = $1;
- $state = 2;
- if (/-(.*)/) {
- $function_purpose = $1;
- } else {
- $function_purpose = "";
- }
- if ($verbose) {
- print STDERR "Info($lineno): Scanning doc for $function\n";
- }
- } else {
- print STDERR "WARN($lineno): Cannot understand $_ on line $lineno",
- " - I thought it was a doc line\n";
- $state = 0;
- }
- } elsif ($state == 2) { # look for head: lines, and include content
- if (/$doc_sect/o) {
- $newsection = $1;
- $newcontents = $2;
-
- if ($contents ne "") {
- $contents =~ s/\&/\\\\\\amp;/g;
- $contents =~ s/\</\\\\\\lt;/g;
- $contents =~ s/\>/\\\\\\gt;/g;
- dump_section($section, $contents);
- $section = $section_default;
- }
-
- $contents = $newcontents;
- if ($contents ne "") {
- $contents .= "\n";
- }
- $section = $newsection;
- } elsif (/$doc_end/) {
-
- if ($contents ne "") {
- $contents =~ s/\&/\\\\\\amp;/g;
- $contents =~ s/\</\\\\\\lt;/g;
- $contents =~ s/\>/\\\\\\gt;/g;
- dump_section($section, $contents);
- $section = $section_default;
- $contents = "";
- }
-
-# print STDERR "end of doc comment, looking for prototype\n";
- $prototype = "";
- $state = 3;
- } elsif (/$doc_content/) {
- # miguel-style comment kludge, look for blank lines after
- # @parameter line to signify start of description
- if ($1 eq "" && $section =~ m/^@/) {
- $contents =~ s/\&/\\\\\\amp;/g;
- $contents =~ s/\</\\\\\\lt;/g;
- $contents =~ s/\>/\\\\\\gt;/g;
- dump_section($section, $contents);
- $section = $section_default;
- $contents = "";
- } else {
- $contents .= $1."\n";
- }
- } else {
- # i dont know - bad line? ignore.
- print STDERR "WARNING($lineno): bad line: $_";
- }
- } elsif ($state == 3) { # scanning for function { (end of prototype)
- if (m#\s*/\*\s+MACDOC\s*#io) {
- # do nothing
- }
- elsif (/([^\{]*)/) {
- $prototype .= $1;
- }
- if (/\{/ || /\#/ || /;/) { # added for #define AK
- $prototype =~ s@/\*.*?\*/@@gos; # strip comments.
- $prototype =~ s@[\r\n]+@ @gos; # strip newlines/cr's.
- $prototype =~ s@^ +@@gos; # strip leading spaces
- dump_function($prototype);
-
- $function = "";
- %constants = ();
- %parameters = ();
- %parametertypes = ();
- @parameterlist = ();
- %sections = ();
- @sectionlist = ();
- $prototype = "";
-
- $state = 0;
- }
- } elsif ($state == 4) {
- # Documentation block
- if (/$doc_block/) {
- dump_section($section, $contents);
- output_intro({'sectionlist' => \@sectionlist,
- 'sections' => \%sections });
- $contents = "";
- $function = "";
- %constants = ();
- %parameters = ();
- %parametertypes = ();
- @parameterlist = ();
- %sections = ();
- @sectionlist = ();
- $prototype = "";
- if ( $1 eq "" ) {
- $section = $section_intro;
- } else {
- $section = $1;
- }
- }
- elsif (/$doc_end/)
- {
- dump_section($section, $contents);
- output_intro({'sectionlist' => \@sectionlist,
- 'sections' => \%sections });
- $contents = "";
- $function = "";
- %constants = ();
- %parameters = ();
- %parametertypes = ();
- @parameterlist = ();
- %sections = ();
- @sectionlist = ();
- $prototype = "";
- $state = 0;
- }
- elsif (/$doc_content/)
- {
- if ( $1 eq "" )
- {
- $contents .= $blankline;
- }
- else
- {
- $contents .= $1 . "\n";
- }
- }
- }
- }
-}
-
+++ /dev/null
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
-<!ENTITY e17 "<productname>Enlightenment 0.17</productname>">
-]>
-
-
-<book id="e17-manual">
- <bookinfo>
- <title>The Enlightenment 0.17 Manual</title>
-
- <authorgroup>
- <author>
- <firstname>Christian</firstname>
- <surname>Kreibich</surname>
- <affiliation>
- <address>
- <email>cK@whoop.org</email>
- </address>
- </affiliation>
- </author>
- </authorgroup>
-
- <copyright>
- <year>2001</year>
- <holder>Christian Kreibich</holder>
- </copyright>
-
- <legalnotice>
- <para>
- 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:
- </para>
- <para>
- The above copyright notice and this permission notice shall be included in
- all copies of the Software and its documentation and acknowledgment shall be
- given in the documentation and software packages that this Software was
- used.
- </para>
- <para>
- 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.
- </para>
- </legalnotice>
-
- <releaseinfo>
- This is document is nowhere near being finished. Be patient.
- </releaseinfo>
-
- </bookinfo>
-
- <toc></toc>
-
- <chapter id="introduction">
- <title>Introduction</title>
- <para>
- This document explains the &e17; release, for both users and
- developers.
- </para>
- </chapter>
-
- <chapter id="using">
- <title>Using &e17;</title>
- <para>
- Here's how you use &e17;.
- </para>
-
- <section id="features">
- <title id="features.title">Feature List</title>
- <para>
- At the moment, &e17; has not been released. The current feature list includes:
-
- <orderedlist>
- <listitem>
- <para>A fully functional and mostly ICCCM-compliant windowmanager.</para>
- </listitem>
- <listitem>
- <para>Multiple desktops (in the version 0.16 sense, so no large,
- virtual desktop area yet).</para>
- </listitem>
- <listitem>
- <para>Shading/unshading of windows.</para>
- </listitem>
- <listitem>
- <para>Ability to browse files in your filesystem through view windows,
- with recognition of the file types and appropriate icons.</para>
- </listitem>
- <listitem>
- <para>Support for icon bars in each view window. These are
- collections of icons for commonly needed applications or documents
- in a directory. For example, in a directory with lots of images
- you will want to have image viewers ready, in a directory with
- MP3 files you'll want music players etc. The icon bars keep
- those applications where you need them.</para>
- </listitem>
- </orderedlist>
-
- This feature list should not imply that &e17; is ready for public use
- yet. Many more features are in development, but their configuration
- is currently hard-coded. If you want a fancy windowmanager with
- full configurability, you best stick to the currently stable 0.16.5
- release.
- </para>
- <para>
- Please do not come to the mailing lists and ask for release dates etc.
- &e17; will be released when it has matured to a stable system that is
- usable also for novices. &e17; will <emphasis>not</emphasis> be as
- rich in features as the 0.16 series -- we intend to produce a simple,
- stable desktop shell for that release. Funky features will be considered
- for the 0.18 release.
- </para>
- </section>
-
- <section id="wm">
- <title id="wm.title">The Window Manager</title>
- <para>
- </para>
- </section>
-
- <section id="fm">
- <title id="fm.title">The File Manager</title>
- <para>
- </para>
- </section>
-
- <section id="concepts">
- <title id="concepts.title">Themeing</title>
- <section id="overview">
- <title id="overview.title">Overview</title>
- <para>
- </para>
- </section>
- <section id="system">
- <title id="system.title">System Settings</title>
- <para>
- </para>
- </section>
- <section id="user">
- <title id="user.title">User Settings</title>
- <para>
- </para>
- </section>
- </section>
-
- </chapter>
-
- <chapter id="inside">
- <title>Inside &e17;</title>
- <para>
- This chapter explains the inner workings of &e17;.
- </para>
-
- <section id="build">
- <title id="build.title">Building &e17;</title>
- <para>
- This chapter explains how to build &e17; manually. The Enlightenment
- Project is hosted by <ulink url="http://www.sourceforge.net">Sourceforge</ulink>,
- the project website is therefore
- <ulink url="http://www.sourceforge.net/projects/enlightenment">http://www.sf.net/projects/enlightenment</ulink>.
- Since you're reading this document, your probably know this already.
- CVS is used for version control, refer to the Sourceforge documentation
- for details about using CVS.
- </para>
- <para>
- <caution>
- <title>Make sure you know what you're doing!</title>
- <para>
- Building e17 from CVS code is not trivial. Expect problems.
- You're using development code, so do not expect the software
- to work. Things can and with all likelihood will break.
- Be sure you know how to handle the tools you need for the
- build.
- </para>
- <para>
- Experience from the mailing lists shows that way too many
- people try using CVS without the proper skills. We will try
- to give help, but by explaining how to build &e17; we lose
- time we'd otherwise spend coding, so try to solve issues
- yourselves first.
- </para>
- </caution>
- </para>
- <para>
- An incomplete tree of the current CVS contents is shown below.
- For details about the modules, please refer to the
- <link linkend="modules" endterm="modules.title">Modules</link>
- section below or the
- <ulink url="http://www.enlightenment.org/pages/components.html">webpage</ulink>.
-
- <programlisting>
-e17
- | \
- | apps
- | |___ e * Enlightenment 0.17, the main program.
- | |
- | |___ ebindings A keybingings and menu contents editor.
- | |
- | |___ ebony A background editor.
- | |
- | |___ efsd * The Enlightenment File System Daemon.
- | |
- | |___ entice An image viewer.
- | |
- | |___ etcher A GUI editor for window borders and more.
- | |
- | ...
- |
- \
- libs
- |___ ebits * A library for "bits", graphical layout structures.
- |
- |___ ecore * An X Windows wrapper and event loop library.
- |
- |___ edb * A database library based on Berkeley DB.
- |
- |___ etox A text layout engine.
- |
- |___ evas * A graphical canvas engine.
- |
- |___ ewl A widget library using evas.
- |
- |___ ewd A container library for hashes, lists etc.
- |
- |___ imlib2 * An image loading and manipulation library.
- |
- |___ imlib2_loaders * A set of loaders for imlib2, separated due to licensing issues.
- </programlisting>
-
- The modules you absolutely need to get &e17; running are marked
- with an asterisk. The next thing you need to know is the build
- sequence. A working sequence is the following:
-
- <orderedlist>
- <listitem>
- <para>Edb</para>
- </listitem>
- <listitem>
- <para>Imlib2</para>
- </listitem>
- <listitem>
- <para>Imlib2 Loaders</para>
- </listitem>
- <listitem>
- <para>Evas</para>
- </listitem>
- <listitem>
- <para>Ebits</para>
- </listitem>
- <listitem>
- <para>Ecore</para>
- </listitem>
- <listitem>
- <para>Efsd</para>
- </listitem>
- <listitem>
- <para>E 17</para>
- </listitem>
- </orderedlist>
-
- Some of the modules have other dependencies, you need:
-
- <itemizedlist mark="opencircle">
- <listitem>
- <para>For Imlib2, you need a few graphics libraries. [FIXME]</para>
- </listitem>
- <listitem>
- <para>For Efsd, you need libxml2 from
- (<ulink url="http://xmlsoft.org/">XMLSoft</ulink>) and fam from
- (<ulink url="http://prdownloads.sourceforge.net/enlightenment/fam-oss-2.6.4-NULL-fix.tar.gz">Version 2.6.4</ulink> or a later version)
- </para>
- </listitem>
- </itemizedlist>
-
- <note>
- <title>There's no real reason to build those packages from source.</title>
- <para>
- It's a lot easier
- to just install the packages of your distribution. Do not forget to
- install the development packages as well, or necessary C header files
- won't be available during the build.
- </para>
- </note>
- </para>
- <para>
- To build, you need recent versions of the following GNU tools:
-
- <itemizedlist mark="opencircle">
- <listitem>
- <para><command>autoconf</command> 2.13 and <command>automake</command> 1.4 <emphasis>OR</emphasis></para>
- </listitem>
- <listitem>
- <para><command>autoconf</command> 2.50+ and <command>automake</command> 1.5</para>
- </listitem>
- <listitem>
- <para><command>gettext</command> 0.10.39 or newer</para>
- </listitem>
- <listitem>
- <para><command>libtool</command> 1.4 or newer</para>
- </listitem>
- </itemizedlist>
-
- Other combinations of <command>automake</command> and
- <command>autoconf</command> may work, but are more
- prone to errors.
- </para>
- </section>
-
- <section id="architecture">
- <title id="architecture.title">&e17; Architecture</title>
- <section id="overall">
- <title id="overall.title">Overview</title>
- <para>
-
- <mediaobject>
- <imageobject>
- <imagedata fileref="figures/architecture.eps" format="eps">
- </imageobject>
- <imageobject>
- <imagedata fileref="figures/architecture.gif" format="gif">
- </imageobject>
- <textobject>
- <phrase>Image of &e17; Architecture</phrase>
- </textobject>
- <caption>
- <para>&e17; Architecture.</para>
- </caption>
- </mediaobject>
-
- </para>
- </section>
- <section id="modules">
- <title id="modules.title">Modules</title>
- <para>
-
- <itemizedlist mark="opencircle">
- <listitem>
- <para><command>e</command></para>
- <para>This is the main &e17; applicaton. It handles managing
- of windows, launching applications, managing icons and files
- on your desktop and in directories, drag and drop etc.
- </para>
- </listitem>
- <listitem>
- <para><command>ecore</command></para>
- <para>Ecore is a convenience library. It handles
- abstracting X calls so you don't have to pass as many parameters to them. It
- wraps lots of other sequences of X calls you want to do often, handles
- caching local geometry of windows to save extra X traffic, abstracts X's
- events and adds a timer system to be able to do timeouts, handles the core
- event loops, abstracts signals into being events in the event queue, and lets
- you arbitrarily add other file descriptors to the loop to listen on and have
- handlers be called when they become active, and much much more. Ecore also
- handles filtering events and calling idle handlers when appropriate. Ecore is
- just what it says - a very complex CORE subsystem. It is all callback based,
- and keeps everything abstracted - but does not move away from normal X11
- primitives like other abstractions (GDK for example), thus keeping 100%
- compatibility with normal Xlib stuff. The core innards of E17 rely heavily on
- Ecore and its ability to not just work, but work well and optimize silently for
- E17.
- </para>
- </listitem>
- <listitem>
- <para><command>evas</command></para>
- <para>Evas is a canvas abstraction that uses Imlib2, as well
- as OpenGL, and X11. It serves as a canvas accelerator and abstraction and
- does the job really well. It has made building the rendering parts of
- &e17; a lot easier.
- </para>
- </listitem>
- <listitem>
- <para><command>ebits</command></para>
- <para>Ebits is a higher-level abstraction of image groups
- built on top of Evas. Basically it's what the old E16 window border logic
- was - but on steroids. It can do a lot more and is being used as the
- basic building block for all widgets in E17. Etcher is a GUI editor that
- can edit Ebits files - thus letting you have a nice GUI to
- design your widgets, window borders etc. in.
- </para>
- </listitem>
- <listitem>
- <para><command>edb</command></para>
- <para>Edb is a database abstraction layer to Berkeley
- DB. Edb contains the source for DB 2.7.7, thus freezing the database
- format on disk, making sure it will never become incompatible (as is a habit
- of the DB interface in libc). Edb wraps this with a convenience and
- optimization API layer, making database access easy, fast and consistent. It
- handles typing of information in the database and much more. Edb is *VERY*
- fast and all of E17 configuration management is built on top of it -
- every configuration file is a database - including Ebits files. Also,
- Efsd stores its metadata information in Edb databases.
- </para>
- </listitem>
- <listitem>
- <para><command>efsd</command></para>
- <para>Efsd is the file system abstraction layer. It is a
- library and a daemon process that the library communicates with for the
- calling process (in this case E17). It handles all filing system interaction
- in an asynchronous manner, so E17 isn't ever left blocking on basic IO
- requests. It handles copying, renaming and deleting of files. Also listing of
- directories, monitoring for changes in directories, retrieving stat
- information on files, as well as metadata retrieval and modification for
- files. All of this is done in an asynchronous request/event system thus
- keeping E17 free to handle user interaction as much as possible while Efsd
- does the nasty IO work.
- </para>
- </listitem>
- <listitem>
- <para><command>imlib2</command></para>
- <para>Imlib2 is the abstraction layer that handles the
- raw nasty work of loading images, saving them, rendering them to a drawable
- or blending and scaling them onto other images, software anti-aliased
- truetype fonts and other goodies. This one is pretty much done and finished
- with. It gets minor updates and fixes as needed, but otherwise is left alone.
- </para>
- </listitem>
- <listitem>
- <para><command>imlib2_loaders</command></para>
- <para>This is a collection of loaders that are not packaged with Imlib2
- due to licensing issues or because the loaders are not commonly needed enough.
- It currently contains a loader for Edb files (where images can be accessed
- through character string keys) and a loader for Gimp's native XCF image
- format.</para>
- </listitem>
- </itemizedlist>
- </para>
- </section>
- </section>
-
- <section id="scripting">
- <title id="scripting.title">Scripting &e17;</title>
- <para>
- &e17; provides hooks to allow script interaction with the core systems,
- using the <ulink url="http://www.ferite.org">Ferite</ulink> scripting
- language. There basic scripting support is in the code now, but it's
- too early to think about writing larger scripts.
- </para>
- </section>
-
- <section id="code">
- <title>Code Documentation</title>
-!Isrc/actions.h
-!Isrc/border.h
-!Isrc/desktops.h
-!Isrc/entry.h
-!Isrc/fs.h
-!Isrc/guides.h
-!Isrc/iconbar.c
-!Isrc/icons.h
-!Isrc/menu.h
-!Isrc/menu.c
-!Isrc/object.h
-!Isrc/observer.h
-!Isrc/place.h
-!Isrc/view.h
- </section>
-
- <section id="roadmap">
- <title id="roadmap.title">Roadmap</title>
- <para>
- </para>
- </section>
-
- </chapter>
-
-</book>
-
+++ /dev/null
-body { margin-left:10px;
- margin-right:10px;
- margin-top:10px;
- margin-bottom:10px;
- color:#0000a0;
- font-size:12pt;
- background-image:url(figures/background.gif);
- background-repeat:no-repeat;
- }
-
-th {
- font-size:14pt;
- }
-
-td {
- font-size:12pt;
- }
-
-div.mediaobject { align:center; }
-div.caption { align:center; }
+++ /dev/null
-# Note that this is NOT a relocatable package
-%define ver 0.17.pre_0
-%define rel 1
-%define prefix /usr/local
-
-Summary: Enlightenment DR0.17 CVS
-Name: enlightenment
-Version: %ver
-Release: %rel
-Copyright: BSD
-Group: X11/Libraries
-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/
-Requires: evas >= 0.0.2
-Requires: edb >= 1.0.0
-Requires: imlib2 >= 1.0.0
-Requires: ebits >= 0.0.0
-Requires: ecore >= 0.0.0
-
-Docdir: %{prefix}/doc
-
-%description
-Errrrrrr - E17. You go figure.
-
-%prep
-%setup
-
-%build
-./configure --prefix=%prefix
-
-if [ "$SMP" != "" ]; then
- (make "MAKE=make -k -j $SMP"; exit 0)
- make
-else
- make
-fi
-###########################################################################
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make prefix=$RPM_BUILD_ROOT%{prefix} install
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%post
-
-%postun
-
-%files
-%defattr(-,root,root)
-%doc README COPYING ChangeLog
-%attr(755,root,root) %{prefix}/bin/enlightenment
-%{prefix}/share/enlightenment/*
-
-%doc AUTHORS
-%doc COPYING
-%doc README
-
-%changelog
-* Sat Jan 6 2001 Lyle Kempler <term@twistedpath.org>
-- Fixed spec file. :)
-* Sat Dec 11 2000 The Rasterman <raster@rasterman.com>
-- Created spec file
-
+++ /dev/null
-libehack.la
-e_hack.lo
-Makefile.in
-Makefile
-.libs
-.deps
-
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-AUTOMAKE_OPTIONS = 1.4 foreign
-
-# A list of all the files in the current directory which can be regenerated
-MAINTAINERCLEANFILES = Makefile.in
-
-LDFLAGS = -L/usr/X11R6/lib -L/usr/local/lib
-INCLUDES = -I/usr/X11R6/include -I/usr/local/include \
- $(X_CFLAGS) -I$(includedir)
-
-lib_LTLIBRARIES = libehack.la
-include_HEADERS =
-libehack_la_SOURCES = \
-e_hack.c \
-e_hack.h
-
-libehack_la_LIBADD = -lX11 @LIBDL@ $(LDFLAGS)
-libehack_la_DEPENDENCIES = $(top_builddir)/config.h
-libehack_la_LDFLAGS = -version-info 0:1:0
+++ /dev/null
-#include "config.h"
-#include "e_hack.h"
-
-/* prototypes */
-static void __e_hack_set_properties(Display *display, Window window);
-
-/* dlopened xlib so we can find the symbols in the real xlib to call them */
-static void *lib_xlib = NULL;
-
-/* the function that actually sets the properties on toplevel window */
-static void
-__e_hack_set_properties(Display *display, Window window)
-{
- static Atom a_launch_id = 0;
- static Atom a_launch_path = 0;
- static Atom a_user_id = 0;
- static Atom a_process_id = 0;
- static Atom a_p_process_id = 0;
- static Atom a_machine_name = 0;
- static Atom a_user_name = 0;
- char *env = NULL;
-
- if (!a_launch_id) a_launch_id = XInternAtom(display, "_E_HACK_LAUNCH_ID", False);
- if (!a_launch_path) a_launch_path = XInternAtom(display, "_E_HACK_LAUNCH_PATH", False);
- if (!a_user_id) a_user_id = XInternAtom(display, "_E_HACK_USER_ID", False);
- if (!a_process_id) a_process_id = XInternAtom(display, "_E_HACK_PROCESS_ID", False);
- if (!a_p_process_id) a_p_process_id = XInternAtom(display, "_E_HACK_PARENT_PROCESS_ID", False);
- if (!a_machine_name) a_machine_name = XInternAtom(display, "_E_HACK_MACHINE_NAME", False);
- if (!a_user_name) a_user_name = XInternAtom(display, "_E_HACK_USER_NAME", False);
-
- if ((env = getenv("E_HACK_LAUNCH_ID")))
- XChangeProperty(display, window, a_launch_id, XA_STRING, 8, PropModeReplace, env, strlen(env));
- if ((env = getenv("E_HACK_LAUNCH_PATH")))
- XChangeProperty(display, window, a_launch_path, XA_STRING, 8, PropModeReplace, env, strlen(env));
- {
- uid_t uid;
- pid_t pid, ppid;
- struct utsname ubuf;
- char buf[4096];
-
- uid = getuid();
- pid = getpid();
- ppid = getppid();
-
- snprintf(buf, sizeof(buf), "%i", uid);
- XChangeProperty(display, window, a_user_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
- snprintf(buf, sizeof(buf), "%i", pid);
- XChangeProperty(display, window, a_process_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
- snprintf(buf, sizeof(buf), "%i", ppid);
- XChangeProperty(display, window, a_p_process_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
- if (!uname(&ubuf))
- {
- snprintf(buf, sizeof(buf), "%s", ubuf.nodename);
- XChangeProperty(display, window, a_machine_name, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
- }
- else
- XChangeProperty(display, window, a_machine_name, XA_STRING, 8, PropModeReplace, " ", 1);
- }
- if ((env = getenv("USER")))
- XChangeProperty(display, window, a_user_name, XA_STRING, 8, PropModeReplace, env, strlen(env));
-}
-
-/* XCreateWindow intercept hack */
-Window
-XCreateWindow(
- Display *display,
- Window parent,
- int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width,
- int depth,
- unsigned int class,
- Visual *visual,
- unsigned long valuemask,
- XSetWindowAttributes *attributes
- )
-{
- static Window (*func)
- (
- Display *display,
- Window parent,
- int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width,
- int depth,
- unsigned int class,
- Visual *visual,
- unsigned long valuemask,
- XSetWindowAttributes *attributes
- ) = NULL;
- int i;
-
- /* find the real Xlib and the real X function */
- if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
- if (!func) func = dlsym (lib_xlib, "XCreateWindow");
-
- /* multihead screen handling loop */
- for (i = 0; i < ScreenCount(display); i++)
- {
- /* if the window is created as a toplevel window */
- if (parent == RootWindow(display, i))
- {
- Window window;
-
- /* create it */
- window = (*func) (display, parent, x, y, width, height,
- border_width, depth, class, visual, valuemask,
- attributes);
- /* set properties */
- __e_hack_set_properties(display, window);
- /* return it */
- return window;
- }
- }
- /* normal child window - create as usual */
- return (*func) (display, parent, x, y, width, height, border_width, depth,
- class, visual, valuemask, attributes);
-}
-
-/* XCreateSimpleWindow intercept hack */
-Window
-XCreateSimpleWindow(
- Display *display,
- Window parent,
- int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width,
- unsigned long border,
- unsigned long background
- )
-{
- static Window (*func)
- (
- Display *display,
- Window parent,
- int x, int y,
- unsigned int width, unsigned int height,
- unsigned int border_width,
- unsigned long border,
- unsigned long background
- ) = NULL;
- int i;
-
- /* find the real Xlib and the real X function */
- if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
- if (!func) func = dlsym (lib_xlib, "XCreateSimpleWindow");
-
- /* multihead screen handling loop */
- for (i = 0; i < ScreenCount(display); i++)
- {
- /* if the window is created as a toplevel window */
- if (parent == RootWindow(display, i))
- {
- Window window;
-
- /* create it */
- window = (*func) (display, parent, x, y, width, height,
- border_width, border, background);
- /* set properties */
- __e_hack_set_properties(display, window);
- /* return it */
- return window;
- }
- }
- /* normal child window - create as usual */
- return (*func) (display, parent, x, y, width, height,
- border_width, border, background);
-}
-
-/* XReparentWindow intercept hack */
-int
-XReparentWindow(
- Display *display,
- Window window,
- Window parent,
- int x, int y
- )
-{
- static int (*func)
- (
- Display *display,
- Window window,
- Window parent,
- int x, int y
- ) = NULL;
- int i;
-
- /* find the real Xlib and the real X function */
- if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
- if (!func) func = dlsym (lib_xlib, "XReparentWindow");
-
- /* multihead screen handling loop */
- for (i = 0; i < ScreenCount(display); i++)
- {
- /* if the window is created as a toplevel window */
- if (parent == RootWindow(display, i))
- {
- /* set properties */
- __e_hack_set_properties(display, window);
- /* reparent it */
- return (*func) (display, window, parent, x, y);
- }
- }
- /* normal child window reparenting - reparent as usual */
- return (*func) (display, window, parent, x, y);
-}
+++ /dev/null
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <dlfcn.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/utsname.h>
-#include <X11/Xlib.h>
-#include <X11/X.h>
-#include <X11/Xatom.h>
+++ /dev/null
-Makefile
-Makefile.in
-POTFILES
+++ /dev/null
-2002-04-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-04-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-08 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-06 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-03-06 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-26 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-24 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-22 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-16 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-15 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2002-02-15 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2001-10-22 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-21 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-13 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-13 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-13 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-09 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2001-10-09 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.40.
-
-2001-08-31 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-31 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-31 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-23 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-23 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-08-15 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-08-07 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-08-03 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-08-03 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-08-02 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-08-02 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-31 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-30 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-30 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-30 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-30 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-29 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-13 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
-
-2001-07-13 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.38.
- * cat-id-tbl.c: Remove file.
- * stamp-cat-id: Remove file.
-
+++ /dev/null
-# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU General Public License
-# but which still want to provide support for the GNU gettext functionality.
-# Please note that the actual code is *not* freely available.
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datadir = @datadir@
-localedir = $(datadir)/locale
-gettextsrcdir = $(datadir)/gettext/po
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @MKINSTALLDIRS@
-mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
-
-CC = @CC@
-GMSGFMT = @GMSGFMT@
-MSGFMT = @MSGFMT@
-XGETTEXT = @XGETTEXT@
-MSGMERGE = msgmerge
-
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@
-CPPFLAGS = @CPPFLAGS@
-
-INCLUDES = -I.. -I$(top_srcdir)/intl
-
-COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
-$(POFILES) $(GMOFILES)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-
-.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo
-
-.c.o:
- $(COMPILE) $<
-
-.po.pox:
- $(MAKE) $(PACKAGE).pot
- $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
-
-.po.mo:
- $(MSGFMT) -o $@ $<
-
-.po.gmo:
- file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
-
-
-all: all-@USE_NLS@
-
-all-yes: $(CATALOGS)
-all-no:
-
-# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
-# otherwise packages like GCC can not be built if only parts of the source
-# have been downloaded.
-
-$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
- $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
- --add-comments --keyword=_ --keyword=N_ \
- --files-from=$(srcdir)/POTFILES.in \
- && test ! -f $(PACKAGE).po \
- || ( rm -f $(srcdir)/$(PACKAGE).pot \
- && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
-
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
- if test "$(PACKAGE)" = "gettext"; then \
- $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
-install-data-no: all
-install-data-yes: all
- $(mkinstalldirs) $(DESTDIR)$(datadir)
- @catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
- dir=$(localedir)/$$lang/LC_MESSAGES; \
- $(mkinstalldirs) $(DESTDIR)$$dir; \
- if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
- else \
- $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
- echo "installing $(srcdir)/$$cat as" \
- "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
- fi; \
- done
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall:
- catalogs='$(CATALOGS)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
- done
- if test "$(PACKAGE)" = "gettext"; then \
- rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
-
-check: all
-
-dvi info tags TAGS ID:
-
-mostlyclean:
- rm -f core core.* *.pox $(PACKAGE).po *.new.po
- rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo
-
-maintainer-clean: distclean
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
- rm -f $(GMOFILES)
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir:
- $(MAKE) update-po
- @$(MAKE) dist2
-# This is a separate target because 'update-po' must be executed before.
-dist2: $(DISTFILES)
- dists="$(DISTFILES)"; \
- for file in $$dists; do \
- if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
- cp -p $$dir/$$file $(distdir); \
- done
-
-update-po: Makefile
- $(MAKE) $(PACKAGE).pot
- if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
- cd $(srcdir); \
- catalogs='$(GMOFILES)'; \
- for cat in $$catalogs; do \
- cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\.gmo$$//'`; \
- echo "$$lang:"; \
- if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
- mv -f $$lang.new.po $$lang.po; \
- else \
- echo "msgmerge for $$cat failed!"; \
- rm -f $$lang.new.po; \
- fi; \
- done
- $(MAKE) update-gmo
-
-update-gmo: Makefile $(GMOFILES)
- @:
-
-Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
- $(SHELL) ./config.status
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
+++ /dev/null
-# List of source files containing translatable strings.
-
-src/main.c
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Free Software Foundation, Inc.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-11-02 16:32-0800\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: ENCODING\n"
+++ /dev/null
-#!/bin/sh
-#
-# setup-gettext - Provides compatibility with versions of gettext
-# from the 0.10.x series and 0.11.x.
-#
-# Copyright (C) 2002 Christian Hammond.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public
-# License along with this program; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-VERSION=0.1.3
-
-VERBOSE=0
-
-parse_gettext_version() {
- GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1.\2.\3/p'`
- GETTEXT_MAJOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^\([0-9]\+\).*/\1/p'`
- GETTEXT_MINOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.\([0-9]\+\).*/\1/p'`
- GETTEXT_MICRO_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/p'`
-}
-
-find_gettext() {
- GETTEXT_TOOL=autopoint
-
- (autopoint --version) < /dev/null > /dev/null 2>&1 || {
- GETTEXT_TOOL=gettextize
-
- (gettextize --version) < /dev/null > /dev/null 2>&1 || {
- GETTEXT_TOOL=
- }
- }
-}
-
-install() {
- [ -f configure.in ] && {
- cp configure.in .tmp-configure.in
- sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
-AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.in > configure.in
- rm .tmp-configure.in
- }
-
- [ -f configure.ac ] && {
- cp configure.ac .tmp-configure.ac
- sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
-AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.ac > configure.ac
- rm .tmp-configure.ac
- }
-
- [ -f autogen.sh ] && {
- cp autogen.sh .tmp-autogen.sh
- sed -e 's/\(gettextize\|autopoint\) --version/.\/setup-gettext --gettext-tool/1' -e 's/^\(echo.*|[\t ]*\)\?\(gettextize\|autopoint\) -.*$/.\/setup-gettext/1' < .tmp-autogen.sh > autogen.sh
- rm .tmp-autogen.sh
- }
-
- echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> acinclude.m4
-}
-
-backup_m4() {
- [ -d m4 ] && mv m4 m4~
-}
-
-restore_m4() {
- [ -d m4~ ] && {
- rm -rf m4
- mv m4~ m4
- }
-}
-
-restore_files() {
- [ -f configure.in~ ] && mv -f configure.in~ configure.in
- [ -f configure.ac~ ] && mv -f configure.ac~ configure.ac
- [ -f Makefile.am~ ] && mv -f Makefile.am~ Makefile.am
-}
-
-abort() {
- restore_files
- restore_m4
-
- exit 1
-}
-
-# Main code
-
-find_gettext
-
-# See if a version of gettext and its tools are installed.
-if [ x$GETTEXT_TOOL = x ]; then
- echo
- echo "You do not have a version of gettext installed."
- echo "Please download one from your local package repository or"
- echo "from ftp://ftp.gnu.org/pub/gnu/gettext/"
- echo
- exit 1
-fi
-
-parse_gettext_version
-
-NUMVAR=$#
-
-if [ $NUMVAR -gt 0 ]; then
- if [ $NUMVAR -gt 1 ]; then
- echo "Only one option at a time!"
- exit 1
-
- elif [ $1 = "--gettext-tool" ]; then
- echo $GETTEXT_TOOL
- exit 0
-
- elif [ $1 = "--help" ]; then
- echo "setup-gettext v$VERSION"
- echo "Usage:"
- echo " --gettext-tool Returns gettextize or autopoint, depending"
- echo " on the version of gettext installed."
- echo " --gettext-version Returns the version of gettext installed."
- echo " --gettext-major-version Returns the major version of gettext installed."
- echo " --gettext-minor-version Returns the minor version of gettext installed."
- echo " --gettext-micro-version Returns the micro version of gettext installed."
- echo " --help Displays this help screen."
- echo
- exit 0
-
- elif [ $1 = "--version" ]; then
- echo $VERSION
- exit 0
-
- elif [ $1 = "--gettext-version" ]; then
- echo $GETTEXT_VERSION
- exit 0
-
- elif [ $1 = "--gettext-major-version" ]; then
- echo $GETTEXT_MAJOR_VERSION
- exit 0
-
- elif [ $1 = "--gettext-minor-version" ]; then
- echo $GETTEXT_MINOR_VERSION
- exit 0
-
- elif [ $1 = "--gettext-micro-version" ]; then
- echo $GETTEXT_MICRO_VERSION
- exit 0
-
- elif [ $1 = "--install" ]; then
- install
- echo "setup-gettext installed."
- exit 0
-
- elif [ $1 = "--happy-url" ]; then
- echo http://gaim.sf.net/forkgettext.jpg
- exit 0
-
- elif [ $1 = "--verbose" ]; then
- VERBOSE=1
-
- else
- echo "Invalid option '$1'"
- exit 1
- fi
-fi
-
-# Okay, run the main stuff
-if [ "$GETTEXT_TOOL" = "autopoint" ]; then
- backup_m4
- [ $VERBOSE -eq 1 ] && echo " autopoint --force"
- echo n | autopoint --force || abort
- restore_m4
-else
- if [ $GETTEXT_MINOR_VERSION -eq 11 ]; then
- backup_m4
-
- # Gettext is pure evil. It DEMANDS that we press Return no matter
- # what. This gets rid of their happy "feature" of doom.
- [ $VERBOSE -eq 1 ] && \
- echo " gettextize --copy --force --intl --no-changelog"
-
- sed 's:read .*< /dev/tty::' `which gettextize` > .temp-gettextize
- chmod +x .temp-gettextize
- echo n | ./.temp-gettextize --copy --force --intl --no-changelog || abort
- rm .temp-gettextize
-
- restore_files
- restore_m4
-
- [ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars
- else
- [ $VERBOSE -eq 1 ] && echo " gettextize --copy --force"
- echo n | gettextize --copy --force || exit;
- fi
-fi
-
+++ /dev/null
-e
-*.o
-*.lo
-core
-Makefile.in
-Makefile
-enlightenment
-.libs
-.deps
-e_ferite_gen_*
+++ /dev/null
--i3
--bl
--bad
--nbap
--sob
--ncdb
--di20
--nbc
--lp
--nce
--npcs
--sc
--ncs
--l80
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-## Enable -DDEBUG for debugging messages, -DDEBUG_NEST
-## for call tracing. Caution -- this will produce a *lot*
-## of output!
-DEBUGFLAGS = -W -Wall -g -DDEBUG #-DDEBUG_NEST
-
-INCLUDES = \
- @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ebg_cflags@ $(DEBUGFLAGS)
-
-bin_PROGRAMS = enlightenment
-
-enlightenment_SOURCES = \
- actions.h actions.c \
- block.c block.h \
- border.h border.c \
- bordermenu.h bordermenu.c \
- menu.h menu.c \
- menubuild.h menubuild.c \
- config.h config.c \
- cursors.c cursors.h \
- data.c data.h \
- debug.c debug.h \
- delayed.h delayed.c \
- desktops.h desktops.c \
- embed.c embed.h \
- entry.h entry.c \
- exec.h exec.c \
- focus.h focus.c \
- file.h file.c \
- fs.h fs.c \
- guides.h guides.c \
- globals.h globals.c \
- icccm.h icccm.c \
- iconbar.h iconbar.c \
- icons.h icons.c \
- ipc.h ipc.c \
- keys.h keys.c \
- main.c \
- match.c match.h \
- object.h object.c \
- observer.h observer.c\
- pack.c \
- place.c place.h \
- resist.h resist.c \
- scrollbar.h scrollbar.c \
- shelf.c \
- text.h text.c \
- util.h util.c \
- view.h view.c \
- e_file.h e_file.c \
- e_dir.h e_dir.c \
- e_view_machine.h e_view_machine.c \
- view_layout.h view_layout.c \
- e_view_look.h e_view_look.c \
- e.h
-
-enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ebg_libs@ -lm
+++ /dev/null
-#include "actions.h"
-#include "config.h"
-#include "debug.h"
-#include "border.h"
-#include "desktops.h"
-#include "exec.h"
-#include "icccm.h"
-#include "keys.h"
-#include "e_view_machine.h"
-#include "util.h"
-#include "guides.h"
-#include "bordermenu.h"
-#include "block.h"
-
-static Evas_List * action_impls = NULL;
-static Evas_List * current_actions = NULL;
-static Evas_List * current_timers = NULL;
-
-static void e_action_find(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods,
- E_Object * object);
-
-static void e_act_move_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_move_stop(E_Object * object, E_Action * a, void *data,
- int x, int y, int rx, int ry);
-
-static void e_act_move_cont(E_Object * object, E_Action * a, void *data,
- int x, int y, int rx, int ry, int dx,
- int dy);
-
-static void e_act_resize_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_resize_stop(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_resize_cont(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry,
- int dx, int dy);
-
-static void e_act_resize_h_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_resize_h_stop(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_resize_h_cont(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry, int dx, int dy);
-
-static void e_act_resize_v_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_resize_v_stop(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_resize_v_cont(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry, int dx, int dy);
-
-static void e_act_close_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_kill_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_shade_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_raise_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_lower_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_raise_lower_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_exec_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_menu_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-#if 0
-static void e_act_exit_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_restart_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-#endif
-static void e_act_stick_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_sound_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_iconify_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_max_start(E_Object * object, E_Action * a, void *data,
- int x, int y, int rx, int ry);
-
-static void e_act_snap_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_zoom_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_desk_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx, int ry);
-
-static void e_act_raise_next_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void e_act_desk_rel_start(E_Object * object, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-static void
-e_action_find(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods, E_Object * object)
-{
- Evas_List *l;
- E_Action *a;
-
- D_ENTER;
-
- /* run thru our actions list and match event, state and stuff with an */
- /* and action for it */
- for (l = config_data->actions; l; l = l->next)
- {
- Evas_List * ll;
-
- a = l->data;
- if (act != a->event)
- goto next;
- if (!((a->name) && (action) && (!strcmp(a->name, action))))
- goto next;
- if ((act >= ACT_MOUSE_CLICK) &&
- (act <= ACT_MOUSE_CLICKED) &&
- (!((a->button == -1) || (a->button == button))))
- goto next;
- if ((act >= ACT_KEY_DOWN) &&
- (act <= ACT_KEY_UP) &&
- (!((a->key) && (key) && (!strcmp(a->key, key)))))
- goto next;
- if ((act >= ACT_MOUSE_CLICK) &&
- (act <= ACT_KEY_UP) &&
- (!((a->modifiers == -1) || (a->modifiers == (int)mods))))
- goto next;
- for (ll = action_impls; ll; ll = ll->next)
- {
- E_Action_Impl *ap;
-
- ap = ll->data;
- if (!strcmp(ap->action, a->action))
- {
- E_Action *aa;
-
- aa = NEW(E_Action, 1);
- ZERO(aa, E_Action, 1);
-
- e_object_init(E_OBJECT(aa),
- (E_Cleanup_Func) e_action_cleanup);
-
- e_strdup(aa->name, a->name);
- e_strdup(aa->action, a->action);
- e_strdup(aa->params, a->params);
- aa->event = a->event;
- aa->button = a->button;
- e_strdup(aa->key, a->key);
- aa->modifiers = a->modifiers;
-
- aa->action_impl = ap;
- e_object_ref(E_OBJECT(ap));
-
- aa->object = object;
- e_object_ref(object);
-
- aa->started = 0;
- current_actions = evas_list_append(current_actions, aa);
- }
- }
- next:
- }
-
- D_RETURN;
-}
-
-void
-e_action_cleanup(E_Action * a)
-{
- D_ENTER;
-
- /* it's a key? lets ungrab it! */
- if ((a->key) && (strlen(a->key) > 0) && (a->grabbed))
- {
- if (a->modifiers == -1)
- e_keys_ungrab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1);
- else
- e_keys_ungrab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers, 0);
- }
-
- /* Clean up the strings by simply freeing them ... */
- IF_FREE(a->name);
- IF_FREE(a->action);
- IF_FREE(a->params);
- IF_FREE(a->key);
-
- /* Cleanup action implementations and objects. These
- * we don't free directly, but just decrement their use counts.
- */
-
- if (a->action_impl)
- {
- e_object_unref(E_OBJECT(a->action_impl));
- a->action_impl = NULL;
- }
-
- if (a->object)
- {
- e_object_unref(a->object);
- a->object = NULL;
- }
-
- /* Cleanup superclass. */
- e_object_cleanup(E_OBJECT(a));
-
- D_RETURN;
-}
-
-int
-e_action_start(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods,
- E_Object * object, void *data, int x, int y, int rx, int ry)
-{
- Evas_List * l;
- int started_long_action = 0;
-
- D_ENTER;
-
- e_action_find(action, act, button, key, mods, object);
- again:
- for (l = current_actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- if (!a->started)
- {
- if (a->action_impl->func_stop)
- {
- a->started = 1;
- started_long_action = 1;
- }
- if (a->action_impl->func_start)
- {
- a->action_impl->func_start(a->object, a, data, x, y, rx, ry);
- }
- }
- if (!a->started)
- {
- current_actions = evas_list_remove(current_actions, a);
- e_object_unref(E_OBJECT(a));
- goto again;
- }
- }
-
- D_RETURN_(started_long_action);
-}
-
-void
-e_action_stop(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods, E_Object * object,
- void *data, int x, int y, int rx, int ry)
-{
- Evas_List * l;
-
- D_ENTER;
-
- again:
- for (l = current_actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- if ((a->started) && (a->action_impl->func_stop))
- {
- int ok = 0;
-
- if ((a->event == ACT_MOUSE_IN) && (act == ACT_MOUSE_OUT))
- ok = 1;
- if ((a->event == ACT_MOUSE_OUT) && (act == ACT_MOUSE_IN))
- ok = 1;
- if ((a->event >= ACT_MOUSE_CLICK) &&
- (a->event <= ACT_MOUSE_TRIPLE) &&
- (act >= ACT_MOUSE_UP) &&
- (act <= ACT_MOUSE_CLICKED) && (a->button == button))
- ok = 1;
- if ((a->event == ACT_MOUSE_MOVE) &&
- ((act == ACT_MOUSE_OUT) ||
- (act == ACT_MOUSE_IN) ||
- ((act >= ACT_MOUSE_CLICK) &&
- (act <= ACT_MOUSE_TRIPLE)) || (act >= ACT_MOUSE_UP)))
- ok = 1;
- if ((a->event == ACT_KEY_DOWN) &&
- (act == ACT_KEY_UP) &&
- (key) && (a->key) && (!strcmp(key, a->key)))
- ok = 1;
- if ((a->event == ACT_KEY_UP) && (act == ACT_KEY_DOWN))
- ok = 1;
- if (ok)
- {
- a->action_impl->func_stop(a->object, a, data, x, y, rx, ry);
- a->started = 0;
- }
- }
- if (!a->started)
- {
- current_actions = evas_list_remove(current_actions, a);
- e_object_unref(E_OBJECT(a));
- goto again;
- }
- }
-
- D_RETURN;
- UN(action);
- UN(mods);
- UN(object);
-}
-
-void
-e_action_cont(char *action, E_Action_Type act, int button, char *key,
- Ecore_Event_Key_Modifiers mods, E_Object * object, void *data,
- int x, int y, int rx, int ry, int dx, int dy)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = current_actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- if ((a->started) && (a->action_impl->func_cont))
- a->action_impl->func_cont(a->object, a, data, x, y, rx, ry, dx, dy);
- }
-
- D_RETURN;
- UN(action);
- UN(act);
- UN(button);
- UN(key);
- UN(mods);
- UN(object);
-}
-
-void
-e_action_stop_by_object(E_Object * object, void *data, int x, int y, int rx,
- int ry)
-{
- Evas_List * l;
-
- D_ENTER;
-
- e_action_del_timer_object(object);
-
- again:
- for (l = current_actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- if ((a->started) && (object == a->object))
- {
- if (a->action_impl->func_stop)
- a->action_impl->func_stop(a->object, a, data, x, y, rx, ry);
-
- a->started = 0;
-
- current_actions = evas_list_remove(current_actions, a);
- e_object_unref(E_OBJECT(a));
-
- goto again;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_action_stop_by_type(char *action)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = current_actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- if ((a->started) && (a->action_impl->func_stop) &&
- (action) && (!strcmp(action, a->name)))
- {
- a->action_impl->func_stop(a->object, a, NULL, 0, 0, 0, 0);
- a->started = 0;
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_action_impl_cleanup(E_Action_Impl * eai)
-{
- D_ENTER;
-
- IF_FREE(eai->action);
- e_object_cleanup(E_OBJECT(eai));
-
- D_RETURN;
-}
-
-void
-e_action_add_impl(char *action, E_Action_Start_Func func_start,
- E_Action_Cont_Func func_cont, E_Action_Stop_Func func_stop)
-{
- E_Action_Impl *ap;
-
- D_ENTER;
-
- ap = NEW(E_Action_Impl, 1);
- ZERO(ap, E_Action_Impl, 1);
-
- e_object_init(E_OBJECT(ap), (E_Cleanup_Func) e_action_impl_cleanup);
-
- e_strdup(ap->action, action);
- ap->func_start = func_start;
- ap->func_cont = func_cont;
- ap->func_stop = func_stop;
- action_impls = evas_list_append(action_impls, ap);
-
- D_RETURN;
-}
-
-void
-e_action_del_timer(E_Object * object, char *name)
-{
- Evas_List * l;
-
- D_ENTER;
-
- again:
- for (l = current_timers; l; l = l->next)
- {
- E_Active_Action_Timer *at;
-
- at = l->data;
- if ((at->object == object) &&
- (name) && (at->name) && (!strcmp(at->name, name)))
- {
- e_object_unref(at->object);
- ecore_del_event_timer(at->name);
- current_timers = evas_list_remove(current_timers, at);
- IF_FREE(at->name);
- FREE(at);
- goto again;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_action_add_timer(E_Object * object, char *name)
-{
- E_Active_Action_Timer *at;
-
- D_ENTER;
-
- at = NEW(E_Active_Action_Timer, 1);
- at->object = object;
- e_object_ref(object);
- e_strdup(at->name, name);
- current_timers = evas_list_append(current_timers, at);
-
- D_RETURN;
-}
-
-void
-e_action_del_timer_object(E_Object * object)
-{
- Evas_List * l;
-
- D_ENTER;
-
- again:
- for (l = current_timers; l; l = l->next)
- {
- E_Active_Action_Timer *at;
-
- at = l->data;
- if (at->object == object)
- {
- e_object_unref(at->object);
- ecore_del_event_timer(at->name);
- current_timers = evas_list_remove(current_timers, at);
- IF_FREE(at->name);
- FREE(at);
- goto again;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_action_init(void)
-{
- D_ENTER;
-
- e_action_add_impl("Window_Move", e_act_move_start, e_act_move_cont,
- e_act_move_stop);
- e_action_add_impl("Window_Resize", e_act_resize_start, e_act_resize_cont,
- e_act_resize_stop);
- e_action_add_impl("Window_Resize_Horizontal", e_act_resize_h_start,
- e_act_resize_h_cont, e_act_resize_h_stop);
- e_action_add_impl("Window_Resize_Vertical", e_act_resize_v_start,
- e_act_resize_v_cont, e_act_resize_v_stop);
- e_action_add_impl("Window_Close", e_act_close_start, NULL, NULL);
- e_action_add_impl("Window_Kill", e_act_kill_start, NULL, NULL);
- e_action_add_impl("Window_Shade", e_act_shade_start, NULL, NULL);
- e_action_add_impl("Window_Raise", e_act_raise_start, NULL, NULL);
- e_action_add_impl("Window_Lower", e_act_lower_start, NULL, NULL);
- e_action_add_impl("Window_Raise_Lower", e_act_raise_lower_start, NULL, NULL);
- e_action_add_impl("Execute", e_act_exec_start, NULL, NULL);
- e_action_add_impl("Menu", e_act_menu_start, NULL, NULL);
- e_action_add_impl("Exit", e_act_exit_start, NULL, NULL);
- e_action_add_impl("Restart", e_act_restart_start, NULL, NULL);
- e_action_add_impl("Window_Stick", e_act_stick_start, NULL, NULL);
- e_action_add_impl("Sound", e_act_sound_start, NULL, NULL);
- e_action_add_impl("Window_Iconify", e_act_iconify_start, NULL, NULL);
- e_action_add_impl("Window_Max_Size", e_act_max_start, NULL, NULL);
- e_action_add_impl("Winodw_Snap", e_act_snap_start, NULL, NULL);
- e_action_add_impl("Window_Zoom", e_act_zoom_start, NULL, NULL);
- e_action_add_impl("Desktop", e_act_desk_start, NULL, NULL);
- e_action_add_impl("Desktop_Relative", e_act_desk_rel_start, NULL, NULL);
- e_action_add_impl("Window_Next", e_act_raise_next_start, NULL, NULL);
-
- D_RETURN;
-}
-
-/* FIXME: these REALLY need to go into other file(s) but it's not worht it */
-/* yet at this point. it can be done later */
-
-/* Erm is that really true? They're all static, all called through the */
-/* above functions -- so it's good to have them encapsulated here? --cK */
-
-/* well i was thinking changing this to be a bunch of: */
-/* #include "action_windows.c" */
-/* #include "action_files.c" */
-/* #include "action_general.c" */
-/* etc. - group actions in files for their logical uses */
-/* kind of evil to inlucde c files.. but it means breaking it up better */
-/* probably moving these includes above the init and having hooks into the */
-/* init func */
-
-static void
-e_act_move_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
- E_Guides_Mode move_mode = E_GUIDES_BOX;
- double align_x = 0.5;
- double align_y = 0.5;
- E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
-
- D_ENTER;
-
- e_block_start("menus");
-
- b = (E_Border *) object;
-
- if (!b)
- b = e_border_current_focused();
-
- if (!b)
- D_RETURN;
-
- if (b->client.fixed)
- D_RETURN;
-
- move_mode = config_data->window->move_mode;
- display_loc = config_data->guides->location;
- align_x = config_data->guides->x;
- align_y = config_data->guides->y;
-
- if (move_mode >= E_GUIDES_BOX)
- b->hold_changes = 1; /* if non opaque */
- b->mode.move = 1;
- b->current.requested.dx = 0;
- b->current.requested.dy = 0;
- b->previous.requested.dx = 0;
- b->previous.requested.dy = 0;
-
- {
- char buf[PATH_MAX];
-
- e_border_print_pos(buf, b);
- e_guides_set_display_alignment(align_x, align_y);
- e_guides_set_mode(move_mode);
- e_guides_set_display_location(display_loc);
- e_guides_display_text(buf);
- snprintf(buf, PATH_MAX, "%s/%s", e_config_get("images"),
- "win_shadow_icon.png");
- e_guides_display_icon(buf);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_show();
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_move_stop(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
-
- e_block_stop("menus");
-
- if (!b)
- b = e_border_current_focused();
-
- if (!b)
- D_RETURN;
-
- if (b->client.fixed)
- D_RETURN;
-
- b->hold_changes = 0; /* if non opaque */
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->changed = 1;
- b->mode.move = 0;
- b->current.requested.dx = 0;
- b->current.requested.dy = 0;
- b->previous.requested.dx = 0;
- b->previous.requested.dy = 0;
- b->changed = 1;
- b->current.requested.visible = 1;
- b->current.visible = 1;
- e_border_adjust_limits(b);
- e_guides_hide();
- e_desktops_add_border(b->desk, b);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_move_cont(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry, int dx, int dy)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
-
- if (!b)
- b = e_border_current_focused();
-
- if (!b)
- D_RETURN;
-
- if (b->client.fixed)
- D_RETURN;
-
- b->current.requested.x += dx;
- b->current.requested.y += dy;
- if (dx != 0)
- b->current.requested.dx = dx;
- if (dy != 0)
- b->current.requested.dy = dy;
- b->changed = 1;
- e_border_adjust_limits(b);
- {
- char buf[1024];
-
- e_border_print_pos(buf, b);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_display_text(buf);
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
- E_Guides_Mode resize_mode = E_GUIDES_BOX;
- double align_x = 0.5;
- double align_y = 0.5;
- E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
-
- D_ENTER;
-
- e_block_start("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
-
- resize_mode = config_data->window->resize_mode;
- display_loc = config_data->guides->location;
- align_x = config_data->guides->x;
- align_y = config_data->guides->y;
-
- if (resize_mode >= E_GUIDES_BOX)
- b->hold_changes = 1; /* if non opaque */
- ecore_window_gravity_set(b->win.client, StaticGravity);
- ecore_window_gravity_set(b->win.b, SouthEastGravity);
- ecore_window_gravity_set(b->win.input, NorthWestGravity);
- ecore_window_gravity_set(b->win.container, NorthWestGravity);
- /* 1 | 2 */
- /* --+-- */
- /* 3 | 4 */
- if (x > (b->current.w / 2))
- {
- if (y > (b->current.h / 2))
- {
- b->mode.resize = 4;
- /* e_border_set_gravity(b, NorthWestGravity); */
- /* ecore_window_gravity_set(b->win.container, SouthEastGravity); */
- }
- else
- {
- b->mode.resize = 2;
- /* e_border_set_gravity(b, SouthWestGravity); */
- /* ecore_window_gravity_set(b->win.container, NorthEastGravity); */
- }
- }
- else
- {
- if (y > (b->current.h / 2))
- {
- b->mode.resize = 3;
-/* e_border_set_gravity(b, NorthEastGravity);*/
-/* ecore_window_gravity_set(b->win.container, SouthWestGravity);*/
- }
- else
- {
- b->mode.resize = 1;
-/* e_border_set_gravity(b, SouthEastGravity);*/
-/* ecore_window_gravity_set(b->win.container, NorthWestGravity); */
- }
- }
- {
- char buf[PATH_MAX];
-
- e_border_print_size(buf, b);
- e_guides_set_display_alignment(align_x, align_y);
- e_guides_set_mode(resize_mode);
- e_guides_set_display_location(display_loc);
- e_guides_display_text(buf);
- snprintf(buf, PATH_MAX, "%s/%s", e_config_get("images"),
- "win_shadow_icon.png");
- e_guides_display_icon(buf);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_show();
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_stop(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- e_block_stop("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- b->hold_changes = 0; /* if non opaque */
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
- b->mode.resize = 0;
- b->changed = 1;
- e_border_adjust_limits(b);
- ecore_window_gravity_set(b->win.client, NorthWestGravity);
- e_border_set_gravity(b, NorthWestGravity);
- e_guides_hide();
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_cont(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry, int dx, int dy)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- if (b->mode.resize == 1)
- {
- b->current.requested.w -= dx;
- b->current.requested.h -= dy;
- b->current.requested.x += dx;
- b->current.requested.y += dy;
- }
- else if (b->mode.resize == 2)
- {
- b->current.requested.w += dx;
- b->current.requested.h -= dy;
- b->current.requested.y += dy;
- }
- else if (b->mode.resize == 3)
- {
- b->current.requested.w -= dx;
- b->current.requested.h += dy;
- b->current.requested.x += dx;
- }
- else if (b->mode.resize == 4)
- {
- b->current.requested.w += dx;
- b->current.requested.h += dy;
- }
- b->changed = 1;
- e_border_adjust_limits(b);
- {
- char buf[1024];
-
- e_border_print_size(buf, b);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_display_text(buf);
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_h_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
- E_Guides_Mode resize_mode = E_GUIDES_BOX;
- double align_x = 0.5;
- double align_y = 0.5;
- E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
-
- D_ENTER;
-
- e_block_start("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
-
- resize_mode = config_data->window->resize_mode;
- display_loc = config_data->guides->location;
- align_x = config_data->guides->x;
- align_y = config_data->guides->y;
-
- if (resize_mode >= E_GUIDES_BOX)
- b->hold_changes = 1; /* if non opaque */
- ecore_window_gravity_set(b->win.client, StaticGravity);
- ecore_window_gravity_set(b->win.b, SouthEastGravity);
- ecore_window_gravity_set(b->win.input, NorthWestGravity);
- ecore_window_gravity_set(b->win.container, NorthWestGravity);
- /* 5 | 6 */
- if (x > (b->current.w / 2))
- {
- b->mode.resize = 6;
-/* e_border_set_gravity(b, NorthWestGravity);*/
- }
- else
- {
- b->mode.resize = 5;
-/* e_border_set_gravity(b, NorthEastGravity);*/
- }
- {
- char buf[PATH_MAX];
-
- e_border_print_size(buf, b);
- e_guides_set_display_alignment(align_x, align_y);
- e_guides_set_mode(resize_mode);
- e_guides_set_display_location(display_loc);
- e_guides_display_text(buf);
- snprintf(buf, PATH_MAX, "%s/%s", e_config_get("images"),
- "win_shadow_icon.png");
- e_guides_display_icon(buf);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_show();
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_h_stop(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- e_block_stop("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- b->hold_changes = 0; /* if non opaque */
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
- b->mode.resize = 0;
- b->changed = 1;
- e_border_adjust_limits(b);
- ecore_window_gravity_set(b->win.client, NorthWestGravity);
- e_border_set_gravity(b, NorthWestGravity);
- e_guides_hide();
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_h_cont(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry, int dx, int dy)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.w == b->client.max.w)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- if (b->mode.resize == 5)
- {
- b->current.requested.w -= dx;
- b->current.requested.x += dx;
- }
- else if (b->mode.resize == 6)
- {
- b->current.requested.w += dx;
- }
- b->changed = 1;
- e_border_adjust_limits(b);
- {
- char buf[1024];
-
- e_border_print_size(buf, b);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_display_text(buf);
- }
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
- UN(dy);
-}
-
-static void
-e_act_resize_v_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
- E_Guides_Mode resize_mode = E_GUIDES_BOX;
- double align_x = 0.5;
- double align_y = 0.5;
- E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
-
- D_ENTER;
-
- e_block_start("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
-
- resize_mode = config_data->window->resize_mode;
- display_loc = config_data->guides->location;
- align_x = config_data->guides->x;
- align_y = config_data->guides->y;
-
- if (resize_mode >= E_GUIDES_BOX)
- b->hold_changes = 1; /* if non opaque */
- ecore_window_gravity_set(b->win.client, StaticGravity);
- ecore_window_gravity_set(b->win.b, SouthEastGravity);
- ecore_window_gravity_set(b->win.input, NorthWestGravity);
- ecore_window_gravity_set(b->win.container, NorthWestGravity);
- /* 7 */
- /* - */
- /* 8 */
- if (y > (b->current.h / 2))
- {
- b->mode.resize = 8;
-/* e_border_set_gravity(b, NorthWestGravity);*/
- }
- else
- {
- b->mode.resize = 7;
-/* e_border_set_gravity(b, SouthWestGravity);*/
- }
- {
- char buf[PATH_MAX];
-
- e_border_print_size(buf, b);
- e_guides_set_display_alignment(align_x, align_y);
- e_guides_set_mode(resize_mode);
- e_guides_set_display_location(display_loc);
- e_guides_display_text(buf);
- snprintf(buf, PATH_MAX, "%s/%s", e_config_get("images"),
- "win_shadow_icon.png");
- e_guides_display_icon(buf);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_show();
- }
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_v_stop(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- e_block_stop("menus");
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- b->hold_changes = 0; /* if non opaque */
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
- b->mode.resize = 0;
- e_border_adjust_limits(b);
- ecore_window_gravity_set(b->win.client, NorthWestGravity);
- e_border_set_gravity(b, NorthWestGravity);
- b->changed = 1;
- e_guides_hide();
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_resize_v_cont(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry, int dx, int dy)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.min.h == b->client.max.h)
- D_RETURN;
- if (b->current.shaded != 0)
- D_RETURN;
- if (b->mode.resize == 7)
- {
- b->current.requested.h -= dy;
- b->current.requested.y += dy;
- }
- else if (b->mode.resize == 8)
- {
- b->current.requested.h += dy;
- }
- e_border_adjust_limits(b);
- b->changed = 1;
- {
- char buf[1024];
-
- e_border_print_size(buf, b);
- e_guides_move(b->current.x, b->current.y);
- e_guides_resize(b->current.w, b->current.h);
- e_guides_display_text(buf);
- }
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
- UN(dx);
-}
-
-static void
-e_act_close_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- if (b->win.client)
- e_icccm_delete(b->win.client);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_kill_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- if (b->win.client)
- ecore_window_kill_client(b->win.client);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void e_act_cb_shade(int val, void *data);
-static void
-e_act_cb_shade(int val, void *data)
-{
- E_Border *b;
- static double t = 0.0;
- double dif;
- int si;
- int pix_per_sec = 3200;
-
- D_ENTER;
-
- b = data;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
-
- if (val == 0)
- {
- t = ecore_get_time();
- ecore_window_gravity_set(b->win.client, SouthWestGravity);
- e_action_del_timer(E_OBJECT(b), "shader");
- e_action_add_timer(E_OBJECT(b), "shader");
- }
-
- dif = ecore_get_time() - t;
-
- si = (int)(dif * (double)pix_per_sec);
- if (si > b->client.h)
- si = b->client.h;
- b->current.shaded = si;
- b->changed = 1;
- e_border_adjust_limits(b);
- e_border_apply_border(b);
- if (si < b->client.h)
- ecore_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data);
- else
- {
- e_action_del_timer(E_OBJECT(b), "shader");
- ecore_window_gravity_reset(b->win.client);
- }
-
- D_RETURN;
-}
-
-static void e_act_cb_unshade(int val, void *data);
-static void
-e_act_cb_unshade(int val, void *data)
-{
- E_Border *b;
- static double t = 0.0;
- double dif;
- int si;
- int pix_per_sec = 3200;
-
- D_ENTER;
-
- b = data;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- if (val == 0)
- {
- t = ecore_get_time();
- ecore_window_gravity_set(b->win.client, SouthWestGravity);
- e_action_del_timer(E_OBJECT(b), "shader");
- e_action_add_timer(E_OBJECT(b), "shader");
- }
-
- dif = ecore_get_time() - t;
-
- si = b->client.h - (int)(dif * (double)pix_per_sec);
- if (si < 0)
- si = 0;
-
- b->current.shaded = si;
- b->changed = 1;
- e_border_adjust_limits(b);
- e_border_apply_border(b);
- if (si > 0)
- ecore_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data);
- else
- {
- e_action_del_timer(E_OBJECT(b), "shader");
- ecore_window_gravity_reset(b->win.client);
- }
-
- D_RETURN;
-}
-
-static void
-e_act_shade_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
-
- if (b->client.is_desktop)
- D_RETURN;
-
- if (b->current.shaded == 0)
- e_act_cb_shade(0, b);
- else
- e_act_cb_unshade(0, b);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_raise_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- e_border_raise(b);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_lower_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- e_border_lower(b);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_raise_lower_start(E_Object * object, E_Action * a, void *data, int x,
- int y, int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_exec_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- char *exe;
-
- D_ENTER;
-
- exe = (char *)a->params;
- if (!exe)
- D_RETURN;
- e_exec_run(exe);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
- UN(object);
-}
-
-static void
-e_act_menu_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- if (e_block_is_active("menus"))
- D_RETURN;
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
-
- e_bordermenu_do(b);
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-void
-e_act_exit_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- D_ENTER;
-
- e_view_machine_close_all_views();
-
- ecore_focus_mode_reset();
- ecore_sync();
-
- e_db_runtime_flush();
-
- exit(0);
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-void
-e_act_restart_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- D_ENTER;
-
- e_view_machine_close_all_views();
-
- ecore_focus_mode_reset();
- ecore_sync();
-
- e_db_runtime_flush();
-
- e_exec_restart();
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_stick_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- if (b->client.sticky)
- b->client.sticky = 0;
- else
- b->client.sticky = 1;
- b->changed = 1;
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_sound_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- D_ENTER;
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_iconify_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-#if 1
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
-
- D("iconify action start\n");
- e_border_iconify(b);
-#endif
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_max_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
- if (b->client.is_desktop)
- D_RETURN;
- if (b->current.shaded > 0)
- D_RETURN;
- if ((b->mode.move) || (b->mode.resize))
- D_RETURN;
- b->mode.move = 0;
- b->mode.resize = 0;
- if (b->max.is)
- {
- b->current.requested.x = b->max.x;
- b->current.requested.y = b->max.y;
- b->current.requested.w = b->max.w;
- b->current.requested.h = b->max.h;
- b->changed = 1;
- b->max.is = 0;
- e_border_adjust_limits(b);
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
-
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_UNMAXIMIZE,
- NULL);
- }
- else
- {
- b->max.x = b->current.x;
- b->max.y = b->current.y;
- b->max.w = b->current.w;
- b->max.h = b->current.h;
- b->current.requested.x = 0;
- b->current.requested.y = 0;
- b->current.requested.w = b->desk->real.w;
- b->current.requested.h = b->desk->real.h;
- b->changed = 1;
- b->max.is = 1;
- e_border_adjust_limits(b);
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
-
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_MAXIMIZE,
- NULL);
- }
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_snap_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
-
- if (!b)
- b = e_border_current_focused();
- if (!b)
- D_RETURN;
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_zoom_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = (E_Border *) object;
-
- if (!b)
- b = e_border_current_focused();
-
- if (!b)
- D_RETURN;
-
- D_RETURN;
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_desk_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- int desk = 0;
-
- D_ENTER;
-
- if (a->params)
- desk = atoi(a->params);
-
- e_desktops_goto_desk(desk);
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_desk_rel_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry)
-{
- int desk = 0;
- int desk_max = e_desktops_get_num() - 1;
-
- D_ENTER;
-
- if (a->params)
- desk = atoi(a->params) + e_desktops_get_current();
-
- if (desk < 0)
- desk = desk_max;
- else if (desk > desk_max)
- desk = 0;
-
- e_desktops_goto_desk(desk);
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
-
-static void
-e_act_raise_next_start(E_Object * object, E_Action * a, void *data, int x,
- int y, int rx, int ry)
-{
- E_Border *current = NULL;
-
- D_ENTER;
-
- current = e_desktop_raise_next_border();
- if (current)
- e_border_send_pointer(current);
-
- D_RETURN;
- UN(object);
- UN(a);
- UN(data);
- UN(x);
- UN(y);
- UN(rx);
- UN(ry);
-}
+++ /dev/null
-#ifndef E_ACTIONS_H
-#define E_ACTIONS_H
-
-#include "object.h"
-
-typedef struct _E_Action E_Action;
-typedef struct _E_Action_Impl E_Action_Impl;
-typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
-
-typedef enum e_action_type
-{
- ACT_MOUSE_IN,
- ACT_MOUSE_OUT,
- ACT_MOUSE_CLICK,
- ACT_MOUSE_DOUBLE,
- ACT_MOUSE_TRIPLE,
- ACT_MOUSE_UP,
- ACT_MOUSE_CLICKED,
- ACT_MOUSE_MOVE,
- ACT_KEY_DOWN,
- ACT_KEY_UP
-}
-E_Action_Type;
-
-struct _E_Active_Action_Timer
-{
- void *object;
- char *name;
-};
-
-struct _E_Action
-{
- E_Object o;
-
- char *name;
- char *action;
- char *params;
- E_Action_Type event;
- int button;
- char *key;
- int modifiers;
- E_Action_Impl *action_impl;
- E_Object *object;
- int started;
- int grabbed;
-};
-
-typedef void (*E_Action_Start_Func) (E_Object * o, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-typedef void (*E_Action_Cont_Func) (E_Object * o, E_Action * a,
- void *data, int x, int y, int rx,
- int ry, int dx, int dy);
-typedef void (*E_Action_Stop_Func) (E_Object * o, E_Action * a,
- void *data, int x, int y, int rx,
- int ry);
-
-struct _E_Action_Impl
-{
- E_Object o;
-
- char *action;
-
- E_Action_Start_Func func_start;
- E_Action_Cont_Func func_cont;
- E_Action_Stop_Func func_stop;
-};
-
-/**
- * e_action_init - Actions implementation initializer
- *
- * This function registers the various action implementations,
- * i.e. the way E performs actions.
- */
-void e_action_init(void);
-void e_action_cleanup(E_Action *a);
-
-int e_action_start(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods,
- E_Object * o, void *data, int x, int y,
- int rx, int ry);
-void e_action_stop(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods,
- E_Object * o, void *data, int x, int y,
- int rx, int ry);
-void e_action_cont(char *action, E_Action_Type act, int button,
- char *key, Ecore_Event_Key_Modifiers mods,
- E_Object * o, void *data, int x, int y,
- int rx, int ry, int dx, int dy);
-void e_action_stop_by_object(E_Object * o, void *data, int x,
- int y, int rx, int ry);
-void e_action_stop_by_type(char *action);
-void e_action_add_impl(char *action,
- E_Action_Start_Func func_start,
- E_Action_Cont_Func func_cont,
- E_Action_Stop_Func func_stop);
-void e_action_del_timer(E_Object * object, char *name);
-void e_action_add_timer(E_Object * object, char *name);
-void e_action_del_timer_object(E_Object * object);
-
-
-void e_act_exit_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry);
-void e_act_restart_start(E_Object * object, E_Action * a, void *data, int x, int y,
- int rx, int ry);
-
-#endif
+++ /dev/null
-#include "e.h"
-#include "debug.h"
-#include "background.h"
-#include "util.h"
-
-static void
-e_background_cleanup(E_Background * bg)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if (bg->layers)
- {
- for (l = bg->layers; l; l = l->next)
- {
- E_Background_Layer *bl;
-
- bl = l->data;
- if (bl->color_class)
- FREE(bl->color_class);
- if (bl->file)
- FREE(bl->file);
- if (bl->obj)
- evas_object_del(bl->obj);
- FREE(bl);
- }
- evas_list_free(bg->layers);
- }
- if (bg->file)
- FREE(bg->file);
- if (bg->base_obj)
- evas_object_del(bg->base_obj);
-
- e_object_cleanup(E_OBJECT(bg));
-
- D_RETURN;
-}
-
-E_Background *
-e_background_new(void)
-{
- E_Background *bg;
-
- D_ENTER;
-
- bg = NEW(E_Background, 1);
- ZERO(bg, E_Background, 1);
-
- e_object_init(E_OBJECT(bg), (E_Cleanup_Func) e_background_cleanup);
-
- D_RETURN_(bg);
-}
-
-E_Background *
-e_background_load(char *file)
-{
- E_Background *bg;
- E_DB_File *db;
- int i, num;
-
- D_ENTER;
-
- db = e_db_open_read(file);
- if (!db)
- D_RETURN_(NULL);
- num = 0;
- e_db_int_get(db, "/type/bg", &num);
- if (num != 1)
- {
- e_db_close(db);
- e_db_flush();
- D_RETURN_(NULL);
- }
- e_db_int_get(db, "/layers/count", &num);
-
- bg = e_background_new();
- e_strdup(bg->file, file);
- for (i = 0; i < num; i++)
- {
- E_Background_Layer *bl;
- char buf[PATH_MAX];
-
- bl = NEW(E_Background_Layer, 1);
- ZERO(bl, E_Background_Layer, 1);
- bg->layers = evas_list_append(bg->layers, bl);
-
- snprintf(buf, PATH_MAX, "/layers/%i/type", i);
- e_db_int_get(db, buf, (int *)&(bl->type));
- snprintf(buf, PATH_MAX, "/layers/%i/inlined", i);
- e_db_int_get(db, buf, &(bl->inlined));
- snprintf(buf, PATH_MAX, "/layers/%i/color_class", i);
- bl->color_class = e_db_str_get(db, buf);
- if (bl->inlined)
- {
- snprintf(buf, PATH_MAX, "%s:/layers/%i/image", file, i);
- e_strdup(bl->file, buf);
- }
- else
- {
- snprintf(buf, PATH_MAX, "/layers/%i/file", i);
- bl->file = e_db_str_get(db, buf);
- }
- snprintf(buf, PATH_MAX, "/layers/%i/scroll.x", i);
- e_db_float_get(db, buf, &(bl->scroll.x));
- snprintf(buf, PATH_MAX, "/layers/%i/scroll.y", i);
- e_db_float_get(db, buf, &(bl->scroll.y));
- snprintf(buf, PATH_MAX, "/layers/%i/pos.x", i);
- e_db_float_get(db, buf, &(bl->pos.x));
- snprintf(buf, PATH_MAX, "/layers/%i/pos.y", i);
- e_db_float_get(db, buf, &(bl->pos.y));
- snprintf(buf, PATH_MAX, "/layers/%i/size.w", i);
- e_db_float_get(db, buf, &(bl->size.w));
- snprintf(buf, PATH_MAX, "/layers/%i/size.h", i);
- e_db_float_get(db, buf, &(bl->size.h));
- snprintf(buf, PATH_MAX, "/layers/%i/size.orig.w", i);
- e_db_int_get(db, buf, &(bl->size.orig.w));
- snprintf(buf, PATH_MAX, "/layers/%i/size.orig.h", i);
- e_db_int_get(db, buf, &(bl->size.orig.h));
- snprintf(buf, PATH_MAX, "/layers/%i/fill.w", i);
- e_db_float_get(db, buf, &(bl->fill.w));
- snprintf(buf, PATH_MAX, "/layers/%i/fill.h", i);
- e_db_float_get(db, buf, &(bl->fill.h));
- snprintf(buf, PATH_MAX, "/layers/%i/fill.orig.w", i);
- e_db_int_get(db, buf, &(bl->fill.orig.w));
- snprintf(buf, PATH_MAX, "/layers/%i/fill.orig.h", i);
- e_db_int_get(db, buf, &(bl->fill.orig.h));
- snprintf(buf, PATH_MAX, "/layers/%i/angle", i);
- e_db_float_get(db, buf, (float *)&(bl->angle));
- snprintf(buf, PATH_MAX, "/layers/%i/fg.r", i);
- e_db_int_get(db, buf, &(bl->fg.r));
- snprintf(buf, PATH_MAX, "/layers/%i/fg.g", i);
- e_db_int_get(db, buf, &(bl->fg.g));
- snprintf(buf, PATH_MAX, "/layers/%i/fg.b", i);
- e_db_int_get(db, buf, &(bl->fg.b));
- snprintf(buf, PATH_MAX, "/layers/%i/fg.a", i);
- e_db_int_get(db, buf, &(bl->fg.a));
- snprintf(buf, PATH_MAX, "/layers/%i/bg.r", i);
- e_db_int_get(db, buf, &(bl->bg.r));
- snprintf(buf, PATH_MAX, "/layers/%i/bg.g", i);
- e_db_int_get(db, buf, &(bl->bg.g));
- snprintf(buf, PATH_MAX, "/layers/%i/bg.b", i);
- e_db_int_get(db, buf, &(bl->bg.b));
- snprintf(buf, PATH_MAX, "/layers/%i/bg.a", i);
- e_db_int_get(db, buf, &(bl->bg.a));
- }
- e_db_close(db);
- D_RETURN_(bg);
-}
-
-void
-e_background_realize(E_Background * bg, Evas * evas)
-{
- Evas_List * l;
- int ww, hh, count;
-
- D_ENTER;
-
- if (bg->evas)
- D_RETURN;
- bg->evas = evas;
- if (!bg->evas)
- D_RETURN;
- for (count = 0, l = bg->layers; l; l = l->next, count++)
- {
- E_Background_Layer *bl;
-
- bl = l->data;
- if (bl->type == E_BACKGROUND_TYPE_IMAGE)
- {
- bl->obj = evas_object_image_add(bg->evas);
- evas_object_image_file_set(bl->obj, bl->file, NULL);
- evas_object_layer_set(bl->obj, 0);
- evas_object_show(bl->obj);
-#if 0 /* dont need this... do we? */
- if (evas_get_image_alpha(bg->evas, bl->obj))
- {
- D("Adding rectangle to bg!\n");
- bg->base_obj = evas_add_rectangle(bg->evas);
- evas_lower(bg->evas, bg->base_obj);
- evas_move(bg->evas, bg->base_obj, 0, 0);
- evas_resize(bg->evas, bg->base_obj, 999999999, 999999999);
- evas_set_color(bg->evas, bg->base_obj, 255, 255, 255, 255);
- evas_show(bg->evas, bg->base_obj);
- }
-#endif
- }
- else if (bl->type == E_BACKGROUND_TYPE_GRADIENT)
- {
- }
- else if (bl->type == E_BACKGROUND_TYPE_SOLID)
- {
- }
- }
- ww = bg->geom.w;
- hh = bg->geom.h;
- bg->geom.w = 0;
- bg->geom.h = 0;
- e_background_set_size(bg, ww, hh);
-
- D_RETURN;
-}
-
-void
-e_background_set_scroll(E_Background * bg, int sx, int sy)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if ((bg->geom.sx == sx) && (bg->geom.sy == sy))
- D_RETURN;
- bg->geom.sx = sx;
- bg->geom.sy = sy;
- if (!bg->evas)
- D_RETURN;
- for (l = bg->layers; l; l = l->next)
- {
- E_Background_Layer *bl;
-
- bl = l->data;
- if (bl->type == E_BACKGROUND_TYPE_IMAGE)
- {
- evas_object_image_fill_set(bl->obj,
- (double)bg->geom.sx * bl->scroll.x,
- (double)bg->geom.sy * bl->scroll.y,
- bl->fw, bl->fh);
- }
- }
- D_RETURN;
-}
-
-void
-e_background_set_size(E_Background * bg, int w, int h)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if ((bg->geom.w == w) && (bg->geom.h == h))
- D_RETURN;
- bg->geom.w = w;
- bg->geom.h = h;
- for (l = bg->layers; l; l = l->next)
- {
- E_Background_Layer *bl;
- double x, y, w, h, fw, fh;
- int iw, ih;
-
- bl = l->data;
- iw = 0;
- ih = 0;
- if (bg->evas)
- evas_object_image_size_get(bl->obj, &iw, &ih);
- w = bl->size.w * (double)bg->geom.w;
- h = bl->size.h * (double)bg->geom.h;
- if (bl->size.orig.w)
- w = (double)iw *bl->size.w;
-
- if (bl->size.orig.h)
- h = (double)ih *bl->size.h;
-
- fw = bl->fill.w * w;
- fh = bl->fill.h * h;
- if (bl->fill.orig.w)
- fw = (double)iw *bl->fill.w;
-
- if (bl->fill.orig.h)
- fh = (double)ih *bl->fill.h;
-
- x = ((double)bg->geom.w - w + 1) * bl->pos.x;
- y = ((double)bg->geom.h - h + 1) * bl->pos.y;
- bl->x = x;
- bl->y = y;
- bl->w = w;
- bl->h = h;
- bl->fw = fw;
- bl->fh = fh;
- if (bg->evas)
- {
- evas_object_move(bl->obj, bl->x, bl->y);
- evas_object_resize(bl->obj, bl->w, bl->h);
- if (bl->type == E_BACKGROUND_TYPE_IMAGE)
- {
- evas_object_image_fill_set(bl->obj,
- (double)bg->geom.sx * bl->scroll.x,
- (double)bg->geom.sy * bl->scroll.y,
- bl->fw, bl->fh);
- }
- else if (bl->type == E_BACKGROUND_TYPE_GRADIENT)
- {
- evas_object_angle_set(bl->obj, bl->angle);
- }
- else if (bl->type == E_BACKGROUND_TYPE_SOLID)
- {
- }
- }
- }
- D_RETURN;
-}
-
-void
-e_background_set_color_class(E_Background * bg, char *cc, int r, int g, int b,
- int a)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = bg->layers; l; l = l->next)
- {
- E_Background_Layer *bl;
-
- bl = l->data;
- if ((bl->color_class) && (cc) && (!strcmp(bl->color_class, cc)))
- {
- if (bg->evas)
- {
- if ((l == bg->layers) && (bg->base_obj))
- evas_object_color_set(bl->obj, r, g, b, 255);
- else
- evas_object_color_set(bl->obj, r, g, b, a);
- }
- }
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_BACKGROUND_H
-#define E_BACKGROUND_H
-
-#include "object.h"
-
-typedef struct _E_Background E_Background;
-typedef struct _E_Background_Layer E_Background_Layer;
-
-typedef enum
-{
- E_BACKGROUND_TYPE_IMAGE = 0,
- E_BACKGROUND_TYPE_GRADIENT = 1,
- E_BACKGROUND_TYPE_SOLID = 2
-}
-E_Background_Type;
-
-struct _E_Background
-{
- E_Object o;
-
- Evas * evas;
- char *file;
-
- struct
- {
- int sx, sy;
- int w, h;
- }
- geom;
-
- Evas_List * layers;
-
- Evas_Object * base_obj;
-};
-
-struct _E_Background_Layer
-{
- E_Background_Type type;
- int inlined;
- struct
- {
- float x, y;
- }
- scroll;
- struct
- {
- float x, y;
- }
- pos;
- struct
- {
- float w, h;
- struct
- {
- int w, h;
- }
- orig;
- }
- size , fill;
- char *color_class;
- char *file;
- double angle;
- struct
- {
- int r, g, b, a;
- }
- fg , bg;
-
- double x, y, w, h, fw, fh;
-
- Evas_Object * obj;
-};
-
-E_Background *e_background_new(void);
-E_Background *e_background_load(char *file);
-
-void e_background_realize(E_Background * bg, Evas * evas);
-void e_background_set_scroll(E_Background * bg, int sx, int sy);
-void e_background_set_size(E_Background * bg, int w, int h);
-void e_background_set_color_class(E_Background * bg, char *cc,
- int r, int g, int b, int a);
-
-#endif
+++ /dev/null
-#include "block.h"
-#include "debug.h"
-#include "util.h"
-
-typedef struct _e_block E_Block;
-
-struct _e_block
-{
- char *name;
- int refs;
-};
-
-static Evas_List * blocks = NULL;
-
-static E_Block *e_block_find(char *name);
-
-static E_Block *
-e_block_find(char *name)
-{
- Evas_List * l;
-
- D_ENTER;
- for (l = blocks; l; l = l->next)
- {
- E_Block *b;
-
- b = l->data;
- if (!strcmp(b->name, name))
- {
- blocks = evas_list_remove(blocks, b);
- blocks = evas_list_prepend(blocks, b);
- D_RETURN_(b);
- }
- }
- D_RETURN_(NULL);
-}
-
-void
-e_block_start(char *name)
-{
- E_Block *b;
-
- D_ENTER;
- b = e_block_find(name);
- if (b)
- {
- b->refs++;
- D_RETURN;
- }
- b = NEW(E_Block, 1);
- ZERO(b, E_Block, 1);
- e_strdup(b->name, name);
- b->refs = 1;
- blocks = evas_list_prepend(blocks, b);
- D_RETURN;
-}
-
-void
-e_block_stop(char *name)
-{
- E_Block *b;
-
- D_ENTER;
- b = e_block_find(name);
- if (b)
- {
- b->refs--;
- if (b->refs < 1)
- {
- blocks = evas_list_remove(blocks, b);
- IF_FREE(b->name);
- FREE(b);
- }
- }
- D_RETURN;
-}
-
-int
-e_block_is_active(char *name)
-{
- E_Block *b;
-
- D_ENTER;
- b = e_block_find(name);
- if (b)
- {
- D_RETURN_(b->refs);
- }
- D_RETURN_(0);
-}
+++ /dev/null
-#ifndef E_BLOCK_H
-#define E_BLOCK_H
-
-#include "e.h"
-
-void e_block_start(char *name);
-void e_block_stop(char *name);
-int e_block_is_active(char *name);
-
-#endif
+++ /dev/null
-#include "cursors.h"
-#include "border.h"
-#include "bordermenu.h"
-#include "config.h"
-#include "debug.h"
-#include "actions.h"
-#include "delayed.h"
-#include "desktops.h"
-#include "resist.h"
-#include "icccm.h"
-#include "file.h"
-#include "util.h"
-#include "place.h"
-#include "match.h"
-#include "focus.h"
-#include "exec.h"
-#include "menu.h"
-
-/* Window border rendering, querying, setting & modification code */
-
-/* globals local to window borders */
-static Evas_List * evases = NULL;
-static Evas_List * borders = NULL;
-
-static int mouse_x, mouse_y, mouse_win_x, mouse_win_y;
-static int mouse_buttons = 0;
-
-static int border_mouse_x = 0;
-static int border_mouse_y = 0;
-static int border_mouse_buttons = 0;
-
-static Ecore_Event *current_ev = NULL;
-
-/* Global delayed window raise action */
-E_Delayed_Action *delayed_window_raise = NULL;
-
-static void e_idle(void *data);
-static void e_map_request(Ecore_Event * ev);
-static void e_configure_request(Ecore_Event * ev);
-static void e_property(Ecore_Event * ev);
-static void e_unmap(Ecore_Event * ev);
-static void e_destroy(Ecore_Event * ev);
-static void e_circulate_request(Ecore_Event * ev);
-static void e_reparent(Ecore_Event * ev);
-static void e_shape(Ecore_Event * ev);
-static void e_focus_in(Ecore_Event * ev);
-static void e_focus_out(Ecore_Event * ev);
-static void e_colormap(Ecore_Event * ev);
-static void e_mouse_down(Ecore_Event * ev);
-static void e_mouse_up(Ecore_Event * ev);
-static void e_mouse_in(Ecore_Event * ev);
-static void e_mouse_out(Ecore_Event * ev);
-static void e_window_expose(Ecore_Event * ev);
-float e_border_delayed_val();
-
-static void e_cb_mouse_in(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow,
- int oh);
-static void e_cb_mouse_out(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow,
- int oh);
-static void e_cb_mouse_down(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_cb_mouse_up(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow,
- int oh);
-static void e_cb_mouse_move(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-
-static void e_cb_border_mouse_in(E_Border * b, Ecore_Event * e);
-static void e_cb_border_mouse_out(E_Border * b, Ecore_Event * e);
-static void e_cb_border_mouse_down(E_Border * b, Ecore_Event * e);
-static void e_cb_border_mouse_up(E_Border * b, Ecore_Event * e);
-static void e_cb_border_mouse_move(E_Border * b, Ecore_Event * e);
-static void e_cb_border_move_resize(E_Border * b);
-static void e_cb_border_visibility(E_Border * b);
-
-static void e_border_poll(int val, void *data);
-static void e_border_cleanup(E_Border * b);
-E_Border *e_border_shuffle_last(E_Border *b);
-E_Border *e_border_current_select(void);
-
-static int
-e_border_replay_query(Ecore_Event_Mouse_Down * ev)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = e_border_find_by_window(ev->win);
- if (b)
- {
- int focus_mode;
-
- focus_mode = config_data->window->focus_mode;
- if ((focus_mode == 2) && (ev->mods == ECORE_EVENT_KEY_MODIFIER_NONE))
- /* FIXME: also if pass click always set */
- D_RETURN_(1);
- }
-
- D_RETURN_(0);
-}
-
-/* what to dowhen we're idle */
-
-void
-e_border_update_borders(void)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- e_border_update(b);
- }
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
-
- if (b->shape_changed)
- {
- e_border_reshape(b);
- }
- }
-
- e_db_runtime_flush();
-
- D_RETURN;
-}
-
-void
-e_border_check_select( void )
-{
- E_Border *b;
- E_Desktop *current_desk;
-
- current_desk = e_desktops_get(e_desktops_get_current());
-
- /* If no borders exist on present desktop */
- if (!current_desk || !current_desk->windows)
- {
- e_icccm_send_focus_to( e_desktop_window(), 1);
- D_RETURN_(NULL);
- }
-
- if((b = e_border_current_focused()))
- e_icccm_send_focus_to( b->win.client, 1);
- else
- e_border_shuffle_last(b);
-}
-
-static void
-e_idle(void *data)
-{
- D_ENTER;
-
- e_border_update_borders();
-
- D_RETURN;
- UN(data);
-}
-
-/* */
-static void
-e_map_request(Ecore_Event * ev)
-{
- Ecore_Event_Window_Map_Request *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (!b)
- {
- if (ecore_window_exists(e->win))
- b = e_border_adopt(e->win, 0);
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_configure_request(Ecore_Event * ev)
-{
- Ecore_Event_Window_Configure_Request *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- int pl, pr, pt, pb;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- if (e->mask & ECORE_EVENT_VALUE_X)
- b->current.requested.x = e->x;
- if (e->mask & ECORE_EVENT_VALUE_Y)
- b->current.requested.y = e->y;
- if ((e->mask & ECORE_EVENT_VALUE_W)
- || (e->mask & ECORE_EVENT_VALUE_H))
- {
- if (b->current.shaded == b->client.h)
- {
- b->current.shaded = e->h;
- }
- else if (b->current.shaded != 0)
- {
- b->current.shaded += b->client.h - e->h;
- if (b->current.shaded > b->client.h)
- b->current.shaded = b->client.h;
- if (b->current.shaded < 1)
- b->current.shaded = 1;
- }
- b->current.requested.w = e->w + pl + pr;
- b->current.requested.h = e->h + pt + pb;
- }
- if ((e->mask & ECORE_EVENT_VALUE_SIBLING)
- && (e->mask & ECORE_EVENT_VALUE_STACKING))
- {
- E_Border *b_rel;
-
- b_rel = e_border_find_by_window(e->stack_win);
- if (b_rel)
- {
- if (e->detail == ECORE_EVENT_STACK_ABOVE)
- e_border_raise_above(b, b_rel);
- else if (e->detail == ECORE_EVENT_STACK_BELOW)
- e_border_lower_below(b, b_rel);
- /* FIXME: need to handle & fix
- * ECORE_EVENT_STACK_TOP_IF
- * ECORE_EVENT_STACK_BOTTOM_IF
- * ECORE_EVENT_STACK_OPPOSITE
- */
- else if (e->detail == ECORE_EVENT_STACK_TOP_IF)
- e_border_raise(b);
- else if (e->detail == ECORE_EVENT_STACK_BOTTOM_IF)
- e_border_lower(b);
- }
- }
- else if (e->mask & ECORE_EVENT_VALUE_STACKING)
- {
- if (e->detail == ECORE_EVENT_STACK_ABOVE)
- e_border_raise(b);
- else if (e->detail == ECORE_EVENT_STACK_BELOW)
- e_border_lower(b);
- /* FIXME: need to handle & fix
- * ECORE_EVENT_STACK_TOP_IF
- * ECORE_EVENT_STACK_BOTTOM_IF
- * ECORE_EVENT_STACK_OPPOSITE
- */
- else if (e->detail == ECORE_EVENT_STACK_TOP_IF)
- e_border_raise(b);
- else if (e->detail == ECORE_EVENT_STACK_BOTTOM_IF)
- e_border_lower(b);
- }
- b->changed = 1;
- e_border_adjust_limits(b);
- }
- else
- {
- if ((e->mask & ECORE_EVENT_VALUE_X)
- && (e->mask & ECORE_EVENT_VALUE_W))
- ecore_window_move_resize(e->win, e->x, e->y, e->w, e->h);
- else if ((e->mask & ECORE_EVENT_VALUE_W)
- || (e->mask & ECORE_EVENT_VALUE_H))
- ecore_window_resize(e->win, e->w, e->h);
- else if ((e->mask & ECORE_EVENT_VALUE_X))
- ecore_window_move(e->win, e->x, e->y);
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_property(Ecore_Event * ev)
-{
- Ecore_Event_Window_Property *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- e_icccm_handle_property_change(e->atom, b);
- e_border_apply_border(b);
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_client_message(Ecore_Event * ev)
-{
- Ecore_Event_Message *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
-
- e_icccm_handle_client_message(e);
-
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_unmap(Ecore_Event * ev)
-{
- Ecore_Event_Window_Unmap *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- if (b->win.client == e->win)
- {
- if (b->ignore_unmap > 0)
- b->ignore_unmap--;
- else
- {
- e_action_stop_by_object(E_OBJECT(b), NULL,
- mouse_win_x, mouse_win_y,
- border_mouse_x, border_mouse_y);
-
- if (e_object_get_usecount(E_OBJECT(b)) == 1)
- {
- e_border_release(b);
- e_border_shuffle_last(b);
- }
- e_object_unref(E_OBJECT(b));
- }
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_destroy(Ecore_Event * ev)
-{
- Ecore_Event_Window_Destroy *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- if (b->win.client == e->win)
- {
- e_action_stop_by_object(E_OBJECT(b), NULL,
- mouse_win_x, mouse_win_y,
- border_mouse_x, border_mouse_y);
-
- if (e_object_get_usecount(E_OBJECT(b)) == 1)
- {
- e_border_release(b);
- e_border_shuffle_last(b);
- }
- e_object_unref(E_OBJECT(b));
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_circulate_request(Ecore_Event * ev)
-{
- Ecore_Event_Window_Circulate_Request *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- if (e->lower)
- e_border_lower(b);
- else
- e_border_raise(b);
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_reparent(Ecore_Event * ev)
-{
- Ecore_Event_Window_Reparent *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_shape(Ecore_Event * ev)
-{
- Ecore_Event_Window_Shape *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if ((b) && (e->win == b->win.client))
- {
- b->current.shaped_client = e_icccm_is_shaped(e->win);
- b->changed = 1;
- b->shape_changed = 1;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_focus_in(Ecore_Event * ev)
-{
- Ecore_Event_Window_Focus_In *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if ((b) && (b->win.client == e->win))
- {
- E_Grab *g;
-
- e_border_focus_grab_ended();
- b->current.selected = 1;
- b->changed = 1;
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_FOCUS_IN,
- NULL);
- g = b->click_grab;
- if (g)
- {
- ecore_button_ungrab(b->win.container, g->button, g->mods,
- g->any_mod);
- FREE(g);
- b->click_grab = NULL;
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_focus_out(Ecore_Event * ev)
-{
- Ecore_Event_Window_Focus_Out *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if ((b) && (b->win.client == e->win))
- {
- int focus_mode;
-
- focus_mode = config_data->window->focus_mode;
- b->current.selected = 0;
- if (e->key_grab)
- b->current.select_lost_from_grab = 1;
- /* settings - click to focus would affect grabs */
- if ((!b->client.internal) && (focus_mode == 2))
- {
- E_Grab *g;
-
- g = NEW(E_Grab, 1);
- ZERO(g, E_Grab, 1);
- g->button = 1;
- g->mods = ECORE_EVENT_KEY_MODIFIER_NONE;
- g->any_mod = 0;
- g->remove_after = 0;
- ecore_button_grab(b->win.container, g->button, XEV_BUTTON_PRESS,
- g->mods, g->any_mod);
- ecore_window_button_grab_auto_replay_set(b->win.container,
- e_border_replay_query);
- b->click_grab = g;
- }
- b->changed = 1;
- }
- e_delayed_action_cancel(delayed_window_raise);
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* */
-static void
-e_colormap(Ecore_Event * ev)
-{
- Ecore_Event_Colormap *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* handling mouse down events */
-static void
-e_mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Down *e;
-
- D_ENTER;
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- mouse_win_x = e->x;
- mouse_win_y = e->y;
- mouse_x = e->rx;
- mouse_y = e->ry;
- mouse_buttons |= (1 << e->button);
- b = e_border_find_by_window(e->win);
- if (b)
- {
- int focus_mode;
-
- focus_mode = config_data->window->focus_mode;
- if (focus_mode == 2)
- {
- e_focus_set_focus(b);
- /* FIXME: if (raise on click to focus) ... */
- e_border_raise(b);
- }
- if (e->win == b->win.main)
- e_cb_border_mouse_down(b, ev);
- else
- {
- Evas *evas;
- int x, y;
-
- evas = b->evas;
- ecore_window_get_root_relative_location(b->win.b, &x, &y);
- x = e->rx - x;
- y = e->ry - y;
- evas_event_feed_mouse_down(evas, e->button);
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* handling mouse up events */
-static void
-e_mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- mouse_win_x = e->x;
- mouse_win_y = e->y;
- mouse_x = e->rx;
- mouse_y = e->ry;
- mouse_buttons &= ~(1 << e->button);
- b = e_border_find_by_window(e->win);
- if (b)
- {
- if (e->win == b->win.main)
- e_cb_border_mouse_up(b, ev);
- else
- {
- Evas *evas;
- int x, y;
-
- evas = b->evas;
- ecore_window_get_root_relative_location(b->win.b, &x, &y);
- x = e->rx - x;
- y = e->ry - y;
- evas_event_feed_mouse_up(evas, e->button);
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* handling mouse move events */
-static void
-e_mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- mouse_win_x = e->x;
- mouse_win_y = e->y;
- mouse_x = e->rx;
- mouse_y = e->ry;
- b = e_border_find_by_window(e->win);
-/* D("motion... %3.8f\n", ecore_get_time());*/
- if (b)
- {
- if (e->win == b->win.main)
- e_cb_border_mouse_move(b, ev);
- else
- {
- Evas *evas;
- int x, y;
-
- evas = b->evas;
- ecore_window_get_root_relative_location(b->win.b, &x, &y);
- x = e->rx - x;
- y = e->ry - y;
- evas_event_feed_mouse_move(evas, x, y);
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* handling mouse enter events */
-static void
-e_mouse_in(Ecore_Event * ev)
-{
- Ecore_Event_Window_Enter *e;
- E_Border *b;
-
- D_ENTER;
- current_ev = ev;
- e = ev->event;
- if ((b = e_border_find_by_window(e->win)))
- {
- if (e->win == b->win.main)
- e_cb_border_mouse_in(b, ev);
- else if (e->win == b->win.input)
- {
- int x, y;
- Evas *evas;
-
- evas = b->evas;
- ecore_window_get_root_relative_location(b->win.b, &x, &y);
- x = e->rx - x;
- y = e->ry - y;
- evas_event_feed_mouse_in(evas);
- evas_event_feed_mouse_move(evas, x, y);
- }
- }
- current_ev = NULL;
- D_RETURN;
-}
-
-/* handling mouse leave events */
-static void
-e_mouse_out(Ecore_Event * ev)
-{
- Ecore_Event_Window_Leave *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- if (e->win == b->win.main)
- e_cb_border_mouse_out(b, ev);
- if (e->win == b->win.input)
- {
- evas_event_feed_mouse_out(b->evas);
- }
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* handling expose events */
-static void
-e_window_expose(Ecore_Event * ev)
-{
- Ecore_Event_Window_Expose *e;
-
- D_ENTER;
-
- current_ev = ev;
- e = ev->event;
- {
- E_Border *b;
-
- b = e_border_find_by_window(e->win);
- if (b)
- {
- e_border_redraw_region(b, e->x, e->y, e->w, e->h);
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-/* what to do with border events */
-
-static void
-e_cb_mouse_in(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow, int oh)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
- if (border_mouse_buttons)
- D_RETURN;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (class)
- e_cursors_display_in_window(b->win.main, class);
- else
- e_cursors_display_in_window(b->win.main, "Default");
- if (!current_ev)
- D_RETURN;
-
- e_action_stop(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
-
- D_RETURN;
- UN(o);
- UN(bt);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_cb_mouse_out(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow, int oh)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
- if (border_mouse_buttons)
- D_RETURN;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (!current_ev)
- D_RETURN;
- e_cursors_display_in_window(b->win.main, "Default");
- e_action_stop(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- D_RETURN;
- UN(o);
- UN(bt);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_cb_mouse_down(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow, int oh)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- border_mouse_buttons = mouse_buttons;
- if (!current_ev)
- D_RETURN;
- {
- E_Action_Type act;
- Ecore_Event_Key_Modifiers mods;
-
- mods = ((Ecore_Event_Mouse_Down *) (current_ev->event))->mods;
- act = ACT_MOUSE_CLICK;
-
- if (((Ecore_Event_Mouse_Down *) (current_ev->event))->double_click)
- act = ACT_MOUSE_DOUBLE;
- else if (((Ecore_Event_Mouse_Down *) (current_ev->event))->triple_click)
- act = ACT_MOUSE_TRIPLE;
-
- e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- }
- D_RETURN;
- UN(o);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_cb_mouse_up(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow, int oh)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- border_mouse_buttons = mouse_buttons;
- if (!current_ev)
- D_RETURN;
- {
- E_Action_Type act;
- Ecore_Event_Key_Modifiers mods;
-
- mods = ((Ecore_Event_Mouse_Up *) (current_ev->event))->mods;
- act = ACT_MOUSE_UP;
-
- if ((x >= ox) && (x < (ox + ow)) && (y >= oy) && (y < (oy + oh)))
- act = ACT_MOUSE_CLICKED;
-
- e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- }
- D_RETURN;
- UN(o);
-}
-
-static void
-e_cb_mouse_move(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow, int oh)
-{
- E_Border *b;
- int dx, dy;
-
- D_ENTER;
-
- b = data;
- dx = mouse_x - border_mouse_x;
- dy = mouse_y - border_mouse_y;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
-
- if (!current_ev)
- D_RETURN;
-
- e_action_cont(class, ACT_MOUSE_MOVE, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y, dx,
- dy);
-
- D_RETURN;
- UN(o);
- UN(bt);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-/* callbacks for certain things */
-static void
-e_cb_border_mouse_in(E_Border * b, Ecore_Event * e)
-{
- int x, y;
- char *class = "Window_Grab";
- int focus_mode;
-
- D_ENTER;
- focus_mode = config_data->window->focus_mode;
- /* pointer focus stuff */
- if (focus_mode == 0)
- e_focus_set_focus(b);
-
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (!current_ev)
- D_RETURN;
-
- x = ((Ecore_Event_Window_Enter *) (e->event))->x;
- y = ((Ecore_Event_Window_Enter *) (e->event))->y;
-
- e_action_stop(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
-
- D_RETURN;
-}
-
-static void
-e_cb_border_mouse_out(E_Border * b, Ecore_Event * e)
-{
- int x, y;
- char *class = "Window_Grab";
-
- D_ENTER;
-
- x = mouse_x;
- y = mouse_y;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (!current_ev)
- D_RETURN;
-
- e_action_stop(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
- D_RETURN;
- UN(e);
-}
-
-static void
-e_cb_border_mouse_down(E_Border * b, Ecore_Event * e)
-{
- int x, y, bt;
- char *class = "Window_Grab";
- int focus_mode;
-
- D_ENTER;
-
- focus_mode = config_data->window->focus_mode;
- ecore_pointer_grab(((Ecore_Event_Mouse_Down *) (e->event))->win,
- CurrentTime);
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (!current_ev)
- D_RETURN;
-
- x = ((Ecore_Event_Mouse_Down *) (e->event))->x;
- y = ((Ecore_Event_Mouse_Down *) (e->event))->y;
- bt = ((Ecore_Event_Mouse_Down *) (e->event))->button;
- {
- E_Action_Type act;
- Ecore_Event_Key_Modifiers mods;
-
- mods = ((Ecore_Event_Mouse_Down *) (current_ev->event))->mods;
- act = ACT_MOUSE_CLICK;
-
- if (((Ecore_Event_Mouse_Down *) (current_ev->event))->double_click)
- act = ACT_MOUSE_DOUBLE;
- else if (((Ecore_Event_Mouse_Down *) (current_ev->event))->triple_click)
- act = ACT_MOUSE_TRIPLE;
-
- e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b), NULL,
- x, y, border_mouse_x, border_mouse_y);
- if (!e_action_start(class, act, bt, NULL, mods, E_OBJECT(b), NULL,
- x, y, border_mouse_x, border_mouse_y))
- {
- ecore_pointer_ungrab(((Ecore_Event_Mouse_Down *) (e->event))->time);
- }
- else
- {
- ecore_pointer_grab(((Ecore_Event_Mouse_Down *) (e->event))->win,
- ((Ecore_Event_Mouse_Down *) (e->event))->time);
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_cb_border_mouse_up(E_Border * b, Ecore_Event * e)
-{
- int x, y, bt;
- char *class = "Window_Grab";
-
- D_ENTER;
-
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
-
- if (!current_ev)
- D_RETURN;
- ecore_pointer_ungrab(((Ecore_Event_Mouse_Up *) (e->event))->time);
-
- x = ((Ecore_Event_Mouse_Up *) (e->event))->x;
- y = ((Ecore_Event_Mouse_Up *) (e->event))->y;
- bt = ((Ecore_Event_Mouse_Up *) (e->event))->button;
- {
- E_Action_Type act;
- Ecore_Event_Key_Modifiers mods;
-
- mods = ((Ecore_Event_Mouse_Up *) (current_ev->event))->mods;
- act = ACT_MOUSE_UP;
- e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
- NULL, x, y, border_mouse_x, border_mouse_y);
- }
-
- D_RETURN;
-}
-
-static void
-e_cb_border_mouse_move(E_Border * b, Ecore_Event * e)
-{
- int dx, dy;
- int x, y;
- char *class = "Window_Grab";
-
- D_ENTER;
-
- dx = mouse_x - border_mouse_x;
- dy = mouse_y - border_mouse_y;
- border_mouse_x = mouse_x;
- border_mouse_y = mouse_y;
- if (!current_ev)
- D_RETURN;
- x = ((Ecore_Event_Mouse_Move *) (e->event))->x;
- y = ((Ecore_Event_Mouse_Move *) (e->event))->y;
- e_action_cont(class, ACT_MOUSE_MOVE, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y, dx,
- dy);
-
- D_RETURN;
-}
-
-static void
-e_cb_border_move_resize(E_Border * b)
-{
- D_ENTER;
-
- D_RETURN;
- UN(b);
-}
-
-static void
-e_cb_border_visibility(E_Border * b)
-{
- D_ENTER;
-
- D_RETURN;
- UN(b);
-}
-
-static void
-e_border_poll(int val, void *data)
-{
- D_ENTER;
-
- ecore_add_event_timer("e_border_poll()", 1.00, e_border_poll, val + 1, NULL);
- D_RETURN;
- UN(data);
-}
-
-static void
-e_border_cleanup_window_list(Evas_List *windows)
-{
- Window temp;
-
- /* Free the old set of pixmaps */
- while (windows)
- {
- temp = (Window) windows->data;
- windows = evas_list_remove(windows, (void *)temp);
- ecore_window_destroy(temp);
- }
-}
-
-static void
-e_border_cleanup(E_Border * b)
-{
- D_ENTER;
-
- e_match_save_props(b);
- D("before notify\n");
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_DELETE, NULL);
- D("after notify\n");
- e_bordermenu_hide();
- e_desktops_del_border(b->desk, b);
- if (b->bits.b)
- ebits_free(b->bits.b);
-
- if (b->obj.title)
- e_text_free(b->obj.title);
-
- if (b->obj.title_clip)
- evas_object_del(b->obj.title_clip);
-
- e_border_cleanup_window_list(b->windows);
- evases = evas_list_remove(evases, b->evas);
- evas_free(b->evas);
-
- ecore_window_destroy(b->win.b);
- ecore_window_destroy(b->win.container);
- ecore_window_destroy(b->win.input);
- ecore_window_destroy(b->win.main);
- borders = evas_list_remove(borders, b);
-
- IF_FREE(b->client.title);
- IF_FREE(b->client.name);
- IF_FREE(b->client.class);
- IF_FREE(b->client.command);
- IF_FREE(b->client.machine);
- IF_FREE(b->client.icon_name);
- IF_FREE(b->border_style);
- IF_FREE(b->border_file);
-
- /* Cleanup superclass. */
- e_observee_cleanup(E_OBSERVEE(b));
-
- D_RETURN;
-}
-
-/* border creation, deletion, modification and general queries */
-
-void
-e_border_apply_border(E_Border * b)
-{
- int pl, pr, pt, pb;
- char *borders, buf[PATH_MAX], border[PATH_MAX], *style = NULL;
- int prop_selected = 0, prop_sticky = 0, prop_shaded = 0;
-
- D_ENTER;
-
- style = "default";
- if ((!b->client.titlebar) && (!b->client.border))
- {
- style = "borderless";
- b->current.has_shape = 0;
- }
- if (b->border_style)
- style = b->border_style;
-
- if (b->current.selected)
- prop_selected = 1;
- if ((b->current.shaded > 0) && (b->current.shaded == b->client.h))
- prop_shaded = 1;
- if (b->client.sticky)
- {
- prop_sticky = 1;
- e_desktops_add_sticky(b);
- }
- else
- {
- e_desktops_rm_sticky(b);
- }
-
- snprintf(border, PATH_MAX, "selected-%i.sticky-%i.shaded-%i.bits.db",
- prop_selected, prop_sticky, prop_shaded);
-
- borders = e_config_get("borders");
- snprintf(buf, PATH_MAX, "%s%s/%s", borders, style, border);
-
- /* if it's not changed - abort and dont do anything */
- if ((b->border_file) && (!strcmp(buf, b->border_file)))
- D_RETURN;
-
- IF_FREE(b->border_file);
- e_strdup(b->border_file, buf);
-
- e_border_set_bits(b, buf);
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- e_icccm_set_frame_size(b->win.client, pl, pr, pt, pb);
-
- D_RETURN;
-}
-
-void
-e_border_reshape(E_Border * b)
-{
- static Window shape_win = 0;
- int pl, pr, pt, pb;
-
- D_ENTER;
-
- if ((b->current.shaped_client == b->previous.shaped_client) &&
- (b->current.shape_changes == b->previous.shape_changes) &&
- (b->current.has_shape == b->previous.has_shape) && (!b->shape_changed))
- D_RETURN;
-
- if (!shape_win)
- shape_win = ecore_window_override_new(0, 0, 0, 1, 1);
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- b->shape_changed = 0;
-
- if ((!b->current.shaped_client) && (!b->current.has_shape))
- {
- ecore_window_set_shape_mask(b->win.main, 0);
- D_RETURN;
- }
-
- ecore_window_resize(shape_win, b->current.w, b->current.h);
-
- if ((b->current.shaped_client) && (!b->current.has_shape))
- {
- XRectangle rects[4];
-
- rects[0].x = 0;
- rects[0].y = 0;
- rects[0].width = b->current.w;
- rects[0].height = pt;
-
- rects[1].x = 0;
- rects[1].y = pt;
- rects[1].width = pl;
- rects[1].height = b->current.h - pt - pb;
-
- rects[2].x = b->current.w - pr;
- rects[2].y = pt;
- rects[2].width = pr;
- rects[2].height = b->current.h - pt - pb;
-
- rects[3].x = 0;
- rects[3].y = b->current.h - pb;
- rects[3].width = b->current.w;
- rects[3].height = pb;
-
- ecore_window_set_shape_window(shape_win, b->win.client, pl,
- pt - b->current.shaded);
- ecore_window_clip_shape_by_rectangle(shape_win, pl, pt,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
-
- ecore_window_add_shape_rectangles(shape_win, rects, 4);
-
- }
- else
- {
- Display *disp;
- Evas_List *windows;
-
- if ((!b->current.shaped_client) && (b->current.has_shape))
- {
- ecore_window_set_shape_rectangle(shape_win, pl,
- pt - b->current.shaded,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
- }
- else
- {
- ecore_window_set_shape_window(shape_win, b->win.client, pl,
- pt - b->current.shaded);
- ecore_window_clip_shape_by_rectangle(shape_win, pl, pt,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
- }
-
- D("SHAPE update for border %p bit %s\n", b, b->border_file);
-
- e_border_update_render(b);
-
- windows = b->windows;
- disp = ecore_display_get();
-
- while (windows)
- {
- int x, y, w, h;
- Window window;
-
- window = (Window) windows->data;
- ecore_window_get_geometry(window, &x, &y, &w, &h);
- ecore_window_add_shape_window(shape_win, window, x, y);
-
- windows = windows->next;
- }
-
- ecore_window_clear(shape_win);
- }
-
- ecore_window_set_shape_window(b->win.main, shape_win, 0, 0);
-
- D_RETURN;
-}
-
-void
-e_border_release(E_Border * b)
-{
- int pl, pr, pt, pb;
-
- D_ENTER;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- ecore_window_reparent(b->win.client, 0, b->current.x + pl,
- b->current.y + pt);
- e_icccm_release(b->win.client);
- e_icccm_send_focus_to( e_desktop_window(), 1);
-
- D_RETURN;
-}
-
-E_Border *
-e_border_adopt(Window win, int use_client_pos)
-{
- E_Border *b;
- int bw;
- int show = 1;
- E_Desktop *initial_desktop;
-
- D_ENTER;
-
- /* create the struct */
- b = e_border_new();
- initial_desktop = b->desk;
-
- /* set the right event on the client */
- ecore_window_set_events(win,
- XEV_VISIBILITY |
- ResizeRedirectMask |
- XEV_CONFIGURE | XEV_MOUSE_MOVE |
- XEV_FOCUS | XEV_PROPERTY | XEV_COLORMAP);
- ecore_window_select_shape_events(win);
- /* parent of the client window listens for these */
- ecore_window_set_events(b->win.container,
- XEV_CHILD_CHANGE | XEV_CHILD_REDIRECT);
- /* add to save set & border of 0 */
- e_icccm_adopt(win);
- bw = ecore_window_get_border_width(win);
- ecore_window_set_border_width(win, 0);
- b->win.client = win;
- b->current.requested.visible = 1;
- /* get hints */
- e_icccm_get_size_info(win, b);
- e_icccm_get_pos_info(win, b);
- {
- int x, y, w, h;
-
- ecore_window_get_geometry(win, &x, &y, &w, &h);
- b->current.requested.x = x;
- b->current.requested.y = y;
- b->current.requested.w = w;
- b->current.requested.h = h;
- }
-
- e_icccm_get_mwm_hints(win, b);
- e_icccm_get_layer(win, b);
- e_icccm_get_title(win, b);
- e_icccm_get_class(win, b);
- e_icccm_get_hints(win, b);
- e_icccm_get_machine(win, b);
- e_icccm_get_command(win, b);
- e_icccm_get_icon_name(win, b);
- e_icccm_get_e_hack_launch_id(win, b);
- b->current.shaped_client = e_icccm_is_shaped(win);
- /* we have now placed the bugger */
- b->placed = 1;
- /* desk area */
- if (use_client_pos)
- {
- int x, y;
-
- ecore_window_get_geometry(win, &x, &y, NULL, NULL);
- b->current.requested.x = x;
- b->current.requested.y = y;
- b->changed = 1;
- }
- /* reparent the window finally */
- ecore_window_reparent(win, b->win.container, 0, 0);
- e_match_set_props(b);
- e_icccm_set_desk_area(win, b->client.area.x, b->client.area.y);
- e_icccm_set_desk(win, b->client.desk);
- /* figure what border to use */
- e_border_apply_border(b);
- {
- int pl, pr, pt, pb;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- b->current.requested.x += pl;
- b->current.requested.y += pt;
- b->changed = 1;
- }
- if (!use_client_pos)
- {
- int x, y;
- int pl, pr, pt, pb;
-
- pl = pr = pt = pb = 0;
- x = y = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- bw *= 2;
- if (b->client.pos.requested)
- {
- switch (b->client.pos.gravity)
- {
- case NorthWestGravity:
- x = b->client.pos.x + pl;
- y = b->client.pos.y + pt;
- break;
- case NorthGravity:
- x = b->client.pos.x + (bw / 2);
- y = b->client.pos.y + pt;
- break;
- case NorthEastGravity:
- x = b->client.pos.x - pr + bw;
- y = b->client.pos.y + pt;
- break;
- case EastGravity:
- x = b->client.pos.x - pr + bw;
- y = b->client.pos.y + (bw / 2);
- break;
- case SouthEastGravity:
- x = b->client.pos.x - pr + bw;
- y = b->client.pos.y - pb + bw;
- break;
- case SouthGravity:
- x = b->client.pos.x + (bw / 2);
- y = b->client.pos.y - pb;
- break;
- case SouthWestGravity:
- x = b->client.pos.x + pl;
- y = b->client.pos.y - pb + bw;
- break;
- case WestGravity:
- x = b->client.pos.x + pl;
- y = b->client.pos.y + (bw / 2);
- break;
- case CenterGravity:
- x = b->client.pos.x;
- y = b->client.pos.y;
- break;
- case StaticGravity:
- x = b->client.pos.x;
- y = b->client.pos.y;
- break;
- case ForgetGravity:
- x = b->client.pos.x;
- y = b->client.pos.y;
- break;
- default:
- x = b->client.pos.x + pl;
- y = b->client.pos.y + pt;
- break;
- }
- }
- else
- {
- show = e_place_border(b, initial_desktop, &x, &y,
- config_data->window->place_mode);
- x += pl;
- y += pt;
- }
- b->current.requested.x = x - pl;
- b->current.requested.y = y - pt;
- b->changed = 1;
- }
- /* show the client */
- e_icccm_state_mapped(win);
- /* fix size so it matches the hints a client asks for */
- b->changed = 1;
- e_border_adjust_limits(b);
- b->current.requested.h = b->current.h;
- b->current.requested.w = b->current.w;
- e_border_raise(b);
- e_border_update(b);
- e_border_reshape(b);
- ecore_window_show(win);
-
- if (b->client.e.launch_id)
- e_exec_broadcast_e_hack_found(b->win.client);
-
- D_RETURN_(b);
-}
-
-E_Border *
-e_border_new(void)
-{
- /* FIXME: need to set an upper limit on the frame size */
- E_Border *b;
- char *font_dir;
- E_Desktop *desk;
-
- D_ENTER;
-
- font_dir = e_config_get("fonts");
- b = NEW(E_Border, 1);
- ZERO(b, E_Border, 1);
-
- e_observee_init(E_OBSERVEE(b), (E_Cleanup_Func) e_border_cleanup);
- e_observer_register_observee(E_OBSERVER(delayed_window_raise),
- E_OBSERVEE(b));
-
- D("BORDER CREATED AT %p\n", b);
-
- b->current.has_shape = 1;
-
- b->current.requested.w = 1;
- b->current.requested.h = 1;
- b->client.min.w = 1;
- b->client.min.h = 1;
- b->client.max.w = 1000000;
- b->client.max.h = 1000000;
- b->client.min.aspect = -1000000;
- b->client.max.aspect = 1000000;
- b->client.step.w = 1;
- b->client.step.h = 1;
- b->client.layer = 4;
- b->client.border = 1;
- b->client.handles = 1;
- b->client.titlebar = 1;
- b->client.takes_focus = 1;
-
- desk = e_desktops_get(e_desktops_get_current());
- e_desktops_add_border(desk, b);
- /* b->win.main = ecore_window_override_new(desk->win.main, 0, 0, 1, 1); */
- b->win.main = ecore_window_override_new(0, 0, 0, 1, 1);
- b->win.input = ecore_window_input_new(b->win.main, 0, 0, 1, 1);
- b->win.container = ecore_window_override_new(b->win.main, 0, 0, 1, 1);
- e_cursors_display_in_window(b->win.container, "Application");
- ecore_window_set_events_propagate(b->win.input, 1);
- ecore_window_set_events(b->win.input, XEV_MOUSE_MOVE | XEV_BUTTON);
- ecore_window_set_events(b->win.main, XEV_IN_OUT);
- ecore_window_set_events(b->win.container, XEV_IN_OUT);
- ecore_window_show(b->win.input);
- ecore_window_show(b->win.container);
-
- b->evas = e_evas_new_all(ecore_display_get(),
- b->win.main,
- 0, 0, 1, 1, font_dir);
- b->win.b = e_evas_get_window(b->evas);
- e_cursors_display_in_window(b->win.b, "Default");
-
- b->obj.title = e_text_new(b->evas, "", "title");
- b->obj.title_clip = evas_object_rectangle_add(b->evas);
- evas_object_color_set(b->obj.title_clip, 255, 255, 255, 255);
- e_text_show(b->obj.title);
- evas_object_show(b->obj.title_clip);
- e_text_set_clip(b->obj.title, b->obj.title_clip);
-
- ecore_window_raise(b->win.input);
- ecore_window_raise(b->win.container);
-
- evases = evas_list_append(evases, b->evas);
-
- ecore_window_set_events(b->win.b, XEV_EXPOSE);
-
- ecore_window_show(b->win.b);
-
- e_border_attach_mouse_grabs(b);
-
- /* e_icccm_send_focus_to(b->win.client, 1);*/
-
- borders = evas_list_prepend(borders, b);
-
- e_observee_notify_all_observers(E_OBSERVEE(b), E_EVENT_BORDER_NEW, NULL);
-
- D_RETURN_(b);
-}
-
-void
-e_border_iconify(E_Border * b)
-{
- D_ENTER;
- b->client.iconified = 1;
- b->current.requested.visible = 0;
- e_icccm_state_iconified(b->win.client);
- b->changed = 1;
- e_border_update(b);
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_ICONIFY, NULL);
-
- D_RETURN;
-}
-
-void
-e_border_uniconify(E_Border * b)
-{
- b->client.iconified = 0;
- b->current.requested.visible = 1;
- b->client.desk = e_desktops_get_current();
- e_icccm_state_mapped(b->win.client);
- b->changed = 1;
- e_border_update(b);
- e_border_raise(b);
-
- e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_UNICONIFY, NULL);
-}
-
-void
-e_border_remove_mouse_grabs(E_Border * b)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if (config_data->grabs)
- {
- for (l = config_data->grabs; l; l = l->next)
- {
- E_Grab *g;
-
- g = l->data;
- ecore_button_ungrab(b->win.main, g->button, g->mods, g->any_mod);
- }
- }
- if (b->click_grab)
- {
- ecore_button_ungrab(b->win.main, b->click_grab->button,
- b->click_grab->mods, b->click_grab->any_mod);
- FREE(b->click_grab);
- }
- b->click_grab = NULL;
-
- D_RETURN;
-}
-
-void
-e_border_remove_click_grab(E_Border * b)
-{
- D_ENTER;
-
- if (b->click_grab)
- {
- E_Grab *g;
-
- g = b->click_grab;
- ecore_button_ungrab(b->win.container, g->button, g->mods, g->any_mod);
- ecore_window_button_grab_auto_replay_set(b->win.container, NULL);
- b->click_grab = NULL;
- FREE(g);
- }
-
- D_RETURN;
-}
-
-void
-e_border_attach_mouse_grabs(E_Border * b)
-{
- int focus_mode;
- Evas_List *l;
-
- D_ENTER;
-
- focus_mode = config_data->window->focus_mode;
-
- /* settings - click to focus would affect grabs */
- if ((!b->current.selected) && (focus_mode == 2))
- {
- E_Grab *g;
-
- g = NEW(E_Grab, 1);
- ZERO(g, E_Grab, 1);
- g->button = 1;
- g->mods = ECORE_EVENT_KEY_MODIFIER_NONE;
- g->any_mod = 0;
- g->remove_after = 0;
- ecore_button_grab(b->win.container, g->button, XEV_BUTTON_PRESS,
- g->mods, g->any_mod);
- ecore_window_button_grab_auto_replay_set(b->win.container,
- e_border_replay_query);
- b->click_grab = g;
- }
-
- for (l = config_data->grabs; l; l = l->next)
- {
- E_Grab *g;
-
- g = l->data;
- ecore_button_grab(b->win.main, g->button, XEV_BUTTON_PRESS, g->mods, 0);
- }
-
- D_RETURN;
-}
-
-void
-e_border_remove_all_mouse_grabs(void)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = borders; l; l = l->next)
- e_border_remove_mouse_grabs((E_Border *) l->data);
-
- D_RETURN;
-}
-
-void
-e_border_attach_all_mouse_grabs(void)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = borders; l; l = l->next)
- e_border_attach_mouse_grabs((E_Border *) l->data);
-
- D_RETURN;
-}
-
-void
-e_border_redo_grabs(void)
-{
- char *grabs_db;
- char *settings_db;
- static time_t mod_date_grabs = 0;
- static time_t mod_date_settings = 0;
- time_t mod;
- int changed = 0;
- Evas_List * l;
-
- D_ENTER;
-
- grabs_db = e_config_get("grabs");
- settings_db = e_config_get("settings");
- mod = e_file_mod_time(grabs_db);
- if (mod != mod_date_grabs)
- changed = 1;
- mod_date_grabs = mod;
- if (!changed)
- {
- mod = e_file_mod_time(settings_db);
- if (mod != mod_date_settings)
- changed = 1;
- mod_date_settings = mod;
- }
- if (!changed)
- D_RETURN;
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- e_border_remove_mouse_grabs(b);
- e_border_attach_mouse_grabs(b);
- }
-
- D_RETURN;
-}
-
-E_Border *
-e_border_find_by_window(Window win)
-{
- Window pwin;
- Evas_List * l;
-
- D_ENTER;
-
- pwin = ecore_window_get_parent(win);
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
-
- if ((win == b->win.main) ||
- (win == b->win.client) ||
- (win == b->win.container) ||
- (win == b->win.input) ||
- (win == b->win.b) ||
- (pwin == b->win.main))
- D_RETURN_(b);
- }
-
- D_RETURN_(NULL);
-}
-
-void
-e_border_set_bits(E_Border * b, char *file)
-{
- int pl, pr, pt, pb, ppl, ppr, ppt, ppb;
-
- D_ENTER;
-
- pl = pr = pt = pb = 0;
- ppl = ppr = ppt = ppb = 0;
-
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
-
- if (b->bits.b)
- ebits_free(b->bits.b);
-
- b->bits.b = ebits_load(file);
- b->bits.new = 1;
- b->changed = 1;
-
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &ppl, &ppr, &ppt, &ppb);
- b->current.requested.w -= (pl + pr) - (ppl + ppr);
- b->current.requested.h -= (pt + pb) - (ppt + ppb);
- b->current.requested.x += (pl - ppl);
- b->current.requested.y += (pt - ppt);
-
- if (b->bits.b)
- {
-
- ebits_add_to_evas(b->bits.b, b->evas);
- ebits_move(b->bits.b, 0, 0);
- ebits_show(b->bits.b);
-
- e_border_set_color_class(b, "Title BG", 100, 200, 255, 255);
-
-#define HOOK_CB(_class) \
-ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_IN, e_cb_mouse_in, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_OUT, e_cb_mouse_out, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_DOWN, e_cb_mouse_down, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_UP, e_cb_mouse_up, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_MOVE, e_cb_mouse_move, b);
- HOOK_CB("Title_Bar");
- HOOK_CB("Resize");
- HOOK_CB("Resize_Horizontal");
- HOOK_CB("Resize_Vertical");
- HOOK_CB("Close");
- HOOK_CB("Iconify");
- HOOK_CB("Max_Size");
- HOOK_CB("Menu");
-
- e_border_adjust_limits(b);
- }
-
- D_RETURN;
-}
-
-void
-e_border_set_color_class(E_Border * b, char *class, int rr, int gg, int bb,
- int aa)
-{
- D_ENTER;
-
- ebits_set_color_class(b->bits.b, class, rr, gg, bb, aa);
-
- D_RETURN;
-}
-
-void
-e_border_adjust_limits(E_Border * b)
-{
- int w, h, pl, pr, pt, pb, mx, my;
-
- D_ENTER;
-
- if (b->mode.move)
- {
- e_resist_border(b);
- }
- else
- {
- b->current.x = b->current.requested.x;
- b->current.y = b->current.requested.y;
- }
-
- b->current.w = b->current.requested.w;
- b->current.h = b->current.requested.h - b->current.shaded;
-
- if ((!b->current.shaded) && (!b->mode.move))
- {
- if (b->current.w < 1)
- b->current.w = 1;
- if (b->current.h < 1)
- b->current.h = 1;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
-
- if (b->current.w < (pl + pr + 1))
- b->current.w = pl + pr + 1;
- if (b->current.h < (pt + pb + 1))
- b->current.h = pt + pb + 1;
-
- w = b->current.w - pl - pr;
- h = b->current.h - pt - pb + b->current.shaded;
-
- mx = my = 1;
- if (b->bits.b)
- ebits_get_min_size(b->bits.b, &mx, &my);
- if (b->current.w < mx)
- b->current.w = mx;
- if (b->current.h < my)
- b->current.h = my;
- mx = my = 999999;
- if (b->bits.b)
- ebits_get_max_size(b->bits.b, &mx, &my);
- if (b->current.w > mx)
- b->current.w = mx;
- if (b->current.h > my)
- b->current.h = my;
-
- if (w < b->client.min.w)
- w = b->client.min.w;
- if (h < b->client.min.h)
- h = b->client.min.h;
- if (w > b->client.max.w)
- w = b->client.max.w;
- if (h > b->client.max.h)
- h = b->client.max.h;
- if ((w > 0) && (h > 0))
- {
- w -= b->client.base.w;
- h -= b->client.base.h;
- if ((w > 0) && (h > 0))
- {
- int i, j;
- double aspect;
-
- aspect = ((double)w) / ((double)h);
- if ((b->mode.resize == 4) || (b->mode.resize == 5))
- {
- if (aspect < b->client.min.aspect)
- h = (int)((double)w / b->client.min.aspect);
- if (aspect > b->client.max.aspect)
- h = (int)((double)w / b->client.max.aspect);
- }
- else if ((b->mode.resize == 6) || (b->mode.resize == 7))
- {
- if (aspect < b->client.min.aspect)
- w = (int)((double)h * b->client.min.aspect);
- if (aspect > b->client.max.aspect)
- w = (int)((double)h * b->client.max.aspect);
- }
- else
- {
- if (aspect < b->client.min.aspect)
- w = (int)((double)h * b->client.min.aspect);
- if (aspect > b->client.max.aspect)
- h = (int)((double)w / b->client.max.aspect);
- }
- i = w / b->client.step.w;
- j = h / b->client.step.h;
- w = i * b->client.step.w;
- h = j * b->client.step.h;
- }
- w += b->client.base.w;
- h += b->client.base.h;
- }
- b->client.w = w;
- b->client.h = h;
- b->current.w = w + pl + pr;
- b->current.h = h + pt + pb;
- }
-
- if (b->current.shaded == 0)
- {
- if ((b->mode.resize == 4) || (b->mode.resize == 6)
- || (b->mode.resize == 8))
- {
- }
- else if ((b->mode.resize == 1) || (b->mode.resize == 5))
- {
- b->current.x += (b->current.requested.w - b->current.w);
- b->current.y += (b->current.requested.h - b->current.h);
- }
- else if ((b->mode.resize == 2) || (b->mode.resize == 7))
- {
- b->current.y += (b->current.requested.h - b->current.h);
- }
- else if ((b->mode.resize == 3))
- {
- b->current.x += (b->current.requested.w - b->current.w);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_border_redraw_region(E_Border * b, int x, int y, int w, int h)
-{
- GC gc;
- Evas_List *windows;
-
- gc = ecore_gc_new(b->win.b);
-
- windows = b->windows;
-
- while (windows)
- {
- int xx, yy, ww, hh;
- Window window;
-
- window = (Window) windows->data;
- ecore_window_get_geometry(window, &xx, &yy, &ww, &hh);
-
- if (INTERSECTS(x, y, w, h, xx, yy, ww, hh))
- {
- int rw, rh;
-
- rw = MIN(w, ww);
- rh = MIN(h, hh);
- ecore_window_clear_area(window, x, y, rw, rh);
- }
-
- windows = windows->next;
- }
-
- ecore_gc_free(gc);
-}
-
-void
-e_border_update_render(E_Border * b)
-{
- GC gc1, gc2;
- Evas_List *up, *hp, *owin, *nwin = NULL;
- Window window;
- Pixmap pmap, mask, temp;
- int pl, pr, pt, pb;
- Evas_Engine_Info_Software_X11 *info;
-
- pmap = ecore_pixmap_new(b->win.b, b->current.w, b->current.h, 0);
- mask = ecore_pixmap_new(b->win.b, b->current.w, b->current.h, 1);
-
- gc1 = ecore_gc_new(pmap);
- gc2 = ecore_gc_new(mask);
-
- info = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(b->evas);
- info->info.drawable = pmap;
- info->info.mask = mask;
- evas_engine_info_set(b->evas, (Evas_Engine_Info *) info);
-
- /*
- * Hide the bits and render to clear the old appearance from generating
- * damage rectangles.
- */
- if (b->bits.b)
- {
- ebits_hide(b->bits.b);
- }
-
- if (b->obj.title)
- {
- evas_object_hide(b->obj.title_clip);
- }
-
- evas_render(b->evas);
-
- /*
- * Position and then show the bits so we only get damage rectangles for the
- * area we want shown.
- */
- if (b->bits.b)
- {
- ebits_move(b->bits.b, 0, 0);
- ebits_resize(b->bits.b, b->current.w, b->current.h);
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- ebits_show(b->bits.b);
- }
-
- if (b->obj.title)
- {
- double tx, ty, tw, th;
-
- ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw,
- &th);
- e_text_move(b->obj.title, tx, ty);
- e_text_set_layer(b->obj.title, 1);
-
- evas_object_move(b->obj.title_clip, tx, ty);
- evas_object_resize(b->obj.title_clip, tw, th);
- evas_object_show(b->obj.title_clip);
- }
-
- hp = up = evas_render_updates(b->evas);
-
- owin = b->windows;
- b->windows = NULL;
-
- D("Rendering %d rectangles for border %p { w = %d, h = %d }\n",
- (up ? up->count : 0), b, b->current.w, b->current.h);
- while (up)
- {
- Evas_Rectangle *u;
-
- u = up->data;
-
- D("\tRectangle { x = %d, y = %d, w = %d, h = %d }\n",
- u->x, u->y, u->w, u->h);
-
- /* Copy the large pixmap to a series of small pixmaps. */
- temp = ecore_pixmap_new(b->win.b, u->w, u->h, 0);
- ecore_gc_set_fg(gc1, 0);
- ecore_fill_rectangle(temp, gc1, 0, 0, u->w, u->h);
- ecore_gc_set_fg(gc1, 1);
- ecore_area_copy(pmap, temp, gc1, u->x, u->y, u->w, u->h, 0, 0);
-
- /* Setup small windows for borders, with the pixmaps as backgrounds */
- window = ecore_window_override_new(b->win.main, u->x, u->y, u->w, u->h);
- ecore_window_set_events_propagate(window, 1);
- ecore_window_set_events(window, XEV_IN_OUT | XEV_MOUSE_MOVE |
- XEV_BUTTON);
- ecore_window_set_background_pixmap(window, temp);
- ecore_pixmap_free(temp);
-
- /* Copy the large mask to a series of small masks. */
- temp = ecore_pixmap_new(b->win.b, u->w, u->h, 1);
- ecore_gc_set_fg(gc2, 0);
- ecore_fill_rectangle(temp, gc2, 0, 0, u->w, u->h);
- ecore_gc_set_fg(gc2, 1);
- ecore_area_copy(mask, temp, gc2, u->x, u->y, u->w, u->h, 0, 0);
-
- ecore_window_set_shape_mask(window, temp);
- ecore_pixmap_free(temp);
-
- nwin = evas_list_append(nwin, (void *)window);
- up = up->next;
- }
-
- evas_render_updates_free(hp);
-
- ecore_gc_free(gc1);
- ecore_gc_free(gc2);
-
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
-
- /* Update the display all at once. */
- b->windows = nwin;
- while (nwin)
- {
- window = (Window)nwin->data;
- ecore_window_raise(window);
- ecore_window_show(window);
- nwin = nwin->next;
- }
-
- /* Order is important here to have a smooth update */
- e_border_redraw_region(b, 0, 0, b->current.w, b->current.h);
- e_border_cleanup_window_list(owin);
-
- D("Finished rendering update\n");
-}
-
-void
-e_border_update(E_Border * b)
-{
- int location_changed = 0;
- int size_changed = 0;
- int border_changed = 0;
- int visibility_changed = 0;
- int state_changed = 0;
-
- D_ENTER;
-
- if (b->hold_changes)
- D_RETURN;
- if (!b->changed)
- D_RETURN;
-
- b->current.visible = b->current.requested.visible;
-
- if ((b->current.x != b->previous.x) || (b->current.y != b->previous.y))
- location_changed = 1;
- if ((b->current.w != b->previous.w) || (b->current.h != b->previous.h))
- size_changed = 1;
- if ((size_changed) && (b->current.has_shape))
- b->shape_changed = 1;
- if (b->current.selected != b->previous.selected)
- state_changed = 1;
- if (state_changed)
- {
- e_border_apply_border(b);
- if (!border_changed)
- {
- ecore_window_gravity_set(b->win.container, StaticGravity);
- border_changed = 1;
- size_changed = 1;
- }
- }
- if (b->bits.new)
- {
- ecore_window_gravity_set(b->win.container, StaticGravity);
- border_changed = 1;
- }
- if ((border_changed) && (b->current.has_shape))
- b->shape_changed = 1;
- if (b->current.visible != b->previous.visible)
- visibility_changed = 1;
-
- if ((location_changed) && (!size_changed))
- {
- int pl, pr, pt, pb;
-
- ecore_window_move(b->win.main, b->current.x, b->current.y);
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- e_icccm_move_resize(b->win.client,
- b->current.x + pl,
- b->current.y + pt, b->client.w, b->client.h);
- e_cb_border_move_resize(b);
- }
- else if (size_changed)
- {
- int pl, pr, pt, pb, w, h;
- int smaller;
-
- if ((b->current.shaped_client) || (b->previous.shaped_client) ||
- (b->current.shape_changes) || (b->previous.shape_changes) ||
- (b->current.has_shape) || (b->previous.has_shape))
- b->shape_changed = 1;
- smaller = 0;
- if ((b->current.w < b->previous.w) || (b->current.h < b->previous.h))
- smaller = 1;
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- ecore_window_move_resize(b->win.input,
- 0, 0, b->current.w, b->current.h);
- ecore_window_move_resize(b->win.main,
- b->current.x, b->current.y,
- b->current.w, b->current.h);
- w = b->current.w, h = b->current.h;
- if ((w < 1) || (h < 1))
- ecore_window_hide(b->win.b);
- else
- {
- ecore_window_show(b->win.b);
- ecore_window_move_resize(b->win.b, 0, 0, w, h);
- evas_output_size_set(b->evas, w, h);
- evas_output_viewport_set(b->evas, 0, 0, w, h);
- }
-
- if (b->current.shaded == b->client.h)
- {
- ecore_window_move_resize(b->win.container,
- b->current.w + 1,
- b->current.h + 1, 320, 320);
- }
- else
- {
- ecore_window_move_resize(b->win.container,
- pl,
- pt,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
- }
-
- ecore_window_move_resize(b->win.client,
- 0, -b->current.shaded,
- b->client.w, b->client.h);
-
- e_icccm_move_resize(b->win.client,
- b->current.x + pl,
- b->current.y + pt - b->current.shaded, b->client.w,
- b->client.h);
- e_cb_border_move_resize(b);
- }
- if ((b->client.title) && (b->bits.b))
- {
- if (b->obj.title)
- {
- if (strcmp(b->client.title, b->obj.title->text))
- {
- e_text_set_text(b->obj.title, b->client.title);
- b->shape_changed = 1;
- }
- if (b->current.selected)
- e_text_set_state(b->obj.title, "selected");
- else
- e_text_set_state(b->obj.title, "normal");
- }
- }
- if (visibility_changed)
- {
- if (b->current.visible)
- ecore_window_show(b->win.main);
- else
- ecore_window_hide(b->win.main);
- e_cb_border_visibility(b);
- }
-
- if (border_changed)
- ecore_window_gravity_set(b->win.container, NorthWestGravity);
- b->bits.new = 0;
- b->previous = b->current;
- b->changed = 0;
-
- D_RETURN;
-}
-
-void
-e_border_set_layer(E_Border * b, int layer)
-{
- int dl;
-
- D_ENTER;
-
- if (b->client.layer == layer)
- D_RETURN;
- dl = layer - b->client.layer;
- b->client.layer = layer;
- if (dl > 0)
- e_border_lower(b);
- else
- e_border_raise(b);
-
- D_RETURN;
-}
-
-static void
-e_border_raise_delayed(int val, void *b)
-{
- int auto_raise = 0;
-
- D_ENTER;
-
- auto_raise = config_data->window->auto_raise;
- if (auto_raise)
- e_border_raise((E_Border *) b);
-
- D_RETURN;
- UN(val);
-}
-
-float
-e_border_delayed_val()
-{
- return config_data->window->raise_delay;
-}
-
-void
-e_border_raise(E_Border * b)
-{
- Evas_List *l;
- Evas_List **windows;
- E_Border *rel;
-
- D_ENTER;
-
- /* Sticky windows are not on a particular desktop, but we need the current
- * desktop window list to raise the window correctly. */
- if (b->client.sticky)
- {
- E_Desktop *desk;
-
- desk = e_desktops_get(e_desktops_get_current());
- windows = &desk->windows;
- }
- else
- windows = &b->desk->windows;
-
- if (!(*windows))
- {
- *windows = evas_list_append(*windows, b);
- ecore_window_raise(b->win.main);
- D_RETURN;
- }
- for (l = *windows; l; l = l->next)
- {
- rel = l->data;
- if (rel->client.layer > b->client.layer)
- {
- if (!b->client.sticky)
- {
- *windows = evas_list_remove(*windows, b);
- *windows = evas_list_prepend_relative(*windows, b, rel);
- }
-
- ecore_window_stack_below(b->win.main, rel->win.main);
- D_RETURN;
- }
- if ((!l->next) && (l->data != b))
- {
- if (!b->client.sticky)
- {
- *windows = evas_list_remove(*windows, b);
- *windows = evas_list_append(*windows, b);
- }
- ecore_window_raise(b->win.main);
- D_RETURN;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_border_lower(E_Border * b)
-{
- Evas_List *l;
- Evas_List **windows;
- E_Border *rel;
-
- D_ENTER;
-
- /* Sticky windows are not on a particular desktop, but we need the current
- * desktop window list to raise the window correctly. */
- if (b->client.sticky)
- {
- E_Desktop *desk;
-
- desk = e_desktops_get(e_desktops_get_current());
- windows = &desk->windows;
- }
- else
- windows = &b->desk->windows;
-
- if (!(*windows))
- {
- *windows = evas_list_append(*windows, b);
- ecore_window_raise(b->win.main);
- D_RETURN;
- }
- for (l = *windows; l; l = l->next)
- {
- rel = l->data;
- if (rel->client.layer == b->client.layer)
- {
- if (b == rel)
- D_RETURN;
- *windows = evas_list_remove(*windows, b);
- *windows = evas_list_prepend_relative(*windows, b, rel);
- ecore_window_stack_below(b->win.main, rel->win.main);
- D_RETURN;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_border_raise_above(E_Border * b, E_Border * above)
-{
- Evas_List **windows;
-
- D_ENTER;
-
- /* Sticky windows are not on a particular desktop, but we need the current
- * desktop window list to raise the window correctly. */
- if (b->client.sticky)
- {
- E_Desktop *desk;
-
- desk = e_desktops_get(e_desktops_get_current());
- windows = &desk->windows;
- }
- else
- windows = &b->desk->windows;
-
- if (!(*windows))
- {
- *windows = evas_list_append(*windows, b);
- ecore_window_raise(b->win.main);
- D_RETURN;
- }
- if (!evas_list_find(*windows, above))
- D_RETURN;
- if (b->client.layer < above->client.layer)
- b->client.layer = above->client.layer;
- *windows = evas_list_remove(*windows, b);
- *windows = evas_list_append_relative(*windows, b, above);
- ecore_window_stack_above(b->win.main, above->win.main);
-
- D_RETURN;
-}
-
-void
-e_border_lower_below(E_Border * b, E_Border * below)
-{
- Evas_List **windows;
-
- D_ENTER;
-
- /* Sticky windows are not on a particular desktop, but we need the current
- * desktop window list to raise the window correctly. */
- if (b->client.sticky)
- {
- E_Desktop *desk;
-
- desk = e_desktops_get(e_desktops_get_current());
- windows = &desk->windows;
- }
- else
- windows = &b->desk->windows;
-
- if (!(*windows))
- {
- *windows = evas_list_append(*windows, b);
- D_RETURN;
- }
- if (!evas_list_find(*windows, below))
- D_RETURN;
- if (b->client.layer > below->client.layer)
- b->client.layer = below->client.layer;
- *windows = evas_list_remove(*windows, b);
- *windows = evas_list_prepend_relative(*windows, b, below);
- ecore_window_stack_below(b->win.main, below->win.main);
-
- D_RETURN;
-}
-
-void
-e_border_init(void)
-{
- D_ENTER;
-
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_IN, e_mouse_in);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_OUT, e_mouse_out);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_MAP_REQUEST,
- e_map_request);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_CONFIGURE_REQUEST,
- e_configure_request);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_PROPERTY, e_property);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_UNMAP, e_unmap);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_DESTROY, e_destroy);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_CIRCULATE_REQUEST,
- e_circulate_request);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_REPARENT, e_reparent);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_SHAPE, e_shape);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_IN, e_focus_in);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_OUT, e_focus_out);
- ecore_event_filter_handler_add(ECORE_EVENT_MESSAGE, e_client_message);
- ecore_event_filter_handler_add(ECORE_EVENT_COLORMAP, e_colormap);
- ecore_event_filter_idle_handler_add(e_idle, NULL);
-
- delayed_window_raise =
- e_delayed_action_new(E_EVENT_BORDER_FOCUS_IN,
- e_border_delayed_val, e_border_raise_delayed);
-
- ecore_add_event_timer("e_border_poll()", 1.00, e_border_poll, 0, NULL);
-
- D_RETURN;
-}
-
-void
-e_border_adopt_children(Window win)
-{
- Window *wins;
- int i, num;
-
- D_ENTER;
-
- wins = ecore_window_get_children(win, &num);
- if (wins)
- {
- for (i = 0; i < num; i++)
- {
- if (ecore_window_is_manageable(wins[i]))
- {
- E_Border *b;
-
- b = e_border_adopt(wins[i], 1);
- {
- int pl, pr, pt, pb;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- b->current.requested.x -= pl;
- b->current.requested.y -= pt;
- b->changed = 1;
- e_border_adjust_limits(b);
- }
- b->ignore_unmap = 2;
- }
- }
- FREE(wins);
- }
-
- D_RETURN;
-}
-
-
-E_Border *
-e_border_current_select(void)
-{
- Evas_List * l;
- E_Desktop * desk;
-
- /* Only check for borders on the current desktop */
- desk = e_desktops_get(e_desktops_get_current());
-
- D_ENTER;
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- if (b->current.selected && b->desk == desk)
- D_RETURN_(b);
- }
-
- D_RETURN_(NULL);
-}
-
-
-E_Border *
-e_border_current_focused(void)
-{
- Evas_List * l;
- E_Desktop * desk;
-
- /* Only check for borders on the current desktop */
- desk = e_desktops_get(e_desktops_get_current());
-
- D_ENTER;
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- if (b->current.selected && b->desk == desk)
- D_RETURN_(b);
- }
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- if (b->current.select_lost_from_grab && b->desk == desk)
- D_RETURN_(b);
- }
-
- D_RETURN_(NULL);
-}
-
-void
-e_border_focus_grab_ended(void)
-{
- Evas_List * l;
- E_Desktop *desk;
-
- D_ENTER;
-
- desk = e_desktops_get(e_desktops_get_current());
-
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- /* Only change selection of items on present desktop */
- if(b->desk == desk)
- {
- b->current.select_lost_from_grab = 0;
- b->current.selected = 0;
- b->changed = 1;
- }
- }
-
- D_RETURN;
-}
-
-int
-e_border_viewable(E_Border * b)
-{
- D_ENTER;
-
- if (b->desk != e_desktops_get(e_desktops_get_current()))
- D_RETURN_(0);
-
- if (b->current.x + b->current.w <= 0)
- D_RETURN_(0);
-
- if (b->current.x >= b->desk->real.w)
- D_RETURN_(0);
-
- if (b->current.y + b->current.h <= 0)
- D_RETURN_(0);
-
- if (b->current.y >= b->desk->real.h)
- D_RETURN_(0);
-
- if (!b->current.visible)
- D_RETURN_(0);
-
- D_RETURN_(1);
-}
-
-void
-e_border_send_pointer(E_Border * b)
-{
- D_ENTER;
-
- ecore_pointer_warp_to(b->current.x + b->current.w / 2,
- b->current.y + b->current.h / 2);
-
- D_RETURN;
-}
-
-void
-e_border_print_pos(char *buf, E_Border * b)
-{
- D_ENTER;
-
- snprintf(buf, PATH_MAX, "%i, %i", b->current.x, b->current.y);
-
- D_RETURN;
-}
-
-void
-e_border_print_size(char *buf, E_Border * b)
-{
- D_ENTER;
-
- if ((b->client.step.w > 1) || (b->client.step.h > 1))
- {
- snprintf(buf, PATH_MAX, "%i x %i",
- (b->client.w - b->client.base.w) / b->client.step.w,
- (b->client.h - b->client.base.h) / b->client.step.h);
- }
- else
- {
- snprintf(buf, PATH_MAX, "%i x %i", b->client.w, b->client.h);
- }
-
- D_RETURN;
-}
-
-void
-e_border_set_gravity(E_Border * b, int gravity)
-{
- D_ENTER;
-
- if (!b)
- D_RETURN;
-
- ecore_window_gravity_set(b->win.container, gravity);
- ecore_window_gravity_set(b->win.input, gravity);
- ecore_window_gravity_set(b->win.b, gravity);
-
- D_RETURN;
-}
-
-Evas_List *
-e_border_get_borders_list()
-{
- D_ENTER;
- D_RETURN_(borders);
-}
-
-void
-e_borders_scroll_list(Evas_List *borders, int dx, int dy)
-{
- Evas_List *l;
-
- for (l = borders; l; l = l->next)
- {
- E_Border *b;
-
- b = l->data;
- ecore_window_gravity_reset(b->win.main);
- if ((!b->client.is_desktop) && (!b->mode.move))
- {
- b->previous.requested.x = b->current.requested.x;
- b->previous.requested.y = b->current.requested.y;
- b->previous.x = b->current.x;
- b->previous.y = b->current.y;
- b->current.requested.x += dx;
- b->current.requested.y += dy;
- b->current.x = b->current.requested.x;
- b->current.y = b->current.requested.y;
- b->changed = 1;
- }
- }
-}
-
-
-E_Border *
-e_border_shuffle_last(E_Border *b)
-{
- Evas_List * next;
- E_Border *start;
- E_Border *current = NULL;
- E_Desktop *current_desk;
-
- D_ENTER;
-
- current_desk = e_desktops_get(e_desktops_get_current());
-
- if (!current_desk || !current_desk->windows)
- {
- e_icccm_send_focus_to( e_desktop_window(), 1);
- D_RETURN_(NULL);
- }
-
- if(b && !b->client.sticky && (b->desk == current_desk))
- current = b;
- else
- current = evas_list_last(current_desk->windows)->data;
-
- /* Find the current border on the list of borders */
- for (next = current_desk->windows; next && next->data != current; next = next->next);
-
- /* Step to the next border, wrap around the queue if the end is reached */
- if (next && next->prev)
- current = next->prev->data;
- else
- current = evas_list_last(next)->data;
-
- e_icccm_send_focus_to(current->win.client, current->client.takes_focus);
-
- D_RETURN_(current);
-}
+++ /dev/null
-#ifndef E_BORDER_H
-#define E_BORDER_H
-
-#include "e.h"
-#include "observer.h"
-#include "debug.h"
-#include "text.h"
-
-#ifndef E_DESKTOPS_TYPEDEF
-#define E_DESKTOPS_TYPEDEF
-typedef struct _E_Desktop E_Desktop;
-#endif
-
-typedef struct _E_Grab E_Grab;
-typedef struct _E_Border E_Border;
-
-struct _E_Grab
-{
- int button;
- Ecore_Event_Key_Modifiers mods;
- int any_mod;
- int remove_after;
- int allow;
-};
-
-struct _E_Border
-{
- E_Observee obs;
-
- struct
- {
- Window main;
- Window b;
- Window input;
- Window container;
- Window client;
- }
- win;
- Evas *evas;
- struct
- {
- E_Text *title;
- Evas_Object *title_clip;
- }
- obj;
- Evas_List *windows;
- struct
- {
- int new;
- Ebits_Object b;
- }
- bits;
-
- struct
- {
- struct
- {
- int x, y, w, h;
- int visible;
- int dx, dy;
- }
- requested;
- int x, y, w, h;
- int visible;
- int selected;
- int select_lost_from_grab;
- int shaded;
- int has_shape;
- int shape_changes;
- int shaped_client;
- }
- current , previous;
-
- struct
- {
- struct
- {
- int w, h;
- double aspect;
- }
- base , min, max, step;
- int layer;
- char *title;
- char *name;
- char *class;
- char *command;
- char *machine;
- char *icon_name;
- int pid;
- Window group;
- int takes_focus;
- int sticky;
- Colormap colormap;
- int fixed;
- int arrange_ignore;
- int hidden;
- int iconified;
- int titlebar;
- int border;
- int handles;
- int initial_state;
- int is_desktop;
- int w, h;
- int no_place;
- struct
- {
- int launch_id;
- pid_t pid;
- pid_t ppid;
- uid_t user;
- }
- e;
- struct
- {
- int requested;
- int x, y;
- int gravity;
- }
- pos;
- int desk;
- struct
- {
- int x, y;
- }
- area;
- int internal;
- struct
- {
- int matched;
- struct
- {
- int matched;
- int ignore;
- }
- prog_location;
- struct
- {
- int matched;
- char *style;
- }
- border;
- struct
- {
- int matched;
- int x, y;
- }
- location;
- struct
- {
- int matched;
- int x, y;
- }
- desk_area;
- struct
- {
- int matched;
- int w, h;
- }
- size;
- struct
- {
- int matched;
- int desk;
- }
- desktop;
- struct
- {
- int matched;
- int sticky;
- }
- sticky;
- struct
- {
- int matched;
- int layer;
- }
- layer;
- }
- matched;
- }
- client;
-
- struct
- {
- int move, resize;
- }
- mode;
-
- struct
- {
- int x, y, w, h;
- int is;
- }
- max;
-
- int ignore_unmap;
- int shape_changed;
- int placed;
-
- E_Grab *click_grab;
- E_Desktop *desk;
-
- char *border_style;
- char *border_file;
-
- int first_expose;
-
- int hold_changes;
-
- int changed;
-};
-
-/**
- * e_border_init - Border handling initialization.
- *
- * This function registers the border event handlers
- * against ecore.
- */
-void e_border_init(void);
-
-E_Border *e_border_new(void);
-
-void e_border_update_borders(void);
-void e_border_redraw_region(E_Border *b, int x, int y,
- int w, int h);
-void e_border_update_render(E_Border * b);
-void e_border_apply_border(E_Border * b);
-void e_border_reshape(E_Border * b);
-void e_border_release(E_Border * b);
-E_Border *e_border_adopt(Window win, int use_client_pos);
-void e_border_adopt_children(Window win);
-void e_border_remove_mouse_grabs(E_Border * b);
-void e_border_remove_click_grab(E_Border * b);
-void e_border_attach_mouse_grabs(E_Border * b);
-void e_border_remove_all_mouse_grabs(void);
-void e_border_attach_all_mouse_grabs(void);
-void e_border_redo_grabs(void);
-E_Border *e_border_find_by_window(Window win);
-void e_border_set_bits(E_Border * b, char *file);
-void e_border_set_color_class(E_Border * b, char *class, int rr,
- int gg, int bb, int aa);
-void e_border_adjust_limits(E_Border * b);
-void e_border_update(E_Border * b);
-void e_border_set_layer(E_Border * b, int layer);
-void e_border_raise(E_Border * b);
-void e_border_lower(E_Border * b);
-void e_border_iconify(E_Border * b);
-void e_border_uniconify(E_Border * b);
-void e_border_raise_above(E_Border * b, E_Border * above);
-void e_border_lower_below(E_Border * b, E_Border * below);
-E_Border *e_border_current_focused(void);
-void e_border_focus_grab_ended(void);
-void e_border_send_pointer(E_Border * b);
-int e_border_viewable(E_Border * b);
-void e_border_print_pos(char *buf, E_Border * b);
-void e_border_print_size(char *buf, E_Border * b);
-void e_border_set_gravity(E_Border * b, int gravity);
-Evas_List *e_border_get_borders_list();
-void e_borders_scroll_list(Evas_List *borders,
- int dx, int dy);
-void e_border_check_select( void );
-
-#endif
+++ /dev/null
-#include "menu.h"
-#include "border.h"
-#include "desktops.h"
-#include "debug.h"
-#include "util.h"
-#include "icccm.h"
-#include "bordermenu.h"
-
-static E_Menu *bordermenu = NULL;
-static E_Border *borderformenu = NULL;
-
-static void e_bordermenu_cb_close(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_kill(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_raise(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_lower(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_sticky(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_iconify(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_max(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_zoom(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_remember_location(E_Menu * m,
- E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_remember_size(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_remember_desktop(E_Menu * m,
- E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_remember_sticky(E_Menu * m,
- E_Menu_Item * mi,
- void *data);
-static void e_bordermenu_cb_remember_prog_location_ignore(E_Menu * m,
- E_Menu_Item *
- mi,
- void *data);
-static void e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi,
- void *data);
-
-static void
-e_bordermenu_cb_close(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (b->win.client)
- e_icccm_delete(b->win.client);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_kill(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (b->win.client)
- ecore_window_kill_client(b->win.client);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_raise(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- e_border_raise(b);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_lower(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- e_border_lower(b);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_sticky(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.sticky = mi->on;
- b->changed = 1;
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_iconify(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_max(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (b->client.is_desktop)
- D_RETURN;
- if (b->current.shaded > 0)
- D_RETURN;
- if ((b->mode.move) || (b->mode.resize))
- D_RETURN;
- b->mode.move = 0;
- b->mode.resize = 0;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- if (mi->on)
- {
- b->max.x = b->current.x;
- b->max.y = b->current.y;
- b->max.w = b->current.w;
- b->max.h = b->current.h;
- b->current.requested.x = 0;
- b->current.requested.y = 0;
- b->current.requested.w = b->desk->real.w;
- b->current.requested.h = b->desk->real.h;
- b->changed = 1;
- b->max.is = mi->on;
- e_border_adjust_limits(b);
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
- }
- else
- {
- b->current.requested.x = b->max.x;
- b->current.requested.y = b->max.y;
- b->current.requested.w = b->max.w;
- b->current.requested.h = b->max.h;
- b->changed = 1;
- b->max.is = mi->on;
- e_border_adjust_limits(b);
- b->current.requested.x = b->current.x;
- b->current.requested.y = b->current.y;
- b->current.requested.w = b->current.w;
- b->current.requested.h = b->current.h;
- }
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_zoom(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_bordermenu_cb_remember_location(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.matched.matched = 1;
- b->client.matched.location.matched = mi->on;
-
- D_RETURN;
- UN(m);
-}
-
-static void
-e_bordermenu_cb_remember_size(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.matched.matched = 1;
- b->client.matched.size.matched = mi->on;
-
- D_RETURN;
- UN(m);
-}
-
-static void
-e_bordermenu_cb_remember_desktop(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.matched.matched = 1;
- b->client.matched.desktop.matched = mi->on;
-
- D_RETURN;
- UN(m);
-}
-
-static void
-e_bordermenu_cb_remember_sticky(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.matched.matched = 1;
- b->client.matched.sticky.matched = mi->on;
-
- D_RETURN;
- UN(m);
-}
-
-static void
-e_bordermenu_cb_remember_prog_location_ignore(E_Menu * m, E_Menu_Item * mi,
- void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
-
- if (mi->on)
- e_menu_item_set_state(mi, 0);
- else
- e_menu_item_set_state(mi, 1);
- e_menu_set_state(m, mi);
-
- b->client.matched.matched = 1;
- b->client.matched.prog_location.matched = mi->on;
- b->client.matched.prog_location.ignore = 1;
-
- D_RETURN;
- UN(m);
-}
-
-static void
-e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- int d = 0;
- E_Border *b;
- E_Desktop *desk;
-
- D_ENTER;
-
- b = data;
- if (b->client.sticky)
- D_RETURN;
-
- sscanf(mi->str, "Desktop %d", &d);
- desk = e_desktops_get(d);
- if (!desk)
- desk = e_desktops_get(e_desktops_get_current());
-
- if (e_desktops_get(b->desk) == desk )
- D_RETURN;
-
- D("Sending border %p to desk %d from %d\n", b, d, b->desk);
- e_desktops_del_border(b->desk, b);
-
- e_desktops_add_border(desk, b);
- b->client.desk = d;
-
- b->current.requested.visible = 0;
- b->changed = 1;
- e_border_update_borders();
-
- e_border_shuffle_last(b);
-
- D_RETURN;
- UN(m);
-}
-
-void
-e_bordermenu_do(E_Border * b)
-{
- int i;
- char label[PATH_MAX];
- E_Menu *menu;
- E_Menu *menu2;
- E_Menu_Item *menuitem;
-
- D_ENTER;
-
- if (borderformenu != b)
- {
- menu = e_menu_new();
- e_menu_set_padding_icon(menu, 2);
- e_menu_set_padding_state(menu, 2);
-
- menuitem = e_menu_item_new("Close");
- /* e_menu_item_set_icon(menuitem, icon); */
- /* e_menu_item_set_scale_icon(menuitem, 1); */
- /* e_menu_item_set_separator(menuitem, 1); */
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_close, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Raise");
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_raise, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Lower");
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_lower, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Iconify");
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_iconify, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Zoom");
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_zoom, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Maximise");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->max.is);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_max, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Sticky");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->client.sticky);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_sticky, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("");
- e_menu_item_set_separator(menuitem, 1);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Kill");
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_kill, b);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("");
- e_menu_item_set_separator(menuitem, 1);
- e_menu_add_item(menu, menuitem);
-
- menuitem = e_menu_item_new("Remember Location");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->client.matched.location.matched);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_remember_location,
- b);
- e_menu_add_item(menu, menuitem);
- e_menu_set_state(menu, menuitem);
-
- menuitem = e_menu_item_new("Remember Size");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->client.matched.size.matched);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_remember_size, b);
- e_menu_add_item(menu, menuitem);
- e_menu_set_state(menu, menuitem);
-
- menuitem = e_menu_item_new("Remember Desktop");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->client.matched.desktop.matched);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_remember_desktop, b);
- e_menu_add_item(menu, menuitem);
- e_menu_set_state(menu, menuitem);
-
- menuitem = e_menu_item_new("Remember Stickiness");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem, b->client.matched.sticky.matched);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_remember_sticky, b);
- e_menu_add_item(menu, menuitem);
- e_menu_set_state(menu, menuitem);
-
- menuitem = e_menu_item_new("Ignore Program Specified Position");
- e_menu_item_set_check(menuitem, 1);
- e_menu_item_set_state(menuitem,
- b->client.matched.prog_location.matched);
- e_menu_item_set_callback(menuitem,
- e_bordermenu_cb_remember_prog_location_ignore,
- b);
- e_menu_add_item(menu, menuitem);
- e_menu_set_state(menu, menuitem);
-
- menu2 = e_menu_new();
- e_menu_set_padding_icon(menu2, 2);
- e_menu_set_padding_state(menu2, 2);
-
- for (i = 0; i < e_desktops_get_num(); i++)
- {
- snprintf(label, PATH_MAX, "Desktop %d", i);
- menuitem = e_menu_item_new(label);
- e_menu_item_set_callback(menuitem, e_bordermenu_cb_to_desktop, b);
- e_menu_add_item(menu2, menuitem);
- }
-
- menuitem = e_menu_item_new("Goto Desktop...");
- e_menu_item_set_submenu(menuitem, menu2);
- e_menu_add_item(menu, menuitem);
-
- bordermenu = menu;
- borderformenu = b;
- }
-
- {
- int pl, pr, pt, pb;
- int crx, cry, crw, crh;
- int mx, my;
-
- menu = bordermenu;
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- crx = b->current.x + pl;
- cry = b->current.y + pt;
- crw = b->client.w;
- crh = b->client.h;
- ecore_pointer_xy_get(&mx, &my);
- if (mx + menu->current.w > crx + crw)
- mx = crx + crw - menu->current.w;
- if (my + menu->current.h > cry + crh)
- my = cry + crh - menu->current.h;
- if (mx < crx)
- mx = crx;
- if (my < cry)
- my = cry;
- e_menu_show_at_mouse(menu, mx, my, CurrentTime);
- }
-
- D_RETURN;
-}
-
-void
-e_bordermenu_hide(void)
-{
- if (bordermenu)
- e_menu_hide(bordermenu);
- borderformenu = 0;
-}
+++ /dev/null
-#ifndef E_BORDERMENU_H
-#define E_BORDERMENU_H
-
-#include "e.h"
-
-void e_bordermenu_do(E_Border * b);
-void e_bordermenu_hide(void);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "actions.h"
-#include "border.h"
-#include "config.h"
-#include "data.h"
-#include "e_dir.h"
-#include "file.h"
-#include "keys.h"
-#include "observer.h"
-#include "util.h"
-
-static char cfg_root[] = "";
-
-static char cfg_grabs_db[PATH_MAX] = "";
-static char cfg_settings_db[PATH_MAX] = "";
-static char cfg_actions_db[PATH_MAX] = "";
-static char cfg_borders_db[PATH_MAX] = "";
-static char cfg_apps_menu_db[PATH_MAX] = "";
-static char cfg_match_db[PATH_MAX] = "";
-static char cfg_menus_dir[PATH_MAX] = "";
-static char cfg_entries_dir[PATH_MAX] = "";
-static char cfg_selections_dir[PATH_MAX] = "";
-static char cfg_scrollbars_dir[PATH_MAX] = "";
-static char cfg_guides_dir[PATH_MAX] = "";
-static char cfg_user_dir[PATH_MAX] = "";
-static char cfg_images_dir[PATH_MAX] = "";
-static char cfg_cursors_dir[PATH_MAX] = "";
-static char cfg_backgrounds_dir[PATH_MAX] = "";
-static char cfg_fonts_dir[PATH_MAX] = "";
-static char cfg_epplets_dir[PATH_MAX] = "";
-static char cfg_layout_dir[PATH_MAX] = "";
-
-static E_Observer *behavior_dir = NULL;
-E_Config *config_data;
-
-E_Data_Base_Type *cfg_actions = NULL;
-E_Data_Base_Type *cfg_config = NULL;
-E_Data_Base_Type *cfg_desktops = NULL;
-E_Data_Base_Type *cfg_grabs = NULL;
-E_Data_Base_Type *cfg_guides = NULL;
-E_Data_Base_Type *cfg_match = NULL;
-E_Data_Base_Type *cfg_menu = NULL;
-E_Data_Base_Type *cfg_move = NULL;
-E_Data_Base_Type *cfg_window = NULL;
-
-void e_config_behavior_changed(E_Observer * observer,
- E_Observee * observee,
- E_Event_Type event, void *data);
-void e_config_settings_reload(char *buf);
-
-char *
-e_config_get(char *type)
-{
- D_ENTER;
-
- /* for now use the system defaults and not the user copied settings */
- /* so if i chnage stuff i dont have to rm my personaly settings and */
- /* have e re-install them. yes this is different from e16 - the */
- /* complexity of merging system and user settings is just a bit */
- /* much for my liking and have decided, for usability, and */
- /* user-freindliness to keep all settings in the user's home dir, */
- /* as well as all data - so the only place to look is there. If you */
- /* have no data it is all copied over for you the first time E is */
- /* run. It's a design decision. */
- /* Later when things are a bit mroe stabilised these will look */
- /* something like: */
- /* E_CONF("grabs", cfg_grabs_db, */
- /* "%sbehavior/default/grabs.db", e_config_user_dir()); */
- /* notice it would use the user config location instead */
- /* but for now i'm keeping it as is for development "ease" */
-
-#define E_CONF(_key, _var, _args...) \
-{ \
- if (!strcmp(type, _key)) \
- { \
- if ((_var)[0]) D_RETURN_(_var); \
- snprintf((_var), PATH_MAX, ## _args); \
- D_RETURN_(_var); \
- } \
-}
-
- E_CONF("grabs", cfg_grabs_db, "%s/behavior/grabs.db", e_config_user_dir());
- E_CONF("settings", cfg_settings_db,
- "%s/behavior/settings.db", e_config_user_dir());
- E_CONF("actions", cfg_actions_db,
- "%s/behavior/actions.db", e_config_user_dir());
- E_CONF("apps_menu", cfg_apps_menu_db,
- "%s/behavior/apps_menu.db", e_config_user_dir());
- E_CONF("match", cfg_match_db, "%s/behavior/match.db", e_config_user_dir());
- E_CONF("borders", cfg_borders_db, PACKAGE_DATA_DIR "/data/borders/");
- E_CONF("menus", cfg_menus_dir, PACKAGE_DATA_DIR "/data/menus/");
- E_CONF("entries", cfg_entries_dir, PACKAGE_DATA_DIR "/data/entries/");
- E_CONF("selections", cfg_selections_dir,
- PACKAGE_DATA_DIR "/data/selections/");
- E_CONF("scrollbars", cfg_scrollbars_dir,
- PACKAGE_DATA_DIR "/data/scrollbars/");
- E_CONF("guides", cfg_guides_dir, PACKAGE_DATA_DIR "/data/guides/");
- E_CONF("images", cfg_images_dir, PACKAGE_DATA_DIR "/data/images/");
- E_CONF("cursors", cfg_cursors_dir, PACKAGE_DATA_DIR "/data/cursors/");
- E_CONF("backgrounds", cfg_backgrounds_dir,
- PACKAGE_DATA_DIR "/data/backgrounds/");
- E_CONF("fonts", cfg_fonts_dir, PACKAGE_DATA_DIR "/data/fonts/");
- E_CONF("epplets", cfg_epplets_dir, PACKAGE_DATA_DIR "/data/epplets/");
- E_CONF("layout", cfg_layout_dir, PACKAGE_DATA_DIR "/data/layout/");
-
- D_RETURN_("");
-}
-
-void
-e_config_actions_init()
-{
- D_ENTER;
-
- /*
- * Define the data type for the E_Actions struct.
- */
- cfg_actions = e_data_type_new();
- E_DATA_NODE(cfg_actions, "name", E_DATA_TYPE_STR, NULL, E_Action, name,
- (E_Data_Value) "");
- E_DATA_NODE(cfg_actions, "action", E_DATA_TYPE_STR, NULL, E_Action, action,
- (E_Data_Value) "");
- E_DATA_NODE(cfg_actions, "params", E_DATA_TYPE_STR, NULL, E_Action,
- params, (E_Data_Value) "");
- E_DATA_NODE(cfg_actions, "event", E_DATA_TYPE_INT, NULL, E_Action, event,
- (E_Data_Value) 0);
- E_DATA_NODE(cfg_actions, "button", E_DATA_TYPE_INT, NULL, E_Action, button,
- (E_Data_Value) 0);
- E_DATA_NODE(cfg_actions, "key", E_DATA_TYPE_STR, NULL, E_Action, key,
- (E_Data_Value) 0);
- E_DATA_NODE(cfg_actions, "modifiers", E_DATA_TYPE_INT, NULL, E_Action,
- modifiers, (E_Data_Value) 0);
-
- D_RETURN;
-}
-
-void
-e_config_desktops_init()
-{
- cfg_desktops = e_data_type_new();
- E_DATA_NODE(cfg_desktops, "count", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- count, (E_Data_Value) 8);
- E_DATA_NODE(cfg_desktops, "scroll", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- scroll, (E_Data_Value) 1);
- E_DATA_NODE(cfg_desktops, "scroll_sticky", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- scroll_sticky, (E_Data_Value) 1);
- E_DATA_NODE(cfg_desktops, "resist", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- resist, (E_Data_Value) 5);
- E_DATA_NODE(cfg_desktops, "speed", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- speed, (E_Data_Value) 30);
- E_DATA_NODE(cfg_desktops, "width", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- width, (E_Data_Value) 1);
- E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
- height, (E_Data_Value) 1);
- E_DATA_NODE(cfg_desktops, "cursors/e_native", E_DATA_TYPE_INT,
- NULL, E_Config_Desktops, e_native_cursors, (E_Data_Value) 1);
-}
-
-void
-e_config_grabs_init()
-{
- cfg_grabs = e_data_type_new();
- E_DATA_NODE(cfg_grabs, "button", E_DATA_TYPE_INT, NULL, E_Grab, button,
- (E_Data_Value) 0);
- E_DATA_NODE(cfg_grabs, "modifiers", E_DATA_TYPE_INT, NULL, E_Grab, mods,
- (E_Data_Value) 0);
-}
-
-void
-e_config_guides_init()
-{
- cfg_guides = e_data_type_new();
- E_DATA_NODE(cfg_guides, "display/location", E_DATA_TYPE_INT, NULL,
- E_Config_Guides, location, (E_Data_Value) 0);
- E_DATA_NODE(cfg_guides, "display/x", E_DATA_TYPE_FLOAT, NULL,
- E_Config_Guides, x, (E_Data_Value) 0);
- E_DATA_NODE(cfg_guides, "display/y", E_DATA_TYPE_FLOAT, NULL,
- E_Config_Guides, y, (E_Data_Value) 0);
-}
-
-void
-e_config_menu_init()
-{
- cfg_menu = e_data_type_new();
- E_DATA_NODE(cfg_menu, "scroll/resist", E_DATA_TYPE_INT, NULL,
- E_Config_Menu, resist, (E_Data_Value) 5);
- E_DATA_NODE(cfg_menu, "scroll/speed", E_DATA_TYPE_INT, NULL,
- E_Config_Menu, speed, (E_Data_Value) 12);
-}
-
-void
-e_config_move_init()
-{
- cfg_move = e_data_type_new();
- E_DATA_NODE(cfg_move, "resist", E_DATA_TYPE_INT, NULL,
- E_Config_Move, resist, (E_Data_Value) 0);
- E_DATA_NODE(cfg_move, "resist/win", E_DATA_TYPE_INT, NULL,
- E_Config_Move, win_resist, (E_Data_Value) 0);
- E_DATA_NODE(cfg_move, "resist/desk", E_DATA_TYPE_INT, NULL,
- E_Config_Move, desk_resist, (E_Data_Value) 0);
-}
-
-void
-e_config_window_init()
-{
- cfg_window = e_data_type_new();
- E_DATA_NODE(cfg_window, "resize/mode", E_DATA_TYPE_INT, NULL,
- E_Config_Window, resize_mode, (E_Data_Value) 0);
- E_DATA_NODE(cfg_window, "move/mode", E_DATA_TYPE_INT, NULL,
- E_Config_Window, move_mode, (E_Data_Value) 0);
- E_DATA_NODE(cfg_window, "focus/mode", E_DATA_TYPE_INT, NULL, E_Config_Window,
- focus_mode, (E_Data_Value) 0);
- E_DATA_NODE(cfg_window, "raise/auto", E_DATA_TYPE_INT, NULL,
- E_Config_Window, auto_raise, (E_Data_Value) 0);
- E_DATA_NODE(cfg_window, "raise/delay", E_DATA_TYPE_FLOAT, NULL,
- E_Config_Window, raise_delay, (E_Data_Value) (float)0.6);
- E_DATA_NODE(cfg_window, "place/mode", E_DATA_TYPE_INT, NULL,
- E_Config_Window, place_mode, (E_Data_Value) 0);
-}
-
-void
-e_config_init(void)
-{
- char buf[PATH_MAX];
- E_Dir *dir;
-
- D_ENTER;
-
- /* Start by initializing the data loading structures */
- e_config_actions_init();
- e_config_desktops_init();
- e_config_grabs_init();
- e_config_guides_init();
- e_config_menu_init();
- e_config_move_init();
- e_config_window_init();
-
- /* Then place the data structures within the config description */
- cfg_config = e_data_type_new();
- E_DATA_NODE(cfg_config, "actions", E_DATA_TYPE_LIST, cfg_actions,
- E_Config, actions, (E_Data_Value) 0);
- E_DATA_NODE(cfg_config, "grabs", E_DATA_TYPE_LIST, cfg_grabs,
- E_Config, grabs, (E_Data_Value) 0);
-
- E_DATA_NODE(cfg_config, "desktops", E_DATA_TYPE_PTR, cfg_desktops,
- E_Config, desktops, (E_Data_Value) 0);
- E_DATA_NODE(cfg_config, "guides", E_DATA_TYPE_PTR, cfg_guides,
- E_Config, guides, (E_Data_Value) 0);
- E_DATA_NODE(cfg_config, "menu", E_DATA_TYPE_PTR, cfg_menu,
- E_Config, menu, (E_Data_Value) 0);
- E_DATA_NODE(cfg_config, "move", E_DATA_TYPE_PTR, cfg_move,
- E_Config, move, (E_Data_Value) 0);
- E_DATA_NODE(cfg_config, "window", E_DATA_TYPE_PTR, cfg_window,
- E_Config, window, (E_Data_Value) 0);
-
- /* Create directories as needed */
- if (!e_file_is_dir(e_config_user_dir()))
- e_file_mkdir(e_config_user_dir());
- snprintf(buf, PATH_MAX, "%sappearance", e_config_user_dir());
- if (!e_file_is_dir(buf))
- e_file_mkdir(buf);
- snprintf(buf, PATH_MAX, "%sappearance/borders", e_config_user_dir());
- if (!e_file_is_dir(buf))
- e_file_mkdir(buf);
- snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir());
- if (!e_file_is_dir(buf))
- e_file_mkdir(buf);
-
- /* With the directories created, create files if needed and load config */
- snprintf(buf, PATH_MAX, "%sbehavior/grabs.db", e_config_user_dir());
- if (!e_file_exists(buf))
- e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/grabs.db", buf);
- snprintf(buf, PATH_MAX, "%sbehavior/settings.db", e_config_user_dir());
- if (!e_file_exists(buf))
- e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/settings.db",
- buf);
- snprintf(buf, PATH_MAX, "%sbehavior/actions.db", e_config_user_dir());
- if (!e_file_exists(buf))
- e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/actions.db",
- buf);
- snprintf(buf, PATH_MAX, "%sbehavior/apps_menu.db", e_config_user_dir());
- if (!e_file_exists(buf))
- e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/apps_menu.db",
- buf);
- snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir());
- if (!e_file_exists(buf))
- e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/behavior.db",
- buf);
-
- /* Load config data and begin monitoring it with efsd */
- e_config_behavior_changed(NULL, NULL, 0, NULL);
-
- snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir());
- dir = e_dir_new();
- e_dir_set_dir(dir, buf);
-
- behavior_dir = NEW(E_Observer, 1);
- ZERO(behavior_dir, sizeof(E_Observer), 1);
- e_observer_init(behavior_dir, E_EVENT_FILE_CHANGE,
- e_config_behavior_changed, free);
- e_observer_register_observee(behavior_dir, E_OBSERVEE(dir));
-
- D_RETURN;
-}
-
-void
-e_config_behavior_changed(E_Observer * observer, E_Observee * observee,
- E_Event_Type event, void *data)
-{
- char buf[PATH_MAX];
- Evas_List *l;
-
- if (config_data)
- {
- for (l = config_data->actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- e_object_unref((E_Object *)a);
- l->data = NULL;
- }
-
- e_data_free(cfg_config, (char *)config_data);
- FREE(config_data);
- }
-
- snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir());
- config_data = e_data_load(buf, "", cfg_config);
-
- /* FIXME: this should probably be a function in actions.c */
- for (l = config_data->actions; l; l = l->next)
- {
- E_Action *a;
-
- a = l->data;
- e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup);
- if ((a->key) && (strlen(a->key) > 0))
- {
- if (a->modifiers == -1)
- e_keys_grab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1);
- else
- e_keys_grab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers,
- 0);
- a->grabbed = 1;
- }
- }
-
- return;
- UN(observer);
- UN(observee);
- UN(event);
- UN(data);
-}
-
-void
-e_config_set_user_dir(char *dir)
-{
- D_ENTER;
-
- STRNCPY(cfg_root, dir, PATH_MAX);
- /* reset the cached dir paths */
- cfg_grabs_db[0] = 0;
- cfg_settings_db[0] = 0;
- cfg_actions_db[0] = 0;
- cfg_borders_db[0] = 0;
- cfg_apps_menu_db[0] = 0;
- cfg_match_db[0] = 0;
- cfg_menus_dir[0] = 0;
- cfg_entries_dir[0] = 0;
- cfg_selections_dir[0] = 0;
- cfg_scrollbars_dir[0] = 0;
- cfg_guides_dir[0] = 0;
- cfg_user_dir[0] = 0;
- cfg_images_dir[0] = 0;
- cfg_cursors_dir[0] = 0;
- cfg_backgrounds_dir[0] = 0;
- cfg_fonts_dir[0] = 0;
- /* init again - if the user hasnt got all the data */
- e_config_init();
-
- D_RETURN;
-}
-
-char *
-e_config_user_dir(void)
-{
- D_ENTER;
-
- /* We copy the config files to the user's home dir, no need to fall back */
- if (cfg_user_dir[0])
- D_RETURN_(cfg_user_dir);
-
- snprintf(cfg_user_dir, PATH_MAX, "%s/.e/", e_util_get_user_home());
-
- D_RETURN_(cfg_user_dir);
-}
+++ /dev/null
-#ifndef E_CONFIG_H
-#define E_CONFIG_H
-
-#include "e.h"
-
-/*
- * Define small subsets of the whole config for defining data types for
- * loading from the databases.
- */
-typedef struct _E_Config_Desktops E_Config_Desktops;
-struct _E_Config_Desktops
-{
- int count;
- int scroll;
- int scroll_sticky;
- int resist;
- int speed;
- int width;
- int height;
- int e_native_cursors;
-};
-
-typedef struct _E_Config_Guides E_Config_Guides;
-struct _E_Config_Guides
-{
- float x;
- float y;
- int location;
-};
-
-typedef struct _E_Config_Menu E_Config_Menu;
-struct _E_Config_Menu
-{
- int resist;
- int speed;
-};
-
-typedef struct _E_Config_Move E_Config_Move;
-struct _E_Config_Move
-{
- int resist;
- int win_resist;
- int desk_resist;
-};
-
-typedef struct _E_Config_Window E_Config_Window;
-struct _E_Config_Window
-{
- int move_mode;
- int focus_mode;
- int auto_raise;
- float raise_delay;
- int resize_mode;
- int place_mode;
-};
-
-typedef struct _E_Config E_Config;
-struct _E_Config
-{
- Evas_List *actions;
- Evas_List *grabs;
- Evas_List *match;
-
- E_Config_Desktops *desktops;
- E_Config_Guides *guides;
- E_Config_Menu *menu;
- E_Config_Move *move;
- E_Config_Window *window;
-};
-
-extern E_Config *config_data;
-
-char *e_config_get(char *type);
-void e_config_init(void);
-void e_config_set_user_dir(char *dir);
-char *e_config_user_dir(void);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "cursors.h"
-#include "config.h"
-#include "util.h"
-#include "file.h"
-#include <X11/cursorfont.h>
-#if 0
-/* XCursor */
-#include <X11/Xcursor/Xcursor.h>
-#endif
-
-typedef struct _e_cursor E_Cursor;
-
-struct _e_cursor
-{
- char *type;
- Cursor cursor;
- time_t mod;
- int x_cursor_id;
-};
-
-static int cursor_change = 0;
-static char *cur_cursor = NULL;
-static char *prev_cursor = NULL;
-static Evas_List * cursors = NULL;
-
-static void e_cursors_idle(void *data);
-static void e_cursors_set(char *type);
-static E_Cursor *e_cursors_find(char *type);
-
-static void
-e_cursors_idle(void *data)
-{
- int change = 0;
-
- D_ENTER;
-
- if (!cursor_change)
- D_RETURN;
- if ((prev_cursor) && (cur_cursor) && (strcmp(prev_cursor, cur_cursor)))
- change = 1;
- if ((prev_cursor) && (!cur_cursor))
- change = 1;
- if ((!prev_cursor) && (cur_cursor))
- change = 1;
- if (change)
- e_cursors_set(cur_cursor);
- IF_FREE(prev_cursor);
- e_strdup(prev_cursor, cur_cursor);
- IF_FREE(cur_cursor);
- cur_cursor = NULL;
- cursor_change = 0;
-
- D_RETURN;
- UN(data);
-}
-
-static void
-e_cursors_set(char *type)
-{
- D_ENTER;
-
- e_cursors_display_in_window(0, type);
-
- D_RETURN;
-}
-
-static E_Cursor *
-e_cursors_find(char *type)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = cursors; l; l = l->next)
- {
- E_Cursor *c;
-
- c = l->data;
- if (!strcmp(c->type, type))
- {
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "%s/%s.db", e_config_get("cursors"), type);
- if (e_file_mod_time(buf) > c->mod)
- {
- cursors = evas_list_remove(cursors, c);
- IF_FREE(c->type);
- ecore_cursor_free(c->cursor);
- FREE(c);
- D_RETURN_(NULL);
- }
- D_RETURN_(c);
- }
- }
- D_RETURN_(NULL);
-}
-
-void
-e_cursors_display_in_window(Window win, char *type)
-{
- E_Cursor *c;
-
- D_ENTER;
-
- if (!type)
- type = "Default";
- c = e_cursors_find(type);
- if (!c)
- {
- Pixmap pmap, mask;
- int hx = 0, hy = 0;
- int fr = 255, fg = 255, fb = 255;
- int br = 0, bg = 0, bb = 0;
- int w = 32, h = 32;
- int ok;
- char buf[PATH_MAX];
- Imlib_Image im;
-
- c = NEW(E_Cursor, 1);
- ZERO(c, E_Cursor, 1);
-
- e_strdup(c->type, type);
-
- snprintf(buf, PATH_MAX, "%s/%s.db", e_config_get("cursors"), type);
- c->mod = e_file_mod_time(buf);
- E_DB_INT_GET(buf, "/cursor/x", hx, ok);
- E_DB_INT_GET(buf, "/cursor/y", hy, ok);
- /* Handle x_cursor if available */
- E_DB_INT_GET(buf, "/cursor/x_id", c->x_cursor_id, ok);
- if(!ok)
- c->x_cursor_id = XC_arrow;
-
- /* Some sample code to load XCursor data directly. */
- /* This works, but shading and colorization is different */
- /* than native XFree86 XCursors. It appears the xcursorgen */
- /* program does some preprocessing. We could do the same. */
-#if 0
- /* XCursor */
- if(0)
- {
- Evas *ic_e;
- Evas_Object *e_im;
- int *idata;
- int wid, hei;
- XcursorImage * xcur;
-
- snprintf(buf, PATH_MAX, "%s/%s.db",
- e_config_get("cursors"), type);
-
- ic_e = e_evas_new_all(ecore_display_get(), 0,
- 0, 0, 200, 200, "");
- e_im = evas_object_image_add(ic_e);
- evas_object_image_file_set(e_im, buf, "/cursor/image");
- idata = evas_object_image_data_get(e_im, 1);
- evas_object_image_size_get(e_im, &wid, &hei);
-
- /* Make sure width and height are sane, protect ourselves.*/
- if(wid > 128) wid=128;
- if(hei > 128) hei=128;
-
- xcur = XcursorImageCreate( wid, hei);
- xcur->pixels = /*Xmalloc ? */(int *) malloc(wid * hei * 4);
- if(!xcur->pixels)
- D("Failed alloc!!!!!!!!!!\n");
- memcpy(xcur->pixels, idata, wid*hei*4);
- xcur->xhot = hx;
- xcur->yhot = hy;
-
- c->cursor = XcursorImageLoadCursor(ecore_display_get(), xcur);
-
- evas_object_del(e_im);
- }
- else
- {
-#endif
-
- /* Only load images for native cursors */
- if(config_data->desktops->e_native_cursors)
- {
-
- snprintf(buf, PATH_MAX, "%s/%s.db:/cursor/image",
- e_config_get("cursors"), type);
-
- im = imlib_load_image(buf);
- if (im)
- {
- DATA32 *data;
- int x, y;
- GC gcf, gcb;
- int have_bg = 0, have_fg = 0;
-
- imlib_context_set_image(im);
- w = imlib_image_get_width();
- h = imlib_image_get_height();
- pmap = ecore_pixmap_new(0, w, h, 1);
- mask = ecore_pixmap_new(0, w, h, 1);
- data = imlib_image_get_data_for_reading_only();
-
- /* figure out fg & bg */
- if (!data)
- goto done;
- for (y = 0; y < h; y++)
- {
- for (x = 0; x < w; x++)
- {
- int r, g, b, a;
- DATA32 pix;
-
- pix = data[(y * w) + x];
- r = (pix >> 16) & 0xff;
- g = (pix >> 8) & 0xff;
- b = (pix) & 0xff;
- a = (pix >> 24) & 0xff;
-
- if (a > 127)
- {
- if (!have_bg)
- {
- br = r;
- bg = g;
- bb = b;
- have_bg = 1;
- }
- if (!have_fg)
- {
- if ((have_bg) &&
- ((br != r) || (bg != g) || (bb != b)))
- {
- fr = r;
- fg = g;
- fb = b;
- have_fg = 1;
- goto done;
- }
- }
- }
- }
- }
- done:
-
- /* FIXME: inefficient - using pixmaps and draw point... should */
- /* use XImages & XShm */
-
- /* get some gc's set up */
- gcb = ecore_gc_new(pmap);
- gcf = ecore_gc_new(pmap);
- ecore_gc_set_fg(gcb, 0);
- ecore_gc_set_fg(gcf, 1);
-
- /* fill out cursor pixmap with 0's (bg) */
- ecore_fill_rectangle(pmap, gcb, 0, 0, w, h);
- ecore_fill_rectangle(mask, gcb, 0, 0, w, h);
- if (!data)
- goto done2;
- for (y = 0; y < h; y++)
- {
- for (x = 0; x < w; x++)
- {
- int r, g, b, a;
- DATA32 pix;
-
- pix = data[(y * w) + x];
- r = (pix >> 16) & 0xff;
- g = (pix >> 8) & 0xff;
- b = (pix) & 0xff;
- a = (pix >> 24) & 0xff;
-
- if (a > 127)
- {
- ecore_draw_point(mask, gcf, x, y);
- if ((r == fr) && (g == fg) && (b == fb))
- ecore_draw_point(pmap, gcf, x, y);
- }
- }
- }
- done2:
- /* clean up */
- ecore_gc_free(gcb);
- ecore_gc_free(gcf);
-
- imlib_image_put_back_data(data);
- imlib_free_image();
- }
- else
- {
- IF_FREE(c->type);
- FREE(c);
- c = NULL;
- }
-
-
- }
- /* end native cursors */
-
-
- if (c)
- {
- /* If behavior.db has /desktops/cursors/native == 1, then use */
- /* images installed */
- /* by E, else use X cursors by cursorfont id. */
- /* Use E's pixmap? */
- if(config_data->desktops->e_native_cursors)
- {
- c->cursor =
- ecore_cursor_new(pmap, mask, hx, hy, fr, fg, fb, br, bg, bb);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
- }
- else
- {
- /* No, use X cursors */
- c->cursor =
- XCreateFontCursor(ecore_display_get(), c->x_cursor_id);
- }
- cursors = evas_list_append(cursors, c);
- }
-#if 0
- } /* XCursor */
-#endif
- }
- if (c)
- {
- ecore_cursor_set(win, c->cursor);
- }
- else
- {
- if (!strcmp(type, "Default"))
- D_RETURN;
- e_cursors_display_in_window(win, "Default");
- }
-
- D_RETURN;
-}
-
-void
-e_cursors_display(char *type)
-{
- D_ENTER;
-
- IF_FREE(cur_cursor);
- e_strdup(cur_cursor, type);
- cursor_change = 1;
-
- D_RETURN;
-}
-
-void
-e_cursors_init(void)
-{
- D_ENTER;
-
- ecore_event_filter_idle_handler_add(e_cursors_idle, NULL);
- e_cursors_set("Default");
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_CURSORS_H
-#define E_CURSORS_H
-
-#include "e.h"
-
-void e_cursors_display(char *type);
-void e_cursors_display_in_window(Window win, char *type);
-void e_cursors_init(void);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "e.h"
-#include "data.h"
-#include "file.h"
-#include "util.h"
-
-void
-e_data_type_add_node(E_Data_Base_Type * base, char *prefix,
- E_Data_Datatype type,
- E_Data_Base_Type * list_type,
- int offset, E_Data_Value def_val)
-{
- E_Data_Node *data_node;
-
- D_ENTER;
-
- data_node = NEW(E_Data_Node, 1);
- ZERO(data_node, E_Data_Node, 1);
-
- data_node->prefix = strdup(prefix);
- data_node->type = type;
- data_node->sub_type = list_type;
- data_node->offset = offset;
- switch (type)
- {
- case E_DATA_TYPE_INT:
- data_node->def_val.int_val = def_val.int_val;
- break;
- case E_DATA_TYPE_FLOAT:
- data_node->def_val.float_val = def_val.float_val;
- break;
- case E_DATA_TYPE_STR:
- if (data_node->def_val.str_val)
- {
- e_strdup(data_node->def_val.str_val, def_val.str_val);
- }
- break;
- default:
- break;
- }
- base->nodes = evas_list_append(base->nodes, data_node);
-
- D_RETURN;
-}
-
-E_Data_Base_Type *
-e_data_type_new(void)
-{
- E_Data_Base_Type *t;
-
- D_ENTER;
-
- t = NEW(E_Data_Base_Type, 1);
- ZERO(t, E_Data_Base_Type, 1);
-
- D_RETURN_(t);
-}
-
-void *
-e_data_load(char *file, char *prefix, E_Data_Base_Type * type)
-{
- E_DB_File *db;
- char buf[PATH_MAX];
- Evas_List *l;
- char *data;
-
- D_ENTER;
-
- if (!e_file_exists(file))
- D_RETURN_(NULL);
- db = e_db_open_read(file);
-
- if (!db)
- D_RETURN_(NULL);
-
- data = NEW(char, type->size);
- ZERO(data, char, type->size);
-
- for (l = type->nodes; l; l = l->next)
- {
- E_Data_Node *node;
-
- node = l->data;
- switch (node->type)
- {
- case E_DATA_TYPE_INT:
- {
- int val;
-
- val = 0;
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if (e_db_int_get(db, buf, &val))
- (*((int *)(&(data[node->offset])))) = val;
- else
- (*((int *)(&(data[node->offset])))) = node->def_val.int_val;
- }
- break;
- case E_DATA_TYPE_STR:
- {
- char *val;
-
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if ((val = e_db_str_get(db, buf)))
- (*((char **)(&(data[node->offset])))) = val;
- else
- e_strdup((*((char **)(&(data[node->offset])))),
- node->def_val.str_val);
- }
- break;
- case E_DATA_TYPE_PTR:
- {
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- (*((void **)(&(data[node->offset])))) = e_data_load(file, buf,
- node->
- sub_type);
- }
- break;
- case E_DATA_TYPE_FLOAT:
- {
- float val;
-
- val = 0;
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if (e_db_float_get(db, buf, &val))
- (*((float *)(&(data[node->offset])))) = val;
- else
- (*((float *)(&(data[node->offset])))) =
- node->def_val.float_val;
- }
- break;
- case E_DATA_TYPE_LIST:
- {
- Evas_List *l2;
- int i, count;
-
- l2 = NULL;
- snprintf(buf, PATH_MAX, "%s/%s/count", prefix, node->prefix);
- count = 0;
- e_db_int_get(db, buf, &count);
- for (i = 0; i < count; i++)
- {
- void *data2;
-
- snprintf(buf, PATH_MAX, "%s/%s/%i", prefix, node->prefix,
- i);
- data2 = e_data_load(file, buf, node->sub_type);
- l2 = evas_list_append(l2, data2);
- }
- (*((Evas_List **) (&(data[node->offset])))) = l2;
- }
- break;
- case E_DATA_TYPE_KEY:
- {
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- (*((char **)(&(data[node->offset])))) = strdup(buf);
- }
- break;
- default:
- break;
- }
- }
-
- e_db_close(db);
- D_RETURN_(data);
-}
-
-void
-e_data_free(E_Data_Base_Type * type, char *data)
-{
- Evas_List *l;
-
- D_ENTER;
-
- for (l = type->nodes; l; l = l->next)
- {
- E_Data_Node *node;
-
- node = l->data;
- switch (node->type)
- {
- case E_DATA_TYPE_LIST:
- {
- Evas_List *l2;
-
- l2 = (*((Evas_List **) (&(data[node->offset]))));
- while (l2)
- {
- char *data2;
-
- data2 = l2->data;
- l2 = evas_list_remove(l2, data2);
- if(data2)
- {
- e_data_free(node->sub_type, (char *)data2);
- FREE(data2);
- }
- }
- }
- break;
- case E_DATA_TYPE_STR:
- case E_DATA_TYPE_KEY:
- {
- IF_FREE((*((char **)(&(data[node->offset])))));
- }
- break;
- case E_DATA_TYPE_PTR:
- {
- e_data_free(node->sub_type,
- (*((void **)(&(data[node->offset])))));
- FREE((*((void **)(&(data[node->offset])))));
- }
- break;
- case E_DATA_TYPE_INT:
- case E_DATA_TYPE_FLOAT:
- break;
- default:
- D("DATA WARNING: Data node %p corrupted!!!\n", node);
- break;
- }
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef _DB_H
-#define _DB_H
-
-/*
- * The API described in this file is used to map data from a database into a
- * struct. TODO: Arbitrary cleanup function for handling fields not described
- * by the base type, ie. not read in from the database.
- */
-
-typedef struct _e_data_base_type E_Data_Base_Type;
-typedef union _e_data_value E_Data_Value;
-typedef struct _e_data_node E_Data_Node;
-typedef enum _e_data_datatype E_Data_Datatype;
-
-enum _e_data_datatype
-{
- E_DATA_TYPE_INT,
- E_DATA_TYPE_STR,
- E_DATA_TYPE_PTR,
- E_DATA_TYPE_FLOAT,
- E_DATA_TYPE_LIST,
- E_DATA_TYPE_KEY
-};
-
-struct _e_data_base_type
-{
- int size;
- Evas_List *nodes;
-};
-
-union _e_data_value
-{
- int int_val;
- float float_val;
- char *str_val;
-};
-
-struct _e_data_node
-{
- char *prefix;
- E_Data_Datatype type;
- int offset;
- E_Data_Base_Type *sub_type;
- E_Data_Value def_val;
-};
-
-#define E_DATA_NODE(var, prefix, type, sub, struct_type, struct_member, def_val) \
-{ \
- struct_type _cfg_dummy; \
- char *_cfg_p1, *_cfg_p2; \
- int _cfg_offset; \
- \
- _cfg_p1 = (char *)(&(_cfg_dummy)); \
- _cfg_p2 = (char *)(&(_cfg_dummy.struct_member)); \
- _cfg_offset = (int)(_cfg_p2 - _cfg_p1); \
- \
- e_data_type_add_node(var, prefix, type, sub, _cfg_offset, def_val); \
- var->size = sizeof(struct_type); \
-}
-
-/**
- * e_data_type_new - create the basis for a new datatype description
- *
- * Returns a pointer to base type for tracking the elements of a data type.
- */
-E_Data_Base_Type *e_data_type_new(void);
-
-/**
- * e_data_type_add_node - add a type node to the base data type
- *
- * Add the necessary information for setting a data field in the base struct.
- */
-void e_data_type_add_node(E_Data_Base_Type * base,
- char *prefix,
- E_Data_Datatype type,
- E_Data_Base_Type * list_type,
- int offset, E_Data_Value def_val);
-
-/**
- * e_data_load - allocate and assign the data of the base type
- *
- * Returns a newly allocated struct of the base type, with data filled from
- * the database file with keys prefixed by prefix.
- */
-void *e_data_load(char *file, char *prefix,
- E_Data_Base_Type * type);
-
-/**
- * e_data_free - free the data allocated by e_data_load
- *
- * The data assigned by e_data_load is freed, but the struct itself is not,
- * since the programmer may have other fields in the struct that were not
- * allocated by e_data_load.
- */
-void e_data_free(E_Data_Base_Type * type, char *data);
-
-#endif
+++ /dev/null
-/*
-
-Copyright (C) 2000, 2001 Christian Kreibich <cK@whoop.org>.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies of the Software and its documentation and acknowledgment shall be
-given in the documentation and software packages that this Software was
-used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-#if HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <sys/time.h>
-#include <unistd.h>
-
-#include "debug.h"
-
-static int do_print = 1;
-static int calldepth = 0;
-
-static void debug_whitespace(int calldepth);
-static void debug_print_info(void);
-
-static void
-debug_whitespace(int calldepth)
-{
- int i;
-
- for (i = 0; i < 2 * calldepth; i++)
- printf("-");
-}
-
-static void
-debug_print_info(void)
-{
- printf("e17 dbg: ");
-}
-
-void
-e_debug_enter(const char *file, const char *func)
-{
- if (do_print)
- {
- calldepth++;
-
- printf("ENTER ");
- debug_print_info();
- debug_whitespace(calldepth);
- printf("%s, %s()\n", file, func);
- fflush(stdout);
- }
-}
-
-void
-e_debug_return(const char *file, const char *func)
-{
- if (do_print)
- {
- printf("RETURN ");
- debug_print_info();
- debug_whitespace(calldepth);
- printf("%s, %s()\n", file, func);
- fflush(stdout);
-
- calldepth--;
-
- if (calldepth < 0)
- printf("NEGATIVE!!!\n");
- }
-}
+++ /dev/null
-/*
-
-Copyright (C) 2000, 2001 Christian Kreibich <cK@whoop.org>.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies of the Software and its documentation and acknowledgment shall be
-given in the documentation and software packages that this Software was
-used.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-*/
-#ifndef E_DEBUG_H
-#define E_DEBUG_H
-
-#include <unistd.h>
-#include <stdio.h>
-
-
-/*
- * #undef DEBUG
- */
-
-#ifdef DEBUG
-
-#define D(fmt, args...) printf(fmt, ## args); fflush(stdout);
-#else
-#define D(msg, args...)
-#endif
-
-#ifdef DEBUG_NEST
-
-void e_debug_enter(const char *file, const char *func);
-void e_debug_return(const char *file, const char *func);
-
-#define D_ENTER e_debug_enter(__FILE__, __FUNCTION__)
-
-#define D_RETURN \
-{ \
- e_debug_return(__FILE__, __FUNCTION__); \
- return; \
-}
-
-#define D_RETURN_(x) \
-{ \
- e_debug_return(__FILE__, __FUNCTION__); \
-\
- return x; \
-}
-#else
-#define D_ENTER
-#define D_RETURN return
-#define D_RETURN_(x) return (x)
-#endif
-
-#endif
+++ /dev/null
-#include <string.h>
-#include "debug.h"
-#include "delayed.h"
-#include "util.h"
-
-static void
-e_delayed_action_cleanup(E_Delayed_Action * eda)
-{
- D_ENTER;
-
- e_delayed_action_cancel(eda);
- e_observer_cleanup(E_OBSERVER(eda));
-
- D_RETURN;
-}
-
-E_Delayed_Action *
-e_delayed_action_new(E_Event_Type event, E_Delay_Val delay,
- E_Delay_Func delay_func)
-{
- E_Delayed_Action *eda = NULL;
-
- D_ENTER;
-
- eda = NEW(E_Delayed_Action, 1);
- memset(eda, 0, sizeof(E_Delayed_Action));
-
- e_observer_init(E_OBSERVER(eda), event, e_delayed_action_start,
- (E_Cleanup_Func) e_delayed_action_cleanup);
-
- eda->delay = delay;
- eda->delay_func = delay_func;
-
- D_RETURN_(eda);
-}
-
-void
-e_delayed_action_start(E_Observer * obs, E_Observee * obj, E_Event_Type event, void *data)
-{
- char event_name[PATH_MAX];
- E_Delayed_Action *eda = (E_Delayed_Action *) obs;
-
- D_ENTER;
-
- snprintf(event_name, PATH_MAX, "_e_delayed_action_notify(%d)", obs->event);
- ecore_add_event_timer(event_name, eda->delay(), eda->delay_func, 0, obj);
-
- D_RETURN;
- UN(event);
- UN(data);
-}
-
-void
-e_delayed_action_cancel(E_Delayed_Action * eda)
-{
- char event_name[PATH_MAX];
-
- D_ENTER;
-
- snprintf(event_name, PATH_MAX, "_e_delayed_action_notify(%d)",
- E_OBSERVER(eda)->event);
- ecore_del_event_timer(event_name);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_DELAYED_H
-#define E_DELAYED_H
-
-#include "e.h"
-#include "observer.h"
-
-typedef void (*E_Delay_Func) (int val, void *obj);
-typedef float (*E_Delay_Val) ();
-
-typedef struct _e_delayed_action
-{
- E_Observer obs;
-
- E_Delay_Val delay;
- E_Delay_Func delay_func;
-
-}
-E_Delayed_Action;
-
-E_Delayed_Action *e_delayed_action_new(E_Event_Type event,
- E_Delay_Val delay,
- E_Delay_Func delay_func);
-
-void e_delayed_action_start(E_Observer * obs, E_Observee * obj,
- E_Event_Type event, void *data);
-void e_delayed_action_cancel(E_Delayed_Action * eda);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "config.h"
-#include "actions.h"
-#include "border.h"
-#include "view.h"
-#include "icccm.h"
-#include "util.h"
-#include "object.h"
-#include "e_view_look.h"
-#include "e_view_machine.h"
-#include "menubuild.h"
-#include "globals.h"
-#include "desktops.h"
-
-static E_Desktop *current_desk = NULL;
-static Evas_List *sticky_list = NULL;
-static Evas_List *desktops = NULL;
-static Window e_base_win = 0;
-static int screen_w, screen_h;
-static int mouse_x, mouse_y;
-
-static void e_idle(void *data);
-static void e_mouse_move(Ecore_Event * ev);
-static void e_mouse_down(Ecore_Event * ev);
-static void e_mouse_up(Ecore_Event * ev);
-static void e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o,
- void *event_info);
-static void e_window_expose(Ecore_Event * ev);
-void e_desktop_layout_reload(E_Desktop * d);
-
-static void
-e_scroller_timer(int val, void *data)
-{
- int ok = 0;
- int resist;
- int scroll_speed;
- static double last_time = 0.0;
- double t;
- E_Desktop *desk;
-
- D_ENTER;
-
- resist = config_data->desktops->resist;
- scroll_speed = config_data->desktops->speed;
-
- t = ecore_get_time();
- if (val != 0)
- scroll_speed = (int)(((t - last_time) / 0.02) * (double)scroll_speed);
- last_time = t;
-
- ok = 0;
- desk = current_desk;
- if (!desk)
- D_RETURN;
- if (mouse_x >= (screen_w - resist))
- {
- int scroll = 0;
-
- if ((desk->desk.area.x + desk->virt.w) > screen_w)
- scroll = desk->desk.area.x + desk->virt.w - screen_w;
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_desktops_scroll(desk, -scroll, 0);
- ok = 1;
- }
- }
- else if (mouse_x < resist)
- {
- int scroll = 0;
-
- if (desk->desk.area.x < 0)
- scroll = -desk->desk.area.x;
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_desktops_scroll(desk, scroll, 0);
- ok = 1;
- }
- }
- if (mouse_y >= (screen_h - resist))
- {
- int scroll = 0;
-
- if ((desk->desk.area.y + desk->virt.h) > screen_h)
- scroll = desk->desk.area.y + desk->virt.h - screen_h;
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_desktops_scroll(desk, 0, -scroll);
- ok = 1;
- }
- }
- else if (mouse_y < resist)
- {
- int scroll = 0;
-
- if (desk->desk.area.y < 0)
- scroll = -desk->desk.area.y;
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_desktops_scroll(desk, 0, scroll);
- ok = 1;
- }
- }
- if ((ok))
- ecore_add_event_timer("desktop_scroller", 0.02, e_scroller_timer, val + 1,
- NULL);
-
- D_RETURN;
- UN(data);
-}
-
-Window
-e_desktop_window()
-{
- return e_base_win;
-}
-
-void
-e_desktops_init(void)
-{
- int i;
- E_Desktop *desk;
-
- D_ENTER;
-
- ecore_window_get_geometry(0, NULL, NULL, &screen_w, &screen_h);
- e_base_win = ecore_window_input_new(0, 0, 0, screen_w, screen_h);
- ecore_window_set_events(e_base_win, XEV_CHILD_REDIRECT | XEV_PROPERTY |
- XEV_COLORMAP | XEV_FOCUS | XEV_KEY |
- XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT);
- ecore_window_set_events_propagate(e_base_win, True);
- ecore_window_show(e_base_win);
-
- D("Creating %d desktops\n", config_data->desktops->count);
- for (i = 0; i < config_data->desktops->count; i++)
- desk = e_desktops_new(i);
-
- current_desk = desktops->data;
-
- e_icccm_advertise_e_compat();
- /* todo
- e_icccm_advertise_mwm_compat();
- e_icccm_advertise_gnome_compat();
- e_icccm_advertise_kde_compat();
- e_icccm_advertise_net_compat();
- */
-
- e_icccm_set_desk_area_size(0, 1, 1);
- e_icccm_set_desk_area(0, 0, 0);
- e_icccm_set_desk(0, 0);
-
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
-
- ecore_event_filter_idle_handler_add(e_idle, NULL);
-
- D_RETURN;
-}
-
-void
-e_desktops_scroll(E_Desktop * desk, int dx, int dy)
-{
- /* Evas_List * l;
- int xd, yd, wd, hd;
- int grav, grav_stick; */
- int scroll_sticky;
-
- D_ENTER;
-
- scroll_sticky = config_data->desktops->scroll_sticky;
-
- if ((dx == 0) && (dy == 0))
- D_RETURN;
- desk->x -= dx;
- desk->y -= dy;
-
- e_borders_scroll_list(desk->windows, dx, dy);
- if (scroll_sticky)
- e_borders_scroll_list(sticky_list, dx, dy);
-
- desk->desk.area.x += dx;
- desk->desk.area.y += dy;
-
- e_bg_set_scroll(desk->bg, desk->desk.area.x, desk->desk.area.y);
-
- D_RETURN;
-}
-
-void
-e_desktops_cleanup(E_Desktop * desk)
-{
- D_ENTER;
-
- while (desk->windows)
- {
- E_Border *b;
-
- b = desk->windows->data;
- e_action_stop_by_object(E_OBJECT(b), NULL, 0, 0, 0, 0);
-
- if (e_object_get_usecount(E_OBJECT(b)) == 1)
- e_border_release(b);
- e_object_unref(E_OBJECT(b));
- }
-
- if (desk->iconbar)
- {
- /* e_iconbar_save_out_final(desk->iconbar); */
- e_object_unref(E_OBJECT(desk->iconbar));
- }
-
- if (desk->look)
- e_object_unref(E_OBJECT(desk->look));
-
- if (desk->bg)
- e_bg_free(desk->bg);
-
- if (desk->evas)
- evas_free(desk->evas);
-
- IF_FREE(desk->name);
- IF_FREE(desk->dir);
-
- e_object_cleanup(E_OBJECT(desk));
-
- D_RETURN;
-}
-
-void
-e_desktop_adaptor_cleanup(void *adaptor)
-{
- e_object_cleanup(E_OBJECT(adaptor));
-}
-
-void
-e_desktop_file_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data)
-{
- E_Desktop_Adaptor *a = (E_Desktop_Adaptor *) obs;
-
- D_ENTER;
-
- if(a&&a->desktop) {
- char *mn=a->desktop->name?a->desktop->name:"";
- if (event & E_EVENT_BG_CHANGED) {
- D("background_reload: %s\n",mn);
- e_desktop_bg_reload(a->desktop); }
- else if (event & E_EVENT_ICB_CHANGED) {
- D("iconbar_reload: %s\n",mn);
- e_desktop_ib_reload(a->desktop); }
- else if (event & E_EVENT_LAYOUT_CHANGED) {
- D("layout_reload: %s\n",mn);
- e_desktop_layout_reload(a->desktop); }}
-#ifdef DEBUG
- else { /* add'l debug foo. technically, a, a->desktop should always be
- set, it's only a->desktop->name that we really worry about.
- Azundris 2003/01/11 */
- if(a) {
- D("e_desktop_file_event_handler: E_Desktop_Adaptor->desktop not set, "); }
- else {
- D("e_desktop_file_event_handler: E_Desktop_Adaptor not set, "); }
-
- if (event & E_EVENT_BG_CHANGED) {
- D("BG_CHANGED\n"); }
- else if (event & E_EVENT_ICB_CHANGED) {
- D("ICB_CHANGED\n"); }
- else if (event & E_EVENT_LAYOUT_CHANGED) {
- D("LAYOUT_CHANGED\n"); }
- else { D(" (unknown event-type)\n"); }}
-#endif
-
- D_RETURN;
- UN(o);
- UN(data);
-}
-
-/* 2002/04/23 Azundris <hacks@azundris.com> Transparency for legacy apps
- *
- * Since we have new fancy ways of drawing stuff, we technically don't
- * use the root window any more, in the X meaning of the word. This
- * results in legacy apps (xchat, xemacs, konsole, ...) failing to find
- * a root pixmap, thereby breaking pseudo-transparency. Since we're
- * using a pixmap below anyway, we may as well export it to unbreak
- * the legacy thingies. This code reuses parts of Esetroot (written
- * by Nat Friedman <ndf@mit.edu> with modifications by Gerald Britton
- * <gbritton@mit.edu> and Michael Jennings <mej@eterm.org>). raster
- * intensely dislikes the pseudo-transparency hacks, so don't go to him
- * if you need to discuss them. : )
- * */
-
-static void
-e_desktops_set_fake_root(Pixmap p)
-{
- Display *Xdisplay;
- Screen *scr;
- Window Xroot;
- int screen;
- Atom prop_root, prop_esetroot, type;
- int format;
- unsigned long length, after;
- unsigned char *data_root, *data_esetroot;
-
- D_ENTER;
-
- Xdisplay = ecore_display_get();
-
- screen = DefaultScreen(Xdisplay);
- Xroot = RootWindow(Xdisplay, screen);
- scr = ScreenOfDisplay(Xdisplay, screen);
-
- ecore_grab();
-
- prop_root = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
- prop_esetroot = XInternAtom(Xdisplay, "ESETROOT_PMAP_ID", True);
-
- if (prop_root != None && prop_esetroot != None)
- {
- XGetWindowProperty(Xdisplay, Xroot, prop_root, 0L, 1L, False,
- AnyPropertyType, &type, &format, &length, &after,
- &data_root);
- if (type == XA_PIXMAP)
- {
- XGetWindowProperty(Xdisplay, Xroot, prop_esetroot, 0L, 1L, False,
- AnyPropertyType, &type, &format, &length,
- &after, &data_esetroot);
- if (data_root && data_esetroot)
- {
- if (type == XA_PIXMAP
- && *((Pixmap *) data_root) == *((Pixmap *) data_esetroot))
- {
- XKillClient(Xdisplay, *((Pixmap *) data_root));
- }
- }
- }
- }
-
- /* This will locate the property, creating it if it doesn't exist */
- prop_root = XInternAtom(Xdisplay, "_XROOTPMAP_ID", False);
- prop_esetroot = XInternAtom(Xdisplay, "ESETROOT_PMAP_ID", False);
-
- /* The call above should have created it. If that failed, we can't
- * continue. */
- if (prop_root == None || prop_esetroot == None)
- {
- fprintf(stderr,
- "E17: Creation of pixmap property failed in internal Esetroot.\n");
- D_RETURN;
- }
-
- XChangeProperty(Xdisplay, Xroot, prop_root, XA_PIXMAP, 32, PropModeReplace,
- (unsigned char *)&p, 1);
- XChangeProperty(Xdisplay, Xroot, prop_esetroot, XA_PIXMAP, 32,
- PropModeReplace, (unsigned char *)&p, 1);
- XSetCloseDownMode(Xdisplay, RetainPermanent);
- ecore_flush();
-
- ecore_window_set_background_pixmap(0, p);
- ecore_window_clear(0);
- ecore_ungrab();
- ecore_flush();
-
- D_RETURN;
-}
-
-void
-e_desktop_bg_reload(E_Desktop * d)
-{
- E_Background bg = NULL;
-
- /* This should only be called if the background did really
- * change in the underlying dir. We dont check again
- * here. */
- D_ENTER;
-
- if (!d || !d->look)
- D_RETURN;
-
- /* nuke the old one */
- if (d->bg)
- {
- int size;
-
- e_bg_free(d->bg);
- d->bg = NULL;
- /*
- * FIXME: Do we need to do all this flushing? Doesn't evas do some
- * time stamp comparisons?
- */
- if (d->evas)
- {
- size = evas_image_cache_get(d->evas);
- evas_image_cache_flush(d->evas);
- evas_image_cache_set(d->evas, size);
- }
- e_db_flush();
- }
-
- if (d->look->obj->bg)
- {
- bg = e_bg_load(d->look->obj->bg);
- }
- else
- {
- /* Our look doesnt provide a bg, falls back */
- char buf[PATH_MAX];
- snprintf(buf, PATH_MAX, "%s/default.bg.db", e_config_get("backgrounds"));
- bg = e_bg_load(buf);
- }
-
- if (bg)
- {
- d->bg = bg;
- if (d->evas)
- {
- e_bg_add_to_evas(d->bg, d->evas);
- e_bg_set_scroll(d->bg, d->desk.area.x, d->desk.area.y);
- e_bg_set_layer(d->bg, 100);
- e_bg_resize(d->bg, d->real.w, d->real.h);
-
- e_bg_callback_add(d->bg, EVAS_CALLBACK_MOUSE_UP, e_bg_up_cb, d);
-
- e_bg_show(d->bg);
- }
- }
-
- evas_damage_rectangle_add(d->evas, 0, 0, d->real.w, d->real.h);
- e_desktop_update(d);
-
- D_RETURN;
-}
-
-void
-e_desktop_layout_reload(E_Desktop * d)
-{
- D_ENTER;
- if (!d || !d->look)
- D_RETURN;
-
- if (e_object_unref(E_OBJECT(d->layout)) == 0)
- d->layout = NULL;
-
- /* try load a new layout */
- d->layout = e_view_layout_new(d);
-
- /* if the layout loaded and theres an evas - we're realized */
- /* so realize the layout */
- if ((d->layout) && (d->evas))
- e_view_layout_realize(d->layout);
-
- e_view_layout_update(d->layout);
-
- D_RETURN;
-}
-
-void
-e_desktop_ib_reload(E_Desktop * d)
-{
- D_ENTER;
-
- /* if we have an iconbar.. well nuke it */
- if (e_object_unref(E_OBJECT(d->iconbar)) == 0)
- d->iconbar = NULL;
-
- /* no iconbar in our look */
- if(!d->look->obj->icb || !d->look->obj->icb_bits)
- D_RETURN;
-
- /* try load a new iconbar */
- if (!d->iconbar)
- d->iconbar = e_iconbar_new(d);
-
- /* if the iconbar loaded and theres an evas - we're realized */
- /* so realize the iconbar */
- if ((d->iconbar) && (d->evas))
- e_iconbar_realize(d->iconbar);
-
- D_RETURN;
-}
-
-E_Desktop *
-e_desktops_new(int i)
-{
- char buf[PATH_MAX];
- /* E_Border *b; */
- E_Desktop *desk;
- E_View_Look *l;
- static Pixmap background = 0;
- Evas_Engine_Info_Software_X11 *einfo;
-
- D_ENTER;
-
- desk = NEW(E_Desktop, 1);
- ZERO(desk, E_Desktop, 1);
-
- e_observee_init(E_OBSERVEE(desk), (E_Cleanup_Func) e_desktops_cleanup);
-
- desk->x = 0;
- desk->y = 0;
- desk->real.w = screen_w;
- desk->real.h = screen_h;
- desk->virt.w = config_data->desktops->width * screen_w;
- desk->virt.h = config_data->desktops->height * screen_h;
- desk->desk.desk = i;
-
- if (!background)
- {
- background = ecore_pixmap_new(0, screen_w, screen_h, 0);
- e_desktops_set_fake_root(background);
- }
-
- desk->evas = evas_new();
- evas_output_method_set(desk->evas, evas_render_method_lookup("software_x11"));
- evas_output_size_set(desk->evas, screen_w, screen_h);
- evas_output_viewport_set(desk->evas, 0, 0, screen_w, screen_h);
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(desk->evas);
- einfo->info.display = ecore_display_get();
- einfo->info.visual = DefaultVisual(einfo->info.display,
- DefaultScreen(einfo->info.display));
- einfo->info.colormap = DefaultColormap(einfo->info.display,
- DefaultScreen(einfo->info.display));
-
- einfo->info.drawable = background;
- einfo->info.depth = DefaultDepth(einfo->info.display,
- DefaultScreen(einfo->info.display));
- einfo->info.rotation = 0;
- einfo->info.debug = 0;
- evas_engine_info_set(desk->evas, (Evas_Engine_Info *) einfo);
-
- snprintf(buf, PATH_MAX, "%sdesktop/%d/.e_layout", e_config_user_dir(), i);
- if (!(l = e_view_machine_look_lookup(buf)))
- desk->look = e_view_look_new();
- else
- {
- desk->look = l;
- e_object_ref(E_OBJECT(desk->look));
- }
-
- e_view_look_set_dir(desk->look, buf);
-
- /* experimental, Azundris 2003/01/11 */
- if(!desk->name) {
- size_t l=0;
- int j=10,k=1;
- while(i>=j) {
- j*=10;
- k++; }
-#define DESK_DFLT_NAME "Desk "
- if((desk->name=malloc(l=sizeof(DESK_DFLT_NAME)+k)))
- snprintf(desk->name,l,"%s%d",DESK_DFLT_NAME,i); }
-
- /* The adaptor allows us to watch the look for events, while keeping the
- * desktop an observable object */
- desk->adaptor = NEW(E_Desktop_Adaptor, 1);
- e_observer_init(E_OBSERVER(desk->adaptor),
- E_EVENT_BG_CHANGED | E_EVENT_ICB_CHANGED | E_EVENT_LAYOUT_CHANGED,
- e_desktop_file_event_handler, e_desktop_adaptor_cleanup);
- desk->adaptor->desktop = desk;
- e_observer_register_observee(E_OBSERVER(desk->adaptor), E_OBSERVEE(desk->look->obj));
-
- e_desktop_bg_reload(desk);
-
- ecore_window_set_background_pixmap(0, background);
- ecore_window_clear(0);
- desktops = evas_list_append(desktops, desk);
-
- D_RETURN_(desk);
-}
-
-void
-e_desktops_add_border(E_Desktop * d, E_Border * b)
-{
- D_ENTER;
-
- if ((!d) || (!b))
- D_RETURN;
-
- if (!evas_list_find(d->windows, b))
- {
- b->desk = d;
- b->client.desk = d->desk.desk;
- b->client.area.x = d->desk.area.x;
- b->client.area.y = d->desk.area.y;
- }
- e_border_raise(b);
-
- D_RETURN;
-}
-
-void
-e_desktops_add_sticky(E_Border *b)
-{
- D_ENTER;
-
- if (b->desk)
- e_desktops_del_border(b->desk, b);
- if (!evas_list_find(sticky_list, b))
- sticky_list = evas_list_append(sticky_list, b);
-
- D_RETURN;
-}
-
-
-void
-e_desktops_rm_sticky(E_Border *b)
-{
- D_ENTER;
-
- if (evas_list_find(sticky_list, b))
- {
- sticky_list = evas_list_remove(sticky_list, b);
- e_desktops_add_border(current_desk, b);
- }
-
- D_RETURN;
-}
-
-
-void
-e_desktops_del_border(E_Desktop * d, E_Border * b)
-{
- D_ENTER;
-
- if ((!d) || (!b))
- D_RETURN;
- d->windows = evas_list_remove(d->windows, b);
- b->desk = NULL;
-
- D_RETURN;
-}
-
-E_Border *
-e_desktop_raise_next_border(void)
-{
- Evas_List * next;
- E_Border *start;
- E_Border *current;
-
- D_ENTER;
-
- if (!current_desk || !current_desk->windows)
- D_RETURN_(NULL);
-
- start = current = e_border_current_focused();
- if (!start)
- start = current = current_desk->windows->data;
-
- /* Find the current border on the list of borders */
- for (next = current_desk->windows; next && next->data != current; next = next->next);
-
- /* Step to the next border, wrap around the queue if the end is reached */
- if (next && next->next)
- next = next->next;
- else
- next = current_desk->windows;
-
- /* Now find the next viewable border on the same desktop */
- current = (E_Border *) next->data;
- while ((current != start) && (!e_border_viewable(current)))
- {
- next = next->next;
- if (!next)
- next = current_desk->windows;
-
- current = (E_Border *) next->data;
- }
-
- e_border_raise(current);
- e_icccm_send_focus_to(current->win.client, current->client.takes_focus);
-
- D_RETURN_(current);
-}
-
-void
-e_desktops_delete(E_Desktop * d)
-{
- D_ENTER;
-
- e_object_unref(E_OBJECT(d));
-
- D_RETURN;
-}
-
-void
-e_desktops_show(E_Desktop * d)
-{
- D_ENTER;
-
- e_bg_show(d->bg);
- evas_damage_rectangle_add(d->evas, 0, 0, d->real.w, d->real.h);
- e_desktop_update(d);
-
- D_RETURN;
-}
-
-void
-e_desktops_hide(E_Desktop * d)
-{
- D_ENTER;
-
- e_bg_hide(d->bg);
-
- D_RETURN;
- UN(d);
-}
-
-int
-e_desktops_get_num(void)
-{
- D_ENTER;
- D_RETURN_(config_data->desktops->count);
-}
-
-E_Desktop *
-e_desktops_get(int d)
-{
- Evas_List * l;
- int i;
-
- D_ENTER;
-
- for (i = 0, l = desktops; l; l = l->next, i++)
- {
- if (i == d)
- D_RETURN_((E_Desktop *) l->data);
- }
-
- D_RETURN_(NULL);
-}
-
-int
-e_desktops_get_current(void)
-{
- D_ENTER;
-
- if (current_desk)
- D_RETURN_(current_desk->desk.desk);
-
- D_RETURN_(0);
-}
-
-void
-e_desktops_goto_desk(int d)
-{
- D_ENTER;
-
- e_desktops_goto(d, 0, 0);
-
- D_RETURN;
-}
-
-void
-e_desktops_goto(int d, int ax, int ay)
-{
- E_Desktop *desk;
-
- D_ENTER;
-
- D("Switching to desktop %d at %d, %d\n", d, ax, ay);
- desk = e_desktops_get(d);
- if (desk)
- {
- int dx, dy;
- Evas_List *l;
- E_Border *b;
-
- if ((d == current_desk->desk.desk))
- D_RETURN;
-
- dx = ax - desk->desk.area.x;
- dy = ay - desk->desk.area.y;
-
- for (l = current_desk->windows; l; l = l->next)
- {
- b = l->data;
- if ((!b->client.iconified) && (!b->mode.move))
- {
- if (b->current.requested.visible)
- {
- b->current.requested.visible = 0;
- b->changed = 1;
- }
- }
- else if ((!b->client.iconified) && (b->mode.move))
- {
- e_desktops_del_border(current_desk, b);
- b->client.desk = desk;
- e_desktops_add_border(desk, b);
- b->current.requested.visible = 1;
- b->changed = 1;
- }
- }
-
- for (l = desk->windows; l; l = l->next)
- {
- b = l->data;
- if ((!b->mode.move) && (!b->client.iconified))
- {
- if (!b->current.requested.visible)
- {
- b->current.requested.visible = 1;
- b->changed = 1;
- }
- }
- }
-
- e_border_update_borders();
-
- e_desktops_scroll(desk, dx, dy);
- dx = current_desk->desk.area.x - desk->desk.area.x;
- dy = current_desk->desk.area.y - desk->desk.area.y;
- e_borders_scroll_list(sticky_list, dx, dy);
-
- e_desktops_hide(current_desk);
- e_desktops_show(desk);
- current_desk = desk;
-
- e_border_check_select();
-
- e_icccm_set_desk_area(0, desk->desk.area.x, desk->desk.area.y);
- e_icccm_set_desk(0, desk->desk.desk);
- e_observee_notify_observers(E_OBSERVEE(desk), E_EVENT_DESKTOP_SWITCH, NULL);
- }
-
- D_RETURN;
-}
-
-Evas_List *
-e_desktops_get_desktops_list()
-{
- D_ENTER;
- D_RETURN_(desktops);
-}
-
-void
-e_desktop_update(E_Desktop *d)
-{
- Evas_Rectangle *u;
- Evas_List *up, *fp;
-
- D_ENTER;
-
- fp = up = evas_render_updates(d->evas);
- /* special code to handle if we are double buffering to a pixmap */
- /* and clear sections of the window if they got updated */
- while (up)
- {
- u = up->data;
- ecore_window_clear_area(0, u->x, u->y, u->w, u->h);
- up = evas_list_next(up);
- }
-
- if (fp)
- evas_render_updates_free(fp);
-
- D_RETURN;
-}
-
-/* handling expose events */
-static void
-e_window_expose(Ecore_Event * ev)
-{
- Ecore_Event_Window_Expose *e;
-
- D_ENTER;
-
- e = ev->event;
-/* if (e->win == DefaultRootWindow(ecore_display_get())) */
- if (e->win == e_base_win)
- e_desktop_update(current_desk);
-
- D_RETURN;
-}
-
-/**
- * e_mouse_down - Handle mouse down events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- D_ENTER;
-
- e = ev->event;
-/* if (e->win == DefaultRootWindow(ecore_display_get())) */
- if (e->win == e_base_win)
- {
- evas_event_feed_mouse_down(current_desk->evas, e->button);
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_up - Handle mouse up events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- D_ENTER;
-
- e = ev->event;
-/* if (e->win == DefaultRootWindow(ecore_display_get())) */
- if (e->win == e_base_win)
- {
- evas_event_feed_mouse_up(current_desk->evas, e->button);
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_move - Handle mouse move events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
-
- D_ENTER;
-
- e = ev->event;
- mouse_x = e->rx;
- mouse_y = e->ry;
- if (config_data->desktops->scroll)
- e_scroller_timer(0, NULL);
-/* if (e->win == DefaultRootWindow(ecore_display_get())) */
- if (e->win == e_base_win)
- {
- evas_event_feed_mouse_move(current_desk->evas, e->x, e->y);
- }
-
- D_RETURN;
-}
-
-static void
-e_idle(void *data)
-{
- D_ENTER;
-
- e_desktop_update(current_desk);
-
- D_RETURN;
- UN(data);
-}
-
-static void
-e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Desktop *d;
- int dx, dy;
- Evas_Event_Mouse_Up *ev_info = event_info;
-
- D_ENTER;
-
- d = _data;
- dx = 0;
- dy = 0;
- ecore_pointer_xy_get(&dx, &dy);
- if (ev_info->button == 1)
- {
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- char *apps_menu_db;
-
- apps_menu_db = e_config_get("apps_menu");
- if (apps_menu_db)
- buildmenu = e_build_menu_new_from_db(apps_menu_db);
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
- if (menu)
- {
- e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
- }
- }
- }
- else if (ev_info->button == 2)
- {
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- D("building iconified windows menu\n");
- buildmenu = e_build_menu_new_from_iconified_borders();
- }
- if (buildmenu && buildmenu->changed)
- {
- D("buildmenu changed! rebuild!\n");
- e_build_menu_iconified_borders_rebuild(buildmenu);
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
- if (menu)
- {
- D("showing iconified window menu\n");
- e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
- }
- }
- }
- else if (ev_info->button == 3)
- {
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- buildmenu =
- e_build_menu_new_from_gnome_apps("/usr/share/gnome/apps");
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
- if (menu)
- e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
- }
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
+++ /dev/null
-#ifndef E_DESKTOPS_H
-#define E_DESKTOPS_H
-
-#include "e.h"
-#include "border.h"
-#include "object.h"
-
-#ifndef E_DESKTOPS_TYPEDEF
-#define E_DESKTOPS_TYPEDEF
-typedef struct _E_Desktop E_Desktop;
-#endif
-
-#include "view_layout.h"
-
-#ifndef E_DESKTOPS_ADAPTOR_TYPEDEF
-#define E_DESKTOPS_ADAPTOR_TYPEDEF
-typedef struct _E_Desktop_Adaptor E_Desktop_Adaptor;
-#endif
-
-struct _E_Desktop
-{
- E_Observee obs;
-
- char *name;
- char *dir;
-/* struct
- {
- Window main;
- }
- win; */
- int x, y;
- struct
- {
- int w, h;
- }
- real , virt;
- Evas_List * windows;
- struct
- {
- int desk;
- struct
- {
- int x, y;
- }
- area;
- }
- desk;
- E_Desktop_Adaptor *adaptor;
- Evas *evas;
- E_View_Layout *layout;
- E_View_Look *look;
- E_Background bg;
- E_Iconbar *iconbar;
-/* int changed; */
-};
-
-struct _E_Desktop_Adaptor
-{
- E_Observer obsvr;
- E_Desktop *desktop;
-};
-
-/**
- * e_desktops_init - Initializes desktop handling.
- *
- * This function creates the necessary windows for desktop handling,
- * and makes sure they're visible and lowered. It does not handle
- * the loading of background graphics information. It also makes
- * sure E rregisters itself as being compatible to GNOME, KDE etc.
- */
-void e_desktops_init(void);
-
-void e_desktops_scroll(E_Desktop * desk, int dx, int dy);
-void e_desktops_free(E_Desktop * desk);
-
-E_Desktop *e_desktops_new(int i);
-void e_desktops_add_border(E_Desktop * d, E_Border * b);
-void e_desktops_add_sticky(E_Border *b);
-void e_desktops_rm_sticky(E_Border *b);
-void e_desktops_del_border(E_Desktop * d, E_Border * b);
-void e_desktops_delete(E_Desktop * d);
-void e_desktops_show(E_Desktop * d);
-void e_desktops_hide(E_Desktop * d);
-
-/**
- * e_desktops_get_num - Returns number of desktops.
- */
-int e_desktops_get_num(void);
-
-/**
- * e_desktops_get - Returns nth desktop
- * @d: The number of the desktop to get
- *
- * The desktops are stored in a linked list. This function
- * returns the nth of those desktops, NULL if no desktop
- * was found at that index.
- */
-E_Desktop *e_desktops_get(int d);
-
-int e_desktops_get_current(void);
-void e_desktops_goto_desk(int d);
-void e_desktops_goto(int d, int ax, int ay);
-Evas_List *e_desktops_get_desktops_list();
-void e_desktop_bg_reload(E_Desktop * d);
-void e_desktop_ib_reload(E_Desktop * d);
-void e_desktop_update(E_Desktop *d);
-E_Border *e_desktop_raise_next_border(void);
-Window e_desktop_window();
-
-#endif
+++ /dev/null
-#ifndef ENLIGHTENMENT_H
-#define ENLIGHTENMENT_H
-
-#include "../config.h"
-#include <X11/Xlib.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <math.h>
-#include <limits.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ipc.h>
-#include <sys/msg.h>
-#include <dirent.h>
-#include <errno.h>
-#include <signal.h>
-#include <fnmatch.h>
-#ifdef WITH_DMALLOC
-#include <dmalloc.h>
-#endif
-#include <Imlib2.h>
-#include <Evas.h>
-#include <Evas_Engine_Software_X11.h>
-#include <Ebits.h>
-#include <Ecore.h>
-#include <Edb.h>
-#include <Ebg.h>
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-#if 0
-#include <execinfo.h>
-#define BT \
-{ \
-void *__BT_array[250]; \
-int __BT_n = backtrace(__BT_array,250); \
-backtrace_symbols_fd(__BT_array, __BT_n, fileno(stdout)); \
-}
-#endif
-
-/* macros for allowing sections of code to be runtime profiled */
-#define E_PROF 1
-#ifdef E_PROF
-extern Evas_List * __e_profiles;
-
-typedef struct _e_prof
-{
- char *func;
- double total;
- double t1, t2;
-}
-E_Prof;
-
-#define E_PROF_START(_prof_func) \
-{ \
-E_Prof __p, *__pp; \
-Evas_List * __pl; \
-__p.func = _prof_func; \
-__p.total = 0.0; \
-__p.t1 = ecore_get_time(); \
-__p.t2 = 0.0;
-
-#define E_PROF_STOP \
-__p.t2 = ecore_get_time(); \
-for (__pl = __e_profiles; __pl; __pl = __pl->next) \
-{ \
-__pp = __pl->data; \
-if (!strcmp(__p.func, __pp->func)) \
-{ \
-__pp->total += (__p.t2 - __p.t1); \
-break; \
-} \
-} \
-if (!__pl) \
-{ \
-__pp = NEW(E_Prof, 1); \
-__pp->func = __p.func; \
-__pp->total = __p.t2 - __p.t1; \
-__pp->t1 = 0.0; \
-__pp->t2 = 0.0; \
-__e_profiles = evas_list_append(__e_profiles, __pp); \
-} \
-}
-#define E_PROF_DUMP \
-{ \
-Evas_List * __pl; \
-for (__pl = __e_profiles; __pl; __pl = __pl->next) \
-{ \
-E_Prof *__p; \
-__p = __pl->data; \
-printf("%3.3f : %s()\n", __p->total, __p->func); \
-} \
-}
-#else
-#define E_PROF_START(_prof_func)
-#define E_PROF_STOP
-#define E_PROF_DUMP
-#endif
-
-#endif
+++ /dev/null
-#include "file.h"
-#include "desktops.h"
-#include "e_dir.h"
-#include "e_view_machine.h"
-#include "view.h"
-#include "icons.h"
-#include "util.h"
-#include "libefsd.h"
-#include "e_file.h"
-#include "globals.h"
-
-static void e_dir_handle_fs_restart(void *data);
-static void e_dir_handle_fs(EfsdEvent * ev);
-static void e_dir_handle_efsd_event_reply(EfsdEvent * ev);
-static void e_dir_handle_efsd_event_reply_stat(EfsdEvent * ev);
-static void e_dir_handle_efsd_event_reply_readlink(EfsdEvent * ev);
-static void e_dir_handle_efsd_event_reply_getfiletype(EfsdEvent * ev);
-static void e_dir_handle_efsd_event_reply_getmeta(EfsdEvent * ev);
-
-static void e_dir_cleanup(E_Dir * d);
-
-void
-e_dir_init(void)
-{
- D_ENTER;
- e_fs_add_event_handler(e_dir_handle_fs);
- D_RETURN;
-}
-
-static void
-e_dir_cleanup(E_Dir * d)
-{
- D_ENTER;
-
- if (!d)
- D_RETURN;
-
- efsd_stop_monitor(e_fs_get_connection(), d->dir, TRUE);
- if (d->restarter)
- e_fs_del_restart_handler(d->restarter);
-
- d->restarter = NULL;
- e_view_machine_unregister_dir(d);
-
- e_object_cleanup(E_OBJECT(d));
-
- D_RETURN;
-}
-
-E_Dir *
-e_dir_new(void)
-{
- E_Dir *d;
-
- D_ENTER;
-
- d = NEW(E_Dir, 1);
- ZERO(d, E_Dir, 1);
- d->dir = NULL;
-
- e_observee_init(E_OBSERVEE(d),
- (E_Cleanup_Func) e_dir_cleanup);
-
- e_view_machine_register_dir(d);
- D_RETURN_(d);
-}
-
-static void
-e_dir_handle_fs_restart(void *data) {
- E_Dir *d;
-
- D_ENTER;
-
- D("e_dir_handle_fs_restart\n");
-
- if((d = data)) {
- if(d->dir&&*(d->dir)) {
- if (e_fs_get_connection()) {
- EfsdOptions *ops;
-
- /* FIXME restart with metadata pending for views */
-
- ops = efsd_ops(3,
- efsd_op_get_stat(),
- efsd_op_get_filetype(), efsd_op_list_all());
- if((d->monitor_id=efsd_start_monitor(e_fs_get_connection(), d->dir,
- ops, TRUE))<0) {
- D("could not restart monitor (connx %p) for \"%s\" => %i\n",
- e_fs_get_connection(), d->dir, d->monitor_id); }
- else {
- D("restarted monitor (connx %p) for \"%s\" => ID %i...\n",
- e_fs_get_connection(), d->dir, d->monitor_id); }}
- else {
- D("could not restart, connection refused\n"); }}
- else {
- D("could not restart, no dir given!?\n"); }}
- else {
- D("could not restart, no data\n"); }
-
- D_RETURN; }
-
-void
-e_dir_set_dir(E_Dir * d, char *dir)
-{
- D_ENTER;
-
- if (!d) {
- D("e_dir_set_dir -- no E_Dir!\n");
- D_RETURN; }
-
- /* stop monitoring old dir */
- if ((d->dir) && (d->monitor_id))
- {
- efsd_stop_monitor(e_fs_get_connection(), d->dir, TRUE);
- d->monitor_id = 0;
- }
- IF_FREE(d->dir);
-
- if(!dir||!*dir) {
- D("e_dir_set_dir -- no dir!\n");
- D_RETURN; }
-
- d->dir = e_file_realpath(dir);
-
- if(!d->dir||!*(d->dir)) {
- /* realpath failed. this would mean that we tried to set a monitor
- on a non-existent (or inacessible) file. this may mean that the
- programmer really meant "...and if it doesn't exist YET, tell me
- if and when it is created", so rather than failing right here and
- now, we'll forget about the realpath, stick in the path they
- requested in the first place, and hope the backend actually supports
- watching something it cannot determine an inode for... we'll still
- throw a warning though, just for good measure. Azundris 2003/01/11 */
- D("e_dir_set_dir -- e_file_realpath(\"%s\") failed...\n",dir);
- if(d->dir)
- free(d->dir);
- if(!(d->dir=strdup(dir))) {
- D("e_dir_set_dir: OOM\n");
- D_RETURN; }}
-
- /* start monitoring new dir */
- d->restarter = e_fs_add_restart_handler(e_dir_handle_fs_restart, d);
- if (e_fs_get_connection())
- {
- EfsdOptions *ops;
-
- ops = efsd_ops(3,
- efsd_op_get_stat(),
- efsd_op_get_filetype(), efsd_op_list_all());
- d->monitor_id = efsd_start_monitor(e_fs_get_connection(), d->dir,
- ops, TRUE);
- D("monitor id for \"%s\" = %i\n", d->dir, d->monitor_id);
- }
- D_RETURN;
-}
-
-static void
-e_dir_handle_fs(EfsdEvent * ev)
-{
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- switch (ev->type)
- {
- case EFSD_EVENT_FILECHANGE:
- switch (ev->efsd_filechange_event.changetype)
- {
- case EFSD_FILE_CREATED:
- e_dir_file_added(ev->efsd_filechange_event.id,
- ev->efsd_filechange_event.file);
- break;
- case EFSD_FILE_EXISTS:
- e_dir_file_added(ev->efsd_filechange_event.id,
- ev->efsd_filechange_event.file);
- break;
- case EFSD_FILE_DELETED:
- e_dir_file_deleted(ev->efsd_filechange_event.id,
- ev->efsd_filechange_event.file);
- break;
- case EFSD_FILE_CHANGED:
- e_dir_file_changed(ev->efsd_filechange_event.id,
- ev->efsd_filechange_event.file);
- break;
- case EFSD_FILE_MOVED:
- e_dir_file_moved(ev->efsd_filechange_event.id,
- ev->efsd_filechange_event.file);
- break;
- case EFSD_FILE_END_EXISTS:
- break;
- default:
- break;
- }
- break;
- case EFSD_EVENT_REPLY:
- e_dir_handle_efsd_event_reply(ev);
- break;
- default:
- break;
- }
- D_RETURN;
-}
-
-static void
-e_dir_handle_efsd_event_reply_getfiletype(EfsdEvent * ev)
-{
- E_File *f;
- char *file = NULL;
- E_Dir *dir;
-
- char *m, *p;
- char mime[PATH_MAX], base[PATH_MAX];
-
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- if (!ev->efsd_reply_event.errorcode == 0)
- D_RETURN;
-
- if ((file = efsd_event_filename(ev)))
- {
- file = e_file_get_file(file);
- }
- dir = e_dir_find_by_monitor_id(efsd_event_id(ev));
- f = e_file_get_by_name(dir->files, file);
-
- /* if its not in the list we care about, its filetype is meaningless */
- if (!f)
- D_RETURN;
-
- m = ev->efsd_reply_event.data;
- p = strchr(m, '/');
- if (p)
- {
- STRNCPY(base, m, PATH_MAX);
- STRNCPY(mime, p + 1, PATH_MAX);
- p = strchr(base, '/');
- *p = 0;
- }
- else
- {
- STRNCPY(base, m, PATH_MAX);
- strcpy(mime, "unknown");
- }
- e_file_set_mime(f, base, mime);
- /* Try to update the GUI.
- * It's just a try because we need to have the file's stat
- * info as well. --cK.
- */
- e_observee_notify_observers(E_OBSERVEE(dir), E_EVENT_FILE_INFO, f);
- D_RETURN;
-}
-
-static void
-e_dir_handle_efsd_event_reply_stat(EfsdEvent * ev)
-{
- E_Dir *d;
- E_File *f;
-
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- if (!ev->efsd_reply_event.errorcode == 0)
- D_RETURN;
-
- d = e_dir_find_by_monitor_id(efsd_event_id(ev));
- f = e_file_get_by_name(d->files, e_file_get_file(efsd_event_filename(ev)));
- /* if its not in the list we care about, return */
- if (!f)
- D_RETURN;
-
- /* When everything went okay and we can find a dir,
- * set the file stat data for the file and try to update the gui.
- * It's just a try because we need to have received the filetype
- * info too. --cK. */
- f->stat = *((struct stat *)efsd_event_data(ev));
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_INFO, f);
-
- D_RETURN;
-}
-
-static void
-e_dir_handle_efsd_event_reply_readlink(EfsdEvent * ev)
-{
- E_Dir *d;
- E_File *f;
-
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- if (!ev->efsd_reply_event.errorcode == 0)
- D_RETURN;
-
- d = e_dir_find_by_monitor_id(efsd_event_id(ev));
- f = e_file_get_by_name(d->files, e_file_get_file(efsd_event_filename(ev)));
- if (f)
- {
- e_file_set_link(f, (char *)efsd_event_data(ev));
- }
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_INFO, f);
-
- D_RETURN;
-}
-
-static void
-e_dir_handle_efsd_event_reply_getmeta(EfsdEvent * ev)
-{
- Evas_List * l;
- EfsdCmdId cmd;
-
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- cmd = efsd_event_id(ev);
- for (l = VM->views; l; l = l->next)
- {
- E_View *v;
-
- v = l->data;
- /* ignore metadata for desktops */
- if (v->is_desktop)
- continue;
- if (v->geom_get.x == cmd)
- {
- v->geom_get.x = 0;
- if (efsd_metadata_get_type(ev) == EFSD_INT)
- {
- if (ev->efsd_reply_event.errorcode == 0)
- efsd_metadata_get_int(ev, &(v->location.x));
- else
- v->location.x = 0;
- }
- }
- else if (v->geom_get.y == cmd)
- {
- v->geom_get.y = 0;
- if (efsd_metadata_get_type(ev) == EFSD_INT)
- {
- if (ev->efsd_reply_event.errorcode == 0)
- efsd_metadata_get_int(ev, &(v->location.y));
- else
- v->location.y = 0;
-
- }
- }
- else if (v->geom_get.w == cmd)
- {
- v->geom_get.w = 0;
- if (efsd_metadata_get_type(ev) == EFSD_INT)
- {
- if (ev->efsd_reply_event.errorcode == 0)
- efsd_metadata_get_int(ev, &(v->size.w));
- else
- v->size.w = 400;
- }
- }
- else if (v->geom_get.h == cmd)
- {
- v->geom_get.h = 0;
- if (ev->efsd_reply_event.errorcode == 0)
- {
- if (ev->efsd_reply_event.errorcode == 0)
- efsd_metadata_get_int(ev, &(v->size.h));
- else
- v->size.h = 401;
- }
- }
- /* We have received all metadata we need, display the view */
- if ((!v->geom_get.x) &&
- (!v->geom_get.y) &&
- (!v->geom_get.w) && (!v->geom_get.h) && (v->geom_get.busy))
- {
- E_Border *b;
-
- ecore_window_move_resize(v->win.base, v->location.x, v->location.y,
- v->size.w, v->size.h);
- ecore_window_set_xy_hints(v->win.base, v->location.x,
- v->location.y);
- v->size.force = 1;
- v->geom_get.busy = 0;
- if (v->bg)
- e_bg_resize(v->bg, v->size.w, v->size.h);
- if (v->options.back_pixmap)
- e_view_update(v);
- b = e_border_adopt(v->win.base, 1);
- b->client.internal = 1;
- e_border_remove_click_grab(b);
- }
- }
- D_RETURN;
-}
-
-static void
-e_dir_handle_efsd_event_reply(EfsdEvent * ev)
-{
- D_ENTER;
-
- if (!ev)
- D_RETURN;
-
- switch (ev->efsd_reply_event.command.type)
- {
- case EFSD_CMD_REMOVE:
- break;
- case EFSD_CMD_MOVE:
- break;
- case EFSD_CMD_SYMLINK:
- break;
- case EFSD_CMD_LISTDIR:
- break;
- case EFSD_CMD_MAKEDIR:
- break;
- case EFSD_CMD_CHMOD:
- break;
- case EFSD_CMD_GETFILETYPE:
- e_dir_handle_efsd_event_reply_getfiletype(ev);
- break;
- case EFSD_CMD_STAT:
- e_dir_handle_efsd_event_reply_stat(ev);
- break;
- case EFSD_CMD_READLINK:
- e_dir_handle_efsd_event_reply_readlink(ev);
- break;
- case EFSD_CMD_CLOSE:
- break;
- case EFSD_CMD_SETMETA:
- break;
- case EFSD_CMD_GETMETA:
- e_dir_handle_efsd_event_reply_getmeta(ev);
- break;
- case EFSD_CMD_STARTMON_DIR:
- break;
- case EFSD_CMD_STARTMON_FILE:
- break;
- case EFSD_CMD_STOPMON_DIR:
- break;
- case EFSD_CMD_STOPMON_FILE:
- break;
- default:
- break;
- }
- D_RETURN;
-}
-
-void
-e_dir_file_added(int id, char *file)
-{
- E_Dir *d;
- E_File *f;
-
- D_ENTER;
-
- /* if we get a path - ignore it - its not a file in the dir */
- if (!file || file[0] == '/')
- D_RETURN;
- d = e_dir_find_by_monitor_id(id);
- if (file[0] != '.')
- {
- f = e_file_new(file);
- d->files = evas_list_append(d->files, f);
- /* tell all views for this dir about the new file */
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_ADD, f);
- }
- D_RETURN;
-}
-
-void
-e_dir_file_deleted(int id, char *file)
-{
- E_File *f;
- E_Dir *d;
-
- D_ENTER;
-
- if (!file || file[0] == '/')
- D_RETURN;
-
- d = e_dir_find_by_monitor_id(id);
- f = e_file_get_by_name(d->files, file);
- d->files = evas_list_remove(d->files, f);
-
- if (file[0] != '.')
- {
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_DELETE, f);
- }
- D_RETURN;
-}
-
-void
-e_dir_file_changed(int id, char *file)
-{
- E_Dir *d;
- E_File *f;
-
- D_ENTER;
-
- if (!file || file[0] == '/')
- D_RETURN;
- d = e_dir_find_by_monitor_id(id);
- f = e_file_get_by_name(d->files, file);
- if (file[0] != '.')
- {
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_CHANGE, f);
- }
- D_RETURN;
-}
-
-void
-e_dir_file_moved(int id, char *file)
-{
- E_Dir *d;
-
- D_ENTER;
-
- if (!file || file[0] == '/')
- D_RETURN;
- d = e_dir_find_by_monitor_id(id);
- D_RETURN;
-}
-
-E_Dir *
-e_dir_find_by_monitor_id(int id)
-{
- E_Dir *d;
- Evas_List * l;
-
- D_ENTER;
-
- for (l = VM->dirs; l; l = l->next)
- {
- d = l->data;
- if (d->monitor_id == id)
- D_RETURN_(d);
- }
- D_RETURN_(NULL);
-}
+++ /dev/null
-#ifndef E_DIR_H
-#define E_DIR_H
-
-#include "fs.h"
-#include "iconbar.h"
-#include "observer.h"
-#include <Evas.h>
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-#ifndef E_ICON_TYPEDEF
-#define E_ICON_TYPEDEF
-typedef struct _E_Icon E_Icon;
-#endif
-
-#ifndef E_DIR_TYPEDEF
-#define E_DIR_TYPEDEF
-typedef struct _E_Dir E_Dir;
-#endif
-
-struct _E_Dir
-{
- E_Observee o;
-
- /* The realpath of the view's directory */
- char *dir;
-
- Evas_List * files;
-
-/*
- * Evas_Object obj_bg;
- *
- * char *bg_file;
- */
-
- E_FS_Restarter *restarter;
-
- int monitor_id;
-
- // int is_desktop;
-};
-
-/**
- * e_dir_set_dir - Assigns a directory to a view E_Dir
- * @ed: The view E_Dir to set the dir for
- * @dir: The directory
- *
- * Set the directory for a dir and starts monitoring it via efsd.
- */
-void e_dir_set_dir(E_Dir * ed, char *dir);
-
-E_Dir *e_dir_new(void);
-void e_dir_init(void);
-void e_dir_register_view(E_Dir * d, E_View * v);
-void e_dir_unregister_view(E_View * v);
-
-E_Dir *e_dir_find_by_monitor_id(int id);
-
-/* Deal with incoming file events */
-void e_dir_file_added(int id, char *file);
-void e_dir_file_deleted(int id, char *file);
-void e_dir_file_changed(int id, char *file);
-void e_dir_file_moved(int id, char *file);
-#endif
+++ /dev/null
-#include "debug.h"
-#include "e_file.h"
-#include "file.h"
-#include "util.h"
-
-static void e_file_cleanup(E_File * f);
-
-static void
-e_file_cleanup(E_File * f)
-{
- D_ENTER;
-
- IF_FREE(f->info.icon);
- IF_FREE(f->info.link);
- IF_FREE(f->info.custom_icon);
- IF_FREE(f->info.mime.base);
- IF_FREE(f->info.mime.type);
- IF_FREE(f->file);
- e_object_cleanup(E_OBJECT(f));
-
- D_RETURN;
-}
-
-E_File *
-e_file_new(char *file)
-{
- E_File *f;
-
- D_ENTER;
-
- if (!file || *file == 0)
- D_RETURN_(NULL);
-
- f = NEW(E_File, 1);
-
- e_object_init(E_OBJECT(f), (E_Cleanup_Func) e_file_cleanup);
-
- f->info.icon = NULL;
- f->info.link = NULL;
- f->info.custom_icon = NULL;
- f->info.mime.base = NULL;
- f->info.mime.type = NULL;
- f->file = strdup(file);
-
- D_RETURN_(f);
-}
-
-E_File *
-e_file_get_by_name(Evas_List * l, char *file)
-{
- Evas_List * ll;
- E_File *f;
-
- D_ENTER;
-
- if (!l || !file || *file == 0)
- D_RETURN_(NULL);
-
- for (ll = l; ll; ll = ll->next)
- {
- f = (E_File *) ll->data;
-
- if (!strcmp(file, f->file))
- {
- D_RETURN_(f);
- }
- }
-
- D_RETURN_(NULL);
-}
-
-void
-e_file_set_mime(E_File * f, char *base, char *mime)
-{
- char icon[PATH_MAX];
- char type[PATH_MAX];
- char *p;
-
- D_ENTER;
-
- if (!f || !base || !mime)
- D_RETURN;
-
- D("Setting mime: %40s: %s/%s\n", f->file, base, mime);
-
- if (((f->info.mime.base) && !(strcmp(f->info.mime.base, base)))
- && ((f->info.mime.type) && !(strcmp(f->info.mime.type, mime))))
- D_RETURN;
-
- IF_FREE(f->info.mime.base);
- IF_FREE(f->info.mime.type);
-
- f->info.mime.base = strdup(base);
- f->info.mime.type = strdup(mime);
-
- /* effect changes here */
-/*
- * if (f->info.custom_icon)
- * {
- * if (f->info.icon)
- * FREE(f->info.icon);
- * f->info.icon = strdup(f->info.custom_icon);
- * evas_set_image_file(f->view->evas, f->obj.icon, f->info.custom_icon);
- * e_view_queue_resort(f->view);
- * D_RETURN;
- * }
- */
-
- /* find an icon */
- STRNCPY(type, f->info.mime.type, PATH_MAX);
- p = type;
- do
- {
- snprintf(icon, PATH_MAX, "%s/data/icons/%s/%s.db",
- PACKAGE_DATA_DIR, f->info.mime.base, type);
- p = strrchr(type, '/');
- if (p)
- *p = 0;
- }
- while (p && !e_file_exists(icon));
-
- /* fallback to base type icon */
- if (!e_file_exists(icon))
- snprintf(icon, PATH_MAX, "%s/data/icons/%s/default.db",
- PACKAGE_DATA_DIR, f->info.mime.base);
- /* still no luck fall back to default */
- if (!e_file_exists(icon))
- snprintf(icon, PATH_MAX, "%s/data/icons/unknown/default.db",
- PACKAGE_DATA_DIR);
-
- f->info.icon = strdup(icon);
-
- D_RETURN;
-}
-
-void
-e_file_set_link(E_File * f, char *link)
-{
- D_ENTER;
-
- if (!f)
- D_RETURN;
-
- if ((!link) && (f->info.link))
- {
- free(f->info.link);
- f->info.link = NULL;
- /* effect changes here */
- }
- else if (link)
- {
- if ((f->info.link) && (!strcmp(f->info.link, link)))
- {
- FREE(f->info.link);
- f->info.link = strdup(link);
- /* effect changes here */
- }
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_EFILE_H
-#define E_EFILE_H
-#include "object.h"
-#include <sys/stat.h>
-
-typedef struct _E_File E_File;
-struct _E_File
-{
- E_Object o;
-
- char *file;
- struct stat stat;
-
- struct
- {
- char *icon;
- char *custom_icon;
- char *link;
- struct
- {
- char *base;
- char *type;
- }
- mime;
- }
- info;
-};
-
-E_File *e_file_new(char *file);
-E_File *e_file_get_by_name(Evas_List * l, char *file);
-void e_file_set_mime(E_File * f, char *base, char *mime);
-void e_file_set_link(E_File * f, char *link);
-
-#endif
+++ /dev/null
-#include "util.h"
-#include "desktops.h"
-#include "e_view_look.h"
-#include "view.h"
-#include "observer.h"
-#include "e_file.h"
-#include "e_dir.h"
-#include "view_layout.h"
-#include "e_view_machine.h"
-
-static void e_view_look_file_delete(E_View_Look *l, E_File *f);
-static void e_view_look_file_change(E_View_Look *l, E_File *f);
-static void e_view_look_cleanup(E_View_Look *l);
-static void e_view_look_objects_cleanup(E_View_Look_Objects *o);
-static void e_view_look_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data);
-
-
-E_View_Look *
-e_view_look_new(void)
-{
- E_View_Look *l;
- D_ENTER;
-
- l = NEW(E_View_Look, 1);
- ZERO(l, E_View_Look, 1);
- e_observer_init(E_OBSERVER(l),
- E_EVENT_FILE_ADD | E_EVENT_FILE_DELETE |
- E_EVENT_FILE_CHANGE,
- (E_Notify_Func) e_view_look_event_handler,
- (E_Cleanup_Func) e_view_look_cleanup);
-
- l->obj = NEW(E_View_Look_Objects, 1);
- ZERO(l->obj, E_View_Look_Objects, 1);
-
- l->obj->bg = NULL;
- l->obj->icb = NULL;
- l->obj->icb_bits = NULL;
- l->obj->layout = NULL;
- e_observee_init(E_OBSERVEE(l->obj), (E_Cleanup_Func) e_view_look_objects_cleanup);
-
- e_view_machine_register_look(l);
-
- D_RETURN_(l);
-}
-
-static void
-e_view_look_cleanup(E_View_Look *l)
-{
- D_ENTER;
- e_view_machine_unregister_look(l);
- e_object_unref(E_OBJECT(l->obj));
- e_observer_cleanup(E_OBSERVER(l));
- D_RETURN;
-}
-
-static void
-e_view_look_objects_cleanup(E_View_Look_Objects *l)
-{
- D_ENTER;
- IF_FREE(l->bg);
- IF_FREE(l->icb);
- IF_FREE(l->icb_bits);
- IF_FREE(l->layout);
- e_observee_cleanup(E_OBSERVEE(l));
- D_RETURN;
-}
-
-static void
-e_view_look_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data)
-{
- E_View_Look *l = (E_View_Look *) obs;
- E_File *f = (E_File *) data;
- D_ENTER;
-
- if (event & E_EVENT_FILE_CHANGE || event & E_EVENT_FILE_ADD)
- e_view_look_file_change(l, f);
- else if (event & E_EVENT_FILE_DELETE)
- e_view_look_file_delete(l, f);
-
- D_RETURN;
- UN(o);
-}
-
-
-void
-e_view_look_set_dir(E_View_Look *l, char *dir)
-{
- E_Dir *d = NULL;
- D_ENTER;
-
- if (!(d = e_view_machine_dir_lookup(dir)))
- {
- D("Model for this dir doesn't exist, make a new one\n");
- d = e_dir_new();
- e_dir_set_dir(d, dir);
- }
- else
- e_object_ref(E_OBJECT(d));
-
- if (d)
- {
- l->dir = d;
- e_observer_register_observee(E_OBSERVER(l), E_OBSERVEE(l->dir));
- }
- else
- {
- D("Couldnt set dir for E_View_Look! Bad!\n");
- }
- D_RETURN;
-}
-
-
-/* React to file event */
-
-static void
-e_view_look_file_change(E_View_Look *l, E_File *f)
-{
- char buf[PATH_MAX];
- D_ENTER;
- snprintf(buf, PATH_MAX, "%s/%s", l->dir->dir, f->file);
- if (!strncmp(f->file, "background.db", PATH_MAX))
- {
- IF_FREE(l->obj->bg);
- l->obj->bg = strdup(buf);
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_BG_CHANGED, f);
- }
- else if (!strncmp(f->file, "iconbar.db", PATH_MAX))
- {
- IF_FREE(l->obj->icb);
- l->obj->icb = strdup(buf);
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
- }
- else if (!strncmp(f->file, "iconbar.bits.db", PATH_MAX))
- {
- IF_FREE(l->obj->icb_bits);
- l->obj->icb_bits = strdup(buf);
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
- }
- else if (!strncmp(f->file, "layout.db", PATH_MAX))
- {
- IF_FREE(l->obj->layout);
- l->obj->layout = strdup(buf);
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_LAYOUT_CHANGED, f);
- }
- D_RETURN;
-}
-
-static void
-e_view_look_file_delete(E_View_Look *l, E_File *f)
-{
- D_ENTER;
-
- if (!strcmp(f->file, "background.db"))
- {
- IF_FREE(l->obj->bg);
- l->obj->bg = NULL;
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_BG_CHANGED, f);
- }
- else if ( !strcmp(f->file, "iconbar.db"))
- {
- IF_FREE(l->obj->icb);
- l->obj->icb = NULL;
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
- }
-
- else if (!strcmp(f->file, "iconbar.bits.db"))
- {
- IF_FREE(l->obj->icb_bits);
- l->obj->icb_bits = NULL;
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
- }
- else if (!strcmp(f->file, "layout.db"))
- {
- IF_FREE(l->obj->layout);
- l->obj->layout = NULL;
- e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_LAYOUT_CHANGED, f);
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_VIEW_LOOK_H
-#define E_VIEW_LOOK_H
-#include "observer.h"
-#include "view_layout.h"
-#include "e_dir.h"
-#include <Evas.h>
-
-#ifndef E_VIEW_LOOK_TYPEDEF
-#define E_VIEW_LOOK_TYPEDEF
-typedef struct _E_View_Look E_View_Look;
-typedef struct _E_View_Look_Objects E_View_Look_Objects;
-#endif
-
-
-#ifndef E_DIR_TYPEDEF
-#define E_DIR_TYPEDEF
-typedef struct _E_Dir E_Dir;
-#endif
-#ifndef E_VIEW_LAYOUT_TYPEDEF
-#define E_VIEW_LAYOUT_TYPEDEF
-typedef struct _E_View_Layout E_View_Layout;
-typedef struct _E_View_Layout_Element E_View_Layout_Element;
-#endif
-
-struct _E_View_Look
-{
- E_Observer o;
-
- E_View_Look_Objects *obj;
-
- /* The .e_layout dir to monitor */
- E_Dir *dir;
-};
-
-struct _E_View_Look_Objects
-{
- E_Observee o;
-
- /* FIXME keep the bits/objects themselves here */
-
- char *bg;
- char *icb;
- char *icb_bits;
- char *layout;
-};
-
-E_View_Look *e_view_look_new(void);
-void e_view_look_set_dir(E_View_Look *l, char *dir);
-
-#endif
+++ /dev/null
-#include <Ecore.h>
-#include "e_view_machine.h"
-#include "e_dir.h"
-#include "e_view_look.h"
-#include "util.h"
-#include "globals.h"
-#include "file.h"
-
-void
-e_view_machine_init()
-{
- D_ENTER;
-
- if (VM == NULL)
- {
- VM = NEW(E_Dir, 1);
- VM->views = NULL;
- VM->dirs = NULL;
- VM->looks = NULL;
- e_view_init();
- e_dir_init();
- }
-
- D_RETURN;
-}
-
-void
-e_view_machine_register_dir(E_Dir * d)
-{
- D_ENTER;
- VM->dirs = evas_list_append(VM->dirs, d);
- D_RETURN;
-}
-
-void
-e_view_machine_unregister_dir(E_Dir * d)
-{
- D_ENTER;
- VM->dirs = evas_list_remove(VM->dirs, d);
- D_RETURN;
-}
-
-void
-e_view_machine_register_view(E_View * v)
-{
- D_ENTER;
- VM->views = evas_list_append(VM->views, v);
- D_RETURN;
-}
-
-void
-e_view_machine_unregister_view(E_View * v)
-{
- D_ENTER;
- VM->views = evas_list_remove(VM->views, v);
- D_RETURN;
-}
-
-void
-e_view_machine_register_look(E_View_Look * l)
-{
- D_ENTER;
- VM->looks = evas_list_append(VM->looks, l);
- D_RETURN;
-}
-
-void
-e_view_machine_unregister_look(E_View_Look * l)
-{
- D_ENTER;
- VM->looks = evas_list_remove(VM->looks, l);
- D_RETURN;
-}
-
-void
-e_view_machine_close_all_views(void)
-{
- Evas_List * l;
-
- D_ENTER;
- /* Copy the list of views and unregister them */
- for (l = VM->views; l; l = l->next)
- {
- E_View *v = l->data;
-
- e_object_unref(E_OBJECT(v->dir));
- }
- D_RETURN;
-}
-
-E_Dir *
-e_view_machine_dir_lookup(char *path)
-{
- E_Dir *d;
- Evas_List * l;
- char *realpath = NULL;
-
- D_ENTER;
-
- if (!path)
- D_RETURN_(NULL);
-
- realpath = e_file_realpath(path);
-
- for (l = VM->dirs; l; l = l->next)
- {
- d = l->data;
- if (!strcmp(d->dir, realpath))
- {
- D("E_Dir for this dir already exists\n");
-
- IF_FREE(realpath);
- D_RETURN_(d);
- }
- }
-
- IF_FREE(realpath);
- D_RETURN_(NULL);
-}
-
-E_View_Look *
-e_view_machine_look_lookup(char *path)
-{
- E_View_Look *vl;
- Evas_List * l;
- char *realpath = NULL;
-
- D_ENTER;
-
- if (!path)
- D_RETURN_(NULL);
-
- realpath = e_file_realpath(path);
-
- for (l = VM->looks; l; l = l->next)
- {
- vl = l->data;
- if (!strcmp(vl->dir->dir, realpath))
- {
- D("E_Dir for this dir already exists\n");
-
- IF_FREE(realpath);
- D_RETURN_(vl);
- }
- }
-
- IF_FREE(realpath);
- D_RETURN_(NULL);
-}
-
-
-E_View *
-e_view_machine_get_view_by_main_window(Window win)
-{
- Evas_List * l;
-
- D_ENTER;
- for (l = VM->views; l; l = l->next)
- {
- E_View *v = l->data;
-
- if (v && win == v->win.main)
- D_RETURN_(v);
- }
- D_RETURN_(NULL);
-}
-
-E_View *
-e_view_machine_get_view_by_base_window(Window win)
-{
- Evas_List * l;
-
- D_ENTER;
- for (l = VM->views; l; l = l->next)
- {
- E_View *v = l->data;
-
- if (v && win == v->win.base)
- D_RETURN_(v);
- }
- D_RETURN_(NULL);
-}
+++ /dev/null
-#ifndef E_VIEW_MACHINE_H
-#define E_VIEW_MACHINE_H
-#include <Evas.h>
-#include "view.h"
-struct _e_view_machine
-{
- Evas_List * views;
- Evas_List * dirs;
- Evas_List * looks;
-
-};
-typedef struct _e_view_machine E_View_Machine;
-
-void e_view_machine_init(void);
-void e_view_machine_register_view(E_View * v);
-void e_view_machine_unregister_view(E_View * v);
-void e_view_machine_register_dir(E_Dir * d);
-void e_view_machine_unregister_dir(E_Dir * d);
-void e_view_machine_register_look(E_View_Look * l);
-void e_view_machine_unregister_look(E_View_Look * l);
-
-void e_view_machine_close_all_views(void);
-E_Dir *e_view_machine_dir_lookup(char *path);
-E_View_Look *e_view_machine_look_lookup(char *path);
-E_View *e_view_machine_get_view_by_main_window(Window win);
-E_View *e_view_machine_get_view_by_base_window(Window win);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "embed.h"
-#include "util.h"
-
-typedef struct _Embed Embed_Private;
-
-struct _Embed
-{
- Ebits_Object o;
- Evas * evas;
- Evas_Object * image_obj;
- Evas_Object * clip_obj;
- int clip_x, clip_y;
- E_Text *text_obj;
-};
-
-static void
-e_embed_text_func_show(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_show(em->clip_obj);
- e_text_show(em->text_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_hide(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_hide(em->clip_obj);
- e_text_hide(em->text_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_move(void *_data, double x, double y)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_move(em->clip_obj, x, y);
- e_text_move(em->text_obj, x, y);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_resize(void *_data, double w, double h)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_resize(em->clip_obj, w, h);
- e_text_resize(em->text_obj, w, h);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_raise(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_raise(em->clip_obj);
- e_text_raise(em->text_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_lower(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_lower(em->clip_obj);
- e_text_lower(em->text_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_set_layer(void *_data, int l)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- evas_object_layer_set(em->clip_obj, l);
- e_text_set_layer(em->text_obj, l);
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_set_clip(void *_data, Evas_Object * clip)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (em->clip_obj)
- {
- if (clip)
- e_text_set_clip(em->clip_obj, clip);
- else
- e_text_unset_clip(em->clip_obj);
- }
- else
- {
- if (clip)
- e_text_set_clip(em->text_obj, clip);
- else
- e_text_unset_clip(em->text_obj);
- }
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_set_color_class(void *_data, char *cc, int r, int g, int b,
- int a)
-{
- D_ENTER;
-
- D_RETURN;
-
- UN(_data);
- UN(cc);
- UN(r);
- UN(g);
- UN(b);
- UN(a);
-}
-
-static void
-e_embed_text_func_get_min_size(void *_data, double *w, double *h)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- e_text_get_min_size(em->text_obj, w, h);
- if (em->clip_x)
- *w = 0;
- if (em->clip_y)
- *h = 0;
-
- D_RETURN;
-}
-
-static void
-e_embed_text_func_get_max_size(void *_data, double *w, double *h)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- e_text_get_max_size(em->text_obj, w, h);
- if (em->clip_x)
- *w = 999999999;
- if (em->clip_y)
- *h = 999999999;
-
- D_RETURN;
-}
-
-/***/
-
-Embed
-e_embed_text(Ebits_Object o, char *bit_name, Evas * evas, E_Text * text_obj,
- int clip_x, int clip_y)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = NEW(Embed_Private, 1);
- ZERO(em, Embed_Private, 1);
- em->o = o;
- em->evas = evas;
- em->text_obj = text_obj;
- em->clip_x = clip_x;
- em->clip_y = clip_y;
- if ((clip_x) || (clip_y))
- {
- em->clip_obj = evas_object_rectangle_add(em->evas);
- evas_object_color_set(em->clip_obj, 255, 255, 255, 255);
- e_text_set_clip(em->text_obj, em->clip_obj);
- evas_object_show(em->clip_obj);
- }
- ebits_set_named_bit_replace(o, bit_name,
- e_embed_text_func_show,
- e_embed_text_func_hide,
- e_embed_text_func_move,
- e_embed_text_func_resize,
- e_embed_text_func_raise,
- e_embed_text_func_lower,
- e_embed_text_func_set_layer,
- e_embed_text_func_set_clip,
- e_embed_text_func_set_color_class,
- e_embed_text_func_get_min_size,
- e_embed_text_func_get_max_size, em);
- D_RETURN_(em);
-}
-
-/*****************************************************************************/
-
-static void
-e_embed_image_func_show(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_show(em->image_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_hide(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_hide(em->image_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_move(void *_data, double x, double y)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_move(em->image_obj, x, y);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_resize(void *_data, double w, double h)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_resize(em->image_obj, w, h);
- evas_object_image_fill_set(em->image_obj, 0, 0, w, h);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_raise(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_raise(em->image_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_lower(void *_data)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_lower(em->image_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_set_layer(void *_data, int l)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- evas_object_layer_set(em->image_obj, l);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_set_clip(void *_data, Evas_Object * clip)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if (clip)
- evas_object_clip_set(em->image_obj, clip);
- else
- evas_object_clip_unset(em->image_obj);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_set_color_class(void *_data, char *cc, int r, int g, int b,
- int a)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = _data;
- if ((cc) && (!strcmp(cc, "icon")))
- evas_object_color_set(em->image_obj, r, g, b, a);
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_get_min_size(void *_data, double *w, double *h)
-{
- Embed_Private *em;
- int iw, ih;
-
- D_ENTER;
-
- em = _data;
- iw = 0;
- ih = 0;
- evas_object_image_size_get(em->image_obj, &iw, &ih);
- if (w)
- *w = iw;
- if (h)
- *h = ih;
-
- D_RETURN;
-}
-
-static void
-e_embed_image_func_get_max_size(void *_data, double *w, double *h)
-{
- Embed_Private *em;
- int iw, ih;
-
- D_ENTER;
-
- em = _data;
- evas_object_image_size_get(em->image_obj, &iw, &ih);
- if (w)
- *w = iw;
- if (h)
- *h = ih;
-
- D_RETURN;
-}
-
-/***/
-
-Embed
-e_embed_image_object(Ebits_Object o, char *bit_name, Evas * evas,
- Evas_Object * image_obj)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = NEW(Embed_Private, 1);
- ZERO(em, Embed_Private, 1);
- em->o = o;
- em->evas = evas;
- em->image_obj = image_obj;
- ebits_set_named_bit_replace(o, bit_name,
- e_embed_image_func_show,
- e_embed_image_func_hide,
- e_embed_image_func_move,
- e_embed_image_func_resize,
- e_embed_image_func_raise,
- e_embed_image_func_lower,
- e_embed_image_func_set_layer,
- e_embed_image_func_set_clip,
- e_embed_image_func_set_color_class,
- e_embed_image_func_get_min_size,
- e_embed_image_func_get_max_size, em);
- D_RETURN_(em);
-}
-
-/*****/
-
-void
-e_embed_free(Embed emb)
-{
- Embed_Private *em;
-
- D_ENTER;
-
- em = emb;
- if (em->clip_obj)
- evas_object_del(em->clip_obj);
- FREE(em);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_EMBED_H
-#define E_EMBED_H
-
-#include "e.h"
-#include "text.h"
-
-typedef void *Embed;
-
-Embed e_embed_text(Ebits_Object o, char *bit_name, Evas * evas,
- E_Text * text_obj, int clip_x, int clip_y);
-Embed e_embed_image_object(Ebits_Object o, char *bit_name,
- Evas * evas, Evas_Object * image_obj);
-void e_embed_free(Embed em);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "entry.h"
-#include "config.h"
-#include "util.h"
-
-static Evas_List * entries;
-
-static void e_clear_selection(Ecore_Event * ev);
-static void e_paste_request(Ecore_Event * ev);
-
-static void e_entry_down_cb(void *_data, Evas * _e, Evas_Object * _o,
- int _b, int _x, int _y);
-static void e_entry_up_cb(void *_data, Evas * _e, Evas_Object * _o, int _b,
- int _x, int _y);
-static void e_entry_move_cb(void *_data, Evas * _e, Evas_Object * _o,
- int _b, int _x, int _y);
-static void e_entry_realize(E_Entry * entry);
-static void e_entry_unrealize(E_Entry * entry);
-static void e_entry_configure(E_Entry * entry);
-
-static void
-e_clear_selection(Ecore_Event * ev)
-{
- Ecore_Event_Clear_Selection *e;
- Evas_List * l;
-
- D_ENTER;
-
- e = ev->event;
- for (l = entries; l; l = l->next)
- {
- E_Entry *entry;
-
- entry = l->data;
- if (entry->selection_win == e->win)
- {
- ecore_window_destroy(entry->selection_win);
- entry->selection_win = 0;
- entry->select.start = -1;
- entry->select.length = 0;
- e_entry_configure(entry);
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_paste_request(Ecore_Event * ev)
-{
- Ecore_Event_Paste_Request *e;
- Evas_List * l;
-
- D_ENTER;
-
- e = ev->event;
- for (l = entries; l; l = l->next)
- {
- E_Entry *entry;
-
- entry = l->data;
- if (entry->paste_win == e->win)
- {
- char *type;
-
- type = e->string;
- e_entry_clear_selection(entry);
- e_entry_insert_text(entry, type);
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_entry_down_cb(void *_data, Evas *_e, Evas_Object * _o, int _b, int _x, int _y)
-{
- E_Entry *entry;
- int pos;
-
- D_ENTER;
-
- entry = _data;
- if ((_b == 2) && (!entry->mouse_down))
- {
- if (entry->paste_win)
- ecore_window_destroy(entry->paste_win);
- entry->paste_win = ecore_selection_request();
- }
- else if (!entry->mouse_down)
- {
- entry->focused = 1;
- /* checkme
- pos = evas_text_at_position(_e, entry->text, _x, _y,
- NULL, NULL, NULL, NULL);
- */
- pos = evas_object_text_char_coords_get(entry->text, _x, _y,
- NULL, NULL, NULL, NULL);
- if (pos < 0)
- {
- int tw;
-
- /* checkme todo
- tw = evas_get_text_width(_e, entry->text);
- */
- if (_x > entry->x + tw)
- {
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if (_x < entry->x)
- {
- entry->cursor_pos = 0;
- }
- }
- else
- {
- entry->cursor_pos = pos;
- }
- entry->mouse_down = _b;
- entry->select.start = -1;
- e_entry_configure(entry);
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_entry_up_cb(void *_data, Evas * _e, Evas_Object * _o, int _b, int _x, int _y)
-{
- E_Entry *entry;
-
- /* int pos; */
-
- D_ENTER;
-
- entry = _data;
- if (_b == entry->mouse_down)
- entry->mouse_down = 0;
- e_entry_configure(entry);
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(_x);
- UN(_y);
-}
-
-static void
-e_entry_move_cb(void *_data, Evas * _e, Evas_Object * _o, int _b, int _x, int _y)
-{
- E_Entry *entry;
-
- D_ENTER;
-
- entry = _data;
- if (entry->mouse_down > 0)
- {
- int pos, ppos;
- double ty;
-
- ppos = entry->cursor_pos;
- evas_object_geometry_get(entry->text, NULL, &ty, NULL, NULL);
- /* checkme
- pos = evas_text_at_position(_e, entry->text, _x, ty,
- NULL, NULL, NULL, NULL);
- */
- pos = evas_object_text_char_coords_get(entry->text, _x, ty,
- NULL, NULL, NULL, NULL);
- if (pos < 0)
- {
- int tw;
-
- /* checkme todo
- tw = evas_get_text_width(_e, entry->text);
- */
- if (_x > entry->x + tw)
- {
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if (_x < entry->x)
- {
- entry->cursor_pos = 0;
- }
- }
- else
- {
- entry->cursor_pos = pos;
- }
- if ((entry->select.start < 0) && (ppos != entry->cursor_pos))
- {
- if (ppos < entry->cursor_pos)
- {
- entry->select.down = ppos;
- entry->select.start = ppos;
- entry->select.length = entry->cursor_pos - ppos + 1;
- }
- else
- {
- entry->select.down = ppos;
- entry->select.start = entry->cursor_pos;
- entry->select.length = ppos - entry->cursor_pos + 1;
- }
- }
- else if (entry->select.start >= 0)
- {
- if (entry->cursor_pos < entry->select.down)
- {
- entry->select.start = entry->cursor_pos;
- entry->select.length =
- entry->select.down - entry->cursor_pos + 1;
- }
- else
- {
- entry->select.start = entry->select.down;
- entry->select.length =
- entry->cursor_pos - entry->select.down + 1;
- }
- }
- if (entry->select.start >= 0)
- {
- char *str2;
-
- str2 = e_entry_get_selection(entry);
- if (str2)
- {
- if (entry->selection_win)
- ecore_window_destroy(entry->selection_win);
- entry->selection_win = ecore_selection_set(str2);
- FREE(str2);
- }
- }
- e_entry_configure(entry);
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(_b);
- UN(_y);
-}
-
-static void
-e_entry_realize(E_Entry * entry)
-{
- char *entries;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- entries = e_config_get("entries");
- snprintf(buf, PATH_MAX, "%s/%s", entries, "base.bits.db");
- entry->obj_base = ebits_load(buf);
- if (entry->obj_base)
- {
- ebits_add_to_evas(entry->obj_base, entry->evas);
-/* ebits_set_color_class(entry->obj_base, "Base FG", 100, 200, 255, 255);*/
- }
- snprintf(buf, PATH_MAX, "%s/%s", entries, "cursor.bits.db");
- entry->obj_cursor = ebits_load(buf);
- if (entry->obj_cursor)
- {
- ebits_add_to_evas(entry->obj_cursor, entry->evas);
-/* ebits_set_color_class(entry->obj_base, "Base FG", 100, 200, 255, 255);*/
- }
- snprintf(buf, PATH_MAX, "%s/%s", entries, "selection.bits.db");
- entry->obj_selection = ebits_load(buf);
- if (entry->obj_selection)
- {
- ebits_add_to_evas(entry->obj_selection, entry->evas);
-/* ebits_set_color_class(entry->obj_base, "Base FG", 100, 200, 255, 255);*/
- }
-
- entry->clip_box = evas_object_rectangle_add(entry->evas);
- entry->text = evas_object_text_add(entry->evas);
- evas_object_text_font_set(entry->text, "borzoib", 8);
- if (entry->obj_cursor)
- ebits_set_clip(entry->obj_cursor, entry->clip_box);
- if (entry->obj_selection)
- ebits_set_clip(entry->obj_selection, entry->clip_box);
- entry->event_box = evas_object_rectangle_add(entry->evas);
- evas_object_color_set(entry->clip_box, 255, 255, 255, 255);
- evas_object_color_set(entry->event_box, 0, 0, 0, 0);
- evas_object_color_set(entry->text, 0, 0, 0, 255);
- evas_object_clip_set(entry->text, entry->clip_box);
- evas_object_clip_set(entry->event_box, entry->clip_box);
- /* checkme todo
- evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_DOWN,
- e_entry_down_cb, entry);
- evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_UP,
- e_entry_up_cb, entry);
- evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_MOVE,
- e_entry_move_cb, entry);
- */
-
- D_RETURN;
-}
-
-static void
-e_entry_unrealize(E_Entry * entry)
-{
- D_ENTER;
-
- if (entry->event_box)
- evas_object_del(entry->event_box);
- if (entry->text)
- evas_object_del(entry->text);
- if (entry->clip_box)
- evas_object_del(entry->clip_box);
- if (entry->obj_base)
- ebits_free(entry->obj_base);
- if (entry->obj_cursor)
- ebits_free(entry->obj_cursor);
- if (entry->obj_selection)
- ebits_free(entry->obj_selection);
- entry->event_box = NULL;
- entry->text = NULL;
- entry->clip_box = NULL;
- entry->obj_base = NULL;
- entry->obj_cursor = NULL;
- entry->obj_selection = NULL;
-
- D_RETURN;
-}
-
-static void
-e_entry_configure(E_Entry * entry)
-{
- int p1l, p1r, p1t, p1b;
- int p2l, p2r, p2t, p2b;
-
- D_ENTER;
-
- if (!entry->evas)
- D_RETURN;
- if (!entry->event_box)
- D_RETURN;
- p1l = p1r = p1t = p1b = 0;
- if (entry->obj_base)
- ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
- p2l = p2r = p2t = p2b = 0;
- if (entry->obj_cursor)
- ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
- if (entry->obj_base)
- {
- ebits_move(entry->obj_base, entry->x, entry->y);
- ebits_resize(entry->obj_base, entry->w, entry->h);
- }
- evas_object_move(entry->clip_box, entry->x + p1l, entry->y + p1t);
- evas_object_resize(entry->clip_box, entry->w - p1l - p1r,
- entry->h - p1t - p1b);
- evas_object_move(entry->event_box, entry->x + p1l + p2l,
- entry->y + p1t + p2t);
- evas_object_resize(entry->event_box, entry->w - p1l - p1r - p2l - p2r,
- entry->h - p1t - p1b - p2t - p2b);
- if ((entry->buffer) && (entry->buffer[0] != 0) && (entry->focused))
- {
- double tx, ty, tw, th;
-
- if (entry->cursor_pos < (int)strlen(entry->buffer))
- {
- /* checkme
- evas_text_at(entry->evas, entry->text, entry->cursor_pos, &tx, &ty,
- &tw, &th);
- */
- evas_object_text_char_pos_get(entry->text, entry->cursor_pos, &tx, &ty,
- &tw, &th);
- }
- else
- {
- entry->cursor_pos = strlen(entry->buffer);
- /* checkme
- evas_text_at(entry->evas, entry->text, entry->cursor_pos - 1, &tx,
- &ty, &tw, &th);
- */
- evas_object_text_char_pos_get(entry->text, entry->cursor_pos - 1, &tx,
- &ty, &tw, &th);
- tx += tw;
- tw = entry->end_width;
- }
- /* check me
- th = evas_get_text_height(entry->evas, entry->text);
- */
- th = evas_object_text_ascent_get(entry->text)+
- evas_object_text_descent_get(entry->text);
- if (tx + tw + entry->scroll_pos > entry->w - p1l - p1r)
- entry->scroll_pos = entry->w - tx - tw - p1l - p1r - p1l - p2l;
- else if (tx + entry->scroll_pos < p1l)
- entry->scroll_pos = 0 - tx;
- if (entry->obj_cursor)
- {
- ebits_move(entry->obj_cursor,
- entry->x + tx + entry->scroll_pos + p1l,
- entry->y + ty + p1t);
- ebits_resize(entry->obj_cursor, tw + p2l + p2r, th + p2t + p2b);
- ebits_show(entry->obj_cursor);
- }
- }
- else if (entry->focused)
- {
- int tx, tw, th;
-
- entry->scroll_pos = 0;
- tw = 4;
- tx = 0;
- /* checkme
- th = evas_get_text_height(entry->evas, entry->text);
- */
- th = evas_object_text_ascent_get(entry->text)+
- evas_object_text_descent_get(entry->text);
- if (entry->obj_cursor)
- {
- ebits_move(entry->obj_cursor,
- entry->x + tx + entry->scroll_pos + p1l,
- entry->y + p1t);
- ebits_resize(entry->obj_cursor, entry->end_width + p2l + p2r,
- th + p2t + p2b);
- ebits_show(entry->obj_cursor);
- }
- }
- else
- {
- if (entry->obj_cursor)
- ebits_hide(entry->obj_cursor);
- }
- evas_object_move(entry->text, entry->x + entry->scroll_pos + p1l + p2l,
- entry->y + p1t + p2t);
- if (entry->select.start >= 0)
- {
- double x1, y1, x2, tw, th;
-
- /* checkme
- evas_text_at(entry->evas, entry->text, entry->select.start, &x1, &y1,
- NULL, NULL);
- */
- evas_object_text_char_pos_get(entry->text, entry->select.start, &x1, &y1,
- NULL, NULL);
- if (entry->select.start + entry->select.length <=
- (int)strlen(entry->buffer))
- {
- /* checkme
- evas_text_at(entry->evas, entry->text,
- entry->select.start + entry->select.length - 1, &x2,
- NULL, &tw, &th);
- */
- evas_object_text_char_pos_get(entry->text,
- entry->select.start + entry->select.length - 1, &x2,
- NULL, &tw, &th);
- }
- else
- {
- /* checkme
- evas_text_at(entry->evas, entry->text,
- entry->select.start + entry->select.length - 2, &x2,
- NULL, &tw, &th);
- */
- evas_object_text_char_pos_get(entry->text,
- entry->select.start + entry->select.length - 2, &x2,
- NULL, &tw, &th);
- tw += entry->end_width;
- }
- /* checkme todo
- th = evas_get_text_height(entry->evas, entry->text);
- */
- if (entry->obj_selection)
- {
- ebits_move(entry->obj_selection,
- entry->x + x1 + entry->scroll_pos + p1l,
- entry->y + y1 + p1t);
- ebits_resize(entry->obj_selection, x2 + tw - x1 + p2l + p2r,
- th + p2t + p2b);
- ebits_show(entry->obj_selection);
- }
- }
- else
- {
- if (entry->obj_selection)
- ebits_hide(entry->obj_selection);
- }
-
- D_RETURN;
-}
-
-void
-e_entry_init(void)
-{
- D_ENTER;
-
- ecore_event_filter_handler_add(ECORE_EVENT_PASTE_REQUEST, e_paste_request);
- ecore_event_filter_handler_add(ECORE_EVENT_CLEAR_SELECTION,
- e_clear_selection);
-
- D_RETURN;
-}
-
-void
-e_entry_free(E_Entry * entry)
-{
- D_ENTER;
-
- entries = evas_list_remove(entries, entry);
- e_entry_unrealize(entry);
- IF_FREE(entry->buffer);
- FREE(entry);
-
- D_RETURN;
-}
-
-E_Entry *
-e_entry_new(void)
-{
- E_Entry *entry;
-
- D_ENTER;
-
- entry = NEW(E_Entry, 1);
- ZERO(entry, E_Entry, 1);
- e_strdup(entry->buffer, "");
- entry->select.start = -1;
- entry->end_width = 4;
- entries = evas_list_prepend(entries, entry);
-
- D_RETURN_(entry);
-}
-
-void
-e_entry_handle_keypress(E_Entry * entry, Ecore_Event_Key_Down * e)
-{
- D_ENTER;
-
- if (!entry->focused)
- D_RETURN;
- if (!strcmp(e->key, "Up"))
- {
- }
- else if (!strcmp(e->key, "Down"))
- {
- }
- else if (!strcmp(e->key, "Left"))
- {
- entry->cursor_pos--;
- if (entry->cursor_pos < 0)
- entry->cursor_pos = 0;
- }
- else if (!strcmp(e->key, "Right"))
- {
- entry->cursor_pos++;
- if (entry->cursor_pos > (int)strlen(entry->buffer))
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if (!strcmp(e->key, "Escape"))
- {
- entry->focused = 0;
- }
- else if (!strcmp(e->key, "BackSpace"))
- {
- /* char *str2; */
-
- if (entry->select.start >= 0)
- e_entry_clear_selection(entry);
- else if (entry->cursor_pos > 0)
- e_entry_delete_to_left(entry);
- }
- else if (!strcmp(e->key, "Delete"))
- {
- /* char *str2; */
-
- if (entry->select.start >= 0)
- e_entry_clear_selection(entry);
- else if (entry->cursor_pos < (int)strlen(entry->buffer))
- e_entry_delete_to_right(entry);
- }
- else if (!strcmp(e->key, "Insert"))
- {
- if (entry->paste_win)
- ecore_window_destroy(entry->paste_win);
- entry->paste_win = ecore_selection_request();
- }
- else if (!strcmp(e->key, "Home"))
- {
- entry->cursor_pos = 0;
- }
- else if (!strcmp(e->key, "End"))
- {
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if (!strcmp(e->key, "Prior"))
- {
- entry->cursor_pos = 0;
- }
- else if (!strcmp(e->key, "Next"))
- {
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if (!strcmp(e->key, "Return"))
- {
- entry->focused = 0;
- if (entry->func_enter)
- entry->func_enter(entry, entry->data_enter);
- }
- else
- {
- char *type;
-
- type = ecore_keypress_translate_into_typeable(e);
- if (type)
- {
- D("Keypress: %0x\n", type[0]);
- if ((strlen(type) == 1) && (type[0] == 0x01)) /* ctrl+a */
- {
- entry->cursor_pos = 0;
- }
- else if ((strlen(type) == 1) && (type[0] == 0x05)) /* ctrl+e */
- {
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if ((strlen(type) == 1) && (type[0] == 0x0b)) /* ctk+k */
- {
- char *str2;
-
- e_strdup(str2, e_entry_get_text(entry));
- str2[entry->cursor_pos] = 0;
- e_entry_set_text(entry, str2);
- FREE(str2);
- }
- else if ((strlen(type) == 1) && (type[0] == 0x06)) /* ctrl+f */
- {
- entry->cursor_pos++;
- if (entry->cursor_pos > (int)strlen(entry->buffer))
- entry->cursor_pos = strlen(entry->buffer);
- }
- else if ((strlen(type) == 1) && (type[0] == 0x02)) /* ctrl+b */
- {
- entry->cursor_pos--;
- if (entry->cursor_pos < 0)
- entry->cursor_pos = 0;
- }
- else if (strlen(type) > 0)
- {
- e_entry_clear_selection(entry);
- e_entry_insert_text(entry, type);
- }
- }
- }
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_set_evas(E_Entry * entry, Evas * evas)
-{
- D_ENTER;
-
- if (entry->evas)
- e_entry_unrealize(entry);
- entry->evas = evas;
- e_entry_realize(entry);
- e_entry_configure(entry);
- if (entry->visible)
- {
- entry->visible = 0;
- e_entry_show(entry);
- }
-
- D_RETURN;
-}
-
-void
-e_entry_show(E_Entry * entry)
-{
- D_ENTER;
-
- if (entry->visible)
- D_RETURN;
- entry->visible = 1;
- if (!entry->evas)
- D_RETURN;
- if (entry->obj_base)
- ebits_show(entry->obj_base);
- if (entry->obj_cursor)
- ebits_show(entry->obj_cursor);
- if (entry->obj_selection)
- ebits_show(entry->obj_selection);
- evas_object_show(entry->event_box);
- evas_object_show(entry->clip_box);
- evas_object_show(entry->text);
-
- D_RETURN;
-}
-
-void
-e_entry_hide(E_Entry * entry)
-{
- D_ENTER;
-
- if (!entry->visible)
- D_RETURN;
- entry->visible = 0;
- if (!entry->evas)
- D_RETURN;
- if (entry->obj_base)
- ebits_hide(entry->obj_base);
- if (entry->obj_cursor)
- ebits_hide(entry->obj_cursor);
- if (entry->obj_selection)
- ebits_hide(entry->obj_selection);
- evas_object_hide(entry->event_box);
- evas_object_hide(entry->clip_box);
- evas_object_hide(entry->text);
-
- D_RETURN;
-}
-
-void
-e_entry_raise(E_Entry * entry)
-{
- D_ENTER;
-
- if (entry->obj_base)
- ebits_raise(entry->obj_base);
- evas_object_raise(entry->clip_box);
- evas_object_raise(entry->text);
- if (entry->obj_selection)
- ebits_raise(entry->obj_selection);
- if (entry->obj_cursor)
- ebits_raise(entry->obj_cursor);
- evas_object_raise(entry->event_box);
-
- D_RETURN;
-}
-
-void
-e_entry_lower(E_Entry * entry)
-{
- D_ENTER;
-
- evas_object_lower(entry->event_box);
- if (entry->obj_cursor)
- ebits_lower(entry->obj_cursor);
- if (entry->obj_selection)
- ebits_lower(entry->obj_selection);
- evas_object_lower(entry->text);
- evas_object_lower(entry->clip_box);
- if (entry->obj_base)
- ebits_lower(entry->obj_base);
-
- D_RETURN;
-}
-
-void
-e_entry_set_layer(E_Entry * entry, int l)
-{
- D_ENTER;
-
- if (entry->obj_base)
- ebits_set_layer(entry->obj_base, l);
- evas_object_layer_set(entry->clip_box, l);
- evas_object_layer_set(entry->text, l);
- if (entry->obj_selection)
- ebits_set_layer(entry->obj_selection, l);
- if (entry->obj_cursor)
- ebits_set_layer(entry->obj_cursor, l);
- evas_object_layer_set(entry->event_box, l);
-
- D_RETURN;
-}
-
-void
-e_entry_set_clip(E_Entry * entry, Evas_Object * clip)
-{
- D_ENTER;
-
- evas_object_clip_set(entry->clip_box, clip);
- if (entry->obj_base)
- ebits_set_clip(entry->obj_base, clip);
-
- D_RETURN;
-}
-
-void
-e_entry_unset_clip(E_Entry * entry)
-{
- D_ENTER;
-
- evas_object_clip_unset(entry->clip_box);
- if (entry->obj_base)
- ebits_unset_clip(entry->obj_base);
-
- D_RETURN;
-}
-
-void
-e_entry_move(E_Entry * entry, int x, int y)
-{
- D_ENTER;
-
- entry->x = x;
- entry->y = y;
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_resize(E_Entry * entry, int w, int h)
-{
- D_ENTER;
-
- entry->w = w;
- entry->h = h;
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_query_max_size(E_Entry * entry, int *w, int *h)
-{
- int p1l, p1r, p1t, p1b;
- int p2l, p2r, p2t, p2b;
-
- D_ENTER;
-
- p1l = p1r = p1t = p1b = 0;
- if (entry->obj_base)
- ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
- p2l = p2r = p2t = p2b = 0;
- if (entry->obj_cursor)
- ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
-
- /* checkme todo
- if (w)
- *w =
- evas_get_text_width(entry->evas, entry->text) + p1l + p1r + p2l + p2r;
- if (h)
- *h =
- evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
- */
-
- D_RETURN;
- UN(w);
- UN(h);
-}
-
-void
-e_entry_max_size(E_Entry * entry, int *w, int *h)
-{
- int p1l, p1r, p1t, p1b;
- int p2l, p2r, p2t, p2b;
-
- D_ENTER;
-
- p1l = p1r = p1t = p1b = 0;
- if (entry->obj_base)
- ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
- p2l = p2r = p2t = p2b = 0;
- if (entry->obj_cursor)
- ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
- if (w)
- *w = 8000;
- /* checkme todo
- if (h)
- *h =
- evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
- */
-
- D_RETURN;
- UN(h);
-}
-
-void
-e_entry_min_size(E_Entry * entry, int *w, int *h)
-{
- int p1l, p1r, p1t, p1b;
- int p2l, p2r, p2t, p2b;
-
- D_ENTER;
-
- p1l = p1r = p1t = p1b = 0;
- if (entry->obj_base)
- ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
- p2l = p2r = p2t = p2b = 0;
- if (entry->obj_cursor)
- ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
- if (w)
- *w = p1l + p1r + p2l + p2r + entry->min_size;
- /* checkme todo
- if (h)
- *h =
- evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
- */
-
- D_RETURN;
- UN(h);
-}
-
-void
-e_entry_set_size(E_Entry * entry, int w, int h)
-{
- int p1l, p1r, p1t, p1b;
- int p2l, p2r, p2t, p2b;
-
- D_ENTER;
-
- p1l = p1r = p1t = p1b = 0;
- if (entry->obj_base)
- ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
- p2l = p2r = p2t = p2b = 0;
- if (entry->obj_cursor)
- ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
- if (p1l + p1r + p2l + p2r + w > entry->w)
- {
- entry->min_size = w;
- e_entry_configure(entry);
- }
-
- D_RETURN;
- UN(h);
-}
-
-void
-e_entry_set_focus(E_Entry * entry, int focused)
-{
- D_ENTER;
-
- if (entry->focused == focused)
- D_RETURN;
- entry->focused = focused;
- e_entry_configure(entry);
- if (entry->focused)
- {
- if (entry->func_focus_in)
- entry->func_focus_in(entry, entry->data_focus_in);
- }
- else
- {
- if (entry->func_focus_out)
- entry->func_focus_out(entry, entry->data_focus_out);
- }
-
- D_RETURN;
-}
-
-void
-e_entry_set_text(E_Entry * entry, const char *text)
-{
- D_ENTER;
-
- IF_FREE(entry->buffer);
- e_strdup(entry->buffer, text);
- evas_object_text_text_set(entry->text, entry->buffer);
- if (entry->cursor_pos > (int)strlen(entry->buffer))
- entry->cursor_pos = strlen(entry->buffer);
- e_entry_configure(entry);
- if (entry->func_changed)
- entry->func_changed(entry, entry->data_changed);
-
- D_RETURN;
-}
-
-const char *
-e_entry_get_text(E_Entry * entry)
-{
- D_ENTER;
-
- D_RETURN_(entry->buffer);
-}
-
-void
-e_entry_set_cursor(E_Entry * entry, int cursor_pos)
-{
- D_ENTER;
-
- entry->cursor_pos = cursor_pos;
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-int
-e_entry_get_cursor(E_Entry * entry)
-{
- D_ENTER;
-
- D_RETURN_(entry->cursor_pos);
-}
-
-void
-e_entry_set_changed_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry, void *_data),
- void *data)
-{
- D_ENTER;
-
- entry->func_changed = func;
- entry->data_changed = data;
-
- D_RETURN;
-}
-
-void
-e_entry_set_enter_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry, void *_data),
- void *data)
-{
- D_ENTER;
-
- entry->func_enter = func;
- entry->data_enter = data;
-
- D_RETURN;
-}
-
-void
-e_entry_set_focus_in_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry, void *_data),
- void *data)
-{
- D_ENTER;
-
- entry->func_focus_in = func;
- entry->data_focus_in = data;
-
- D_RETURN;
-}
-
-void
-e_entry_set_focus_out_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry, void *_data),
- void *data)
-{
- D_ENTER;
-
- entry->func_focus_out = func;
- entry->data_focus_out = data;
-
- D_RETURN;
-}
-
-void
-e_entry_insert_text(E_Entry * entry, char *text)
-{
- int size;
- char *str2;
-
- D_ENTER;
-
- if (!text)
- D_RETURN;
- size = strlen(e_entry_get_text(entry)) + 1 + strlen(text);
- str2 = malloc(size);
- str2[0] = 0;
- strncat(str2, entry->buffer, entry->cursor_pos);
- strncat(str2, text, size);
- strncat(str2, &(entry->buffer[entry->cursor_pos]), size);
- e_entry_set_text(entry, str2);
- FREE(str2);
- entry->cursor_pos += strlen(text);
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_clear_selection(E_Entry * entry)
-{
- char *str2;
-
- D_ENTER;
-
- if (entry->select.start >= 0)
- {
- e_strdup(str2, e_entry_get_text(entry));
- if (entry->select.start + entry->select.length >
- (int)strlen(entry->buffer))
- entry->select.length = strlen(entry->buffer) - entry->select.start;
- strcpy(&(str2[entry->select.start]),
- &(entry->buffer[entry->select.start + entry->select.length]));
- e_entry_set_text(entry, str2);
- FREE(str2);
- entry->cursor_pos = entry->select.start;
- entry->select.start = -1;
- }
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_delete_to_left(E_Entry * entry)
-{
- char *str2;
-
- D_ENTER;
-
- e_strdup(str2, e_entry_get_text(entry));
- strcpy(&(str2[entry->cursor_pos - 1]), &(entry->buffer[entry->cursor_pos]));
- entry->cursor_pos--;
- e_entry_set_text(entry, str2);
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-void
-e_entry_delete_to_right(E_Entry * entry)
-{
- char *str2;
-
- D_ENTER;
-
- e_strdup(str2, e_entry_get_text(entry));
- strcpy(&(str2[entry->cursor_pos]), &(entry->buffer[entry->cursor_pos + 1]));
- e_entry_set_text(entry, str2);
- FREE(str2);
- e_entry_configure(entry);
-
- D_RETURN;
-}
-
-char *
-e_entry_get_selection(E_Entry * entry)
-{
- D_ENTER;
-
- if (entry->select.start >= 0)
- {
- char *str2;
- int len;
-
- len = entry->select.length;
- if (entry->select.start + entry->select.length >=
- (int)strlen(entry->buffer))
- len = strlen(entry->buffer) - entry->select.start;
- str2 = e_util_memdup(&(entry->buffer[entry->select.start]), len + 1);
- str2[len] = 0;
- D_RETURN_(str2);
- }
-
- D_RETURN_(NULL);
-}
+++ /dev/null
-#ifndef E_ENTRY_H
-#define E_ENTRY_H
-
-#include "e.h"
-
-typedef struct _E_Entry E_Entry;
-
-struct _E_Entry
-{
- Evas * evas;
- char *buffer;
- int cursor_pos;
- struct
- {
- int start, length, down;
- }
- select;
- int mouse_down;
- int visible;
- int focused;
- int scroll_pos;
- int x, y, w, h;
- int min_size;
- Ebits_Object obj_base;
- Ebits_Object obj_cursor;
- Ebits_Object obj_selection;
- Evas_Object * event_box;
- Evas_Object * clip_box;
- Evas_Object * text;
- Window paste_win;
- Window selection_win;
- int end_width;
- void (*func_changed) (E_Entry * entry, void *data);
- void *data_changed;
- void (*func_enter) (E_Entry * entry, void *data);
- void *data_enter;
- void (*func_focus_in) (E_Entry * entry, void *data);
- void *data_focus_in;
- void (*func_focus_out) (E_Entry * entry, void *data);
- void *data_focus_out;
-};
-
-/**
- * e_entry_init - Text entry widget event handler initialization.
- *
- * This function initalizes the entry widget code, it registers
- * the event handlers needed for managing a text entry widget.
- */
-void e_entry_init(void);
-
-void e_entry_free(E_Entry * entry);
-E_Entry *e_entry_new(void);
-void e_entry_handle_keypress(E_Entry * entry,
- Ecore_Event_Key_Down * e);
-void e_entry_set_evas(E_Entry * entry, Evas * evas);
-void e_entry_show(E_Entry * entry);
-void e_entry_hide(E_Entry * entry);
-void e_entry_raise(E_Entry * entry);
-void e_entry_lower(E_Entry * entry);
-void e_entry_set_layer(E_Entry * entry, int l);
-void e_entry_set_clip(E_Entry * entry, Evas_Object * clip);
-void e_entry_unset_clip(E_Entry * entry);
-void e_entry_move(E_Entry * entry, int x, int y);
-void e_entry_resize(E_Entry * entry, int w, int h);
-void e_entry_query_max_size(E_Entry * entry, int *w, int *h);
-void e_entry_max_size(E_Entry * entry, int *w, int *h);
-void e_entry_min_size(E_Entry * entry, int *w, int *h);
-void e_entry_set_size(E_Entry * entry, int w, int h);
-void e_entry_set_focus(E_Entry * entry, int focused);
-void e_entry_set_text(E_Entry * entry, const char *text);
-const char *e_entry_get_text(E_Entry * entry);
-void e_entry_set_cursor(E_Entry * entry, int cursor_pos);
-int e_entry_get_cursor(E_Entry * entry);
-void e_entry_set_changed_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry,
- void *_data),
- void *data);
-void e_entry_set_enter_callback(E_Entry * entry,
- void (*func) (E_Entry * _entry,
- void *_data),
- void *data);
-void e_entry_set_focus_in_callback(E_Entry * entry,
- void (*func) (E_Entry *
- _entry,
- void *_data),
- void *data);
-void e_entry_set_focus_out_callback(E_Entry * entry,
- void (*func) (E_Entry *
- _entry,
- void *_data),
- void *data);
-void e_entry_insert_text(E_Entry * entry, char *text);
-void e_entry_clear_selection(E_Entry * entry);
-void e_entry_delete_to_left(E_Entry * entry);
-void e_entry_delete_to_right(E_Entry * entry);
-char *e_entry_get_selection(E_Entry * entry);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "exec.h"
-#include "desktops.h"
-#include "util.h"
-
-static int e_argc = 0;
-static char **e_argv = NULL;
-
-typedef struct _e_hack_found_cb E_Hack_Found_CB;
-
-struct _e_hack_found_cb
-{
- int dirty;
- void (*func) (Window win, void *data);
- void *func_data;
-};
-
-static Evas_List * hack_found_cb = NULL;
-
-void *
-e_exec_broadcast_cb_add(void (*func) (Window win, void *_data), void *data)
-{
- E_Hack_Found_CB *cb;
-
- cb = NEW(E_Hack_Found_CB, 1);
- ZERO(cb, E_Hack_Found_CB, 1);
- cb->func = func;
- cb->func_data = data;
- hack_found_cb = evas_list_append(hack_found_cb, cb);
- return cb;
-}
-
-void
-e_exec_broadcast_cb_del(void *cbp)
-{
- E_Hack_Found_CB *cb;
-
- cb = (E_Hack_Found_CB *) cbp;
- cb->dirty = 1;
-}
-
-void
-e_exec_broadcast_e_hack_found(Window win)
-{
- Evas_List * l;
-
- for (l = hack_found_cb; l; l = l->next)
- {
- E_Hack_Found_CB *cb;
-
- cb = l->data;
- if (!cb->dirty)
- {
- if (cb->func)
- cb->func(win, cb->func_data);
- }
- }
- again:
- for (l = hack_found_cb; l; l = l->next)
- {
- E_Hack_Found_CB *cb;
-
- cb = l->data;
- if (cb->dirty)
- {
- hack_found_cb = evas_list_remove(hack_found_cb, cb);
- goto again;
- }
- }
-}
-
-void
-e_exec_set_args(int argc, char **argv)
-{
- D_ENTER;
-
- e_argc = argc;
- e_argv = argv;
-
- D_RETURN;
-}
-
-void
-e_exec_restart(void)
-{
- int i, num;
- char exe[PATH_MAX];
-
- D_ENTER;
-
- D("e_exec_restart()\n");
- /* unset events on root */
- ecore_window_set_events(0, XEV_NONE);
- /* reset focus mode to default pointer root */
- ecore_focus_mode_reset();
- /* destroy all desktops */
- num = e_desktops_get_num();
- for (i = 0; i < num; i++)
- {
- E_Desktop *desk;
-
- desk = e_desktops_get(0);
- e_desktops_delete(desk);
- }
- /* ensure it's all done */
- ecore_sync();
- /* rerun myself */
- exe[0] = 0;
- for (i = 0; i < e_argc; i++)
- {
- strncat(exe, e_argv[i], PATH_MAX);
- strcat(exe, " ");
- }
- execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
-
- D_RETURN;
-}
-
-pid_t
-e_exec_run(char *exe)
-{
- pid_t pid;
-
- D_ENTER;
-
- pid = fork();
- if (pid)
- D_RETURN_(pid);
- setsid();
- execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
- exit(0);
-
- D_RETURN_(0);
-}
-
-pid_t
-e_exec_run_in_dir(char *exe, char *dir)
-{
- pid_t pid;
-
- D_ENTER;
-
- pid = fork();
- if (pid)
- D_RETURN_(pid);
- chdir(dir);
- setsid();
- execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
- exit(0);
-
- D_RETURN_(0);
-}
-
-pid_t
-e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env,
- char *launch_path)
-{
- static int launch_id = 0;
- char preload_paths[PATH_MAX];
- char preload[PATH_MAX];
- char *exe2;
- pid_t pid;
-
- D_ENTER;
-
- launch_id++;
- if (launch_id_ret)
- *launch_id_ret = launch_id;
- pid = fork();
- if (pid)
- D_RETURN_(pid);
- chdir(dir);
- setsid();
- if (env)
- {
- while (*env)
- {
- e_util_set_env(env[0], env[1]);
- env += 2;
- }
- }
- /* launch Id hack - if it's an X program the windows popped up should */
- /* have this launch Id number set on them - as well as process ID */
- /* machine name, and user name */
- if (launch_path)
- e_util_set_env("E_HACK_LAUNCH_PATH", launch_path);
- snprintf(preload_paths, PATH_MAX, "E_HACK_LAUNCH_ID=%i LD_PRELOAD_PATH='%s'",
- launch_id, PACKAGE_LIB_DIR);
- snprintf(preload, PATH_MAX, "LD_PRELOAD='libehack.so libX11.so libdl.so'");
- exe2 = malloc(strlen(exe) + 1 +
- strlen(preload_paths) + 1 + strlen(preload) + 1);
- snprintf(exe2, PATH_MAX, "%s %s %s", preload_paths, preload, exe);
-
- execl("/bin/sh", "/bin/sh", "-c", exe2, NULL);
- exit(0);
-
- D_RETURN_(0);
-}
+++ /dev/null
-#ifndef E_EXEC_H
-#define E_EXEC_H
-
-#include "e.h"
-
-void
- *e_exec_broadcast_cb_add(void (*func) (Window win, void *data), void *data);
-void e_exec_broadcast_cb_del(void *cb);
-void e_exec_broadcast_e_hack_found(Window win);
-void e_exec_set_args(int argc, char **argv);
-void e_exec_restart(void);
-pid_t e_exec_run(char *exe);
-pid_t e_exec_run_in_dir(char *exe, char *dir);
-pid_t e_exec_in_dir_with_env(char *exe, char *dir,
- int *launch_id_ret, char **env,
- char *launch_path);
-
-#endif
+++ /dev/null
-#include "e.h"
-#include "debug.h"
-#include "file.h"
-#include "util.h"
-
-time_t
-e_file_mod_time(char *file)
-{
- struct stat st;
-
- D_ENTER;
-
- if (stat(file, &st) < 0)
- D_RETURN_(0);
-
- D_RETURN_(st.st_mtime);
-}
-
-int
-e_file_exists(char *file)
-{
- struct stat st;
-
- D_ENTER;
-
- if (stat(file, &st) < 0)
- D_RETURN_(0);
-
- D_RETURN_(1);
-}
-
-int
-e_file_is_dir(char *file)
-{
- struct stat st;
-
- D_ENTER;
-
- if (stat(file, &st) < 0)
- D_RETURN_(0);
- if (S_ISDIR(st.st_mode))
- D_RETURN_(1);
-
- D_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)
-{
- D_ENTER;
-
- if (mkdir(dir, default_mode) < 0)
- D_RETURN_(0);
-
- D_RETURN_(1);
-}
-
-int
-e_file_cp(char *src, char *dst)
-{
- FILE *f1, *f2;
- char buf[16384];
- size_t num;
-
- D_ENTER;
-
- f1 = fopen(src, "rb");
- if (!f1)
- D_RETURN_(0);
- f2 = fopen(dst, "wb");
- if (!f2)
- {
- fclose(f1);
- D_RETURN_(0);
- }
- while ((num = fread(buf, 1, 16384, f1)) > 0)
- fwrite(buf, 1, num, f2);
- fclose(f1);
- fclose(f2);
-
- D_RETURN_(1);
-}
-
-char *
-e_file_realpath(char *file)
-{
- char buf[PATH_MAX];
- char *f;
-
- D_ENTER;
-
- if (!realpath(file, buf))
- D_RETURN_(strdup(""));
- e_strdup(f, buf);
-
- D_RETURN_(f);
-}
-
-char *
-e_file_get_file(char *path)
-{
- char *result = NULL;
-
- D_ENTER;
-
- if (!path)
- D_RETURN_(NULL);
-
- if ((result = strrchr(path, '/')))
- result++;
- else
- result = path;
-
- D_RETURN_(result);
-}
-
-char *
-e_file_get_dir(char *file)
-{
- char *p;
- char *f;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- STRNCPY(buf, file, PATH_MAX);
- p = strrchr(buf, '/');
- if (!p)
- {
- e_strdup(f, file);
- D_RETURN_(f);
- }
- *p = 0;
- e_strdup(f, buf);
-
- D_RETURN_(f);
-}
-
-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;
-
- D_ENTER;
-
- if (!st)
- D_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;
- }
-
- D_RETURN_(ok);
-}
-
-char *
-e_file_readlink(char *link)
-{
- char buf[PATH_MAX];
- char *f;
- int count;
-
- D_ENTER;
-
- if ((count = readlink(link, buf, sizeof(buf))) < 0)
- D_RETURN_(NULL);
- buf[count] = 0;
- e_strdup(f, buf);
-
- D_RETURN_(f);
-}
-
-Evas_List *
-e_file_ls(char *dir)
-{
- DIR *dirp;
- struct dirent *dp;
- Evas_List * list;
-
- D_ENTER;
-
- dirp = opendir(dir);
- if (!dirp)
- D_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)
- {
- e_strdup(f, dp->d_name);
- list = evas_list_prepend_relative(list, f, l->data);
- break;
- }
- }
- /* nowhwre to go? just append it */
- e_strdup(f, dp->d_name);
- if (!l)
- list = evas_list_append(list, f);
- }
- }
- closedir(dirp);
-
- D_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_cp(char *src, char *dst);
-char *e_file_realpath(char *file);
-
-/**
- * e_file_get_file - returns file in a path
- * @path: The chanonical path to a file
- *
- * This functions returns the file name (everything
- * after the last "/") of a full path. It returns
- * a pointer into the original string, so you don't
- * need to free the result.
- */
-char *e_file_get_file(char *path);
-
-/**
- * e_file_get_dir - returns directory in a path
- * @path: The chanonical path to a file
- *
- * This functions returns the directory name (everything
- * before the last "/") of a full path. It returns
- * a freshly allocated string, so you need to free
- *the result.
- */
-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 "debug.h"
-#include "focus.h"
-#include "icccm.h"
-#include "e.h"
-#include "util.h"
-
-static Evas_List * focus_list = NULL;
-
-void
-e_focus_set_focus(E_Border * b)
-{
- D_ENTER;
-
- e_icccm_send_focus_to(b->win.client, e_focus_can_focus(b));
-
- D_RETURN;
-}
-
-int
-e_focus_can_focus(E_Border * b)
-{
- D_ENTER;
-
- D_RETURN_(b->client.takes_focus);
-}
-
-void
-e_focus_list_border_add(E_Border * b)
-{
- D_ENTER;
-
- D_RETURN;
- UN(b);
-}
-
-void
-e_focus_list_border_del(E_Border * b)
-{
- D_ENTER;
-
- D_RETURN;
- UN(b);
-}
-
-void
-e_focus_list_clear(void)
-{
- D_ENTER;
-
- if (focus_list)
- {
- evas_list_free(focus_list);
- focus_list = NULL;
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_FOCUS_H
-#define E_FOCUS_H
-
-#include "border.h"
-
-void e_focus_set_focus(E_Border * b);
-int e_focus_can_focus(E_Border * b);
-void e_focus_list_border_add(E_Border * b);
-void e_focus_list_border_del(E_Border * b);
-void e_focus_list_clear(void);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "fs.h"
-#include "exec.h"
-#include "util.h"
-
-static EfsdConnection *ec = NULL;
-static Evas_List * fs_handlers = NULL;
-static Evas_List * fs_restart_handlers = NULL;
-static pid_t efsd_pid = 0;
-
-static void e_fs_child_handle(Ecore_Event * ev);
-static void e_fs_fd_handle(int fd);
-static void e_fs_restarter(int val, void *data);
-static void e_fs_idle(void *data);
-static void e_fs_flush_timeout(int val, void *data);
-
-static void
-e_fs_flush_timeout(int val, void *data)
-{
- D_ENTER;
-
- if (!ec)
- D_RETURN;
- if (efsd_commands_pending(ec) > 0)
- {
- if (efsd_flush(ec) > 0)
- ecore_add_event_timer("e_fs_flush_timeout()",
- 0.00, e_fs_flush_timeout, 0, NULL);
- }
-
- D_RETURN;
- UN(data);
- UN(val);
-}
-
-static void
-e_fs_idle(void *data)
-{
- D_ENTER;
-
- e_fs_flush_timeout(0, NULL);
-
- D_RETURN;
- UN(data);
-}
-
-static void
-e_fs_child_handle(Ecore_Event * ev)
-{
- Ecore_Event_Child *e;
-
- D_ENTER;
-
- e = ev->event;
- D("pid went splat! (%i)\n", e->pid);
- if (e->pid == efsd_pid)
- {
- D("it was efsd!\n");
- if (ec)
- efsd_close(ec);
- ec = NULL;
- efsd_pid = 0;
- e_fs_restarter(1, NULL);
- }
-
- D_RETURN;
-}
-
-static void
-e_fs_fd_handle(int fd)
-{
- double start, current;
-
- D_ENTER;
-
- start = ecore_get_time();
- while ((ec) && efsd_events_pending(ec))
- {
- EfsdEvent ev;
-
- if (efsd_next_event(ec, &ev) >= 0)
- {
- Evas_List * l;
-
- for (l = fs_handlers; l; l = l->next)
- {
- void (*func) (EfsdEvent * ev);
-
- func = l->data;
- func(&ev);
- }
- efsd_event_cleanup(&ev);
- }
- else
- {
- efsd_close(ec);
- ecore_del_event_fd(fd);
- ec = NULL;
- e_fs_restarter(0, NULL);
- /* FIXME: need to queue a popup dialog here saying */
- /* efsd went wonky */
- D("EEEEEEEEEEK efsd went wonky. Bye bye efsd.\n");
- }
-
- /* spent more thna 1/20th of a second here.. get out */
- current = ecore_get_time();
- if ((current - start) > 0.05)
- {
- D("fs... too much time spent..\n");
- break;
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_fs_restarter(int val, void *data)
-{
- D_ENTER;
-
- if (ec)
- D_RETURN;
-
- ec = efsd_open();
-
- if ((!ec) && (val > 0))
- {
- if (efsd_pid <= 0)
- {
- efsd_pid = e_exec_run("efsd -f");
- D("launch efsd... %i\n", efsd_pid);
- }
- if (efsd_pid > 0)
- ec = efsd_open();
- }
- if (ec)
- {
- Evas_List * l;
-
- ecore_add_event_fd(efsd_get_connection_fd(ec), e_fs_fd_handle);
- for (l = fs_restart_handlers; l; l = l->next)
- {
- E_FS_Restarter *rs;
-
- rs = l->data;
- rs->func(rs->data);
- }
- }
- else
- {
- double gap;
-
- gap = (double)val / 10;
- if (gap > 10.0)
- gap = 10.0;
- ecore_add_event_timer("e_fs_restarter", gap, e_fs_restarter, val + 1,
- NULL);
- }
-
- D_RETURN;
- UN(data);
-}
-
-E_FS_Restarter *
-e_fs_add_restart_handler(void (*func) (void *data), void *data)
-{
- E_FS_Restarter *rs;
-
- D_ENTER;
-
- rs = NEW(E_FS_Restarter, 1);
- ZERO(rs, E_FS_Restarter, 1);
- rs->func = func;
- rs->data = data;
- fs_restart_handlers = evas_list_append(fs_restart_handlers, rs);
-
- D_RETURN_(rs);
-}
-
-void
-e_fs_del_restart_handler(E_FS_Restarter * rs)
-{
- D_ENTER;
-
- if (evas_list_find(fs_restart_handlers, rs))
- {
- fs_restart_handlers = evas_list_remove(fs_restart_handlers, rs);
- FREE(rs);
- }
-
- D_RETURN;
-}
-
-void
-e_fs_add_event_handler(void (*func) (EfsdEvent * ev))
-{
- D_ENTER;
-
- if (!func)
- D_RETURN;
- fs_handlers = evas_list_append(fs_handlers, func);
-
- D_RETURN;
-}
-
-void
-e_fs_init(void)
-{
- D_ENTER;
-
- /* Hook in an fs handler that gets called whenever
- * a child of this process exits.
- */
- ecore_event_filter_handler_add(ECORE_EVENT_CHILD, e_fs_child_handle);
-
- /* Also hook in an idle handler to flush efsd's
- * write queue.
- *
- * FIXME: This should be handled by letting ecore
- * report when Efsd's file descriptor becomes
- * writeable, and then calling efsd_flush().
- */
- ecore_event_filter_idle_handler_add(e_fs_idle, NULL);
- e_fs_restarter(0, NULL);
-
- D_RETURN;
-}
-
-void
-e_fs_cleanup(void)
-{
- D_ENTER;
-
- efsd_close(ec);
- D("Connection to Efsd closed.\n");
-
- D_RETURN;
-}
-
-EfsdConnection *
-e_fs_get_connection(void)
-{
- D_ENTER;
-
- D_RETURN_(ec);
-}
+++ /dev/null
-#ifndef E_FS_H
-#define E_FS_H
-
-#include <libefsd.h>
-
-typedef struct _E_FS_Restarter E_FS_Restarter;
-
-struct _E_FS_Restarter
-{
- void (*func) (void *data);
- void *data;
-};
-
-/**
- * e_fs_init - Filesystem code initialization.
- *
- * This function makes sure that efsd is running,
- * starts it when necessary, and makes sure that
- * it can be restarted in case efsd dies.
- */
-void e_fs_init(void);
-
-/**
- * e_fs_cleanup - Filesystem code cleanup routine.
- *
- * This function takes care of properly saying
- * good bye to Efsd.
- */
-void e_fs_cleanup(void);
-
-E_FS_Restarter *e_fs_add_restart_handler(void (*func) (void *data),
- void *data);
-void e_fs_del_restart_handler(E_FS_Restarter * rs);
-void e_fs_add_event_handler(void (*func) (EfsdEvent * ev));
-EfsdConnection *e_fs_get_connection(void);
-
-#endif
+++ /dev/null
-#include <Evas.h>
-#include <Ecore.h>
-#include "view.h"
-#include "e_view_machine.h"
-
-Ecore_Event_Key_Modifiers multi_select_mod = ECORE_EVENT_KEY_MODIFIER_SHIFT;
-Ecore_Event_Key_Modifiers range_select_mod = ECORE_EVENT_KEY_MODIFIER_CTRL;
-E_View_Machine *VM = NULL;
+++ /dev/null
-#ifndef E_GLOBALS_H
-#define E_GLOBALS_H
-extern Ecore_Event_Key_Modifiers multi_select_mod;
-extern Ecore_Event_Key_Modifiers range_select_mod;
-extern E_View_Machine *VM;
-#endif
+++ /dev/null
-#include "debug.h"
-#include "guides.h"
-#include "text.h"
-#include "config.h"
-#include "embed.h"
-#include "util.h"
-#include <Imlib2.h>
-
-static struct
-{
- int changed;
-
- struct
- {
- struct
- {
- E_Guides_Location loc;
- struct
- {
- double x, y;
- }
- align;
- char *text;
- char *icon;
- }
- display;
- int x, y, w, h;
- int visible;
- E_Guides_Mode mode;
- }
- current , prev;
-
- struct
- {
- Window display;
- Window l, r, t, b;
- }
- win;
- struct
- {
- Evas * evas;
- Ebits_Object bg;
- E_Text *text;
- Evas_Object * icon;
- Imlib_Image image;
- }
- disp;
- struct
- {
- Embed icon;
- Embed text;
- }
- embed;
-}
-guides;
-
-static void e_guides_idle(void *data);
-static void e_guides_update(void);
-
-static void
-e_guides_idle(void *data)
-{
- D_ENTER;
-
- e_guides_update();
-
- D_RETURN;
- UN(data);
-}
-
-static void
-e_guides_update(void)
-{
- int font_cache = 1024 * 1024;
- int image_cache = 8192 * 1024;
- char *font_dir;
- int redraw;
-
- D_ENTER;
-
- if (!guides.changed)
- D_RETURN;
-
- redraw = 0;
- if (guides.prev.visible != guides.current.visible)
- {
- if (guides.current.visible)
- {
- if (!guides.win.display)
- {
- guides.win.l = ecore_window_override_new(0, 0, 0, 1, 1);
- guides.win.r = ecore_window_override_new(0, 0, 0, 1, 1);
- guides.win.t = ecore_window_override_new(0, 0, 0, 1, 1);
- guides.win.b = ecore_window_override_new(0, 0, 0, 1, 1);
- guides.win.display = ecore_window_override_new(0, 0, 0, 1, 1);
- ecore_window_save_under(guides.win.l);
- ecore_window_save_under(guides.win.r);
- ecore_window_save_under(guides.win.t);
- ecore_window_save_under(guides.win.b);
- ecore_window_save_under(guides.win.display);
- redraw = 1;
- }
- if (!guides.disp.evas)
- {
- font_dir = e_config_get("fonts");
- guides.disp.evas = evas_new();
- evas_output_method_set(guides.disp.evas,
- evas_render_method_lookup("software_x11"));
- evas_font_path_append(guides.disp.evas, font_dir);
- evas_output_size_set(guides.disp.evas, 1, 1);
- evas_output_viewport_set(guides.disp.evas, 0, 0, 1, 1);
- evas_font_cache_set(guides.disp.evas, font_cache);
- evas_image_cache_set(guides.disp.evas, image_cache);
-
- {
- Evas_Engine_Info_Software_X11 *einfo;
- XSetWindowAttributes att;
- /*Window window;*/
-
- Pixmap pmap, mask;
-
- pmap = ecore_pixmap_new(guides.win.display, 100, 100, 0);
- mask = ecore_pixmap_new(guides.win.display, 100, 100, 1);
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(guides.disp.evas);
-
- /* the following is specific to the engine */
- einfo->info.display = ecore_display_get();
- einfo->info.visual = DefaultVisual(einfo->info.display, DefaultScreen(einfo->info.display));
- einfo->info.colormap = DefaultColormap(einfo->info.display, DefaultScreen(einfo->info.display));
-
- att.background_pixmap = None;
- att.colormap = /*colormap*/ DefaultColormap(einfo->info.display, DefaultScreen(einfo->info.display));
- att.border_pixel = 0;
- att.event_mask = 0;
- einfo->info.drawable = pmap;
- einfo->info.mask = mask;
-
- einfo->info.depth = DefaultDepth(einfo->info.display, DefaultScreen(einfo->info.display));
- einfo->info.rotation = 0;
- einfo->info.debug = 0;
- evas_engine_info_set(guides.disp.evas, (Evas_Engine_Info *) einfo);
-
- /* And setup for Imlib2 */
- imlib_context_set_display(einfo->info.display);
- imlib_context_set_visual(DefaultVisual(einfo->info.display, DefaultScreen(einfo->info.display)));
- }
-
-
- }
- }
- else
- {
- if (guides.win.display)
- {
- ecore_window_destroy(guides.win.display);
- ecore_window_destroy(guides.win.l);
- ecore_window_destroy(guides.win.r);
- ecore_window_destroy(guides.win.t);
- ecore_window_destroy(guides.win.b);
- guides.win.display = 0;
- guides.win.l = 0;
- guides.win.r = 0;
- guides.win.t = 0;
- guides.win.b = 0;
- }
- if (guides.disp.evas)
- {
- if (guides.embed.icon)
- e_embed_free(guides.embed.icon);
- if (guides.embed.text)
- e_embed_free(guides.embed.text);
- guides.embed.icon = NULL;
- guides.embed.text = NULL;
- if (guides.disp.bg)
- ebits_free(guides.disp.bg);
- if (guides.disp.text)
- e_text_free(guides.disp.text);
- if (guides.disp.image)
- {
- imlib_context_set_image(guides.disp.image);
- imlib_free_image();
- }
- evas_free(guides.disp.evas);
- guides.disp.evas = NULL;
- guides.disp.bg = NULL;
- guides.disp.text = NULL;
- guides.disp.icon = NULL;
- guides.disp.image = NULL;
- }
- }
- }
- if (guides.current.x != guides.prev.x)
- redraw = 1;
- if (guides.current.y != guides.prev.y)
- redraw = 1;
- if (guides.current.w != guides.prev.w)
- redraw = 1;
- if (guides.current.h != guides.prev.h)
- redraw = 1;
- if (guides.current.display.loc != guides.prev.display.loc)
- redraw = 1;
- if (guides.current.display.align.x != guides.prev.display.align.x)
- redraw = 1;
- if (guides.current.display.align.y != guides.prev.display.align.y)
- redraw = 1;
- if (guides.current.display.text != guides.prev.display.text)
- redraw = 1;
- if (guides.current.display.icon != guides.prev.display.icon)
- redraw = 1;
- if (guides.current.mode != guides.prev.mode)
- redraw = 1;
-
- if ((guides.win.display) && (redraw))
- {
- int dx, dy, dw, dh, sw, sh, mw, mh;
- char file[PATH_MAX];
-
- if (!guides.disp.text)
- {
- guides.disp.text =
- e_text_new(guides.disp.evas, guides.current.display.text,
- "guides");
- e_text_set_layer(guides.disp.text, 100);
- e_text_show(guides.disp.text);
- }
- if ((!guides.current.display.icon) && (guides.disp.icon))
- {
- evas_object_del(guides.disp.icon);
- guides.disp.icon = NULL;
- }
- if ((guides.current.display.icon) && (!guides.disp.icon))
- {
- guides.disp.icon =
- evas_object_image_add(guides.disp.evas);
- evas_object_image_file_set(guides.disp.icon,
- guides.current.display.icon, NULL);
- evas_object_show(guides.disp.icon);
- }
- if (guides.disp.icon)
- evas_object_image_file_set(guides.disp.icon,
- guides.current.display.icon, NULL);
- e_text_set_text(guides.disp.text, guides.current.display.text);
- if (!guides.disp.bg)
- {
- char *dir;
-
- dir = e_config_get("guides");
- snprintf(file, PATH_MAX, "%s/display.bits.db", dir);
- guides.disp.bg = ebits_load(file);
- if (guides.disp.bg)
- {
- ebits_add_to_evas(guides.disp.bg, guides.disp.evas);
- ebits_set_layer(guides.disp.bg, 0);
- ebits_show(guides.disp.bg);
- }
- }
-
- mw = 1;
- mh = 1;
-
- if (guides.disp.bg)
- {
- if (!guides.embed.icon)
- {
- if (guides.embed.icon)
- e_embed_free(guides.embed.icon);
- if (guides.embed.text)
- e_embed_free(guides.embed.text);
- guides.embed.icon =
- e_embed_image_object(guides.disp.bg, "Icon",
- guides.disp.evas, guides.disp.icon);
- guides.embed.text =
- e_embed_text(guides.disp.bg, "Text", guides.disp.evas,
- guides.disp.text, 0, 0);
- }
- ebits_get_real_min_size(guides.disp.bg, &mw, &mh);
- }
-
- dw = mw;
- dh = mh;
-
- if (guides.disp.bg)
- {
- ebits_move(guides.disp.bg, 0, 0);
- ebits_resize(guides.disp.bg, dw, dh);
- }
- if (guides.current.display.loc ==
- E_GUIDES_DISPLAY_LOCATION_SCREEN_MIDDLE)
- {
- ecore_window_get_geometry(0, NULL, NULL, &sw, &sh);
- dx =
- (int)(((double)sw -
- (double)dw) * guides.current.display.align.x);
- dy =
- (int)(((double)sh -
- (double)dh) * guides.current.display.align.y);
- }
- else if (guides.current.display.loc ==
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE)
- {
- dx =
- guides.current.x +
- (int)(((double)guides.current.w -
- (double)dw) * guides.current.display.align.x);
- dy =
- guides.current.y +
- (int)(((double)guides.current.h -
- (double)dh) * guides.current.display.align.y);
- }
-
- if (guides.disp.image)
- {
- imlib_context_set_image(guides.disp.image);
- imlib_free_image();
- guides.disp.image = NULL;
- }
-
- evas_output_size_set(guides.disp.evas, dw, dh);
- evas_output_viewport_set(guides.disp.evas, 0, 0, dw, dh);
- evas_damage_rectangle_add(guides.disp.evas, 0, 0, dw, dh);
- evas_render(guides.disp.evas);
- {
- Evas_Engine_Info_Software_X11 *einfo;
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(guides.disp.evas);
-
-
- ecore_window_set_background_pixmap(guides.win.display, einfo->info.drawable);
- ecore_window_set_shape_mask(guides.win.display, einfo->info.mask);
- ecore_window_clear(guides.win.display);
- }
- ecore_window_move(guides.win.display, dx, dy);
- ecore_window_resize(guides.win.display, dw, dh);
-
- if (guides.current.mode == E_GUIDES_BOX)
- {
- int fr, fg, fb, fa, br, bg, bb, ba;
- int x, y, w, h;
- Pixmap pmap, mask;
- Imlib_Image image;
-
- imlib_context_set_dither_mask(1);
- imlib_context_set_dither(1);
- imlib_context_set_blend(1);
- imlib_context_set_color_modifier(NULL);
-
- fr = 255;
- fg = 255;
- fb = 255;
- fa = 255;
- br = 0;
- bg = 0;
- bb = 0;
- ba = 255;
-
- x = guides.current.x;
- y = guides.current.y + 3;
- w = 3;
- h = guides.current.h - 6;
- if ((w > 0) && (h > 0))
- {
- image = imlib_create_image(w, h);
- imlib_context_set_image(image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- imlib_context_set_color(fr, fg, fb, fa);
- imlib_image_draw_line(1, 0, 1, h - 1, 0);
- imlib_context_set_color(br, bg, bb, ba);
- imlib_image_draw_line(0, 0, 0, h - 1, 0);
- imlib_image_draw_line(2, 0, 2, h - 1, 0);
-
- pmap = ecore_pixmap_new(guides.win.l, w, h, 0);
- mask = ecore_pixmap_new(guides.win.l, w, h, 1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
- ecore_window_move(guides.win.l, x, y);
- ecore_window_resize(guides.win.l, w, h);
- ecore_window_set_background_pixmap(guides.win.l, pmap);
- ecore_window_set_shape_mask(guides.win.l, mask);
- ecore_window_clear(guides.win.l);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
- }
- else
- {
- ecore_window_resize(guides.win.l, 0, 0);
- }
-
- x = guides.current.x + guides.current.w - 3;
- y = guides.current.y + 3;
- w = 3;
- h = guides.current.h - 6;
- if ((w > 0) && (h > 0))
- {
- image = imlib_create_image(w, h);
- imlib_context_set_image(image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- imlib_context_set_color(fr, fg, fb, fa);
- imlib_image_draw_line(1, 0, 1, h - 1, 0);
- imlib_context_set_color(br, bg, bb, ba);
- imlib_image_draw_line(0, 0, 0, h - 1, 0);
- imlib_image_draw_line(2, 0, 2, h - 1, 0);
-
- pmap = ecore_pixmap_new(guides.win.r, w, h, 0);
- mask = ecore_pixmap_new(guides.win.r, w, h, 1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
- ecore_window_move(guides.win.r, x, y);
- ecore_window_resize(guides.win.r, w, h);
- ecore_window_set_background_pixmap(guides.win.r, pmap);
- ecore_window_set_shape_mask(guides.win.r, mask);
- ecore_window_clear(guides.win.r);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
- }
- else
- {
- ecore_window_resize(guides.win.r, 0, 0);
- }
-
- x = guides.current.x;
- y = guides.current.y;
- w = guides.current.w;
- h = 3;
- if ((w > 0) && (h > 0))
- {
- image = imlib_create_image(w, h);
- imlib_context_set_image(image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- imlib_context_set_color(br, bg, bb, ba);
- imlib_image_draw_line(0, 0, w - 1, 0, 0);
- imlib_image_draw_line(2, 2, w - 3, 2, 0);
- imlib_image_draw_line(0, 1, 0, 2, 0);
- imlib_image_draw_line(w - 1, 1, w - 1, 2, 0);
- imlib_context_set_color(fr, fg, fb, fa);
- imlib_image_draw_line(1, 1, w - 2, 1, 0);
- imlib_image_draw_line(1, 2, 1, 2, 0);
- imlib_image_draw_line(w - 2, 2, w - 2, 2, 0);
-
- pmap = ecore_pixmap_new(guides.win.t, w, h, 0);
- mask = ecore_pixmap_new(guides.win.t, w, h, 1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
- ecore_window_move(guides.win.t, x, y);
- ecore_window_resize(guides.win.t, w, h);
- ecore_window_set_background_pixmap(guides.win.t, pmap);
- ecore_window_set_shape_mask(guides.win.t, mask);
- ecore_window_clear(guides.win.t);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
- }
- else
- {
- ecore_window_resize(guides.win.t, 0, 0);
- }
-
- x = guides.current.x;
- y = guides.current.y + guides.current.h - 3;
- w = guides.current.w;
- h = 3;
- if ((w > 0) && (h > 0))
- {
- image = imlib_create_image(w, h);
- imlib_context_set_image(image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- imlib_context_set_color(br, bg, bb, ba);
- imlib_image_draw_line(0, 2, w - 1, 2, 0);
- imlib_image_draw_line(2, 0, w - 3, 0, 0);
- imlib_image_draw_line(0, 0, 0, 1, 0);
- imlib_image_draw_line(w - 1, 0, w - 1, 1, 0);
- imlib_context_set_color(fr, fg, fb, fa);
- imlib_image_draw_line(1, 1, w - 2, 1, 0);
- imlib_image_draw_line(1, 0, 1, 0, 0);
- imlib_image_draw_line(w - 2, 0, w - 2, 0, 0);
-
- pmap = ecore_pixmap_new(guides.win.b, w, h, 0);
- mask = ecore_pixmap_new(guides.win.b, w, h, 1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
- ecore_window_move(guides.win.b, x, y);
- ecore_window_resize(guides.win.b, w, h);
- ecore_window_set_background_pixmap(guides.win.b, pmap);
- ecore_window_set_shape_mask(guides.win.b, mask);
- ecore_window_clear(guides.win.b);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
- }
- else
- {
- ecore_window_resize(guides.win.b, 0, 0);
- }
- }
- }
-
- if (guides.prev.visible != guides.current.visible)
- {
- if (guides.current.visible)
- {
- if (guides.current.mode != E_GUIDES_OPAQUE)
- {
- ecore_window_raise(guides.win.l);
- ecore_window_show(guides.win.l);
- ecore_window_raise(guides.win.r);
- ecore_window_show(guides.win.r);
- ecore_window_raise(guides.win.t);
- ecore_window_show(guides.win.t);
- ecore_window_raise(guides.win.b);
- ecore_window_show(guides.win.b);
- }
- ecore_window_raise(guides.win.display);
- ecore_window_show(guides.win.display);
- }
- }
- if (guides.current.mode != guides.prev.mode)
- {
- if (guides.current.mode == E_GUIDES_BOX)
- {
- if (guides.current.visible)
- {
- ecore_window_raise(guides.win.l);
- ecore_window_show(guides.win.l);
- ecore_window_raise(guides.win.r);
- ecore_window_show(guides.win.r);
- ecore_window_raise(guides.win.t);
- ecore_window_show(guides.win.t);
- ecore_window_raise(guides.win.b);
- ecore_window_show(guides.win.b);
- ecore_window_raise(guides.win.display);
- ecore_window_show(guides.win.display);
- }
- }
- else if (guides.prev.mode == E_GUIDES_OPAQUE)
- {
- ecore_window_hide(guides.win.l);
- ecore_window_hide(guides.win.r);
- ecore_window_hide(guides.win.t);
- ecore_window_hide(guides.win.b);
- }
- }
- guides.prev = guides.current;
-
- D_RETURN;
-}
-
-void
-e_guides_show(void)
-{
- D_ENTER;
-
- if (guides.current.visible)
- D_RETURN;
- guides.changed = 1;
- guides.current.visible = 1;
-
- D_RETURN;
-}
-
-void
-e_guides_hide(void)
-{
- D_ENTER;
-
- if (!guides.current.visible)
- D_RETURN;
- guides.changed = 1;
- guides.current.visible = 0;
-
- D_RETURN;
-}
-
-void
-e_guides_move(int x, int y)
-{
- D_ENTER;
-
- if ((guides.current.x == x) && (guides.current.y == y))
- D_RETURN;
- guides.changed = 1;
- guides.current.x = x;
- guides.current.y = y;
-
- D_RETURN;
-}
-
-void
-e_guides_resize(int w, int h)
-{
- D_ENTER;
-
- if ((guides.current.w == w) && (guides.current.h == h))
- D_RETURN;
- guides.changed = 1;
- guides.current.w = w;
- guides.current.h = h;
-
- D_RETURN;
-}
-
-void
-e_guides_display_text(char *text)
-{
- D_ENTER;
-
- if ((guides.current.display.text) && (text) &&
- (!strcmp(guides.current.display.text, text)))
- D_RETURN;
- guides.changed = 1;
- IF_FREE(guides.current.display.text);
- guides.current.display.text = NULL;
- guides.prev.display.text = (char *)1;
- e_strdup(guides.current.display.text, text);
-
- D_RETURN;
-}
-
-void
-e_guides_display_icon(char *icon)
-{
- D_ENTER;
-
- if ((guides.current.display.icon) && (icon) &&
- (!strcmp(guides.current.display.icon, icon)))
- D_RETURN;
- guides.changed = 1;
- IF_FREE(guides.current.display.icon);
- guides.current.display.icon = NULL;
- guides.prev.display.icon = (char *)1;
- e_strdup(guides.current.display.icon, icon);
-
- D_RETURN;
-}
-
-void
-e_guides_set_display_location(E_Guides_Location loc)
-{
- D_ENTER;
-
- if (guides.current.display.loc == loc)
- D_RETURN;
- guides.changed = 1;
- guides.current.display.loc = loc;
-
- D_RETURN;
-}
-
-void
-e_guides_set_display_alignment(double x, double y)
-{
- D_ENTER;
-
- if ((guides.current.display.align.x == x) &&
- (guides.current.display.align.y == y))
- D_RETURN;
- guides.changed = 1;
- guides.current.display.align.x = x;
- guides.current.display.align.y = y;
-
- D_RETURN;
-}
-
-void
-e_guides_set_mode(E_Guides_Mode mode)
-{
- D_ENTER;
-
- if (guides.current.mode == mode)
- D_RETURN;
- guides.changed = 1;
- guides.current.mode = mode;
-
- D_RETURN;
-}
-
-void
-e_guides_init(void)
-{
- D_ENTER;
-
- guides.changed = 0;
-
- guides.current.display.loc = E_GUIDES_DISPLAY_LOCATION_SCREEN_MIDDLE;
- guides.current.display.text = NULL;
- guides.current.display.icon = NULL;
- guides.current.display.align.x = 0.5;
- guides.current.display.align.y = 0.5;
- guides.current.x = 0;
- guides.current.y = 0;
- guides.current.w = 0;
- guides.current.h = 0;
- guides.current.visible = 0;
- guides.current.mode = E_GUIDES_BOX;
-
- guides.prev = guides.current;
-
- guides.win.display = 0;
- guides.win.l = 0;
- guides.win.r = 0;
- guides.win.t = 0;
- guides.win.b = 0;
-
- guides.disp.evas = NULL;
- guides.disp.bg = NULL;
- guides.disp.text = NULL;
- guides.disp.icon = NULL;
- guides.disp.image = NULL;
-
- ecore_event_filter_idle_handler_add(e_guides_idle, NULL);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_GUIDES_H
-#define E_GUIDES_H
-
-typedef enum e_guides_mode
-{
- E_GUIDES_OPAQUE, /* configure window border & client */
- E_GUIDES_BORDER, /* unmap client and configure window border */
- E_GUIDES_BOX, /* box outline */
- E_GUIDES_TECHNICAL /* lots of lines & info */
-}
-E_Guides_Mode;
-
-typedef enum e_guides_location
-{
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE,
- E_GUIDES_DISPLAY_LOCATION_SCREEN_MIDDLE
-}
-E_Guides_Location;
-
-/**
- * e_guides_init - Guides initialization.
- *
- * This function initializes guides handling. Guides are
- * little help windows that pop up when you move or resize
- * a window.
- */
-void e_guides_init(void);
-
-void e_guides_show(void);
-void e_guides_hide(void);
-void e_guides_move(int x, int y);
-void e_guides_resize(int w, int h);
-void e_guides_display_text(char *text);
-void e_guides_display_icon(char *icon);
-void e_guides_set_display_location(E_Guides_Location loc);
-void e_guides_set_display_alignment(double x, double y);
-void e_guides_set_mode(E_Guides_Mode mode);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "e.h"
-#include "border.h"
-#include "icccm.h"
-#include "util.h"
-
-/* Motif window hints */
-#define MWM_HINTS_FUNCTIONS (1L << 0)
-#define MWM_HINTS_DECORATIONS (1L << 1)
-#define MWM_HINTS_INPUT_MODE (1L << 2)
-#define MWM_HINTS_STATUS (1L << 3)
-
-/* bit definitions for MwmHints.functions */
-#define MWM_FUNC_ALL (1L << 0)
-#define MWM_FUNC_RESIZE (1L << 1)
-#define MWM_FUNC_MOVE (1L << 2)
-#define MWM_FUNC_MINIMIZE (1L << 3)
-#define MWM_FUNC_MAXIMIZE (1L << 4)
-#define MWM_FUNC_CLOSE (1L << 5)
-
-/* bit definitions for MwmHints.decorations */
-#define MWM_DECOR_ALL (1L << 0)
-#define MWM_DECOR_BORDER (1L << 1)
-#define MWM_DECOR_RESIZEH (1L << 2)
-#define MWM_DECOR_TITLE (1L << 3)
-#define MWM_DECOR_MENU (1L << 4)
-#define MWM_DECOR_MINIMIZE (1L << 5)
-#define MWM_DECOR_MAXIMIZE (1L << 6)
-
-/* bit definitions for MwmHints.inputMode */
-#define MWM_INPUT_MODELESS 0
-#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
-#define MWM_INPUT_SYSTEM_MODAL 2
-#define MWM_INPUT_FULL_APPLICATION_MODAL 3
-
-#define PROP_MWM_HINTS_ELEMENTS 5
-
-/* Motif window hints */
-typedef struct _mwmhints
-{
- int flags;
- int functions;
- int decorations;
- int inputMode;
- int status;
-}
-MWMHints;
-
-void
-e_icccm_move_resize(Window win, int x, int y, int w, int h)
-{
- D_ENTER;
-
- ecore_window_send_event_move_resize(win, x, y, w, h);
-
- D_RETURN;
-}
-
-void
-e_icccm_send_focus_to(Window win, int takes_focus)
-{
- static Atom a_wm_take_focus = 0;
- static Atom a_wm_protocols = 0;
- int msg_focus = 0;
- int *props;
- int size;
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_take_focus, "WM_TAKE_FOCUS");
- ECORE_ATOM(a_wm_protocols, "WM_PROTOCOLS");
-
- props = ecore_window_property_get(win, a_wm_protocols, XA_ATOM, &size);
- if (props)
- {
- int i, num;
-
- num = size / sizeof(int);
- for (i = 0; i < num; i++)
- {
- if (props[i] == (int)a_wm_take_focus)
- msg_focus = 1;
- }
- FREE(props);
- }
- if (takes_focus)
- ecore_focus_to_window(win);
- if (msg_focus)
- {
- unsigned int data[5];
-
- data[0] = a_wm_take_focus;
- data[1] = CurrentTime;
- ecore_window_send_client_message(win, a_wm_protocols, 32, data);
- }
-
- D_RETURN;
-}
-
-void
-e_icccm_delete(Window win)
-{
- static Atom a_wm_delete_window = 0;
- static Atom a_wm_protocols = 0;
- int *props;
- int size;
- int del_win = 0;
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_delete_window, "WM_DELETE_WINDOW");
- ECORE_ATOM(a_wm_protocols, "WM_PROTOCOLS");
-
- props = ecore_window_property_get(win, a_wm_protocols, XA_ATOM, &size);
- if (props)
- {
- int i, num;
-
- num = size / sizeof(int);
- for (i = 0; i < num; i++)
- {
- if (props[i] == (int)a_wm_delete_window)
- del_win = 1;
- }
- FREE(props);
- }
- if (del_win)
- {
- unsigned int data[5];
-
- data[0] = a_wm_delete_window;
- data[1] = CurrentTime;
- ecore_window_send_client_message(win, a_wm_protocols, 32, data);
- }
- else
- {
- ecore_window_kill_client(win);
- }
-
- D_RETURN;
-}
-
-void
-e_icccm_state_mapped(Window win)
-{
- static Atom a_wm_state = 0;
- unsigned int data[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_state, "WM_STATE");
- data[0] = NormalState;
- data[1] = 0;
- ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_state_iconified(Window win)
-{
- static Atom a_wm_state = 0;
- unsigned int data[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_state, "WM_STATE");
- data[0] = IconicState;
- data[1] = 0;
- ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_state_withdrawn(Window win)
-{
- static Atom a_wm_state = 0;
- unsigned int data[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_state, "WM_STATE");
- data[0] = WithdrawnState;
- data[1] = 0;
- ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_adopt(Window win)
-{
- D_ENTER;
-
- ecore_window_add_to_save_set(win);
-
- D_RETURN;
-}
-
-void
-e_icccm_release(Window win)
-{
- D_ENTER;
-
- ecore_window_del_from_save_set(win);
-
- D_RETURN;
-}
-
-void
-e_icccm_get_pos_info(Window win, E_Border * b)
-{
- XSizeHints hint;
- int mask;
-
- D_ENTER;
-
- if (ecore_window_get_wm_size_hints(win, &hint, &mask))
- {
- if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
- {
- int x, y, w, h;
-
- D("%li %li\n", hint.flags & USPosition, hint.flags & PPosition);
- b->client.pos.requested = 1;
- b->client.pos.gravity = NorthWestGravity;
- if (hint.flags & PWinGravity)
- b->client.pos.gravity = hint.win_gravity;
- x = y = w = h = 0;
- ecore_window_get_geometry(win, &x, &y, &w, &h);
- b->client.pos.x = x;
- b->client.pos.y = y;
- }
- else
- {
- b->client.pos.requested = 0;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_icccm_get_size_info(Window win, E_Border * b)
-{
- int base_w, base_h, min_w, min_h, max_w, max_h, grav, step_w,
- step_h;
- double aspect_min, aspect_max;
- int mask;
- XSizeHints hint;
-
- D_ENTER;
-
- grav = NorthWestGravity;
- mask = 0;
- min_w = 0;
- min_h = 0;
- max_w = 65535;
- max_h = 65535;
- aspect_min = 0.0;
- aspect_max = 999999.0;
- step_w = 1;
- step_h = 1;
- base_w = 0;
- base_h = 0;
- if (ecore_window_get_wm_size_hints(win, &hint, &mask))
- {
- if (hint.flags & PMinSize)
- {
- min_w = hint.min_width;
- min_h = hint.min_height;
- }
- if (hint.flags & PMaxSize)
- {
- max_w = hint.max_width;
- max_h = hint.max_height;
- if (max_w < min_w)
- max_w = min_w;
- if (max_h < min_h)
- max_h = min_h;
- }
- if (hint.flags & PResizeInc)
- {
- step_w = hint.width_inc;
- step_h = hint.height_inc;
- if (step_w < 1)
- step_w = 1;
- if (step_h < 1)
- step_h = 1;
- }
- if (hint.flags & PBaseSize)
- {
- base_w = hint.base_width;
- base_h = hint.base_height;
- if (base_w > max_w)
- max_w = base_w;
- if (base_h > max_h)
- max_h = base_h;
- }
- else
- {
- base_w = min_w;
- base_h = min_h;
- }
- if (hint.flags & PAspect)
- {
- if (hint.min_aspect.y > 0)
- aspect_min =
- ((double)hint.min_aspect.x) / ((double)hint.min_aspect.y);
- if (hint.max_aspect.y > 0)
- aspect_max =
- ((double)hint.max_aspect.x) / ((double)hint.max_aspect.y);
- }
- }
- b->client.min.w = min_w;
- b->client.min.h = min_h;
- b->client.max.w = max_w;
- b->client.max.h = max_h;
- b->client.base.w = base_w;
- b->client.base.h = base_h;
- b->client.step.w = step_w;
- b->client.step.h = step_h;
- b->client.min.aspect = aspect_min;
- b->client.max.aspect = aspect_max;
- b->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_icccm_get_mwm_hints(Window win, E_Border * b)
-{
- static Atom a_motif_wm_hints = 0;
- MWMHints *mwmhints;
- int size;
-
- D_ENTER;
-
- ECORE_ATOM(a_motif_wm_hints, "_MOTIF_WM_HINTS");
-
- mwmhints =
- ecore_window_property_get(win, a_motif_wm_hints, a_motif_wm_hints, &size);
- if (mwmhints)
- {
- int num;
-
- num = size / sizeof(int);
- if (num < PROP_MWM_HINTS_ELEMENTS)
- {
- FREE(mwmhints);
- D_RETURN;
- }
- if (mwmhints->flags & MWM_HINTS_DECORATIONS)
- {
- b->client.border = 0;
- b->client.handles = 0;
- b->client.titlebar = 0;
- if (mwmhints->decorations & MWM_DECOR_ALL)
- {
- b->client.border = 1;
- b->client.handles = 1;
- b->client.titlebar = 1;
- }
- if (mwmhints->decorations & MWM_DECOR_BORDER)
- b->client.border = 1;
- if (mwmhints->decorations & MWM_DECOR_RESIZEH)
- b->client.handles = 1;
- if (mwmhints->decorations & MWM_DECOR_TITLE)
- b->client.titlebar = 1;
- }
- FREE(mwmhints);
- }
-
- D_RETURN;
-}
-
-void
-e_icccm_get_layer(Window win, E_Border * b)
-{
- static Atom a_win_layer = 0;
- int *props;
- int size;
-
- D_ENTER;
-
- ECORE_ATOM(a_win_layer, "_WIN_LAYER");
-
- props = ecore_window_property_get(win, a_win_layer, XA_CARDINAL, &size);
- if (props)
- {
- int num;
-
- num = size / sizeof(int);
- if (num > 0)
- b->client.layer = props[0];
- FREE(props);
- }
-
- D_RETURN;
-}
-
-void
-e_icccm_get_title(Window win, E_Border * b)
-{
- char *title;
-
- D_ENTER;
-
- title = ecore_window_get_title(win);
-
- if (b->client.title)
- {
- if ((title) && (!strcmp(title, b->client.title)))
- {
- FREE(title);
- D_RETURN;
- }
- b->changed = 1;
- FREE(b->client.title);
- }
- b->client.title = NULL;
- if (title)
- b->client.title = title;
- else
- e_strdup(b->client.title, "No Title");
-
- D_RETURN;
-}
-
-void
-e_icccm_get_class(Window win, E_Border * b)
-{
- D_ENTER;
-
- IF_FREE(b->client.name);
- IF_FREE(b->client.class);
- b->client.name = NULL;
- b->client.class = NULL;
- ecore_window_get_name_class(win, &(b->client.name), &(b->client.class));
- if (!b->client.name)
- e_strdup(b->client.name, "Unknown");
- if (!b->client.class)
- e_strdup(b->client.class, "Unknown");
-
- D_RETURN;
-}
-
-void
-e_icccm_get_hints(Window win, E_Border * b)
-{
- D_ENTER;
-
- ecore_window_get_hints(win,
- &(b->client.takes_focus),
- &(b->client.initial_state),
- NULL, NULL, NULL, &(b->client.group));
-
- D_RETURN;
-}
-
-void
-e_icccm_get_machine(Window win, E_Border * b)
-{
- D_ENTER;
-
- IF_FREE(b->client.machine);
- b->client.machine = NULL;
- b->client.machine = ecore_window_get_machine(win);
-
- D_RETURN;
-}
-
-void
-e_icccm_get_command(Window win, E_Border * b)
-{
- D_ENTER;
-
- IF_FREE(b->client.command);
- b->client.command = NULL;
- b->client.command = ecore_window_get_command(win);
-
- D_RETURN;
-}
-
-void
-e_icccm_get_icon_name(Window win, E_Border * b)
-{
- D_ENTER;
-
- IF_FREE(b->client.icon_name);
- b->client.icon_name = NULL;
- b->client.icon_name = ecore_window_get_icon_name(win);
-
- D_RETURN;
-}
-
-void
-e_icccm_get_state(Window win, E_Border * b)
-{
- D_ENTER;
-
- D_RETURN;
- UN(win);
- UN(b);
-}
-
-void
-e_icccm_set_frame_size(Window win, int l, int r, int t, int b)
-{
- static Atom a_e_frame_size = 0;
- int props[4];
-
- D_ENTER;
-
- ECORE_ATOM(a_e_frame_size, "_E_FRAME_SIZE");
- props[0] = l;
- props[1] = r;
- props[2] = t;
- props[3] = b;
- ecore_window_property_set(win, a_e_frame_size, XA_CARDINAL, 32, props, 4);
-
- D_RETURN;
-}
-
-void
-e_icccm_set_desk_area(Window win, int ax, int ay)
-{
- static Atom a_win_area = 0;
- int props[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_win_area, "_WIN_AREA");
- props[0] = ax;
- props[1] = ay;
- ecore_window_property_set(win, a_win_area, XA_CARDINAL, 32, props, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_set_desk_area_size(Window win, int ax, int ay)
-{
- static Atom a_win_area_count = 0;
- int props[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_win_area_count, "_WIN_AREA_COUNT");
- props[0] = ax;
- props[1] = ay;
- ecore_window_property_set(win, a_win_area_count, XA_CARDINAL, 32, props, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_set_desk(Window win, int d)
-{
- static Atom a_win_workspace = 0;
- int props[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_win_workspace, "_WIN_WORKSPACE");
- props[0] = d;
- ecore_window_property_set(win, a_win_workspace, XA_CARDINAL, 32, props, 1);
-
- D_RETURN;
-}
-
-int
-e_icccm_is_shaped(Window win)
-{
- int w, h, num;
- int shaped = 1;
- XRectangle *rect;
-
- D_ENTER;
-
- ecore_window_get_geometry(win, NULL, NULL, &w, &h);
- rect = ecore_window_get_shape_rectangles(win, &num);
-
- if (!rect)
- D_RETURN_(1);
-
- if ((num == 1) &&
- (rect[0].x == 0) && (rect[0].y == 0) &&
- (rect[0].width == w) && (rect[0].height == h))
- shaped = 0;
- XFree(rect);
-
- D_RETURN_(shaped);
-}
-
-void
-e_icccm_get_e_hack_launch_id(Window win, E_Border * b)
-{
- static Atom a_e_hack_launch_id = 0;
- int *props;
- int size;
-
- D_ENTER;
-
- ECORE_ATOM(a_e_hack_launch_id, "_E_HACK_LAUNCH_ID");
-
- props = ecore_window_property_get(win, a_e_hack_launch_id, XA_STRING, &size);
- if (props)
- {
- char *str;
-
- str = NEW(char, size + 1);
- ZERO(str, char, size + 1);
-
- memcpy(str, props, size);
- b->client.e.launch_id = atoi(str);
- FREE(str);
- FREE(props);
- }
- else
- b->client.e.launch_id = 0;
-
- D_RETURN;
-}
-
-void
-e_icccm_handle_property_change(Atom a, E_Border * b)
-{
- static Atom a_wm_normal_hints = 0;
- static Atom a_motif_wm_hints = 0;
- static Atom a_wm_name = 0;
- static Atom a_wm_class = 0;
- static Atom a_wm_hints = 0;
- static Atom a_wm_client_machine = 0;
- static Atom a_wm_command = 0;
- static Atom a_wm_icon_name = 0;
- static Atom a_wm_state = 0;
- static Atom a_e_hack_launch_id = 0;
-
- D_ENTER;
-
- ECORE_ATOM(a_wm_normal_hints, "WM_NORMAL_HINTS");
- ECORE_ATOM(a_motif_wm_hints, "_MOTIF_WM_HINTS");
- ECORE_ATOM(a_wm_name, "WM_NAME");
- ECORE_ATOM(a_wm_class, "WM_CLASS");
- ECORE_ATOM(a_wm_hints, "WM_HINTS");
- ECORE_ATOM(a_wm_client_machine, "WM_CLIENT_MACHINE");
- ECORE_ATOM(a_wm_command, "WM_COMMAND");
- ECORE_ATOM(a_wm_icon_name, "WM_ICON_NAME");
- ECORE_ATOM(a_wm_state, "WM_STATE");
- ECORE_ATOM(a_e_hack_launch_id, "_E_HACK_LAUNCH_ID");
-
- if (a == a_wm_normal_hints)
- e_icccm_get_size_info(b->win.client, b);
- else if (a == a_motif_wm_hints)
- e_icccm_get_mwm_hints(b->win.client, b);
- else if (a == a_wm_name)
- e_icccm_get_title(b->win.client, b);
- else if (a == a_wm_class)
- e_icccm_get_class(b->win.client, b);
- else if (a == a_wm_hints)
- e_icccm_get_hints(b->win.client, b);
- else if (a == a_wm_client_machine)
- e_icccm_get_machine(b->win.client, b);
- else if (a == a_wm_command)
- e_icccm_get_command(b->win.client, b);
- else if (a == a_wm_icon_name)
- e_icccm_get_icon_name(b->win.client, b);
- else if (a == a_wm_state)
- e_icccm_get_state(b->win.client, b);
- else if (a == a_e_hack_launch_id)
- e_icccm_get_e_hack_launch_id(b->win.client, b);
-
- D_RETURN;
-}
-
-void
-e_icccm_handle_client_message(Ecore_Event_Message * e)
-{
- D_ENTER;
-
- D_RETURN;
- UN(e);
-}
-
-void
-e_icccm_advertise_e_compat(void)
-{
- D_ENTER;
-
- D_RETURN;
-}
-
-void
-e_icccm_advertise_mwm_compat(void)
-{
- static Atom a_motif_wm_info = 0;
- int props[2];
-
- D_ENTER;
-
- ECORE_ATOM(a_motif_wm_info, "_MOTIF_WM_INFO");
- props[0] = 2;
- props[0] = ecore_window_root();
- ecore_window_property_set(0, a_motif_wm_info, a_motif_wm_info, 32, props, 2);
-
- D_RETURN;
-}
-
-void
-e_icccm_advertise_gnome_compat(void)
-{
- static Atom a_win_supporting_wm_check = 0;
- static Atom a_win_protocols = 0;
- static Atom a_win_wm_name = 0;
- static Atom a_win_wm_version = 0;
- static Atom a_win_layer = 0;
- int props[32];
- Window win;
-
- D_ENTER;
-
- ECORE_ATOM(a_win_protocols, "_WIN_PROTOCOLS");
- ECORE_ATOM(a_win_layer, "_WIN_LAYER");
- props[0] = a_win_protocols;
- ecore_window_property_set(0, a_win_protocols, XA_ATOM, 32, props, 1);
-
- ECORE_ATOM(a_win_wm_name, "_WIN_WM_NAME");
- ecore_window_property_set(0, a_win_wm_name, XA_STRING, 8, "Enlightenment",
- strlen("Enlightenment"));
- ECORE_ATOM(a_win_wm_version, "_WIN_WM_VERSION");
- ecore_window_property_set(0, a_win_wm_version, XA_STRING, 8, "0.17.0",
- strlen("0.17.0"));
-
- ECORE_ATOM(a_win_supporting_wm_check, "_WIN_SUPPORTING_WM_CHECK");
- win = ecore_window_override_new(0, 0, 0, 7, 7);
- props[0] = win;
- ecore_window_property_set(win, a_win_supporting_wm_check, XA_CARDINAL, 32,
- props, 1);
- ecore_window_property_set(0, a_win_supporting_wm_check, XA_CARDINAL, 32,
- props, 1);
-
- D_RETURN;
-}
-
-void
-e_icccm_advertise_kde_compat(void)
-{
- D_ENTER;
-
- D_RETURN;
-}
-
-void
-e_icccm_advertise_net_compat(void)
-{
- D_ENTER;
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_ICCCM_H
-#define E_ICCCM_H
-
-#include "e.h"
-
-void e_icccm_move_resize(Window win, int x, int y, int w, int h);
-void e_icccm_send_focus_to(Window win, int takes_focus);
-void e_icccm_delete(Window win);
-void e_icccm_state_mapped(Window win);
-void e_icccm_state_iconified(Window win);
-void e_icccm_state_withdrawn(Window win);
-void e_icccm_adopt(Window win);
-void e_icccm_release(Window win);
-void e_icccm_get_pos_info(Window win, E_Border * b);
-void e_icccm_get_size_info(Window win, E_Border * b);
-void e_icccm_get_mwm_hints(Window win, E_Border * b);
-void e_icccm_get_layer(Window win, E_Border * b);
-void e_icccm_get_title(Window win, E_Border * b);
-void e_icccm_get_class(Window win, E_Border * b);
-void e_icccm_get_hints(Window win, E_Border * b);
-void e_icccm_get_machine(Window win, E_Border * b);
-void e_icccm_get_command(Window win, E_Border * b);
-void e_icccm_get_icon_name(Window win, E_Border * b);
-void e_icccm_get_state(Window win, E_Border * b);
-void e_icccm_set_frame_size(Window win, int l, int r, int t,
- int b);
-void e_icccm_set_desk_area(Window win, int ax, int ay);
-void e_icccm_set_desk_area_size(Window win, int ax, int ay);
-void e_icccm_set_desk(Window win, int d);
-int e_icccm_is_shaped(Window win);
-void e_icccm_get_e_hack_launch_id(Window win, E_Border * b);
-void e_icccm_handle_property_change(Atom a, E_Border * b);
-void e_icccm_handle_client_message(Ecore_Event_Message * e);
-void e_icccm_advertise_e_compat(void);
-void e_icccm_advertise_mwm_compat(void);
-void e_icccm_advertise_gnome_compat(void);
-void e_icccm_advertise_kde_compat(void);
-void e_icccm_advertise_net_compat(void);
-
-#endif
+++ /dev/null
-#include "e.h"
-#include "debug.h"
-#include "data.h"
-#include "desktops.h"
-#include "iconbar.h"
-#include "util.h"
-#include "border.h"
-#include "file.h"
-#include "icons.h"
-
-#include <assert.h>
-#undef NDEBUG
-
-static E_Data_Base_Type *cf_iconbar = NULL;
-static E_Data_Base_Type *cf_iconbar_icon = NULL;
-
-static Evas_List * iconbars = NULL;
-
-/* internal func (iconbar use only) prototypes */
-
-static void e_ib_bit_down_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_ib_bit_up_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow,
- int oh);
-
-static void ib_scroll_timeout(int val, void *data);
-static void ib_timeout(int val, void *data);
-static void ib_cancel_launch_timeout(int val, void *data);
-
-static void ib_bits_show(void *data);
-static void ib_bits_hide(void *data);
-static void ib_bits_move(void *data, double x, double y);
-static void ib_bits_resize(void *data, double w, double h);
-static void ib_bits_raise(void *data);
-static void ib_bits_lower(void *data);
-static void ib_bits_set_layer(void *data, int l);
-static void ib_bits_set_clip(void *data, Evas_Object * clip);
-static void ib_bits_set_color_class(void *data, char *cc, int r, int g,
- int b, int a);
-static void ib_bits_get_min_size(void *data, double *w, double *h);
-static void ib_bits_get_max_size(void *data, double *w, double *h);
-
-static void ib_mouse_in(void *data, Evas * _e, Evas_Object * _o, void *event_info);
-static void ib_mouse_out(void *data, Evas * _e, Evas_Object * _o, void *event_info);
-static void ib_mouse_down(void *data, Evas * _e, Evas_Object * _o, void *event_info);
-static void ib_mouse_up(void *data, Evas * _e, Evas_Object * _o, void *event_info);
-static void ib_mouse_move(void *data, Evas * _e, Evas_Object * _o, void *event_info);
-
-static void e_iconbar_icon_cleanup(E_Iconbar_Icon * ic);
-
-static void ib_child_handle(Ecore_Event * ev);
-static void ib_window_mouse_out(Ecore_Event *ev);
-
-/* NB: comments here for illustration & helping people understand E's code */
-/* This is a start of the comments. if you feel they are not quite good */
-/* as you figure things out and if you think they could be more helpful */
-/* please feel free to add to them to make them easier to read and be more */
-/* helpful. */
-
-/* static internal - called when iconbar bit has a mouse button pressed */
-/* on it */
-static void
-e_ib_bit_down_cb(void *data, Ebits_Object o, char *class, int bt, int x,
- int y, int ox, int oy, int ow, int oh)
-{
- E_Iconbar *ib;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- if (!class)
- D_RETURN;
- if (!strcmp(class, "Scrollbar_Arrow1"))
- ib_scroll_timeout(8, ib);
- else if (!strcmp(class, "Scrollbar_Arrow2"))
- ib_scroll_timeout(-8, ib);
- else if (!strcmp(class, "Scrollbar_Trough"))
- {
- }
-
- D_RETURN;
- UN(o);
- UN(bt);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-
-}
-
-/* static internal - called when iconbar bit has a mouse button released */
-/* on it */
-static void
-e_ib_bit_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Iconbar *ib;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- if (!class)
- D_RETURN;
- if (!strcmp(class, "Scrollbar_Arrow1"))
- ib_scroll_timeout(0, ib);
- else if (!strcmp(class, "Scrollbar_Arrow2"))
- ib_scroll_timeout(0, ib);
- else if (!strcmp(class, "Scrollbar_Trough"))
- {
- }
-
- D_RETURN;
- UN(o);
- UN(bt);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-/**
- * e_iconbar_cleanup - Iconbar destructor.
- * @ib: The iconbar to be cleaned up.
- *
- * How do we free these pesky little urchins...
- */
-static void
-e_iconbar_cleanup(E_Iconbar * ib)
-{
- char buf[PATH_MAX];
-
- D_ENTER;
-
- /* remove from our list */
- iconbars = evas_list_remove(iconbars, ib);
-
- /* save scroll position */
- /* tell the view we attached to that somehting in it changed. this way */
- /* the view will now it needs to redraw */
- /* ib->desktop->changed = 1; */
- /* free up our ebits */
- if (ib->bit)
- ebits_free(ib->bit);
-
- /* if we have any icons... */
- if (ib->icons)
- {
- Evas_List * l;
-
- /* go thru the list of icon and unref each one.. ie - free it */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- e_object_unref(E_OBJECT(ic));
- }
- /* free the list itself */
- evas_list_free(ib->icons);
- }
- /* cleaup the clip object */
- if ((ib->desktop) && (ib->desktop->evas) && (ib->clip))
- evas_object_del(ib->clip);
- /* delete any timers intended to work on this iconbar */
- snprintf(buf, PATH_MAX, "iconbar_reload:%d", ib->desktop->desk.desk);
- ecore_del_event_timer(buf);
- snprintf(buf, PATH_MAX, "iconbar_scroll:%d", ib->desktop->desk.desk);
- ecore_del_event_timer(buf);
-
- /* call the destructor of the base class */
- e_object_cleanup(E_OBJECT(ib));
-
- D_RETURN;
-}
-
-/**
- * e_iconbar_init - Init function
- *
- * Initialises the iconbar system
- */
-void
-e_iconbar_init()
-{
- D_ENTER;
-
- /* we set up data structure and types so the data system can just */
- /* read a db and dump it right into memory - including lists of stuff */
-
- /* a new data type - an iconbar icon */
- cf_iconbar_icon = e_data_type_new();
- /* this is a member of the iconbar icon struct we want the data system */
- /* to get from the db for us. the key is "exec". the type is a string */
- /* the struct memebr is exec. the default value is "". see the data.h */
- /* header for more info */
- E_DATA_NODE(cf_iconbar_icon, "exec", E_DATA_TYPE_STR, NULL,
- E_Iconbar_Icon, exec, (E_Data_Value)"");
- E_DATA_NODE(cf_iconbar_icon, "wait", E_DATA_TYPE_INT, NULL,
- E_Iconbar_Icon, wait, (E_Data_Value)0);
- E_DATA_NODE(cf_iconbar_icon, "wait_timeout", E_DATA_TYPE_FLOAT, NULL,
- E_Iconbar_Icon, wait_timeout, (E_Data_Value)0);
- /* this memebr will be replaced by the relative key path in the db as a */
- /* string */
- E_DATA_NODE(cf_iconbar_icon, "image", E_DATA_TYPE_KEY, NULL,
- E_Iconbar_Icon, image_path, (E_Data_Value)"");
-
- /* a new data type - in this case the iconbar istelf. the only thing we */
- /* want the data system to do it fill it with iconbar icon members in */
- /* the list */
- cf_iconbar = e_data_type_new();
- E_DATA_NODE(cf_iconbar, "icons", E_DATA_TYPE_LIST, cf_iconbar_icon,
- E_Iconbar, icons, (E_Data_Value)"");
- E_DATA_NODE(cf_iconbar, "scroll", E_DATA_TYPE_FLOAT, NULL, E_Iconbar,
- scroll, (E_Data_Value)0);
-
- ecore_event_filter_handler_add(ECORE_EVENT_CHILD, ib_child_handle);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_OUT, ib_window_mouse_out);
-
- D_RETURN;
-}
-
-/**
- * e_iconbar_new - Iconbar constructor
- * @v: The view for which an iconbar is to be constructed
- */
-E_Iconbar *
-e_iconbar_new(E_Desktop * d)
-{
- Evas_List *l;
- char buf[PATH_MAX];
- E_Iconbar *ib;
-
- D_ENTER;
-
- D("new iconbar for desktop: %d\n", d->desk.desk);
- if(!d || !d->look || !d->look->obj
- || !d->look->obj->icb || !d->look->obj->icb_bits)
- D_RETURN_(NULL);
-
- /* first we want to load the iconbar data itself - ie the data info */
- /* for what icons we have and what they execute */
- snprintf(buf, PATH_MAX, "%s", d->look->obj->icb);
- /* use the data system to simply load up the db and start making */
- /* structs and lists and stuff for us... we told it how to in init */
- ib = e_data_load(buf, "", cf_iconbar);
- /* flush image cache */
- {
- if (d->evas)
- {
- int size;
-
- size = evas_image_cache_get(d->evas);
- evas_image_cache_flush(d->evas);
- evas_image_cache_set(d->evas, size);
- }
- }
- /* flush edb cached handled */
- e_db_flush();
- /* no iconbar data loaded ? return NULL */
- if (!ib)
- {
- D("no data loaded, return null\n");
- D_RETURN_(NULL);
- }
-
- /* now that the data system has doe the loading. we need to init the */
- /* object and set up ref counts and free method */
- e_object_init(E_OBJECT(ib), (E_Cleanup_Func) e_iconbar_cleanup);
-
- /* the iconbar needs to know what view it's in */
- ib->desktop = d;
- /* clip object = NULL */
- ib->clip = NULL;
- /* reset has been scrolled flag */
- ib->has_been_scrolled = 0;
-
- /* now go thru all the icons that were loaded */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- /* and init the iconbar icon object */
- e_object_init(E_OBJECT(ic), (E_Cleanup_Func) e_iconbar_icon_cleanup);
-
- /* and have the iconbar icon know what iconbar it belongs to */
- ic->iconbar = ib;
- }
-
- /* now we need to load up a bits file that tells us where in the view the */
- /* iconbar is meant to go. same place. just a slightly different name */
- snprintf(buf, PATH_MAX, "%s", ib->desktop->look->obj->icb_bits);
- ib->bit = ebits_load(buf);
-
- /* we didn't find one? */
- if (!ib->bit)
- {
- D("bits not loaded, cleanup and return null\n");
- /* unref the iconbar (and thus it will get freed and all icons in it */
- e_object_unref(E_OBJECT(ib));
- /* return NULL - no iconbar worth doing here if we don't know where */
- /* to put it */
- D_RETURN_(NULL);
- }
- ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow1",
- EVAS_CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
- ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow1",
- EVAS_CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
- ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow2",
- EVAS_CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
- ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow2",
- EVAS_CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
-
- /* add to our list of iconbars */
- iconbars = evas_list_append(iconbars, ib);
-
- /* aaah. our nicely constructed iconbar data struct with all the goodies */
- /* we need. return it. she's ready for use. */
- D("iconbar created!\n");
- D_RETURN_(ib);
-}
-
-/**
- * e_iconbar_icon_cleanup -- Iconbar icon destructor
- * @ic: The icon that is to be freed
- */
-static void
-e_iconbar_icon_cleanup(E_Iconbar_Icon * ic)
-{
- D_ENTER;
- D("iconbar icon cleanup\n");
- /* if we have an imageobject. nuke it */
- if (ic->image)
- evas_object_del(ic->image);
- /* cleanup the imlib_image */
- if (ic->imlib_image)
- {
- imlib_context_set_image(ic->imlib_image);
- imlib_free_image();
- }
-
- /* free strings ... if they exist */
- IF_FREE(ic->image_path);
- IF_FREE(ic->exec);
- /* stop the timer for this icon */
- if (ic->hi.timer)
- {
- ecore_del_event_timer(ic->hi.timer);
- FREE(ic->hi.timer);
- }
- if (ic->hi.image)
- evas_object_del(ic->hi.image);
-
- if (ic->launch_id_cb)
- {
- e_exec_broadcast_cb_del(ic->launch_id_cb);
- ic->launch_id_cb = NULL;
- }
- if (ic->launch_id)
- {
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "iconbar_launch_wait:%i", ic->launch_id);
- ecore_del_event_timer(buf);
- ic->launch_id = 0;
- }
- /* Call the destructor of the base class */
- e_object_cleanup(E_OBJECT(ic));
-
- D_RETURN;
-}
-
-/**
- * e_iconbar_realize - Iconbar initialization.
- * @ib: The iconbar to initalize
- *
- * Turns an iconbar into more than a
- * structure of data -- actually create evas objcts
- * we can do something visual with
- */
-void
-e_iconbar_realize(E_Iconbar * ib)
-{
- Evas_List * l;
-
- if (!ib) D_RETURN;
-
- D_ENTER;
- D("realize iconbar\n");
- /* create clip object */
- ib->clip = evas_object_rectangle_add(ib->desktop->evas);
- evas_object_color_set(ib->clip, 255, 255, 255, 190);
- /* go thru every icon in the iconbar */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
- char buf[PATH_MAX];
- int err;
-
- ic = l->data;
- /* set the path of the image to load to be the iconbar db plus */
- /* the path of the key to the image memebr - that is actually */
- /* a lump of image data inlined in the iconbar db - so the icons */
- /* themselves follow the iconbar wherever it goes */
- snprintf(buf, PATH_MAX, "%s:%s",
- ib->desktop->look->obj->icb, ic->image_path);
- /* add the icon image object */
- ic->image = evas_object_image_add(ib->desktop->evas);
- evas_object_image_file_set(ic->image, ib->desktop->look->obj->icb,
- ic->image_path);
- err = evas_object_image_load_error_get(ic->image);
- if(err)
- D("Evas icon load error %d !!!\n", err);
- /* add an imlib image so we can save it later */
- ic->imlib_image = imlib_load_image(buf);
- /* clip the icon */
- evas_object_clip_set(ic->image, ib->clip);
- /* set it to be semi-transparent */
- evas_object_color_set(ic->image, 255, 255, 255, 128);
- /* set up callbacks on events - so the ib_* functions will be */
- /* called when the corresponding event happens to the icon */
- evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_IN,
- ib_mouse_in, ic);
- evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_OUT,
- ib_mouse_out, ic);
- evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_DOWN,
- ib_mouse_down, ic);
- evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_UP,
- ib_mouse_up, ic);
- evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_MOVE,
- ib_mouse_move, ic);
- }
- /* add the ebit we loaded to the evas the iconbar exists in - now the */
- /* ebit is more than just structures as well. */
- ebits_add_to_evas(ib->bit, ib->desktop->evas);
- /* aaaaaaaaah. the magic of being able to replace a named bit in an ebit */
- /* (in this case we expect a bit called "Icons" to exist - the user will */
- /* have added a bit called this into the ebit to indicate where he/she */
- /* wants icons to go. we basically replace this bit with a virtual set */
- /* of callbacks that ebits will call if this bit is to be moved, resized */
- /* shown, hidden, raised, lowered etc. we provide the callbacks. */
- ebits_set_named_bit_replace(ib->bit, "Icons",
- ib_bits_show,
- ib_bits_hide,
- ib_bits_move,
- ib_bits_resize,
- ib_bits_raise,
- ib_bits_lower,
- ib_bits_set_layer,
- ib_bits_set_clip,
- ib_bits_set_color_class,
- ib_bits_get_min_size, ib_bits_get_max_size, ib);
- /* now move this ebit to a really high layer.. so its ontop of a lot */
- ebits_set_layer(ib->bit, 10000);
- /* and now call "fix" - i called it fix cause it does a few things... */
- /* but fixes the iconbar so its the size of the view, in the right */
- /* place and arranges the icons in their right spots */
- e_iconbar_fix(ib);
- D("realized!\n");
- D_RETURN;
-}
-
-/**
- * e_iconbar_get_length - get lenght of the icons in the iconbar
- * @ib: The iconbar for which to fix the geometry
- *
- * This functionc alculates the length of the iconbar (either horizontal)
- * or vertical - and returns that.
- *
- */
-double
-e_iconbar_get_length(E_Iconbar * ib)
-{
- double ix, iy, aw, ah;
- double len;
- Evas_List * l;
-
- D_ENTER;
-
- /* init len */
- len = 0;
- /* find icon area geometry */
- ix = ib->icon_area.x;
- iy = ib->icon_area.y;
- aw = ib->icon_area.w;
- ah = ib->icon_area.h;
-
- /* loop throught icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
- int iw, ih;
-
- ic = l->data;
- /* find out the original image size (of the image file) */
- evas_object_image_size_get(ic->image, &iw, &ih);
- if (aw > ah) /* horizontal */
- {
- len += iw;
- }
- else /* vertical */
- {
- len += ih;
- }
- }
- /* return length */
- D_RETURN_(len);
-}
-
-/**
- * e_iconbar_fix - iconbar geometry update
- * @ib: The iconbar for which to fix the geometry
- *
- * This function corrects the geometry and visibility
- * of the iconbar gfx and icons
- */
-void
-e_iconbar_fix(E_Iconbar * ib)
-{
- Evas_List * l;
- double x, y, w, h;
- double ix, iy, aw, ah;
-
- D_ENTER;
- x = y = w = h = 0;
- /* get geometry from layout */
- if (!e_view_layout_get_element_geometry(ib->desktop->layout, "Iconbar",
- &x, &y, &w, &h))
- {
- D_RETURN;
- }
- D("iconbar fix: %f, %f, %f, %f\n", x, y, w, h);
- /* move and resize iconbar to geometry specified in layout */
- ebits_move(ib->bit, x, y);
- ebits_resize(ib->bit, w, h);
- /* show it. harmless to do this all the time */
- ebits_show(ib->bit);
- /* tell the view we belong to something may have changed so it can draw */
- /* ib->desktop->changed = 1; */
-
- /* the callbacks set up in th ebtis replace will set up what area in */
- /* the canvas icons can exist in. lets extract them here */
- ix = ib->icon_area.x;
- iy = ib->icon_area.y;
- aw = ib->icon_area.w;
- ah = ib->icon_area.h;
-
- /* if we have icons- show the clipper that will clip them */
- if (ib->icons)
- evas_object_show(ib->clip);
- /* no icons - hide the clipper as it will be a real object */
- else
- evas_object_hide(ib->clip);
-
- /* move the clip object to fill the icon area */
- evas_object_move(ib->clip, ix, iy);
- evas_object_resize(ib->clip, aw, ah);
-
- if (aw > ah) /* horizontal */
- {
- double len;
-
- len = e_iconbar_get_length(ib);
- if (aw > len)
- {
- if ((ib->scroll + len) > aw)
- ib->scroll = aw - len;
- else if (ib->scroll < 0)
- ib->scroll = 0;
- }
- else
- {
- if ((ib->scroll + len) > aw)
- ib->scroll = aw - len;
- else if (ib->scroll > 0)
- ib->scroll = 0;
- }
- ix += ib->scroll;
- }
- else /* vertical */
- {
- double len;
-
- len = e_iconbar_get_length(ib);
- if (ah > len)
- {
- if ((ib->scroll + len) > ah)
- ib->scroll = ah - len;
- else if (ib->scroll < 0)
- ib->scroll = 0;
- }
- else
- {
- if ((ib->scroll + len) < ah)
- ib->scroll = ah - len;
- else if (ib->scroll > 0)
- ib->scroll = 0;
- }
- iy += ib->scroll;
- }
-
- /* now go thru all the icons... */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
- int iw, ih;
- double w, h;
- double ox, oy;
-
- ic = l->data;
- /* find out the original image size (of the image file) */
- evas_object_image_size_get(ic->image, &iw, &ih);
- w = iw;
- h = ih;
- ox = 0;
- oy = 0;
- /* if the area to put icons is wider that it is tall... horizonatal */
- /* layout of the icons seems smart */
- if (aw > ah) /* horizontal */
- {
- /* if the icon height is bigger than the icon space */
- if (h > ah)
- {
- /* scale the icon down in both directions soit fits */
- w = (ah * w) / h;
- h = ah;
- }
- /* center the icon vertically if its smaller */
- ox = 0;
- oy = (ah - h) / 2;
-
- /* set the icons geometry */
- ic->current.x = ix + ox;
- ic->current.y = iy + oy;
- ic->current.w = w;
- ic->current.h = h;
-
- /* advance our position counter to the next spot */
- ix += w;
- }
- /* taller than it is wide. might be good to be vertical */
- else /* vertical */
- {
- /* if theicon width is bigger than the icon space */
- if (w > aw)
- {
- /* scale it down to fit */
- h = (aw * h) / w;
- w = aw;
- }
- /* center it horizontally */
- ox = (aw - w) / 2;
- oy = 0;
-
- /* set the icons geometry */
- ic->current.x = ix + ox;
- ic->current.y = iy + oy;
- ic->current.w = w;
- ic->current.h = h;
-
- /* advance out counter to the next spot */
- iy += h;
- }
-
- /* now move the icona nd resize it */
- evas_object_move(ic->image, ic->current.x,
- ic->current.y);
- evas_object_resize(ic->image, ic->current.w,
- ic->current.h);
- evas_object_image_fill_set(ic->image, 0, 0,
- ic->current.w, ic->current.h);
-
- /* kjb cep - layer ??? */
- /*
- printf(" icon!! %f,%f %f,%f\n", ic->current.x, ic->current.y,
- ic->current.w, ic->current.h );
- */
- }
-
- D_RETURN;
-}
-
-/**
- * e_iconbar_save_out_final - save out final state of iconbar back to disk
- * @ib: The iconbar
- *
- * This function saves the state of the iconbar to the db it comes from
- */
-void
-e_iconbar_save_out_final(E_Iconbar * ib)
-{
- char buf[PATH_MAX];
-
- D_ENTER;
-
- if (ib->desktop)
- {
- E_DB_File *edb;
- Evas_List * l;
- int i;
-
- snprintf(buf, PATH_MAX, "%s/.e_iconbar.db", ib->desktop->dir);
- D("%s\n", buf);
-
- if (ib->changed)
- {
- D("ib changed\n") edb = e_db_open(buf);
- if (edb)
- {
- D("got edb\n");
- for (l = ib->icons, i = 0; l; l = l->next, i++)
- {
- E_Iconbar_Icon *ic = l->data;
- char buf2[PATH_MAX];
-
- if (ic)
- {
- /* save out exec */
- snprintf(buf2, PATH_MAX, "/icons/%i/exec", i);
- D("set exec: %i\n", i);
- e_db_str_set(edb, buf2, ic->exec);
-
- /* save out image */
- if (ic->imlib_image)
- {
- imlib_context_set_image(ic->imlib_image);
- imlib_image_attach_data_value("compression",
- NULL, 9, NULL);
- imlib_image_set_format("db");
-
- snprintf(buf2, PATH_MAX,
- "%s/.e_iconbar.db:/icons/%i/image",
- ib->desktop->dir, i);
- D("save image\n");
- imlib_save_image(buf2);
- }
- }
- }
- D("set count\n");
- e_db_int_set(edb, "/icons/count", i);
- D("set scroll\n");
- e_db_float_set(edb, "/scroll", ib->scroll);
- D("close db\n");
- e_db_close(edb);
-
- }
- }
-
- else
- {
- E_DB_FLOAT_SET(buf, "/scroll", ib->scroll);
- }
- /*D ("set just_saved\n");
- * ib->just_saved = 1; */
- ib->changed = 0;
-
- }
- D_RETURN;
-}
-
-void
-e_iconbar_handle_launch_id(Window win, void *data)
-{
- E_Iconbar_Icon *ic;
- E_Border *b;
-
- ic = (E_Iconbar_Icon *) data;
- b = e_border_find_by_window(win);
- if (!b)
- return;
- if ((ic->launch_id) && (b->client.e.launch_id))
- {
- if (b->client.e.launch_id == ic->launch_id)
- {
- if (ic->launch_id)
- {
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "iconbar_launch_wait:%i",
- ic->launch_id);
- ecore_del_event_timer(buf);
- }
- ic->launch_id = 0;
- if (ic->launch_id_cb)
- {
- e_exec_broadcast_cb_del(ic->launch_id_cb);
- ic->launch_id_cb = NULL;
- }
- evas_object_color_set(ic->image, 255, 255, 255,
- 128);
- /* ic->iconbar->desktop->changed = 1; */
- }
- }
-}
-
-/* static (internal to iconbar use only) callbacks */
-
-/* scroll timeout. called to continuously scroll when arrow button down */
-static void
-ib_scroll_timeout(int val, void *data)
-{
- E_Iconbar *ib;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- /* get our iconbar pointer */
- ib = (E_Iconbar *) data;
-
- snprintf(buf, PATH_MAX, "iconbar_scroll:%s", ib->desktop->name);
- if (val == 0)
- ecore_del_event_timer(buf);
- else
- {
- ib->has_been_scrolled = 1;
- ib->scroll += val;
- e_iconbar_fix(ib);
- ecore_add_event_timer(buf, 0.02, ib_scroll_timeout, val, ib);
- }
- D_RETURN;
-}
-
-static void
-ib_cancel_launch_timeout(int val, void *data)
-{
- E_Iconbar_Icon *ic;
-
- D_ENTER;
-
- ic = (E_Iconbar_Icon *) data;
-
- if (ic->launch_id)
- {
- ic->launch_id = 0;
- if (ic->launch_id_cb)
- {
- e_exec_broadcast_cb_del(ic->launch_id_cb);
- ic->launch_id_cb = NULL;
- }
- evas_object_color_set(ic->image, 255, 255, 255, 128);
- /* ic->iconbar->desktop->changed = 1; */
- }
- D_RETURN;
- UN(val);
-}
-
-/* this timeout is responsible for doing the mouse over animation */
-static void
-ib_timeout(int val, void *data)
-{
- E_Iconbar_Icon *ic;
- double t;
-
- D_ENTER;
-
- /* get the iconbar icon we are dealign with */
- ic = (E_Iconbar_Icon *) data;
- /* val <= 0 AND we're hilited ? first call as a timeout handler. */
- if ((val <= 0) && (ic->hilited))
- {
- /* note the "start" time */
- ic->hi.start = ecore_get_time();
- /* no hilite (animation) image */
- if (!ic->hi.image)
- {
- /* add it */
- ic->hi.image = evas_object_image_add(ic->iconbar->desktop->evas);
- evas_object_image_file_set(ic->hi.image,
- ic->iconbar->desktop->look->obj->icb,
- ic->image_path);
- /* put it high up */
- evas_object_layer_set(ic->hi.image, 20000);
- /* dont allow it to capture any events (enter, leave etc. */
- evas_object_pass_events_set(ic->hi.image, 1);
- /* show it */
- evas_object_show(ic->hi.image);
- }
- /* start at 0 */
- val = 0;
- }
- /* what time is it ? */
- t = ecore_get_time();
- if (ic->launch_id)
- {
- evas_object_color_set(ic->image, 255, 255, 255, 50);
- if (ic->hi.image)
- evas_object_color_set(ic->hi.image, 255, 255, 255, 0);
- }
- /* if the icon is hilited */
- else if (ic->hilited)
- {
- double x, y, w, h;
- double nw, nh, tt;
- int a;
- double speed;
-
- /* find out where the original icon image is */
- evas_object_geometry_get(ic->image, &x, &y, &w, &h);
- /* tt is the time since we started */
- tt = t - ic->hi.start;
- /* the speed to run at - the less, the faster (ie a loop is 0.5 sec) */
- speed = 0.5;
- /* if we are beyond the time loop.. reset the start time to now */
- if (tt > speed)
- ic->hi.start = t;
- /* limit time to max loop time */
- if (tt > speed)
- tt = speed;
- /* calculate alpha to be invers of time sizne loop start */
- a = (int)(255.0 * (speed - tt));
- /* size is icon size + how far in loop we are */
- nw = w * ((tt / speed) + 1.0);
- nh = h * ((tt / speed) + 1.0);
- /* move the hilite icon to a good spot */
- evas_object_move(ic->hi.image,
- x + ((w - nw) / 2), y + ((h - nh) / 2));
- /* resize it */
- evas_object_resize(ic->hi.image, nw, nh);
- /* reset its fill so ti fills its space */
- evas_object_image_fill_set(ic->hi.image, 0, 0, nw,
- nh);
- /* set its fade */
- evas_object_color_set(ic->hi.image, 255, 255, 255, a);
- /* incirment our count */
- val++;
- }
- /* if it snot hilited */
- else
- {
- double tt;
- int a;
- double speed;
-
- /* delete the animation object */
- if (ic->hi.image)
- evas_object_del(ic->hi.image);
- ic->hi.image = NULL;
-
- /* if we were pulsating.. reset start timer */
- if (val > 0)
- {
- ic->hi.start = t;
- /* val back to 0 */
- val = 0;
- }
- /* speed of the ramp */
- speed = 1.0;
- /* position on the fade out */
- tt = (t - ic->hi.start) / speed;
- if (tt > 1.0)
- tt = 1.0;
- /* alpha value caluclated on ramp position */
- a = (int)((double)((1.0 - tt) * 127.0) + 128.0);
- /* set alpha value */
- evas_object_color_set(ic->image, 255, 255, 255, a);
- /* time is at end of ramp.. kill timer */
- if (tt == 1.0)
- {
- /* free the timer name string */
- IF_FREE(ic->hi.timer);
- ic->hi.timer = NULL;
- }
- /* decrement count */
- val--;
- }
- /* if we have a timer name.. rerun the timer in 0.05 */
- if (ic->hi.timer)
- ecore_add_event_timer(ic->hi.timer, 0.05, ib_timeout, val, data);
- /* flag the view that we changed */
- /* ic->iconbar->desktop->changed = 1; */
-
- D_RETURN;
-}
-
-/* called when an ebits object bit needs to be shown */
-static void
-ib_bits_show(void *data)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* show all the icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- evas_object_show(ic->image);
- }
-
- D_RETURN;
-}
-
-/* called when an ebit object bit needs to hide */
-static void
-ib_bits_hide(void *data)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* hide all the icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- evas_object_hide(ic->image);
- }
-
- D_RETURN;
-}
-
-/* called when an ebit objetc bit needs to move */
-static void
-ib_bits_move(void *data, double x, double y)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* dont do anything.. just record the geometry. we'll deal with it later */
- ib->icon_area.x = x;
- ib->icon_area.y = y;
-
- D_RETURN;
- UN(l);
-}
-
-/* called when an ebit object bit needs to resize */
-static void
-ib_bits_resize(void *data, double w, double h)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* dont do anything.. just record the geometry. we'll deal with it later */
- ib->icon_area.w = w;
- ib->icon_area.h = h;
-
- D_RETURN;
- UN(l);
-}
-
-/* called when the ebits object bit needs to be raised */
-static void
-ib_bits_raise(void *data)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* raise all the icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- evas_object_raise(ic->image);
- }
-
- D_RETURN;
-}
-
-/* called when the ebits object bit needs to be lowered */
-static void
-ib_bits_lower(void *data)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* lower all the icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- evas_object_lower(ic->image);
- }
-
- D_RETURN;
-}
-
-/* called when the ebits object bit needs to change layers */
-static void
-ib_bits_set_layer(void *data, int lay)
-{
- E_Iconbar *ib;
- Evas_List * l;
-
- D_ENTER;
-
- ib = (E_Iconbar *) data;
- /* set the layer for all the icons */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- evas_object_layer_set(ic->image, lay);
- }
-
- D_RETURN;
-}
-
-/* not used... err.. ebits clips for us to the maximum allowed space of */
-/* the ebit object bit - dont know why i have this here */
-static void
-ib_bits_set_clip(void *data, Evas_Object * clip)
-{
- D_ENTER;
-
- D_RETURN;
- UN(data);
- UN(clip);
-}
-
-/* we arent going to recolor our icons here according to color class */
-static void
-ib_bits_set_color_class(void *data, char *cc, int r, int g, int b, int a)
-{
- D_ENTER;
-
- D_RETURN;
- UN(data);
- UN(cc);
- UN(r);
- UN(g);
- UN(b);
- UN(a);
-}
-
-/* our minimum size for icon space is 0x0 */
-static void
-ib_bits_get_min_size(void *data, double *w, double *h)
-{
- D_ENTER;
-
- *w = 0;
- *h = 0;
-
- D_RETURN;
- UN(data);
-}
-
-/* our maximum is huge */
-static void
-ib_bits_get_max_size(void *data, double *w, double *h)
-{
- D_ENTER;
-
- *w = 999999;
- *h = 999999;
-
- D_RETURN;
- UN(data);
-}
-
-/* called on events on icons */
-
-/* called when a mouse goes in on an icon object */
-static void
-ib_mouse_in(void *data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Iconbar_Icon *ic;
-
- D_ENTER;
-
- /* get he iconbaricon pointer from the data member */
- ic = (E_Iconbar_Icon *) data;
- /* set hilited flag */
- ic->hilited = 1;
- /* make it more opaque */
- evas_object_color_set(ic->image, 255, 255, 255, 255);
- /* if we havent started an animation timer - start one */
- if (!ic->hi.timer)
- {
- char buf[PATH_MAX];
-
- /* come up with a unique name for it */
- snprintf(buf, PATH_MAX, "iconbar:%s/%s", ic->iconbar->desktop->name,
- ic->image_path);
- e_strdup(ic->hi.timer, buf);
- /* call the timeout */
- ib_timeout(0, ic);
- }
- /* tell the view the iconbar is in.. something changed that might mean */
- /* a redraw is needed */
- /* ic->iconbar->desktop->changed = 1; */
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-/* called when a mouse goes out of an icon object */
-static void
-ib_mouse_out(void *data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Iconbar_Icon *ic;
-
- D_ENTER;
-
- /* get he iconbaricon pointer from the data member */
- ic = (E_Iconbar_Icon *) data;
- /* unset hilited flag */
- ic->hilited = 0;
- /* tell the view the iconbar is in.. something changed that might mean */
- /* a redraw is needed */
- /* ic->iconbar->desktop->changed = 1; */
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-/* called when the mouse goes up on an icon object */
-static void
-ib_mouse_up(void *data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Iconbar_Icon *ic;
- Evas_Event_Mouse_Up *ev = event_info;
-
- D_ENTER;
-
- /* get he iconbaricon pointer from the data member */
- ic = (E_Iconbar_Icon *) data;
-
- ic->mouse_down = 0;
- /* if we are moving the icon */
- if (ic->moving)
- {
- ic->moving = 0;
-
- e_iconbar_icon_move(ic, ev->output.x, ev->output.y);
- }
-
- /* Otherwise, not moving so execute, etc */
- else
- {
- /* if we're busy launching something.. dont run anything */
- if (ic->launch_id)
- D_RETURN;
- /* run something! */
- if (ic->exec)
- {
- if (!ic->wait)
- {
- if (e_exec_run(ic->exec) < 0)
- {
- D("Failed to execute: %s\n", ic->exec);
- }
- }
- else
- {
- int id_ret = 0;
-
- ic->launch_pid =
- e_exec_in_dir_with_env(ic->exec, e_util_get_user_home(),
- &id_ret, NULL, NULL);
- if (ic->launch_pid >= 0)
- {
- ic->launch_id = id_ret;
- if (id_ret > 0)
- {
- char buf[PATH_MAX];
-
- ic->launch_id_cb =
- e_exec_broadcast_cb_add
- (e_iconbar_handle_launch_id, ic);
- snprintf(buf, PATH_MAX, "iconbar_launch_wait:%i",
- ic->launch_id);
- if (ic->wait_timeout > 0.0)
- ecore_add_event_timer(buf, ic->wait_timeout,
- ib_cancel_launch_timeout,
- ic->launch_id, ic);
- else
- ecore_add_event_timer(buf, 15.0,
- ib_cancel_launch_timeout,
- ic->launch_id, ic);
- evas_object_color_set(ic->image,
- 255, 255, 255, 50);
- if (ic->hi.image)
- evas_object_color_set(ic->hi.image, 255, 255, 255, 0);
- }
- }
- }
- }
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-/* called when the mouse goes down on an icon object */
-static void
-ib_mouse_down(void *data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Iconbar_Icon *ic;
- Evas_Event_Mouse_Down *ev = event_info;
-
- D_ENTER;
-
- ic = (E_Iconbar_Icon *) data;
-
- ic->down.x = ev->output.x;
- ic->down.y = ev->output.y;
-
- ic->mouse_down = ev->button;
-
- D_RETURN;
- UN(data);
- UN(_e);
- UN(_o);
-}
-
-/* called when a mouse goes out of an icon object */
-static void
-ib_mouse_move(void *data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Iconbar_Icon *ic;
- Evas_Event_Mouse_Move *ev = event_info;
-
- D_ENTER;
-
- /* get he iconbaricon pointer from the data member */
- ic = (E_Iconbar_Icon *) data;
-
- if (ic->mouse_down)
- {
- int dx, dy;
-
- ic->mouse.x = ev->cur.output.x;
- ic->mouse.y = ev->cur.output.y;
-
- dx = ic->down.x - ic->mouse.x;
- dy = ic->down.y - ic->mouse.y;
-
- if (dx > 3 || dx < -3 || dy > 3 || dy < -3)
- {
- ic->moving = 1;
-
- evas_object_move(ic->image,
- ic->mouse.x - (ic->down.x - ic->current.x),
- ic->mouse.y - (ic->down.y - ic->current.y));
- }
-
- }
-
- D_RETURN;
- UN(data);
- UN(_e);
- UN(_o);
-}
-
-void
-e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y)
-{
- D_ENTER;
-
- D("in icon move\n");
- /* if dragged outside remove from list */
- if (x > ic->iconbar->icon_area.x + ic->iconbar->icon_area.w ||
- y > ic->iconbar->icon_area.y + ic->iconbar->icon_area.h)
- {
- evas_list_remove(ic->iconbar->icons, ic);
-
- /* make the changes */
- e_iconbar_fix(ic->iconbar);
-
- /* set flag and save */
- ic->iconbar->changed = 1;
- e_iconbar_save_out_final(ic->iconbar);
-
- e_object_unref(E_OBJECT(ic));
- }
-
- /* otherwise move to the correct place in list */
- else
- {
- E_Iconbar_Icon *lic;
- Evas_List * l;
-
- double aw = ic->iconbar->icon_area.w;
- double ah = ic->iconbar->icon_area.h;
-
- /* before first icon? move to start */
- lic = (E_Iconbar_Icon *) ic->iconbar->icons->data;
- /* horizontal */
- if (aw > ah && x < lic->current.x)
- {
- ic->iconbar->icons = evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_prepend_relative(ic->iconbar->icons, ic, lic);
- }
- /* vertical */
- else if (aw < ah && y < lic->current.y)
- {
- ic->iconbar->icons = evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_prepend_relative(ic->iconbar->icons, ic, lic);
- }
-
- /* not before first icon, check place among other icons */
- else
- {
- for (l = ic->iconbar->icons; l; l = l->next)
- {
- lic = (E_Iconbar_Icon *) l->data;
-
- /* if in same position, skip */
- if (ic == lic)
- {
- l = l->next;
- if (l)
- lic = (E_Iconbar_Icon *) l->data;
- else
- break;
- }
- /* horizontal */
- if (aw > ah)
- {
- /* place before icon */
- if (x > lic->current.x &&
- x < lic->current.x + (lic->current.w / 2))
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_prepend_relative(ic->iconbar->icons,
- ic, lic);
- }
- /* place after icon */
- else if (x < lic->current.x + lic->current.w
- && x > lic->current.x + (lic->current.w / 2))
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_append_relative(ic->iconbar->icons, ic,
- lic);
- }
- /* after last icon */
- else if (x > lic->current.x + lic->current.w
- && l->next == NULL)
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_append_relative(ic->iconbar->icons, ic,
- lic);
- }
-
- }
- /* vertical */
- else
- {
- /* place before icon */
- if (y > lic->current.y &&
- y < lic->current.y + (lic->current.h / 2))
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_prepend_relative(ic->iconbar->icons,
- ic, lic);
- }
- /* place after icon */
- else if (y < lic->current.y + lic->current.h
- && y > lic->current.y + (lic->current.h / 2))
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_append_relative(ic->iconbar->icons, ic,
- lic);
- }
- /* after last icon */
- else if (y > lic->current.y + lic->current.h
- && l->next == NULL)
- {
- ic->iconbar->icons =
- evas_list_remove(ic->iconbar->icons, ic);
- ic->iconbar->icons =
- evas_list_append_relative(ic->iconbar->icons, ic,
- lic);
- }
- }
- }
- }
- /* make the changes */
- e_iconbar_fix(ic->iconbar);
-
- /* set flag and save */
- ic->iconbar->changed = 1;
- e_iconbar_save_out_final(ic->iconbar);
-/* ic->iconbar->just_saved = 0;*/
- e_desktop_ib_reload(ic->iconbar->desktop);
-
- }
- D_RETURN;
-}
-
-/* called when a dnd drop occurs on an iconbar */
-void
-e_iconbar_dnd_add_files(E_Desktop * d, E_View * source, int num_files,
- char **dnd_files)
-{
- Evas_List * execs = NULL;
- Evas_List * l;
-
- int i;
-
- D_ENTER;
- D("add files: %s\n", source->dir->dir);
- for (i = 0; i < num_files; i++)
- {
- char *file = e_file_get_file(strdup(dnd_files[i]));
- E_Icon *ic = e_icon_find_by_file(source, file);
-
- if (ic)
- {
- D("icon mime.base: %s\n", ic->file->info.mime.base);
- if (!strcmp(ic->file->info.mime.base, "db"))
- {
- /* if its an icon db, set the icon */
- D("db!\n");
- for (l = d->iconbar->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ibic;
- char buf[PATH_MAX];
-
- if (l->data)
- ibic = (E_Iconbar_Icon *) (l->data);
-
- if (ibic)
- {
- if (d->iconbar->dnd.x > ibic->current.x &&
- d->iconbar->dnd.x <
- ibic->current.x + ibic->current.w
- && d->iconbar->dnd.y > ibic->current.y
- && d->iconbar->dnd.y <
- ibic->current.y + ibic->current.h)
- {
- D("over icon: %s\n", ibic->exec);
- snprintf(buf, PATH_MAX, "%s/%s:/icon/normal",
- ic->view->dir->dir, ic->file->file);
- D("set icon: %s\n", buf);
-
- ibic->imlib_image = imlib_load_image(buf);
-
- /* FIXME: this should be cleaner */
- ibic->iconbar->changed = 1;
- e_iconbar_save_out_final(ibic->iconbar);
- }
- }
- }
- break;
- }
- else if (e_file_can_exec(&ic->file->stat))
- {
- execs = evas_list_append(execs, ic);
- }
- }
- }
- for (l = execs; l; l = l->next)
- {
- /* add exec icons */
- E_Icon *ic;
- E_Iconbar_Icon *ibic;
- char buf[PATH_MAX];
-
- D("now add the icon\n");
-
- if (l->data)
- ic = l->data;
- else
- D_RETURN;
-
- ibic = NEW(E_Iconbar_Icon, 1);
- ZERO(ibic, E_Iconbar_Icon, 1);
-
- e_object_init(E_OBJECT(ibic), (E_Cleanup_Func) e_iconbar_icon_cleanup);
- if (d->iconbar)
- ibic->iconbar = d->iconbar;
- else
- D("EEEEEEEEEEEEK: how the hell did this happen?");
-
- D("x: %f, v-dir: %s, ib-dir: %s\n", ibic->iconbar->icon_area.x,
- d->dir, ibic->iconbar->desktop->dir);
-
- if (!ic->file->info.icon)
- D_RETURN;
- snprintf(buf, PATH_MAX, "%s:/icon/normal", ic->file->info.icon);
- ibic->image = evas_object_image_add(d->evas);
- evas_object_image_file_set(ibic->image, ic->file->info.icon,
- "/icon/normal");
- ibic->imlib_image = imlib_load_image(buf);
- ibic->image_path = strdup(ic->file->info.icon);
- snprintf(buf, PATH_MAX, "%s/%s", ic->view->dir->dir, ic->file->file);
- ibic->exec = strdup(buf);
-
- evas_object_clip_set(ibic->image, d->iconbar->clip);
- evas_object_color_set(ibic->image, 255, 255, 255, 128);
- evas_object_layer_set(ibic->image, 11000);
- evas_object_show(ibic->image);
- evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_IN,
- ib_mouse_in, ibic);
- evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_OUT,
- ib_mouse_out, ibic);
- evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_DOWN,
- ib_mouse_down, ibic);
- evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_UP,
- ib_mouse_up, ibic);
- evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_MOVE,
- ib_mouse_move, ibic);
-
- ibic->iconbar->icons = evas_list_append(ibic->iconbar->icons, ibic);
-
- /* this adds the icon to the correct place in the list and saves */
- e_iconbar_icon_move(ibic, d->iconbar->dnd.x, d->iconbar->dnd.y);
- }
-}
-
-/* called when child processes exit */
-static void
-ib_child_handle(Ecore_Event * ev)
-{
- Ecore_Event_Child *e;
- Evas_List * l;
-
- D_ENTER;
-
- e = ev->event;
- for (l = iconbars; l; l = l->next)
- {
- E_Iconbar *ib;
- Evas_List * ll;
-
- ib = l->data;
- for (ll = ib->icons; ll; ll = ll->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = ll->data;
- if (ic->launch_pid == e->pid)
- {
- ic->launch_pid = 0;
- if (ic->launch_id)
- {
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "iconbar_launch_wait:%i",
- ic->launch_id);
- ecore_del_event_timer(buf);
- }
- ic->launch_id = 0;
- if (ic->launch_id_cb)
- {
- e_exec_broadcast_cb_del(ic->launch_id_cb);
- ic->launch_id_cb = NULL;
- }
-
- evas_object_color_set(ic->image, 255,
- 255, 255, 128);
-
- /* ic->iconbar->desktop->changed = 1; */
- D_RETURN;
- }
- }
- }
-
- D_RETURN;
-}
-
-static void
-ib_window_mouse_out(Ecore_Event * ev)
-{
- E_Desktop *desk;
- Ecore_Event_Window_Focus_Out *e;
- Evas_List *l;
-
- D_ENTER;
-
- e = ev->event;
- desk = e_desktops_get(e_desktops_get_current());
- if (desk->iconbar && e->win == e_desktop_window())
- {
- for (l = desk->iconbar->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic = l->data;
-
- ic->hilited = 0;
- }
- }
- D_RETURN;
-
-}
-
-E_Rect *
-e_iconbar_get_resist_rect(E_Iconbar * ib)
-{
- double x, y, w, h;
- int resist = 32;
- E_Rect *r;
-
- D_ENTER;
-
- ebits_get_named_bit_geometry(ib->bit, "Resist", &x, &y, &w, &h);
-
- r = NEW(E_Rect, 1);
- r->x = x;
- r->y = y;
- r->w = w;
- r->h = h;
- r->v1 = resist;
-
- D_RETURN_(r);
-}
+++ /dev/null
-#ifndef IB_ICONBAR_H
-#define IB_ICONBAR_H
-
-#include "e.h"
-#include "config.h"
-#include "exec.h"
-#include "view.h"
-#include "object.h"
-#include "resist.h"
-
-typedef struct _E_Iconbar_Icon E_Iconbar_Icon;
-
-#ifndef E_ICONBAR_TYPEDEF
-#define E_ICONBAR_TYPEDEF
-typedef struct _E_Iconbar E_Iconbar;
-#endif
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-struct _E_Iconbar
-{
- E_Object o;
-
- E_Desktop *desktop;
- Evas_List *icons;
-
- Evas_Object *clip;
-
- int has_been_scrolled;
- int changed;
- int just_saved;
- float scroll;
-
- Ebits_Object *bit;
- struct
- {
- double x, y, w, h;
- }
- icon_area;
-
- struct
- {
- int x, y;
- }
- dnd;
-};
-
-struct _E_Iconbar_Icon
-{
- E_Object o;
-
- E_Iconbar *iconbar;
-
- Evas_Object * image;
- Imlib_Image imlib_image;
-
- char *image_path;
- char *exec;
-
- int hilited;
- struct
- {
- Evas_Object * image;
- char *timer;
- double start;
- }
- hi;
-
- struct
- {
- double x, y;
- }
- down , mouse;
-
- struct
- {
- double x, y;
- double w, h;
- }
- current;
-
- int mouse_down;
- int moving;
-
- int wait;
- float wait_timeout;
-
- pid_t launch_pid;
- int launch_id;
- void *launch_id_cb;
-};
-
-void e_iconbar_init(void);
-E_Iconbar *e_iconbar_new(E_Desktop * d);
-void e_iconbar_icon_free(E_Iconbar_Icon *);
-void e_iconbar_realize(E_Iconbar * ib);
-void e_iconbar_fix(E_Iconbar * ib);
-double e_iconbar_get_length(E_Iconbar * ib);
-void e_iconbar_file_add(E_View * v, char *file);
-void e_iconbar_file_delete(E_View * v, char *file);
-void e_iconbar_file_change(E_View * v, char *file);
-void e_iconbar_save_out_final(E_Iconbar * ib);
-E_Rect *e_iconbar_get_resist_rect(E_Iconbar * ib);
-void e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y);
-void e_iconbar_dnd_add_files(E_Desktop * d, E_View * source,
- int num_files, char **dnd_files);
-
-#endif
+++ /dev/null
-#include "view.h"
-#include "icons.h"
-#include "debug.h"
-#include "cursors.h"
-#include "file.h"
-#include "util.h"
-#include "e_dir.h"
-#include "e_file.h"
-#include "e_view_machine.h"
-#include "globals.h"
-
-static void e_icon_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
-static void e_icon_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
-static void e_icon_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
-static void e_icon_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
-static void e_icon_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
-
-static void
-e_icon_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Icon *ic;
- Ecore_Event *ev;
- Ecore_Event_Mouse_Down *e;
- Evas_Event_Mouse_Down *ev_info = event_info;
-
- D_ENTER;
-
- ev = e_view_get_current_event();
- if (!ev)
- D_RETURN;
- e = ev->event;
- ic = _data;
- ic->view->select.down.x = ev_info->output.x;
- ic->view->select.down.y = ev_info->output.y;
- ic->state.clicked = 1;
- e_icon_update_state(ic);
- if (ev_info->button == 1)
- {
- if (e->double_click)
- {
- e_icon_exec(ic);
- ic->state.just_executed = 1;
- }
- else
- {
- if (!ic->state.selected)
- {
- if ((e->mods & multi_select_mod))
- {
- e_icon_select(ic);
- }
- else
- {
- e_view_deselect_all_except(ic);
- e_icon_select(ic);
- }
- ic->state.just_selected = 1;
- }
- }
- }
- else if (ev_info->button == 2)
- {
- }
- else if (ev_info->button == 3)
- {
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_icon_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Icon *ic;
- Ecore_Event *ev;
- Ecore_Event_Mouse_Up *e;
- Evas_Event_Mouse_Up *ev_info = event_info;
-
- D_ENTER;
-
- ev = e_view_get_current_event();
- if (!ev)
- D_RETURN;
- e = ev->event;
- ic = _data;
- if (ic->view->drag.started)
- {
- int x, y;
-
- ic->state.clicked = 0;
- ic->state.just_selected = 0;
- e_icon_update_state(ic);
- ecore_window_no_ignore(ic->view->drag.win);
- ecore_window_destroy(ic->view->drag.win);
- ic->view->drag.started = 0;
- if (e->mods & ECORE_EVENT_KEY_MODIFIER_SHIFT)
- ecore_dnd_set_mode_copy();
- else
- ecore_dnd_set_mode_move();
- ecore_dnd_set_data(ic->view->win.base);
-
- /* FIXME: if button use is right mouse then do an ask */
-
- /* Handle dnd motion(drop) - dragging==0 */
- ecore_pointer_xy_get(&x, &y);
- ecore_window_dnd_handle_motion(ic->view->win.base, x, y, 0);
- ecore_window_dnd_finished();
- D_RETURN;
- }
- if (ev_info->button == 1)
- {
- if (ic->state.just_executed)
- {
- ic->state.just_executed = 0;
- }
- else
- {
- if ((e->mods & multi_select_mod))
- {
- if ((ic->state.selected) && (!ic->state.just_selected))
- e_icon_deselect(ic);
- }
- else
- {
- e_view_deselect_all_except(ic);
- e_icon_select(ic);
- }
- }
- ic->state.just_selected = 0;
- }
- ic->state.clicked = 0;
- e_icon_update_state(ic);
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_icon_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Icon *ic;
-
- D_ENTER;
-
- ic = _data;
- e_cursors_display_in_window(ic->view->win.main, "View_Icon");
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-static void
-e_icon_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Icon *ic;
-
- ic = _data;
- e_cursors_display_in_window(ic->view->win.main, "View");
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-static void
-_paint_selected_icons_onto_drag_window(E_View * v, Imlib_Image im, int wx,
- int wy)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if (!v || !im || v->select.count <= 0)
- D_RETURN;
-
- /* paint all selected icons onto the invisible drag window */
- for (l = v->icons; l; l = l->next)
- {
- double ix, iy;
- int icx, icy;
- Imlib_Image im2;
- char icon[PATH_MAX];
- E_Icon *ic;
-
- ic = l->data;
- if (!ic->state.selected)
- continue;
-
- evas_object_geometry_get(ic->obj.icon, &ix, &iy, NULL, NULL);
- icx = ix + v->location.x - wx;
- icy = iy + v->location.y - wy;
- if (!ic->file->info.icon)
- {
- D("EEEEEEEEEEK %s has no icon\n", ic->file->file);
- D_RETURN;
- }
- if (ic->state.clicked)
- {
- snprintf(icon, PATH_MAX, "%s:/icon/clicked", ic->file->info.icon);
- }
- else if (ic->state.selected)
- {
- snprintf(icon, PATH_MAX, "%s:/icon/selected", ic->file->info.icon);
- }
- else
- {
- snprintf(icon, PATH_MAX, "%s:/icon/normal", ic->file->info.icon);
- }
- im2 = imlib_load_image(icon);
- if (im2)
- {
- int iw, ih;
-
- imlib_context_set_image(im2);
- iw = imlib_image_get_width();
- ih = imlib_image_get_height();
- imlib_context_set_image(im);
- imlib_blend_image_onto_image(im2, 1,
- 0, 0, iw, ih, icx, icy, iw, ih);
- imlib_context_set_image(im2);
- imlib_free_image();
- imlib_context_set_image(im);
- }
- else
- {
- D("eek cant load\n");
- }
- }
- D_RETURN;
-}
-
-static void
-_start_drag(E_View * v, int _x, int _y)
-{
- Pixmap pmap, mask;
- Evas_List * l;
- int x, y, xx, yy, rw, rh, downx, downy, wx, wy, ww, wh;
- int dx, dy;
-
- if (!v)
- D_RETURN;
-
- dx = abs(v->select.down.x - _x);
- dy = abs(v->select.down.y - _y);
- /* drag treshold */
- if ((dx < 3) && (dy < 3))
- D_RETURN;
-
- /* find extents of icons to be dragged */
- x = y = xx = yy = 999999999;
-
- D("sel count %i\n", v->select.count);
- if (v->select.count > 0)
- {
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if (ic->state.selected)
- {
- int ix, iy, iw, ih;
-
- ix = ic->view->scroll.x + ic->geom.x + v->location.x;
- iy = ic->view->scroll.y + ic->geom.y + v->location.y;
- iw = ic->geom.w;
- ih = ic->geom.h;
- if (ix < x)
- x = ix;
- if (iy < y)
- y = iy;
- if ((ix + iw) > xx)
- xx = ix + iw;
- if ((iy + ih) > yy)
- yy = iy + ih;
- }
- }
- }
- ecore_window_get_geometry(0, NULL, NULL, &rw, &rh);
- downx = v->select.down.x + v->location.x;
- downy = v->select.down.y + v->location.y;
-
- wx = x;
- ww = xx - x;
- if (wx < -(rw - downx))
- {
- wx = -(rw - downx);
- ww -= (wx - x);
- }
- if ((wx + ww) > (rw + downx))
- ww = (rw + downx) - wx;
- wy = y;
- wh = yy - y;
- if (wy < -(rh - downy))
- {
- wy = -(rh - downy);
- wh -= (wy - y);
- }
- if ((wy + wh) > (rh + downy))
- wh = (rh + downy) - wy;
-
- v->drag.x = wx + v->location.x;
- v->drag.y = wy + v->location.y;
- v->drag.offset.x = downx - v->drag.x;
- v->drag.offset.y = downy - v->drag.y;
-
- if ((ww < 1) || (wh < 1))
- D_RETURN;
-
- v->drag.win = ecore_window_override_new(0, wx, wy, ww, wh);
- pmap = ecore_pixmap_new(v->drag.win, ww, wh, 0);
- mask = ecore_pixmap_new(v->drag.win, ww, wh, 1);
- {
- Imlib_Image im;
-
- im = imlib_create_image(ww, wh);
- imlib_context_set_image(im);
- imlib_image_set_has_alpha(1);
- imlib_context_set_blend(1);
- imlib_image_clear();
- imlib_context_set_color_modifier(NULL);
- imlib_context_set_cliprect(0, 0, 0, 0);
- imlib_context_set_angle(0);
-
- _paint_selected_icons_onto_drag_window(v, im, wx, wy);
-
- imlib_context_set_image(im);
- if (ww * wh < (200 * 200))
- imlib_context_set_dither_mask(1);
- else
- imlib_context_set_dither_mask(0);
- imlib_context_set_dither(1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_context_set_blend(0);
- imlib_context_set_color_modifier(NULL);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
- }
- ecore_window_set_background_pixmap(v->drag.win, pmap);
- ecore_window_set_shape_mask(v->drag.win, mask);
- ecore_window_ignore(v->drag.win);
- ecore_window_raise(v->drag.win);
- ecore_window_show(v->drag.win);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
-
- /* Initiate dnd */
- ecore_dnd_set_mode_copy();
- ecore_dnd_set_data(v->win.base);
-
- ecore_dnd_own_selection(v->win.base);
-
- v->drag.started = 1;
-}
-
-static void
-e_icon_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- E_Icon *ic;
- Ecore_Event *ev;
- Ecore_Event_Mouse_Move *e;
- Evas_Event_Mouse_Move *ev_info = event_info;
-
- D_ENTER;
-
- ev = e_view_get_current_event();
- if (!ev)
- D_RETURN;
-
- e = ev->event;
- ic = _data;
-
- if (!ic->state.clicked)
- D_RETURN;
-
- if (!ic->view->drag.started)
- {
- _start_drag(ic->view, ev_info->cur.output.x, ev_info->cur.output.y);
- }
- else if (ic->view->drag.started)
- {
- int x, y;
-
- x = ev_info->cur.output.x - ic->view->drag.offset.x;
- y = ev_info->cur.output.y - ic->view->drag.offset.y;
- ic->view->drag.x = x;
- ic->view->drag.y = y;
- ic->view->drag.update = 1;
- ic->view->changed = 1;
-
- if (e->mods & ECORE_EVENT_KEY_MODIFIER_SHIFT)
- {
- ecore_dnd_set_mode_copy();
- ic->view->drag.drop_mode = E_DND_COPY;
- }
- else
- {
- ecore_dnd_set_mode_move();
- ic->view->drag.drop_mode = E_DND_MOVE;
- }
- ecore_dnd_set_data(ic->view->win.base);
-
- /* Handle dnd motion - dragging==1 */
- ecore_pointer_xy_get(&x, &y);
- ecore_window_dnd_handle_motion(ic->view->win.base, x, y, 1);
- }
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_icon_cleanup(E_Icon * ic)
-{
- D_ENTER;
-
- /* FIXME: free stuff here! this leaks ... */
- /* (think I got them all) */
-
- if (ic->obj.event1)
- {
- evas_object_del(ic->obj.event1);
- evas_object_del(ic->obj.event2);
- }
-
- if (ic->obj.icon)
- evas_object_del(ic->obj.icon);
-
- if (ic->obj.text)
- e_text_free(ic->obj.text);
-
- if (ic->obj.sel.under.icon)
- ebits_free(ic->obj.sel.under.icon);
- if (ic->obj.sel.under.text)
- ebits_free(ic->obj.sel.under.text);
- if (ic->obj.sel.over.icon)
- ebits_free(ic->obj.sel.over.icon);
- if (ic->obj.sel.over.text)
- ebits_free(ic->obj.sel.over.text);
-
- e_object_cleanup(E_OBJECT(ic));
-
- D_RETURN;
-}
-
-E_Icon *
-e_icon_new(void)
-{
- E_Icon *ic;
-
- D_ENTER;
-
- ic = NEW(E_Icon, 1);
- ZERO(ic, E_Icon, 1);
-
- e_object_init(E_OBJECT(ic), (E_Cleanup_Func) e_icon_cleanup);
-
- D_RETURN_(ic);
-}
-
-E_Icon *
-e_icon_find_by_file(E_View * view, char *file)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = view->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if ((ic) && (ic->file->file) && (file)
- && (!strcmp(ic->file->file, file)))
- D_RETURN_(ic);
- }
- D_RETURN_(NULL);
-}
-
-void
-e_icon_show(E_Icon * ic)
-{
- D_ENTER;
-
- if (ic->state.visible)
- D_RETURN;
- ic->state.visible = 1;
-
- if (!ic->obj.event1)
- {
- ic->obj.event1 = evas_object_rectangle_add(ic->view->evas);
- ic->obj.event2 = evas_object_rectangle_add(ic->view->evas);
- evas_object_color_set(ic->obj.event1, 0, 0, 0, 0);
- evas_object_color_set(ic->obj.event2, 0, 0, 0, 0);
- evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_DOWN,
- e_icon_down_cb, ic);
- evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_UP,
- e_icon_up_cb, ic);
- evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_IN,
- e_icon_in_cb, ic);
- evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_OUT,
- e_icon_out_cb, ic);
- evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_MOVE,
- e_icon_move_cb, ic);
- evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_DOWN,
- e_icon_down_cb, ic);
- evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_UP,
- e_icon_up_cb, ic);
- evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_IN,
- e_icon_in_cb, ic);
- evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_OUT,
- e_icon_out_cb, ic);
- evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_MOVE,
- e_icon_move_cb, ic);
-
- }
- evas_object_layer_set(ic->obj.icon, 200);
- e_text_set_layer(ic->obj.text, 200);
- evas_object_layer_set(ic->obj.event1, 210);
- evas_object_layer_set(ic->obj.event2, 210);
-
- evas_object_show(ic->obj.icon);
- e_text_show(ic->obj.text);
- evas_object_show(ic->obj.event1);
- evas_object_show(ic->obj.event2);
-
- D_RETURN;
-}
-
-void
-e_icon_hide(E_Icon * ic)
-{
- D_ENTER;
-
- if (!ic->state.visible)
- D_RETURN;
- ic->state.visible = 0;
- evas_object_hide(ic->obj.icon);
- e_text_hide(ic->obj.text);
- evas_object_hide(ic->obj.event1);
- evas_object_hide(ic->obj.event2);
-
- /* Hide any selection in the view */
- if (ic->obj.sel.under.icon)
- ebits_hide(ic->obj.sel.under.icon);
- if (ic->obj.sel.under.text)
- ebits_hide(ic->obj.sel.under.text);
- if (ic->obj.sel.over.icon)
- ebits_hide(ic->obj.sel.over.icon);
- if (ic->obj.sel.over.text)
- ebits_hide(ic->obj.sel.over.text);
-
- D_RETURN;
-}
-
-void
-e_icon_hide_delete_pending(E_Icon * ic)
-{
- D_ENTER;
-
- if (!ic->state.visible)
- D_RETURN;
- if (ic->state.selected)
- {
- if (ic->view->drag.drop_mode == E_DND_MOVE)
- {
- evas_object_hide(ic->obj.icon);
- ic->state.drag_delete = 1;
- }
- else
- /* copy... */
- {
- evas_object_show(ic->obj.icon);
- ic->state.drag_delete = 0;
- }
- }
-
- D_RETURN;
-}
-
-void
-e_icon_show_delete_end(E_Icon * ic, E_dnd_enum dnd_pending_mode)
-{
- D_ENTER;
-
- if (!ic->state.visible)
- D_RETURN;
- if (ic->state.drag_delete)
- {
- if (dnd_pending_mode == E_DND_DELETED
- || dnd_pending_mode == E_DND_COPIED)
- {
- ic->state.drag_delete = 0;
- if (dnd_pending_mode == E_DND_COPIED)
- evas_object_show(ic->obj.icon);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_icon_apply_xy(E_Icon * ic)
-{
- D_ENTER;
-
- /* these calc icon extents for: */
- /* [I] */
- /* Ig */
- /* [txt] */
-
- if (ic->geom.text.w > ic->geom.icon.w)
- ic->geom.w = ic->geom.text.w;
- else
- ic->geom.w = ic->geom.icon.w;
- ic->geom.h = ic->geom.icon.h + ic->geom.text.h + ic->view->spacing.icon.g;
-
- if(ic->obj.event1)
- {
- evas_object_resize(ic->obj.event1,
- ic->geom.icon.w, ic->geom.icon.h);
- evas_object_resize(ic->obj.event2,
- ic->geom.text.w, ic->geom.text.h);
- evas_object_move(ic->obj.event1,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.icon.w) / 2),
- ic->view->scroll.y + ic->geom.y);
- evas_object_move(ic->obj.event2,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.text.w) / 2),
- ic->view->scroll.y + ic->geom.y + ic->geom.icon.h +
- ic->view->spacing.icon.g);
- }
- evas_object_move(ic->obj.icon,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.icon.w) / 2),
- ic->view->scroll.y + ic->geom.y);
- e_text_move(ic->obj.text,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.text.w) / 2),
- ic->view->scroll.y + ic->geom.y + ic->geom.icon.h +
- ic->view->spacing.icon.g);
- if (ic->obj.sel.under.icon)
- {
- int pl, pr, pt, pb;
-
- ebits_get_insets(ic->obj.sel.under.icon, &pl, &pr, &pt, &pb);
- ebits_move(ic->obj.sel.under.icon,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.icon.w) / 2) - pl,
- ic->view->scroll.y + ic->geom.y - pt);
- ebits_resize(ic->obj.sel.under.icon, ic->geom.icon.w + pl + pr,
- ic->geom.icon.h + pt + pb);
- ebits_show(ic->obj.sel.under.icon);
- }
- if (ic->obj.sel.under.text)
- {
- int pl, pr, pt, pb;
-
- ebits_get_insets(ic->obj.sel.under.text, &pl, &pr, &pt, &pb);
- ebits_move(ic->obj.sel.under.text,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.text.w) / 2) - pl,
- ic->view->scroll.y + ic->geom.y + ic->geom.icon.h +
- ic->view->spacing.icon.g - pt);
- ebits_resize(ic->obj.sel.under.text, ic->geom.text.w + pl + pr,
- ic->geom.text.h + pt + pb);
- ebits_show(ic->obj.sel.under.text);
- }
- if (ic->obj.sel.over.icon)
- {
- int pl, pr, pt, pb;
-
- ebits_get_insets(ic->obj.sel.over.icon, &pl, &pr, &pt, &pb);
- ebits_move(ic->obj.sel.over.icon,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.icon.w) / 2) - pl,
- ic->view->scroll.y + ic->geom.y - pt);
- ebits_resize(ic->obj.sel.over.icon, ic->geom.icon.w + pl + pr,
- ic->geom.icon.h + pt + pb);
- ebits_show(ic->obj.sel.over.icon);
- }
- if (ic->obj.sel.over.text)
- {
- int pl, pr, pt, pb;
-
- ebits_get_insets(ic->obj.sel.over.text, &pl, &pr, &pt, &pb);
- ebits_move(ic->obj.sel.over.text,
- ic->view->scroll.x + ic->geom.x +
- ((ic->geom.w - ic->geom.text.w) / 2) - pl,
- ic->view->scroll.y + ic->geom.y + ic->geom.icon.h +
- ic->view->spacing.icon.g - pt);
- ebits_resize(ic->obj.sel.over.text, ic->geom.text.w + pl + pr,
- ic->geom.text.h + pt + pb);
- ebits_show(ic->obj.sel.over.text);
- }
- if ((ic->geom.x != ic->prev_geom.x) || (ic->geom.y != ic->prev_geom.y))
- {
- ic->q.write_xy = 1;
- /* FIXME */
- //e_view_queue_icon_xy_record(ic->view);
- }
- if (ic->geom.x != ic->prev_geom.x)
- ic->view->extents.valid = 0;
- else if (ic->geom.y != ic->prev_geom.y)
- ic->view->extents.valid = 0;
- else if (ic->geom.w != ic->prev_geom.w)
- ic->view->extents.valid = 0;
- else if (ic->geom.h != ic->prev_geom.h)
- ic->view->extents.valid = 0;
-
- ic->prev_geom = ic->geom;
- ic->prev_geom.x = ic->geom.x;
- ic->prev_geom.y = ic->geom.y;
- ic->prev_geom.w = ic->geom.w;
- ic->prev_geom.h = ic->geom.h;
-
- D_RETURN;
-}
-
-void
-e_icon_check_permissions(E_Icon * ic)
-{
- D_ENTER;
-
- if (!ic || !ic->file->info.mime.base || ic->file->stat.st_ino == 0)
- D_RETURN;
-
- if (!strcmp(ic->file->info.mime.base, "dir"))
- {
- if (e_file_can_exec(&ic->file->stat))
- evas_object_color_set(ic->obj.icon, 255, 255, 255, 255);
- else
- evas_object_color_set(ic->obj.icon, 128, 128, 128, 128);
- }
-
- D_RETURN;
-}
-
-void
-e_icon_initial_show(E_Icon * ic)
-{
- D_ENTER;
-
- /* check if we have enuf info and we havent been shown yet */
- if (!ic->file->info.icon || !ic->obj.icon || ic->state.visible)
- D_RETURN;
-
- /* first. lets figure out the size of the icon */
- evas_object_image_size_get(ic->obj.icon,
- &(ic->geom.icon.w), &(ic->geom.icon.h));
- {
- double tw, th;
-
- e_text_get_geometry(ic->obj.text, NULL, NULL, &tw, &th);
- ic->geom.text.w = (int)tw;
- ic->geom.text.h = (int)th;
- }
-
- /* now lets allocate space for it if we need to */
- ic->geom.x = 999999;
- ic->geom.y = 999999;
-
- /* if needed queue a tiemout for a resort */
- e_view_queue_resort(ic->view);
-
- /* actually show the icon */
- e_icon_apply_xy(ic);
- e_icon_show(ic);
-
- D_RETURN;
-}
-
-void
-e_icon_update_state(E_Icon * ic)
-{
- char icon[PATH_MAX], key[PATH_MAX];
- int iw, ih;
-
- D_ENTER;
-
- if (!ic->file->info.icon)
- {
- D("EEEEEEEEEEK %s has no icon\n", ic->file->file);
- D_RETURN;
- }
- if (ic->state.clicked)
- {
- snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
- strcpy(key, "/icon/clicked");
- }
- else if (ic->state.selected)
- {
- snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
- strcpy(key, "/icon/selected");
- }
- else
- {
- snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
- strcpy(key, "/icon/normal");
- }
- if ((ic->state.selected) &&
- (!ic->obj.sel.under.icon) && (!ic->obj.sel.over.icon))
- {
- char file[PATH_MAX];
-
-/*
- snprintf(file, PATH_MAX, "%s/file.bits.db", e_config_get("selections"));
- ic->obj.sel.over.icon = ebits_load(file);
- snprintf(file, PATH_MAX, "%s/text.bits.db", e_config_get("selections"));
- ic->obj.sel.over.text = ebits_load(file);
- */
- snprintf(file, PATH_MAX, "%s/file.bits.db", e_config_get("selections"));
- ic->obj.sel.under.icon = ebits_load(file);
- snprintf(file, PATH_MAX, "%s/text.bits.db", e_config_get("selections"));
- ic->obj.sel.under.text = ebits_load(file);
- if (ic->obj.sel.under.icon)
- {
- ebits_add_to_evas(ic->obj.sel.under.icon, ic->view->evas);
- ebits_set_layer(ic->obj.sel.under.icon, 195);
- }
- if (ic->obj.sel.under.text)
- {
- ebits_add_to_evas(ic->obj.sel.under.text, ic->view->evas);
- ebits_set_layer(ic->obj.sel.under.text, 195);
- }
- if (ic->obj.sel.over.icon)
- {
- ebits_add_to_evas(ic->obj.sel.over.icon, ic->view->evas);
- ebits_set_layer(ic->obj.sel.over.icon, 205);
- }
- if (ic->obj.sel.over.text)
- {
- ebits_add_to_evas(ic->obj.sel.over.text, ic->view->evas);
- ebits_set_layer(ic->obj.sel.over.text, 205);
- }
- }
- else if ((!ic->state.selected) &&
- ((ic->obj.sel.under.icon) || (ic->obj.sel.over.icon)))
- {
- if (ic->obj.sel.under.icon)
- ebits_free(ic->obj.sel.under.icon);
- if (ic->obj.sel.under.text)
- ebits_free(ic->obj.sel.under.text);
- if (ic->obj.sel.over.icon)
- ebits_free(ic->obj.sel.over.icon);
- if (ic->obj.sel.over.text)
- ebits_free(ic->obj.sel.over.text);
- ic->obj.sel.under.icon = NULL;
- ic->obj.sel.under.text = NULL;
- ic->obj.sel.over.icon = NULL;
- ic->obj.sel.over.text = NULL;
- }
- /* This relies on the obj.icon having been allocated in view_file_add.
- * Maybe it would be better to allocate here, the first
- * time the icon is set? -- till */
- evas_object_image_file_set(ic->obj.icon, icon, key);
- evas_object_image_size_get(ic->obj.icon, &iw, &ih);
- /* kjb cep */
- /* evas_object_image_size_set(ic->obj.icon, 30, 30);
- */
- /* Hmm, this shouldn't be needed, should it? */
-
- evas_object_resize(ic->obj.icon,
- iw, ih);
- evas_object_image_fill_set(ic->obj.icon,
- 0, 0, iw, ih);
-
- e_icon_check_permissions(ic);
- e_icon_apply_xy(ic);
- ic->view->changed = 1;
-
- if ((iw != ic->geom.icon.w) || (ih != ic->geom.icon.h))
- e_view_queue_resort(ic->view);
-
- D_RETURN;
-}
-
-void
-e_icon_invert_selection(E_Icon * ic)
-{
- D_ENTER;
-
- if (ic->state.selected)
- e_icon_deselect(ic);
- else
- e_icon_select(ic);
-
- D_RETURN;
-}
-
-void
-e_icon_select(E_Icon * ic)
-{
- D_ENTER;
-
- if (!ic->state.selected)
- {
- ic->state.selected = 1;
- ic->view->select.count++;
- e_icon_update_state(ic);
- }
-
- D_RETURN;
-}
-
-void
-e_icon_deselect(E_Icon * ic)
-{
- D_ENTER;
-
- if (ic->state.selected)
- {
- ic->state.selected = 0;
- ic->view->select.count--;
- e_icon_update_state(ic);
- }
- D_RETURN;
-}
-
-void
-e_icon_exec(E_Icon * ic)
-{
- D_ENTER;
-
- if (!strcmp(ic->file->info.mime.base, "dir") &&
- e_file_can_exec(&ic->file->stat))
- {
- E_View *v;
- char buf[PATH_MAX];
-
- v = e_view_new();
- v->size.w = 400;
- v->size.h = 300;
- v->options.back_pixmap = 0;
- snprintf(buf, PATH_MAX, "%s/%s", ic->view->dir->dir, ic->file->file);
- D("new dir >%s<\n", buf);
- e_view_set_dir(v, buf);
- e_view_realize(v);
- e_view_populate(v);
- e_view_set_look(v, NULL);
-
- e_view_bg_reload(v);
- ecore_window_set_title(v->win.base, ic->file->file);
- ecore_window_set_name_class(v->win.base, "FileView", "E");
- ecore_window_set_min_size(v->win.base, 8, 8);
- }
- e_icon_deselect(ic);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_ICONS_H
-#define E_ICONS_H
-
-#include "e_file.h"
-#include "view.h"
-#include "text.h"
-
-#ifndef E_ICON_TYPEDEF
-#define E_ICON_TYPEDEF
-typedef struct _E_Icon E_Icon;
-#endif
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-struct _E_Icon
-{
- E_Object o;
-
- E_File *file;
- E_View *view;
-
- struct
- {
- Evas_Object * icon;
- Evas_Object * event1;
- Evas_Object * event2;
- E_Text *text;
- struct
- {
- struct
- {
- Ebits_Object icon;
- Ebits_Object text;
- }
- over , under;
- }
- sel;
- }
- obj;
-
- struct
- {
- int hilited;
- int clicked;
- int selected;
- int running;
- int disabled;
- int visible;
- int just_selected;
- int just_executed;
- int drag_delete;
- }
- state;
-
- struct
- {
- int x, y, w, h;
- struct
- {
- int w, h;
- }
- icon;
- struct
- {
- int w, h;
- }
- text;
- }
- geom , prev_geom;
-
- struct
- {
- int write_xy;
- }
- q;
-
- int changed;
-};
-
-E_Icon *e_icon_new(void);
-void e_icon_update_state(E_Icon * ic);
-void e_icon_invert_selection(E_Icon * ic);
-void e_icon_select(E_Icon * ic);
-void e_icon_deselect(E_Icon * ic);
-
-/**
- * e_icon_exec - handles execution paths when user activates an icon
- * @ic: The activated icon
- *
- * This function takes care of opening views when the user activates a
- * directory, launching commands when an executable is activated etc.
- */
-void e_icon_exec(E_Icon * ic);
-
-void e_icon_initial_show(E_Icon * ic);
-void e_icon_set_mime(E_Icon * ic, char *base, char *mime);
-void e_icon_set_link(E_Icon * ic, char *link);
-E_Icon *e_icon_find_by_file(E_View * view, char *file);
-void e_icon_show(E_Icon * ic);
-void e_icon_hide(E_Icon * ic);
-void e_icon_hide_delete_pending(E_Icon * ic);
-void e_icon_show_delete_end(E_Icon * ic,
- E_dnd_enum dnd_pending_mode);
-void e_icon_apply_xy(E_Icon * ic);
-void e_icon_check_permissions(E_Icon * ic);
-
-#endif
+++ /dev/null
-#include "ipc.h"
+++ /dev/null
-#ifndef E_IPC_H
-#define E_IPC_H
-
-#include "e.h"
-
-void e_ipc_init(void);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "keys.h"
-#include "actions.h"
-
-static void e_key_down(Ecore_Event * ev);
-static void e_key_up(Ecore_Event * ev);
-
-static void
-e_key_down(Ecore_Event * ev)
-{
- Ecore_Event_Key_Down *e;
-
- D_ENTER;
-
- e = ev->event;
- if (e->win == ecore_get_key_grab_win())
- {
- e_action_stop("Key_Binding", ACT_KEY_DOWN, 0, e->key, e->mods,
- NULL, NULL, 0, 0, 0, 0);
- e_action_start("Key_Binding", ACT_KEY_DOWN, 0, e->key, e->mods,
- NULL, NULL, 0, 0, 0, 0);
- }
-
- D_RETURN;
-}
-
-static void
-e_key_up(Ecore_Event * ev)
-{
- Ecore_Event_Key_Up *e;
-
- D_ENTER;
-
- e = ev->event;
- if (e->win == ecore_get_key_grab_win())
- {
- e_action_stop("Key_Binding", ACT_KEY_UP, 0, e->key, e->mods,
- NULL, NULL, 0, 0, 0, 0);
- e_action_start("Key_Binding", ACT_KEY_UP, 0, e->key, e->mods,
- NULL, NULL, 0, 0, 0, 0);
- }
-
- D_RETURN;
-}
-
-void
-e_keys_init(void)
-{
- D_ENTER;
-
- /* load up our actions .... once to get some grabbed keys */
- e_action_start("", ACT_KEY_DOWN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- NULL, NULL, 0, 0, 0, 0);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
-
- D_RETURN;
-}
-
-void
-e_keys_grab(char *key, Ecore_Event_Key_Modifiers mods, int anymod)
-{
- D_ENTER;
-
- ecore_key_grab(key, mods, anymod, 0);
-
- D_RETURN;
-}
-
-void
-e_keys_ungrab(char *key, Ecore_Event_Key_Modifiers mods, int anymod)
-{
- D_ENTER;
-
- ecore_key_ungrab(key, mods, anymod);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_KEYS_H
-#define E_KEYS_H
-
-#include "e.h"
-
-void e_keys_init(void);
-void e_keys_grab(char *key, Ecore_Event_Key_Modifiers mods,
- int anymod);
-void e_keys_ungrab(char *key, Ecore_Event_Key_Modifiers mods,
- int anymod);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "actions.h"
-#include "guides.h"
-#include "cursors.h"
-#include "border.h"
-#include "config.h"
-#include "desktops.h"
-#include "exec.h"
-#include "fs.h"
-#include "entry.h"
-#include "keys.h"
-#include "ipc.h"
-#include "menu.h"
-#include "view.h"
-#include "place.h"
-#include "iconbar.h"
-#include "util.h"
-#include "e_view_machine.h"
-
-#include <time.h>
-#include <X11/Xproto.h>
-
-#ifdef E_PROF
-Evas_List * __e_profiles = NULL;
-#endif
-
-static void cb_exit(void);
-static void wm_running_error(Display * d, XErrorEvent * ev);
-static void setup(void);
-
-static void ecore_idle(void *data);
-
-static void
-ecore_idle(void *data)
-{
- D_ENTER;
- /* FIXME -- Raster, how is this related to the desktop code? */
-
- e_db_runtime_flush();
- D_RETURN;
- UN(data);
-}
-
-static void
-cb_exit(void)
-{
- D_ENTER;
-
- e_fs_cleanup();
- E_PROF_DUMP;
-
- D_RETURN;
-}
-
-static void
-wm_running_error(Display * d, XErrorEvent * ev)
-{
- D_ENTER;
-
- if ((ev->request_code == X_ChangeWindowAttributes) &&
- (ev->error_code == BadAccess))
- {
- fprintf(stderr, "A window manager is already running.\n");
- fprintf(stderr, "Exiting Enlightenment. Error.\n");
- exit(-2);
- }
-
- D_RETURN;
- UN(d);
-}
-
-static void
-setup(void)
-{
- D_ENTER;
-
- ecore_grab();
- ecore_sync();
-
- /* Start to manage all those windows that we're interested in ... */
- e_border_adopt_children(0);
-
- ecore_ungrab();
-
- D_RETURN;
-}
-
-int
-main(int argc, char **argv)
-{
- char *display = NULL;
- int i;
-
- srand(time(NULL));
- atexit(cb_exit);
- e_exec_set_args(argc, argv);
-
- /* Check command line options here: */
- for (i = 1; i < argc; i++)
- {
- if (((!strcmp("-d", argv[i]))
- || (!strcmp("-disp", argv[i]))
- || (!strcmp("-display", argv[i]))
- || (!strcmp("--display", argv[i]))) && (argc - i > 1))
- {
- display = argv[++i];
- }
- else if ((!strcmp("-h", argv[i]))
- || (!strcmp("-?", argv[i]))
- || (!strcmp("-help", argv[i])) || (!strcmp("--help", argv[i])))
- {
- printf("enlightenment options: \n"
- "\t[-d | -disp | -display --display] display_name \n"
- "\t[-v | -version | --version] \n");
- exit(0);
- }
- else if ((!strcmp("-v", argv[i]))
- || (!strcmp("-version", argv[i]))
- || (!strcmp("--version", argv[i])))
- {
- printf("Enlightenment Version: %s\n", ENLIGHTENMENT_VERSION);
- exit(0);
- }
- }
-
- if (!ecore_display_init(display))
- {
- fprintf(stderr, "Enlightenment Error: cannot connect to display!\n");
- fprintf(stderr, "Exiting Enlightenment. Error.\n");
- exit(-1);
- }
-
- /* Initialize signal handlers, clear ecore event handlers
- * and hook in ecore's X event handler. */
- ecore_event_signal_init();
- ecore_event_filter_init();
- ecore_event_x_init();
-
- /* become a wm */
- ecore_grab();
- ecore_sync();
- ecore_set_error_handler(wm_running_error);
- ecore_window_set_events(0, XEV_CHILD_REDIRECT | XEV_PROPERTY | XEV_COLORMAP |
- XEV_FOCUS | XEV_KEY | XEV_MOUSE_MOVE | XEV_BUTTON |
- XEV_IN_OUT);
- ecore_sync();
- ecore_reset_error_handler();
- ecore_ungrab();
-
- /* Initialization for the various modules: */
-
- e_view_machine_init();
- e_config_init();
- e_keys_init();
- e_fs_init();
- e_border_init();
- e_desktops_init();
- e_action_init();
- e_menu_init();
- e_entry_init();
- e_guides_init();
- e_place_init();
- e_cursors_init();
- e_iconbar_init();
-
- ecore_event_filter_idle_handler_add(ecore_idle, NULL);
- e_desktops_show(e_desktops_get(0));
-
- setup();
-
- ecore_event_loop();
-
- return 0;
-}
+++ /dev/null
-#include "debug.h"
-#include "match.h"
-#include "config.h"
-
-void
-e_match_set_props(E_Border * b)
-{
- char buf[PATH_MAX];
- E_DB_File *db;
- int ok;
-
- D_ENTER;
-
- if ((!b->client.name) || (!b->client.class))
- D_RETURN;
- db = e_db_open(e_config_get("match"));
- snprintf(buf, PATH_MAX, "match/%s/%s/match", b->client.name,
- b->client.class);
- ok = e_db_int_get(db, buf, &(b->client.matched.matched));
- if (!ok)
- {
- e_db_close(db);
- D_RETURN;
- }
- snprintf(buf, PATH_MAX, "match/%s/%s/prog_location/ignore", b->client.name,
- b->client.class);
- b->client.matched.prog_location.matched =
- e_db_int_get(db, buf, &(b->client.matched.prog_location.ignore));
- snprintf(buf, PATH_MAX, "match/%s/%s/border/border", b->client.name,
- b->client.class);
- b->client.matched.border.style = e_db_str_get(db, buf);
- b->client.matched.border.matched = (int)b->client.matched.border.style;
- snprintf(buf, PATH_MAX, "match/%s/%s/location/x", b->client.name,
- b->client.class);
- b->client.matched.location.matched =
- e_db_int_get(db, buf, &(b->client.matched.location.x));
- snprintf(buf, PATH_MAX, "match/%s/%s/location/y", b->client.name,
- b->client.class);
- b->client.matched.location.matched =
- e_db_int_get(db, buf, &(b->client.matched.location.y));
- snprintf(buf, PATH_MAX, "match/%s/%s/desk_area/x", b->client.name,
- b->client.class);
- b->client.matched.desk_area.matched =
- e_db_int_get(db, buf, &(b->client.matched.desk_area.x));
- snprintf(buf, PATH_MAX, "match/%s/%s/desk_area/y", b->client.name,
- b->client.class);
- b->client.matched.desk_area.matched =
- e_db_int_get(db, buf, &(b->client.matched.desk_area.y));
- snprintf(buf, PATH_MAX, "match/%s/%s/size/w", b->client.name,
- b->client.class);
- b->client.matched.size.matched =
- e_db_int_get(db, buf, &(b->client.matched.size.w));
- snprintf(buf, PATH_MAX, "match/%s/%s/size/h", b->client.name,
- b->client.class);
- b->client.matched.size.matched =
- e_db_int_get(db, buf, &(b->client.matched.size.h));
- snprintf(buf, PATH_MAX, "match/%s/%s/desktop/desk", b->client.name,
- b->client.class);
- b->client.matched.desktop.matched =
- e_db_int_get(db, buf, &(b->client.matched.desktop.desk));
- snprintf(buf, PATH_MAX, "match/%s/%s/sticky/sticky", b->client.name,
- b->client.class);
- b->client.matched.sticky.matched =
- e_db_int_get(db, buf, &(b->client.matched.sticky.sticky));
- snprintf(buf, PATH_MAX, "match/%s/%s/layer/layer", b->client.name,
- b->client.class);
- b->client.matched.layer.matched =
- e_db_int_get(db, buf, &(b->client.matched.layer.layer));
-
- if (b->client.matched.prog_location.matched)
- {
- b->client.pos.requested = 0;
- }
- if (b->client.matched.border.matched)
- {
- IF_FREE(b->border_style);
- b->border_style = b->client.matched.border.style;
- }
- if (b->client.matched.location.matched)
- {
- b->client.pos.requested = 1;
- b->client.pos.gravity = NorthWestGravity;
- b->client.pos.x = b->client.matched.location.x;
- b->client.pos.y = b->client.matched.location.y;
- b->client.no_place = 1;
- }
- if (b->client.matched.desk_area.matched)
- {
- b->client.pos.x +=
- (b->client.matched.desk_area.x -
- b->desk->desk.area.x) * b->desk->real.w;
- b->client.pos.y +=
- (b->client.matched.desk_area.y -
- b->desk->desk.area.y) * b->desk->real.h;
- b->client.area.x = b->client.matched.desk_area.x;
- b->client.area.y = b->client.matched.desk_area.y;
- }
- if (b->client.matched.size.matched)
- {
- b->current.requested.w = b->client.matched.size.w;
- b->current.requested.h = b->client.matched.size.h;
- ecore_window_resize(b->win.client, b->client.matched.size.w,
- b->client.matched.size.h);
- }
- if (b->client.matched.desktop.matched)
- {
- b->client.desk = b->client.matched.desktop.desk;
- e_border_raise(b);
- if (b->client.desk != b->desk->desk.desk)
- b->current.requested.visible = 0;
- b->client.no_place = 1;
- }
- if (b->client.matched.sticky.matched)
- {
- b->client.sticky = b->client.matched.sticky.sticky;
- }
- if (b->client.matched.layer.matched)
- {
- b->client.layer = b->client.matched.layer.layer;
- }
-
- e_db_close(db);
-
- D_RETURN;
-}
-
-void
-e_match_save_props(E_Border * b)
-{
- char buf[PATH_MAX];
- E_DB_File *db;
-
- D_ENTER;
-
- if ((!b->client.name) || (!b->client.class))
- D_RETURN;
-
- db = e_db_open(e_config_get("match"));
- if (!db)
- D_RETURN;
-
- snprintf(buf, PATH_MAX, "match/%s/%s/match", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.matched);
-
- if (b->client.matched.location.matched)
- {
- b->client.matched.location.x = b->current.x;
- b->client.matched.location.y = b->current.y;
- snprintf(buf, PATH_MAX, "match/%s/%s/location/x", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.location.x);
- snprintf(buf, PATH_MAX, "match/%s/%s/location/y", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.location.y);
- }
- else
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/location/x", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- snprintf(buf, PATH_MAX, "match/%s/%s/location/y", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- }
-
- if (b->client.matched.size.matched)
- {
- b->client.matched.size.w = b->client.w;
- b->client.matched.size.h = b->client.h;
- snprintf(buf, PATH_MAX, "match/%s/%s/size/w", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.size.w);
- snprintf(buf, PATH_MAX, "match/%s/%s/size/h", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.size.h);
- }
- else
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/size/w", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- snprintf(buf, PATH_MAX, "match/%s/%s/size/h", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- }
-
- if (b->client.matched.desktop.matched)
- {
- b->client.matched.desktop.desk = b->client.desk;
- snprintf(buf, PATH_MAX, "match/%s/%s/desktop/desk", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.desktop.desk);
- }
- else
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/desktop/desk", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- }
-
- if (b->client.matched.sticky.matched)
- {
- b->client.matched.sticky.sticky = b->client.sticky;
- snprintf(buf, PATH_MAX, "match/%s/%s/sticky/sticky", b->client.name,
- b->client.class);
- e_db_int_set(db, buf, b->client.matched.sticky.sticky);
- }
- else
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/sticky/sticky", b->client.name,
- b->client.class);
- e_db_data_del(db, buf);
- }
-
- if (b->client.matched.prog_location.matched)
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/prog_location/ignore",
- b->client.name, b->client.class);
- e_db_int_set(db, buf, b->client.matched.prog_location.ignore);
- }
- else
- {
- snprintf(buf, PATH_MAX, "match/%s/%s/prog_location/ignore",
- b->client.name, b->client.class);
- e_db_data_del(db, buf);
- }
-
- e_db_close(db);
- e_db_runtime_flush();
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_MATCH_H
-#define E_MATCH_H
-
-#include "e.h"
-#include "border.h"
-#include "desktops.h"
-
-void e_match_set_props(E_Border * b);
-void e_match_save_props(E_Border * b);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "menu.h"
-#include "config.h"
-#include "util.h"
-#include "math.h"
-
-static Evas_List * open_menus = NULL; /* List of all open menus */
-static Evas_List * menus = NULL;
-static E_Menu_Item *curr_selected_item = NULL; /* Currently selected item */
-static Window menu_event_win = 0; /* Window which originated event */
-static int screen_w, screen_h; /* Screen width and height */
-static int mouse_x, mouse_y; /* Mouse coordinates */
-static int keyboard_nav = 0; /* If non-zero, navigating with keyboard */
-
-static void e_idle(void *data);
-static void e_wheel(Ecore_Event * ev);
-static void e_key_down(Ecore_Event * ev);
-static void e_key_up(Ecore_Event * ev);
-static void e_mouse_down(Ecore_Event * ev);
-static void e_mouse_up(Ecore_Event * ev);
-static void e_mouse_move(Ecore_Event * ev);
-static void e_mouse_in(Ecore_Event * ev);
-static void e_mouse_out(Ecore_Event * ev);
-static void e_window_expose(Ecore_Event * ev);
-static void e_menu_item_select(E_Menu_Item * mi);
-static void e_menu_item_unselect(E_Menu_Item * mi);
-
-static void
-e_scroller_timer(int val, void *data)
-{
- Evas_List * l;
- int ok = 0;
- int resist = 5;
- int scroll_speed = 12;
- static double last_time = 0.0;
- double t;
-
- D_ENTER;
-
- resist = config_data->menu->resist;
- scroll_speed = config_data->menu->speed;
-
- t = ecore_get_time();
- if (val != 0)
- scroll_speed = (int)(((t - last_time) / 0.02) * (double)scroll_speed);
- last_time = t;
-
- ok = 0;
- if (mouse_x >= (screen_w - resist))
- {
- int scroll = 0;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if ((m->current.x + m->current.w) > screen_w)
- scroll = m->current.x + m->current.w - screen_w;
- }
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_menu_scroll_all_by(-scroll, 0);
- ok = 1;
- }
- }
- else if (mouse_x < resist)
- {
- int scroll = 0;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->current.x < 0)
- scroll = -m->current.x;
- }
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_menu_scroll_all_by(scroll, 0);
- ok = 1;
- }
- }
- if (mouse_y >= (screen_h - resist))
- {
- int scroll = 0;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if ((m->current.y + m->current.h) > screen_h)
- scroll = m->current.y + m->current.h - screen_h;
- }
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_menu_scroll_all_by(0, -scroll);
- ok = 1;
- }
- }
- else if (mouse_y < resist)
- {
- int scroll = 0;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->current.y < 0)
- scroll = -m->current.y;
- }
- if (scroll)
- {
- if (scroll > scroll_speed)
- scroll = scroll_speed;
- e_menu_scroll_all_by(0, scroll);
- ok = 1;
- }
- }
- if ((ok) && (open_menus))
- ecore_add_event_timer("menu_scroller", 0.02, e_scroller_timer, val + 1,
- NULL);
-
- D_RETURN;
- UN(data);
-}
-
-static void
-e_idle(void *data)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_update_base(m);
- }
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_update_shows(m);
- }
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_update_hides(m);
- }
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_update_finish(m);
- }
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->first_expose)
- evas_render(m->evas);
- }
- again:
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->delete_me)
- {
- e_object_unref(E_OBJECT(m));
- goto again;
- }
- }
-
- e_db_runtime_flush();
-
- D_RETURN;
- UN(data);
-}
-
-/**
- * e_wheel - Handle mouse wheel events
- *
- * @ev: Pointer to event.
- */
-static void
-e_wheel(Ecore_Event * ev)
-{
- Ecore_Event_Wheel *e;
-
- D_ENTER;
-
- e = ev->event;
- if (e->win == menu_event_win)
- {
- }
-
- D_RETURN;
-}
-
-/**
- * e_key_down - Handle key down events
- *
- * @ev: Pointer to event.
- */
-static void
-e_key_down(Ecore_Event * ev)
-{
- Ecore_Event_Key_Down *e;
- int ok;
-
- D_ENTER;
-
- e = ev->event;
- ok = 0;
- if (e->win == menu_event_win)
- ok = 1;
- else
- {
- Evas_List * l;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if ((e->win == m->win.main) || (e->win == m->win.evas))
- {
- ok = 1;
- break;
- }
- }
- }
- if (ok)
- {
- Evas_List * l;
- E_Menu *m = NULL;
- E_Menu_Item *mi = NULL;
-
- for (l = open_menus; l; l = l->next)
- {
- m = l->data;
- if (m->selected)
- {
- mi = m->selected;
- break;
- }
- }
- if (!strcmp(e->key, "Up"))
- {
- keyboard_nav = 1;
- e_menu_select(0, -1);
- }
- else if (!strcmp(e->key, "Down"))
- {
- keyboard_nav = 1;
- e_menu_select(0, 1);
- }
- else if (!strcmp(e->key, "Left"))
- {
- keyboard_nav = 1;
- e_menu_select(-1, 0);
- }
- else if (!strcmp(e->key, "Right"))
- {
- keyboard_nav = 1;
- e_menu_select(1, 0);
- }
- else if (!strcmp(e->key, "Escape"))
- {
- keyboard_nav = 1;
- for (l = menus; l; l = l->next)
- {
- m = l->data;
-
- if (m->current.visible)
- e_menu_hide(m);
- }
- }
- else if (!strcmp(e->key, "Return"))
- {
- keyboard_nav = 1;
- if (mi)
- {
- e_menu_callback_item(m, mi);
- mi->selected = 0;
- mi->menu->selected = NULL;
- }
- for (l = menus; l; l = l->next)
- {
- m = l->data;
-
- if (m->current.visible)
- e_menu_hide(m);
- }
- }
- else
- {
- }
- }
-
- D_RETURN;
-}
-
-/**
- * e_key_up - Handle key up events
- *
- * @ev: Pointer to event.
- */
-static void
-e_key_up(Ecore_Event * ev)
-{
- Ecore_Event_Key_Up *e;
-
- D_ENTER;
-
- e = ev->event;
- {
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_down - Handle mouse down events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Down *e;
-
- D_ENTER;
-
- e = ev->event;
- {
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_up - Handle mouse up events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- D_ENTER;
-
- e = ev->event;
- keyboard_nav = 0;
- if (e->win == menu_event_win)
- {
- if (open_menus)
- {
- E_Menu *m;
-
- m = open_menus->data;
- if ((e->time - m->time) > 200)
- {
- Evas_List * l;
-
- for (l = open_menus; l; l = l->next)
- {
- m = l->data;
- /* Ensure that the item is actually selected and
- * that the mouse pointer really is over it: */
- if (m->selected)
- {
- /* Get the dimensions of the selection for use in
- * the test */
- double s_x, s_y, s_w, s_h;
- evas_object_geometry_get(m->selected->obj_entry,
- &s_x, &s_y, &s_w, &s_h);
- if (INTERSECTS(m->current.x + rint(s_x),
- m->current.y + rint(s_y),
- rint(s_w),
- rint(s_h),
- mouse_x, mouse_y, 0,
- 0))
- {
- e_menu_callback_item(m, m->selected);
- }
- e_menu_item_unselect(m->selected);
- break;
- }
- }
- for (l = menus; l; l = l->next)
- {
- m = l->data;
-
- if (m->current.visible)
- e_menu_hide(m);
- }
- }
- }
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_move - Handle mouse move events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
-
- D_ENTER;
-
- e = ev->event;
- keyboard_nav = 0;
- if (e->win == menu_event_win)
- {
- Evas_List * l;
-
- mouse_x = e->rx;
- mouse_y = e->ry;
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- /* checkme
- evas_event_move(m->evas,
- e->rx - m->current.x, e->ry - m->current.y);
- */
- evas_event_feed_mouse_move(m->evas,
- e->rx - m->current.x, e->ry - m->current.y);
- }
- }
- else
- {
- Evas_List * l;
-
- mouse_x = e->rx;
- mouse_y = e->ry;
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
-
- /* checkme
- evas_event_move(m->evas,
- e->rx - m->current.x, e->ry - m->current.y);
- */
- evas_event_feed_mouse_move(m->evas,
- e->rx - m->current.x, e->ry - m->current.y);
- }
- }
- e_scroller_timer(0, NULL);
-
- D_RETURN;
-}
-
-/**
- * e_mouse_in - Handle mouse enter events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_in(Ecore_Event * ev)
-{
- Ecore_Event_Window_Enter *e;
-
- D_ENTER;
-
- e = ev->event;
- keyboard_nav = 0;
- if (e->win == menu_event_win)
- {
- }
-
- D_RETURN;
-}
-
-/**
- * e_mouse_out - Handle mouse leave events
- *
- * @ev: Pointer to event.
- */
-static void
-e_mouse_out(Ecore_Event * ev)
-{
- Ecore_Event_Window_Leave *e;
-
- D_ENTER;
-
- e = ev->event;
- keyboard_nav = 0;
- if (e->win == menu_event_win)
- {
- }
- else
- {
- Evas_List * l;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if ((e->win == m->win.main) || (e->win == m->win.evas))
- {
- evas_event_feed_mouse_move(m->evas, -99999999, -99999999);
- }
- }
- }
-
- D_RETURN;
-}
-
-/**
- * e_window_expose - Handle window expose events
- *
- * @ev: Pointer to event.
- */
-static void
-e_window_expose(Ecore_Event * ev)
-{
- Ecore_Event_Window_Expose *e;
-
- D_ENTER;
-
- e = ev->event;
- {
- Evas_List * l;
-
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (e->win == m->win.evas)
- {
- m->first_expose = 1;
- /* checkme
- evas_update_rect(m->evas, e->x, e->y, e->w, e->h);
- */
- evas_damage_rectangle_add(m->evas, e->x, e->y, e->w, e->h);
- break;
- }
-
- e_menu_update_shape(m);
- }
- }
-
- D_RETURN;
-}
-
-/**
- * e_menu_item_unselect - Unselect a menu item.
- *
- * @mi: Pointer to the menu item to be unselected.
- */
-static void
-e_menu_item_unselect(E_Menu_Item * mi)
-{
- D_ENTER;
- if ((mi) && (mi->menu->selected == mi))
- {
- mi->menu->selected = curr_selected_item = NULL;
-
- mi->selected = 0;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-/**
- * e_menu_item_select - Select a menu item.
- * NOTE - Assumes only one item can be selected at once,
- * and unselects any previously selected menu item.
- *
- * @mi: Pointer to the menu item to be selected.
- */
-static void
-e_menu_item_select(E_Menu_Item * mi)
-{
- D_ENTER;
-
- // e_menu_item_unselect(curr_selected_item);
- if (mi)
- {
- mi->menu->selected = mi;
- mi->selected = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- curr_selected_item = mi;
- }
-
- D_RETURN;
-}
-
-/**
- * e_menu_item_in_cb - Callback for when mouse enters a specific menu item.
- * Attached by e_item_realize(). Selects menu item.
- *
- * @_data: Pointer to actual menu item structure.
- * @_e: Evas
- * @_o: Evas object
- * @_b: ?????
- * @x: ?????
- * @y: ?????
- */
-static void
-e_menu_item_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *ev_info)
-{
- E_Menu_Item *mi;
- Evas_Event_Mouse_In *event_info = ev_info;
-
- D_ENTER;
-
- mi = _data;
- e_menu_item_select(mi);
- e_menu_hide_submenus(mi->menu);
- if (mi->submenu && mi->submenu->entries)
- {
- e_menu_move_to(mi->submenu,
- mi->menu->current.x + mi->menu->current.w,
- mi->menu->current.y + mi->y - mi->menu->border.t);
- e_menu_show(mi->submenu);
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-/**
- * e_menu_item_out_cb - Callback for when mouse leaves a specific menu item.
- * Attached by e_item_realize(). Unselects menu item.
- *
- * @_data: Pointer to actual menu item structure.
- * @_e: Evas
- * @_o: Evas object
- * @_b: ?????
- * @x: ?????
- * @y: ?????
- */
-static void
-e_menu_item_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *ev_info)
-{
- E_Menu_Item *mi;
- Evas_Event_Mouse_Out *event_info = ev_info;
-
- D_ENTER;
-
- mi = _data;
- e_menu_item_unselect(mi);
-
- D_RETURN;
- UN(_e);
- UN(_o);
- UN(event_info);
-}
-
-void
-e_menu_callback_item(E_Menu * m, E_Menu_Item * mi)
-{
- D_ENTER;
-
- if (mi->func_select)
- mi->func_select(m, mi, mi->func_select_data);
-
- D_RETURN;
-}
-
-void
-e_menu_hide_callback(E_Menu * m, void (*func) (E_Menu * m, void *data),
- void *data)
-{
- m->func_hide = func;
- m->func_hide_data = data;
-}
-
-void
-e_menu_item_set_callback(E_Menu_Item * mi,
- void (*func) (E_Menu * m, E_Menu_Item * mi,
- void *data), void *data)
-{
- D_ENTER;
-
- mi->func_select = func;
- mi->func_select_data = data;
-
- D_RETURN;
-}
-
-/**
- * e_menu_hide_submenus - Hide all menus except @menus_after.
- * Assumes all menus after @menus_after in the list open_menus
- * are submenus of @menus_after.
- *
- * @menus_after: All menus after this are hidden.
- */
-void
-e_menu_hide_submenus(E_Menu * menus_after)
-{
- Evas_List * l;
-
- D_ENTER;
-
- /* Loop thru all open menus: */
- for (l = open_menus; l; l = l->next)
- {
- /* Found submenu, so now hide all remaining menus: */
- if (l->data == menus_after)
- {
- l = l->next;
- for (; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_hide(m);
- }
- break;
- }
- }
-
- D_RETURN;
-}
-
-/**
- * e_menu_select - Attempt to select the menu entry @dx entries across,
- * and @dy entries down.
- *
- * @dx: Horizontal offset of new menu entry.
- * @dy: Vertical offset of new menu entry.
- */
-void
-e_menu_select(int dx, int dy)
-{
- Evas_List *l, *ll;
- int done = 0;
-
- D_ENTER;
-
- /* Loop through all open menus, tile done or reached end */
- for (l = open_menus; (l) && (!done); l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- /* If this is the selected menu: */
- if (m->selected)
- {
- /* Go through the menu entries: */
- for (ll = m->entries; (ll) && (!done); ll = ll->next)
- {
- E_Menu_Item *mi;
-
- mi = ll->data;
- /* Found the currently selected entry: */
- if (mi->selected)
- {
- /* Vertical movement, up and down menu: */
- if (dy != 0)
- {
- int ok = 0;
-
- /* Only go up or down if entry exists to do so, */
- /* and skip over separators: */
- if (dy < 0)
- {
- for (; ll->prev; ll = ll->prev)
- {
- mi = ll->prev->data;
- if (!mi->separator)
- {
- ok = 1;
- break;
- }
- }
- }
- else if (dy > 0)
- {
- for (; ll->next; ll = ll->next)
- {
- mi = ll->next->data;
- if (!mi->separator)
- {
- ok = 1;
- break;
- }
- }
- }
-
- if (ok)
- {
- /* Unselect old and select new item: */
- e_menu_item_unselect(m->selected);
- e_menu_item_select(mi);
- e_menu_hide_submenus(mi->menu);
-
- /* If submenu, display it: */
- if (mi->submenu && mi->submenu->entries)
- {
- e_menu_move_to(mi->submenu,
- mi->menu->current.x +
- mi->menu->current.w,
- mi->menu->current.y +
- mi->y -
- mi->menu->border.t);
- e_menu_show(mi->submenu);
- }
- }
- }
- done = 1;
- }
- }
- /* Horizontal movement, into and out of submenus: */
- if (dx != 0)
- {
- int ok = 0;
-
- /* Only carry on if appropriate submenus exist: */
- if ((dx < 0) && (l->prev))
- ok = 1;
- else if ((dx > 0) && (l->next))
- ok = 1;
- if (ok)
- {
- E_Menu_Item *mi = NULL;
- E_Menu *mm;
-
- /* Moving out of a submenu: */
- if (dx < 0)
- {
- Evas_List * ll;
-
- mm = l->prev->data;
- for (ll = mm->entries; (ll) && (!mi); ll = ll->next)
- {
- E_Menu_Item *mmi;
-
- mmi = ll->data;
- if (mmi->submenu == m)
- mi = mmi;
- }
- }
- /* Moving into a submenu: */
- else
- {
- mm = l->next->data;
- if (mm->entries)
- mi = mm->entries->data;
- }
- if (mi)
- {
- /* Unselect old and select new item: */
- e_menu_item_unselect(m->selected);
- e_menu_item_select(mi);
- e_menu_hide_submenus(mi->menu);
-
- /* If new entry is a submenu, display it: */
- if (mi->submenu && mi->submenu->entries)
- {
- e_menu_move_to(mi->submenu,
- mi->menu->current.x +
- mi->menu->current.w,
- mi->menu->current.y + mi->y -
- mi->menu->border.t);
- e_menu_show(mi->submenu);
- }
- e_menu_update_visibility(mm);
- }
- }
- done = 1;
- }
- e_menu_update_visibility(m);
- }
- }
- /* If opened a new submenu, position it and display it: */
- if (!done)
- {
- if (open_menus)
- {
- E_Menu *m;
- E_Menu_Item *mi;
-
- m = open_menus->data;
- mi = m->entries->data;
- e_menu_item_select(mi);
- if (mi->submenu && mi->submenu->entries)
- {
- e_menu_move_to(mi->submenu,
- mi->menu->current.x + mi->menu->current.w,
- mi->menu->current.y + mi->y -
- mi->menu->border.t);
- e_menu_show(mi->submenu);
- }
- }
- }
-
- D_RETURN;
-}
-
-void
-e_menu_init(void)
-{
- D_ENTER;
-
- ecore_window_get_geometry(0, NULL, NULL, &screen_w, &screen_h);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_IN, e_mouse_in);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_OUT, e_mouse_out);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_WHEEL, e_wheel);
- ecore_event_filter_idle_handler_add(e_idle, NULL);
-
- D_RETURN;
-}
-
-void
-e_menu_event_win_show(void)
-{
- D_ENTER;
-
- /* create it */
- if (!menu_event_win)
- {
- menu_event_win = ecore_window_input_new(0, 0, 0, screen_w, screen_h);
- ecore_window_set_events(menu_event_win,
- XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT |
- XEV_KEY);
- ecore_window_show(menu_event_win);
- ecore_keyboard_grab(menu_event_win);
- ecore_grab_mouse(menu_event_win, 1, 0);
- }
- /* raise it */
- if (menu_event_win)
- ecore_window_raise(menu_event_win);
- if ((!ecore_grab_window_get()) || (!ecore_keyboard_grab_window_get()))
- {
- Evas_List * l;
-
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->current.visible)
- e_menu_hide(m);
- }
- e_menu_event_win_hide();
- }
-
- D_RETURN;
-}
-
-void
-e_menu_event_win_hide(void)
-{
- D_ENTER;
-
- /* destroy it */
- if (menu_event_win)
- {
- ecore_ungrab_mouse();
- ecore_keyboard_ungrab();
- ecore_window_destroy(menu_event_win);
- menu_event_win = 0;
- }
-
- D_RETURN;
-}
-
-/**
- * e_menu_set_background - Sets the background of menu @m
- * Sets background of menu using the default theme background,
- * base.bits.db
- *
- * @m: Menu to set background on.
- */
-void
-e_menu_set_background(E_Menu * m)
-{
- char *menus;
- char buf[PATH_MAX];
- char *part;
- int pl, pr, pt, pb;
-
- D_ENTER;
-
- menus = e_config_get("menus");
-
- part = "base.bits.db";
- snprintf(buf, PATH_MAX, "%s%s", menus, part);
- if ((m->bg_file) && (!strcmp(m->bg_file, buf)))
- D_RETURN;
-
- IF_FREE(m->bg_file);
- m->bg_file = strdup(buf);
-
- if (m->bg)
- ebits_free(m->bg);
- m->bg = ebits_load(m->bg_file);
- if (m->bg)
- ebits_set_color_class(m->bg, "Menu BG", 100, 200, 255, 255);
-
- pl = pr = pt = pb = 0;
- if (m->bg)
- {
- ebits_get_insets(m->bg, &pl, &pr, &pt, &pb);
- ebits_add_to_evas(m->bg, m->evas);
- ebits_move(m->bg, 0, 0);
- ebits_show(m->bg);
- ebits_set_layer(m->bg, 0);
- }
- m->current.w += ((pl + pr) - (m->border.l + m->border.r));
- m->current.h += ((pt + pb) - (m->border.t + m->border.b));
- m->border.l = pl;
- m->border.r = pr;
- m->border.t = pt;
- m->border.b = pb;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_set_sel(E_Menu * m, E_Menu_Item * mi)
-{
- char *menus;
- char buf[PATH_MAX];
- int pl, pr, pt, pb;
- int has_sub = 0;
- int selected = 0;
-
- D_ENTER;
-
- menus = e_config_get("menus");
- if (!mi->separator)
- {
- selected = mi->selected;
- if (mi->submenu)
- has_sub = 1;
- snprintf(buf, PATH_MAX, "%sselected-%i.submenu-%i.bits.db", menus,
- selected, has_sub);
- if ((mi->bg_file) && (!strcmp(mi->bg_file, buf)))
- D_RETURN;
- }
- IF_FREE(mi->bg_file);
- if (!mi->separator)
- mi->bg_file = strdup(buf);
- else
- mi->bg_file = NULL;
- if (mi->bg)
- ebits_free(mi->bg);
- if (mi->bg_file)
- mi->bg = ebits_load(mi->bg_file);
- if (mi->bg)
- ebits_set_color_class(mi->bg, "Menu BG", 100, 200, 255, 255);
-
- pl = pr = pt = pb = 0;
- if (mi->bg)
- {
- ebits_get_insets(mi->bg, &pl, &pr, &pt, &pb);
- ebits_add_to_evas(mi->bg, m->evas);
- ebits_set_layer(mi->bg, 1);
- }
- if (m->sel_border.l < pl)
- {
- m->sel_border.l = pl;
- m->recalc_entries = 1;
- }
- if (m->sel_border.r < pr)
- {
- m->sel_border.r = pr;
- m->recalc_entries = 1;
- }
- if (m->sel_border.t < pt)
- {
- m->sel_border.t = pt;
- m->recalc_entries = 1;
- }
- if (m->sel_border.b < pb)
- {
- m->sel_border.b = pb;
- m->recalc_entries = 1;
- }
- m->redo_sel = 1;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_set_sep(E_Menu * m, E_Menu_Item * mi)
-{
- char *menus;
- char buf[PATH_MAX];
- int pl, pr, pt, pb, minx, miny;
-
- D_ENTER;
-
- menus = e_config_get("menus");
- snprintf(buf, PATH_MAX, "%sseparator.bits.db", menus);
- if ((mi->sep_file) && (!strcmp(mi->sep_file, buf)))
- D_RETURN;
-
- IF_FREE(mi->sep_file);
- mi->sep_file = strdup(buf);
-
- if (mi->sep)
- ebits_free(mi->sep);
- mi->sep = ebits_load(mi->sep_file);
- if (mi->sep)
- ebits_set_color_class(mi->sep, "Menu BG", 100, 200, 255, 255);
-
- pl = pr = pt = pb = 0;
- minx = 0;
- miny = 0;
- if (mi->sep)
- {
- ebits_get_insets(mi->sep, &pl, &pr, &pt, &pb);
- ebits_add_to_evas(mi->sep, m->evas);
- ebits_set_layer(mi->sep, 1);
- ebits_get_min_size(mi->sep, &minx, &miny);
- }
- if (mi->size.min.w < minx)
- mi->size.min.w = minx;
- if (mi->size.min.h < miny)
- mi->size.min.h = miny;
- m->redo_sel = 1;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_set_state(E_Menu * m, E_Menu_Item * mi)
-{
- char *menus;
- char buf[PATH_MAX];
- int on;
- int pl, pr, pt, pb, minx, miny;
-
- D_ENTER;
-
- menus = e_config_get("menus");
- on = mi->on;
- if (mi->check)
- snprintf(buf, PATH_MAX, "%scheck-%i.bits.db", menus, on);
- else
- snprintf(buf, PATH_MAX, "%sradio-%i.bits.db", menus, on);
- if ((mi->state_file) && (!strcmp(mi->state_file, buf)))
- D_RETURN;
-
- IF_FREE(mi->state_file);
- mi->state_file = strdup(buf);
-
- if (mi->state)
- ebits_free(mi->state);
- mi->state = ebits_load(mi->state_file);
- if (mi->state)
- ebits_set_color_class(mi->state, "Menu BG", 100, 200, 255, 255);
-
- pl = pr = pt = pb = 0;
- minx = 0;
- miny = 0;
- if (mi->state)
- {
- ebits_get_insets(mi->state, &pl, &pr, &pt, &pb);
- ebits_add_to_evas(mi->state, m->evas);
- ebits_set_layer(mi->state, 2);
- ebits_get_min_size(mi->state, &minx, &miny);
- }
- if (mi->size.min.w < minx)
- mi->size.min.w = minx;
- if (mi->size.min.h < miny)
- mi->size.min.h = miny;
- m->redo_sel = 1;
- m->changed = 1;
-
- D_RETURN;
-}
-
-static void
-e_menu_cleanup(E_Menu * m)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = m->entries; l; l = l->next)
- {
- E_Menu_Item *mi;
-
- mi = l->data;
- e_menu_item_unrealize(m, mi);
- IF_FREE(mi->str);
- IF_FREE(mi->icon);
- free(mi);
- }
- m->entries = evas_list_free(m->entries);
- m->selected = NULL;
- IF_FREE(m->bg_file);
- evas_free(m->evas);
- ecore_window_destroy(m->win.main);
- menus = evas_list_remove(menus, m);
- open_menus = evas_list_remove(open_menus, m);
-
- /* Call the destructor of the base class */
- e_object_cleanup(E_OBJECT(m));
- m = NULL;
-
- D_RETURN;
-}
-
-E_Menu *
-e_menu_new(void)
-{
- E_Menu *m;
- char *font_dir;
-
- D_ENTER;
-
- font_dir = e_config_get("fonts");
-
- m = NEW(E_Menu, 1);
- ZERO(m, E_Menu, 1);
-
- e_object_init(E_OBJECT(m), (E_Cleanup_Func) e_menu_cleanup);
-
- m->win.main = ecore_window_override_new(0, 0, 0, 1, 1);
- m->evas = e_evas_new_all(ecore_display_get(),
- m->win.main,
- 0, 0, 1, 1, font_dir);
- /* aaaaaaaaah. this makes building the menu fast - moves the mouse far */
- /* far far far far away so callbacks and events arent triggerd as we */
- /* create objects that ofter hang around 0,0 - the default place for */
- /* the pointer to be... this means my 2000 entry menu works and comes up */
- /* pretty damn fast - considering i creating it when i click :) - problem */
- /* you can't fit 2000 entires into a window in X - since the limit is */
- /* 65536x65536 fo X - the other problem is i can only really draw in */
- /* the first 32768x32768 pixels of the window - thus limiting the menu */
- /* size to well - 32768x32768 - normally ok - but in extremes not so */
- /* good. We *COULD* do a workaround that meant we did the menu scrolling */
- /* within the evas and faked a menu window that only gets as big as the */
- /* screen - an then re-render it all - but well.. it's an extreme and */
- /* for now i think people will just have to live with a maximum menu size */
- /* of 32768x32768... didums! */
- evas_event_feed_mouse_move(m->evas, -999999999, -99999999);
-
- m->win.evas = e_evas_get_window(m->evas);
- ecore_window_set_events(m->win.evas,
- XEV_EXPOSE | XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT
- | XEV_KEY);
- ecore_window_set_events(m->win.main, XEV_IN_OUT | XEV_KEY);
- ecore_window_show(m->win.evas);
-
- e_menu_set_background(m);
-
- m->current.w = m->border.l + m->border.r;
- m->current.h = m->border.t + m->border.b;
- m->changed = 1;
-
- menus = evas_list_prepend(menus, m);
-
- D_RETURN_(m);
-}
-
-void
-e_menu_hide(E_Menu * m)
-{
- D_ENTER;
-
- if (m->selected)
- {
- m->selected->selected = 0;
- }
- m->selected = NULL;
- m->redo_sel = 1;
- m->current.visible = 0;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_show(E_Menu * m)
-{
- D_ENTER;
-
- m->current.visible = 1;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_move_to(E_Menu * m, int x, int y)
-{
- D_ENTER;
-
- m->current.x = x;
- m->current.y = y;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_show_at_mouse(E_Menu * m, int x, int y, Time t)
-{
- D_ENTER;
-
- D("show at mouse\n");
- m->current.x = x;
- m->current.y = y;
- m->time = t;
- D("show menu\n") e_menu_show(m);
-
- D_RETURN;
-}
-
-void
-e_menu_add_item(E_Menu * m, E_Menu_Item * mi)
-{
- D_ENTER;
-
- m->entries = evas_list_append(m->entries, mi);
- m->recalc_entries = 1;
- m->changed = 1;
- mi->menu = m;
- e_menu_item_realize(m, mi);
-
- D_RETURN;
-}
-
-void
-e_menu_del_item(E_Menu * m, E_Menu_Item * mi)
-{
- D_ENTER;
-
- m->entries = evas_list_remove(m->entries, mi);
- m->recalc_entries = 1;
- m->changed = 1;
- e_menu_item_unrealize(m, mi);
- IF_FREE(mi->str);
- IF_FREE(mi->icon);
- if (mi->menu->selected == mi)
- mi->menu->selected = NULL;
- FREE(mi);
- mi->menu = NULL;
-
- D_RETURN;
-}
-
-void
-e_menu_item_update(E_Menu * m, E_Menu_Item * mi)
-{
- int tx, ty, tw, th, ix, iy, iw, ih, rx, ry, rw, rh;
- double dtw, dth;
-
- D_ENTER;
-
- if (mi->sep)
- {
- ebits_move(mi->sep, mi->x, mi->y);
- ebits_resize(mi->sep, mi->size.w + m->sel_border.l + m->sel_border.r,
- mi->size.h);
- ebits_show(mi->sep);
- }
- else
- {
- rx = 0;
- ry = 0;
- rh = 0;
- rw = m->size.state;
- if (mi->state)
- {
- ebits_get_min_size(mi->state, &rw, &rh);
- rx = 0;
- ry = ((mi->size.h - rh) / 2);
- ebits_move(mi->state, m->sel_border.l + mi->x + rx,
- m->sel_border.t + mi->y + ry);
- ebits_resize(mi->state, rw, rh);
- }
-
- tx = 0;
- ty = 0;
- tw = 0;
- th = 0;
- if (mi->obj_text)
- {
- evas_object_geometry_get(mi->obj_text, NULL, NULL, &dtw, &dth);
- tw = (int)dtw;
- th = (int)dth;
- }
-
- ix = 0;
- iy = 0;
- iw = 0;
- ih = 0;
- if (mi->obj_icon)
- {
- int sh;
-
- evas_object_image_size_get(mi->obj_icon, &iw, &ih);
- sh = th;
- if (rh > th)
- sh = rh;
- if ((mi->scale_icon) && (ih > sh) && (mi->str))
- {
- iw = (iw * sh) / ih;
- ih = sh;
- }
- if (m->size.state)
- ix = rx + m->size.state + m->pad.state;
- ix += ((m->size.icon - iw) / 2);
- iy = ((mi->size.h - ih) / 2);
- evas_object_move(mi->obj_icon, m->sel_border.l + mi->x + ix,
- m->sel_border.t + mi->y + iy);
- evas_object_resize(mi->obj_icon, iw, ih);
- evas_object_image_fill_set(mi->obj_icon, 0, 0, iw, ih);
- }
-
- if (mi->obj_text)
- {
- if (m->size.state)
- tx = rx + m->size.state + m->pad.state;
- if (m->size.icon)
- tx += m->size.icon + m->pad.icon;
- ty = ((mi->size.h - th) / 2);
- evas_object_move(mi->obj_text, m->sel_border.l + mi->x + tx,
- m->sel_border.t + mi->y + ty);
- }
-
- if (mi->obj_entry)
- {
- evas_object_move(mi->obj_entry, mi->x, mi->y);
- evas_object_resize(mi->obj_entry,
- mi->size.w + m->sel_border.l + m->sel_border.r,
- mi->size.h + m->sel_border.t + m->sel_border.b);
- }
- if (mi->state)
- {
- ebits_show(mi->state);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_unrealize(E_Menu * m, E_Menu_Item * mi)
-{
- D_ENTER;
-
- if (mi->bg)
- ebits_free(mi->bg);
- mi->bg = NULL;
- IF_FREE(mi->bg_file);
- mi->bg_file = NULL;
- if (mi->obj_entry)
- evas_object_del(mi->obj_entry);
- mi->obj_entry = NULL;
- if (mi->obj_text)
- evas_object_del(mi->obj_text);
- mi->obj_text = NULL;
- if (mi->obj_icon)
- evas_object_del(mi->obj_icon);
- mi->obj_icon = NULL;
- if (mi->state)
- ebits_free(mi->state);
- mi->state = NULL;
- IF_FREE(mi->state_file);
- mi->state_file = NULL;
- if (mi->sep)
- ebits_free(mi->sep);
- mi->sep = NULL;
- IF_FREE(mi->sep_file);
- mi->sep_file = NULL;
-
- D_RETURN;
- UN(m);
-}
-
-void
-e_menu_item_realize(E_Menu * m, E_Menu_Item * mi)
-{
- double tw, th;
- int iw, ih, rw, rh;
-
- D_ENTER;
-
- if (mi->separator)
- {
- e_menu_set_sep(m, mi);
- }
- else
- {
- if (mi->str)
- {
- mi->obj_text = evas_object_text_add(m->evas);
- evas_object_text_font_set(mi->obj_text, "menu", 8);
- evas_object_text_text_set(mi->obj_text, mi->str);
- evas_object_color_set(mi->obj_text, 0, 0, 0, 255);
- evas_object_show(mi->obj_text);
- evas_object_layer_set(mi->obj_text, 10);
- }
- if (mi->icon)
- {
- mi->obj_icon = evas_object_image_add(m->evas);
- evas_object_image_file_set(mi->obj_icon, mi->icon, NULL);
- evas_object_show(mi->obj_icon);
- evas_object_layer_set(mi->obj_icon, 10);
- }
- mi->obj_entry = evas_object_rectangle_add(m->evas);
- evas_object_layer_set(mi->obj_entry, 11);
- evas_object_color_set(mi->obj_entry, 0, 0, 0, 0);
- evas_object_show(mi->obj_entry);
- tw = 0;
- th = 0;
- if (mi->obj_text)
- evas_object_geometry_get(mi->obj_text, NULL, NULL, &tw, &th);
- iw = 0;
- ih = 0;
- if (mi->obj_icon)
- evas_object_image_size_get(mi->obj_icon, &iw, &ih);
- rw = 0;
- rh = 0;
- if (mi->state)
- ebits_get_min_size(mi->state, &rw, &rh);
- mi->size.min.w = (int)tw + rw;
- if (rh > th)
- th = (double)rh;
- if (((!mi->scale_icon) && (ih > th)) || ((!mi->str) && (ih > th)))
- th = (double)ih;
- mi->size.min.h = (int)th;
- /* checkme todo */
- evas_object_event_callback_add(mi->obj_entry, EVAS_CALLBACK_MOUSE_IN,
- e_menu_item_in_cb, mi);
- evas_object_event_callback_add(mi->obj_entry, EVAS_CALLBACK_MOUSE_OUT,
- e_menu_item_out_cb, mi);
- e_menu_set_sel(m, mi);
- if ((mi->radio) || (mi->check))
- e_menu_set_state(m, mi);
- }
-
- D_RETURN;
-}
-
-E_Menu_Item *
-e_menu_item_new(char *str)
-{
- E_Menu_Item *mi;
-
- D_ENTER;
-
- mi = NEW(E_Menu_Item, 1);
- ZERO(mi, E_Menu_Item, 1);
-
- if (str)
- mi->str = strdup(str);
-
- D_RETURN_(mi);
-}
-
-void
-e_menu_obscure_outside_screen(E_Menu * m)
-{
- D_ENTER;
-
- /* obscure stuff outside the screen boundaries - optimizes rendering */
- evas_obscured_clear(m->evas);
- evas_obscured_rectangle_add(m->evas,
- -m->current.x - 100000,
- -m->current.y - 100000, 200000 + screen_w, 100000);
- evas_obscured_rectangle_add(m->evas,
- -m->current.x - 100000,
- -m->current.y - 100000, 100000, 200000 + screen_h);
- evas_obscured_rectangle_add(m->evas,
- -m->current.x - 100000,
- screen_h - m->current.y, 200000 + screen_w, 100000);
- evas_obscured_rectangle_add(m->evas,
- screen_w - m->current.x,
- -m->current.y - 100000, 100000, 200000 + screen_h);
-
- D_RETURN;
-}
-
-void
-e_menu_scroll_all_by(int dx, int dy)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- if (m->current.visible)
- {
- m->current.x += dx;
- m->current.y += dy;
- m->changed = 1;
- }
- }
- if (!keyboard_nav)
- {
- for (l = open_menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- evas_event_feed_mouse_move(m->evas,
- mouse_x - m->current.x, mouse_y - m->current.y);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_menu_update_visibility(E_Menu * m)
-{
- E_Menu_Item *mi;
-
- D_ENTER;
- mi = m->selected;
- if (mi)
- {
- /* if the entry is off screen - scroll so it's on screen */
- if (m->current.x < 0)
- e_menu_scroll_all_by(-m->current.x, 0);
- else if ((m->current.x + m->current.w) > screen_w)
- {
- e_menu_scroll_all_by(screen_w - (m->current.x + m->current.w), 0);
- }
- if ((m->current.y + m->sel_border.t + mi->y) < 0)
- {
- if (m->current.y < -(screen_h / 4))
- e_menu_scroll_all_by(0, screen_h / 4);
- else
- e_menu_scroll_all_by(0, -m->current.y);
- }
- else if ((m->current.y + m->sel_border.t + mi->y + mi->size.h) >
- screen_h)
- {
- if ((m->current.y + m->current.h - screen_h) < (screen_h / 4))
- e_menu_scroll_all_by(0,
- -(m->current.y + m->current.h - screen_h));
- else
- e_menu_scroll_all_by(0, -(screen_h / 4));
- }
- }
-
- D_RETURN;
-}
-
-void
-e_menu_update_base(E_Menu * m)
-{
- int size_changed = 0;
- int location_changed = 0;
-
- D_ENTER;
-
- if (!m->changed)
- D_RETURN;
-
- if (m->recalc_entries)
- {
- Evas_List * l;
- int max_w, max_h;
- int i;
-
- max_w = 0;
- max_h = 0;
- for (l = m->entries; l; l = l->next)
- {
- E_Menu_Item *mi;
-
- mi = l->data;
- if (mi->size.min.h > max_h)
- max_h = mi->size.min.h;
- }
- m->size.state = 0;
- m->size.icon = 0;
- m->size.text = 0;
- for (l = m->entries; l; l = l->next)
- {
- E_Menu_Item *mi;
- int iw, ih, rw, rh;
- double tw, th;
-
- mi = l->data;
- if (!mi->separator)
- {
- tw = 0;
- th = 0;
- if (mi->obj_text)
- evas_object_geometry_get(mi->obj_text, NULL, NULL, &tw,
- &th);
- iw = 0;
- ih = 0;
- if (mi->obj_icon)
- evas_object_image_size_get(mi->obj_icon, &iw, &ih);
- rw = 0;
- rh = 0;
- if (mi->state)
- ebits_get_min_size(mi->state, &rw, &rh);
- if (m->size.text < tw)
- m->size.text = tw;
- if (m->size.state < rw)
- m->size.state = rw;
- if ((mi->scale_icon) && (iw > 0) && (ih > 0) && (mi->str))
- {
- int iiw;
-
- iiw = iw;
- if (ih > (int)th)
- iiw = (iw * (int)th) / ih;
- if (m->size.icon < iiw)
- m->size.icon = iiw;
- }
- else if (m->size.icon < iw)
- m->size.icon = iw;
- }
- }
- max_w = m->size.state;
- if (m->size.state)
- max_w += m->pad.state;
- max_w += m->size.icon;
- if (m->size.icon)
- max_w += m->pad.icon;
- max_w += m->size.text;
-
- i = m->border.t;
- for (l = m->entries; l; l = l->next)
- {
- E_Menu_Item *mi;
-
- mi = l->data;
- mi->size.w = max_w;
- if (mi->separator)
- mi->size.h = mi->size.min.h;
- else
- mi->size.h = max_h;
- mi->x = m->border.l;
- mi->y = i;
- if (!mi->separator)
- i += m->sel_border.t + m->sel_border.b;
- if (mi->separator)
- i += mi->size.h;
- else
- i += max_h;
- e_menu_item_update(m, mi);
- }
- m->current.w =
- m->border.l + m->border.r + max_w + m->sel_border.l +
- m->sel_border.r;
- m->current.h = m->border.b + i;
-
- m->recalc_entries = 0;
- }
- if (m->redo_sel)
- {
- Evas_List * l;
-
- for (l = m->entries; l; l = l->next)
- {
- E_Menu_Item *mi;
-
- mi = l->data;
- e_menu_set_sel(m, mi);
- if (mi)
- {
- if (mi->bg)
- {
- ebits_move(mi->bg, mi->x, mi->y);
- ebits_resize(mi->bg,
- mi->size.w + m->sel_border.l +
- m->sel_border.r,
- mi->size.h + m->sel_border.t +
- m->sel_border.b);
- ebits_show(mi->bg);
- }
- }
- }
- m->redo_sel = 0;
- }
-
- if ((m->current.x != m->previous.x) || (m->current.y != m->previous.y))
- location_changed = 1;
- if ((m->current.w != m->previous.w) || (m->current.h != m->previous.h))
- size_changed = 1;
-
- if ((location_changed) && (size_changed))
- {
- ecore_window_move_resize(m->win.main, m->current.x, m->current.y,
- m->current.w, m->current.h);
- e_menu_obscure_outside_screen(m);
- }
- else if (location_changed)
- {
- ecore_window_move(m->win.main, m->current.x, m->current.y);
- e_menu_obscure_outside_screen(m);
- }
- else if (size_changed)
- {
- ecore_window_resize(m->win.main, m->current.w, m->current.h);
- }
- if (size_changed)
- {
- ecore_window_resize(m->win.evas, m->current.w, m->current.h);
- evas_output_size_set(m->evas, m->current.w, m->current.h);
- evas_output_viewport_set(m->evas, 0, 0, m->current.w, m->current.h);
- if (m->bg)
- ebits_resize(m->bg, m->current.w, m->current.h);
- }
-
- e_menu_update_shape(m);
-
- D_RETURN;
-}
-
-void
-e_menu_update_finish(E_Menu * m)
-{
- D_ENTER;
-
- if (!m->changed)
- D_RETURN;
- m->previous = m->current;
- m->changed = 0;
-
- D_RETURN;
-}
-
-void
-e_menu_update_shows(E_Menu * m)
-{
- D_ENTER;
-
- if (!m->changed)
- D_RETURN;
- if (m->current.visible != m->previous.visible)
- {
- if (m->current.visible)
- {
- ecore_window_raise(m->win.main);
- e_menu_event_win_show();
- ecore_window_show(m->win.main);
- if (!open_menus)
- keyboard_nav = 0;
- open_menus = evas_list_append(open_menus, m);
- }
- }
-
- e_menu_update_shape(m);
-
- D_RETURN;
-}
-
-void
-e_menu_update_hides(E_Menu * m)
-{
- D_ENTER;
-
- if (!m->changed)
- D_RETURN;
- if (m->current.visible != m->previous.visible)
- {
- if (!m->current.visible)
- {
- if (m->selected)
- {
- E_Menu_Item *mi;
-
- mi = m->selected;
- mi->selected = 0;
- e_menu_set_sel(m, mi);
- if (mi)
- {
- if (mi->bg)
- {
- ebits_move(mi->bg, mi->x, mi->y);
- ebits_resize(mi->bg,
- mi->size.w + m->sel_border.l +
- m->sel_border.r,
- mi->size.h + m->sel_border.t +
- m->sel_border.b);
- ebits_show(mi->bg);
- }
- }
- m->redo_sel = 1;
- m->changed = 1;
- m->selected = NULL;
- }
- open_menus = evas_list_remove(open_menus, m);
- ecore_window_hide(m->win.main);
- if (!open_menus)
- e_menu_event_win_hide();
- if (m->func_hide)
- m->func_hide(m, m->func_hide_data);
- }
- }
-
- e_menu_update_shape(m);
-
- D_RETURN;
-}
-
-void
-e_menu_update_shape(E_Menu *m)
-{
- Pixmap pmap, mask;
-
- D_ENTER;
-
- pmap = ecore_pixmap_new(m->win.main, m->current.w, m->current.h, 0);
- mask = ecore_pixmap_new(m->win.main, m->current.w, m->current.h, 1);
-
- e_evas_get_mask(m->evas, pmap, mask);
- ecore_window_set_background_pixmap(m->win.main, pmap);
- ecore_window_set_shape_mask(m->win.main, mask);
- ecore_window_clear(m->win.main);
-
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
-
- D_RETURN;
-}
-
-void
-e_menu_update(E_Menu * m)
-{
- D_ENTER;
-
- e_menu_update_base(m);
- e_menu_update_shows(m);
- e_menu_update_hides(m);
- e_menu_update_finish(m);
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_icon(E_Menu_Item * mi, char *icon)
-{
- D_ENTER;
-
- IF_FREE(mi->icon);
- mi->icon = NULL;
- if (icon)
- mi->icon = strdup(icon);
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_text(E_Menu_Item * mi, char *text)
-{
- D_ENTER;
-
- IF_FREE(mi->str);
- mi->str = NULL;
- if (text)
- mi->str = strdup(text);
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_separator(E_Menu_Item * mi, int sep)
-{
- D_ENTER;
-
- mi->separator = sep;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_radio(E_Menu_Item * mi, int radio)
-{
- D_ENTER;
-
- mi->radio = radio;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_check(E_Menu_Item * mi, int check)
-{
- D_ENTER;
-
- mi->check = check;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_state(E_Menu_Item * mi, int state)
-{
- D_ENTER;
-
- mi->on = state;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_submenu(E_Menu_Item * mi, E_Menu * submenu)
-{
- D_ENTER;
-
- if (mi->submenu)
- e_menu_hide(mi->submenu);
- mi->submenu = submenu;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_item_set_scale_icon(E_Menu_Item * mi, int scale)
-{
- D_ENTER;
-
- mi->scale_icon = scale;
- if (mi->menu)
- {
- mi->menu->recalc_entries = 1;
- mi->menu->changed = 1;
- }
-
- D_RETURN;
-}
-
-void
-e_menu_set_padding_icon(E_Menu * m, int pad)
-{
- D_ENTER;
-
- m->pad.icon = pad;
- m->recalc_entries = 1;
- m->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_menu_set_padding_state(E_Menu * m, int pad)
-{
- D_ENTER;
-
- m->pad.state = pad;
- m->recalc_entries = 1;
- m->changed = 1;
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_MENU_H
-#define E_MENU_H
-
-#include "e.h"
-#include "object.h"
-
-typedef struct _E_Menu E_Menu;
-typedef struct _E_Menu_Item E_Menu_Item;
-
-struct _E_Menu
-{
- E_Object o;
-
- struct
- {
- int x, y, w, h;
- int visible;
- }
- current , previous;
- struct
- {
- int l, r, t, b;
- }
- border , sel_border;
- struct
- {
- Window main, evas;
- }
- win;
- Evas * evas;
- Ebits_Object * bg;
- Evas_List * entries;
- char *bg_file;
-
- int first_expose;
-
- int recalc_entries;
- int redo_sel;
- int changed;
-
- int delete_me;
-
- struct
- {
- int state, icon, text;
- }
- size;
- struct
- {
- int icon, state;
- }
- pad;
-
- E_Menu_Item *selected;
-
- Time time;
-
- void (*func_hide) (E_Menu * m, void *data);
- void *func_hide_data;
-};
-
-struct _E_Menu_Item
-{
- int x, y;
- struct
- {
- struct
- {
- int w, h;
- }
- min;
- int w, h;
- }
- size;
-
- Ebits_Object bg;
- char *bg_file;
- int selected;
-
- Evas_Object * obj_entry;
-
- char *str;
- Evas_Object * obj_text;
-
- char *icon;
- Evas_Object * obj_icon;
- int scale_icon;
-
- Ebits_Object state;
- char *state_file;
-
- Ebits_Object sep;
- char *sep_file;
-
- int separator;
- int radio_group;
- int radio;
- int check;
- int on;
-
- E_Menu *menu;
- E_Menu *submenu;
-
- void (*func_select) (E_Menu * m, E_Menu_Item * mi,
- void *data);
- void *func_select_data;
-};
-
-/**
- * e_menu_init - Menu event handling initalization.
- *
- * This function hooks in the necessary event handlers for
- * menu handling.
- */
-void e_menu_init(void);
-
-void e_menu_callback_item(E_Menu * m, E_Menu_Item * mi);
-void e_menu_item_set_callback(E_Menu_Item * mi,
- void (*func) (E_Menu * m,
- E_Menu_Item * mi,
- void *data),
- void *data);
-void e_menu_hide_callback(E_Menu * m,
- void (*func) (E_Menu * m, void *data),
- void *data);
-void e_menu_hide_submenus(E_Menu * menus_after);
-void e_menu_select(int dx, int dy);
-void e_menu_event_win_show(void);
-void e_menu_event_win_hide(void);
-void e_menu_set_background(E_Menu * m);
-void e_menu_set_sel(E_Menu * m, E_Menu_Item * mi);
-void e_menu_set_sep(E_Menu * m, E_Menu_Item * mi);
-void e_menu_set_state(E_Menu * m, E_Menu_Item * mi);
-E_Menu *e_menu_new(void);
-void e_menu_hide(E_Menu * m);
-void e_menu_show(E_Menu * m);
-void e_menu_move_to(E_Menu * m, int x, int y);
-void e_menu_show_at_mouse(E_Menu * m, int x, int y, Time t);
-void e_menu_add_item(E_Menu * m, E_Menu_Item * mi);
-void e_menu_del_item(E_Menu * m, E_Menu_Item * mi);
-void e_menu_item_update(E_Menu * m, E_Menu_Item * mi);
-void e_menu_item_unrealize(E_Menu * m, E_Menu_Item * mi);
-void e_menu_item_realize(E_Menu * m, E_Menu_Item * mi);
-E_Menu_Item *e_menu_item_new(char *str);
-void e_menu_obscure_outside_screen(E_Menu * m);
-void e_menu_scroll_all_by(int dx, int dy);
-void e_menu_update_visibility(E_Menu * m);
-void e_menu_update_base(E_Menu * m);
-void e_menu_update_finish(E_Menu * m);
-void e_menu_update_shows(E_Menu * m);
-void e_menu_update_hides(E_Menu * m);
-void e_menu_update_shape(E_Menu *m);
-void e_menu_update(E_Menu * m);
-void e_menu_item_set_icon(E_Menu_Item * mi, char *icon);
-void e_menu_item_set_text(E_Menu_Item * mi, char *text);
-void e_menu_item_set_separator(E_Menu_Item * mi, int sep);
-void e_menu_item_set_radio(E_Menu_Item * mi, int radio);
-void e_menu_item_set_check(E_Menu_Item * mi, int check);
-void e_menu_item_set_state(E_Menu_Item * mi, int state);
-void e_menu_item_set_submenu(E_Menu_Item * mi, E_Menu * submenu);
-void e_menu_item_set_scale_icon(E_Menu_Item * mi, int scale);
-void e_menu_set_padding_icon(E_Menu * m, int pad);
-void e_menu_set_padding_state(E_Menu * m, int pad);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "menu.h"
-#include "menubuild.h"
-#include "exec.h"
-#include "util.h"
-#include "file.h"
-#include "border.h"
-#include "observer.h"
-#include "actions.h"
-
-Evas_List * build_menus = NULL;
-
-static void e_build_menu_cb_exec(E_Menu * m, E_Menu_Item * mi,
- void *data);
-static void e_build_menu_cb_exec(E_Menu * m, E_Menu_Item * mi,
- void *data);
-
-static void e_build_menu_unbuild(E_Build_Menu * bm);
-
-static void e_build_menu_db_poll(int val, void *data);
-static E_Menu *e_build_menu_db_build_number(E_Build_Menu * bm,
- E_DB_File * db, int num);
-static void e_build_menu_db_build(E_Build_Menu * bm);
-
-static void e_build_menu_gnome_apps_poll(int val, void *data);
-static void e_build_menu_gnome_apps_build(E_Build_Menu * bm);
-
-static E_Menu *e_build_menu_iconified_borders_build(E_Build_Menu * bm);
-static void e_build_menu_iconified_borders_changed(E_Observer *
- observer,
- E_Observee *
- observee,
- E_Event_Type event,
- void *data);
-
-/* ------------ various callbacks ---------------------- */
-static void
-e_build_menu_cb_exec(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- char *exe;
-
- D_ENTER;
-
- exe = data;
- e_exec_run(exe);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_build_menu_cb_uniconify(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- E_Border *b;
-
- D_ENTER;
-
- b = data;
- e_border_uniconify(b);
-
- D_RETURN;
- UN(m);
- UN(mi);
-}
-
-static void
-e_build_menu_cb_script(E_Menu * m, E_Menu_Item * mi, void *data)
-{
- char *script;
-
- D_ENTER;
-
- script = data;
-
- if(strstr(script, "e.shutdown"))
- e_act_exit_start(NULL,NULL,NULL,0,0,0,0);
-
- if(strstr(script, "e.restart"))
- e_act_restart_start(NULL,NULL,NULL,0,0,0,0);
-
- D_RETURN;
- UN(m);
- UN(mi);
- UN(script);
- UN(data);
-}
-
-/*--------------------------------------------------------*/
-
-static void
-e_build_menu_unbuild(E_Build_Menu * bm)
-{
- Evas_List * l;
-
- D_ENTER;
-
- bm->menu = NULL;
- if (bm->menus)
- {
- for (l = bm->menus; l; l = l->next)
- {
- E_Menu *m;
-
- m = l->data;
- e_menu_hide(m);
- e_menu_update_shows(m);
- e_menu_update_hides(m);
- e_menu_update_finish(m);
-
- e_object_unref(E_OBJECT(m));
- }
- bm->menus = evas_list_free(bm->menus);
- }
- if (bm->commands)
- {
- for (l = bm->commands; l; l = l->next)
- {
- IF_FREE(l->data);
- }
- bm->commands = evas_list_free(bm->commands);
- }
-
- D_RETURN;
-}
-
-/* BUILDING from DB's */
-
-static void
-e_build_menu_db_poll(int val, void *data)
-{
- time_t mod;
- E_Build_Menu *bm;
-
- D_ENTER;
-
- bm = data;
- mod = e_file_mod_time(bm->file);
- if (mod <= bm->mod_time)
- {
- ecore_add_event_timer(bm->file, 1.0, e_build_menu_db_poll, 0, data);
- D_RETURN;
- }
- bm->mod_time = mod;
-
- e_build_menu_unbuild(bm);
- e_build_menu_db_build(bm);
- if (!bm->menu)
- bm->mod_time = 0;
-
- ecore_add_event_timer(bm->file, 1.0, e_build_menu_db_poll, 0, data);
-
- D_RETURN;
- UN(val);
-}
-
-static void
-e_build_menu_gnome_apps_poll(int val, void *data)
-{
- time_t mod;
- E_Build_Menu *bm;
-
- D_ENTER;
-
- bm = data;
- mod = e_file_mod_time(bm->file);
- if (mod <= bm->mod_time)
- {
- ecore_add_event_timer(bm->file, 1.0, e_build_menu_gnome_apps_poll, 0,
- data);
- D_RETURN;
- }
- bm->mod_time = mod;
-
- e_build_menu_unbuild(bm);
- e_build_menu_gnome_apps_build(bm);
- if (!bm->menu)
- bm->mod_time = 0;
-
- ecore_add_event_timer(bm->file, 1.0, e_build_menu_gnome_apps_poll, 0, data);
-
- D_RETURN;
- UN(val);
-}
-
-static E_Menu *
-e_build_menu_db_build_number(E_Build_Menu * bm, E_DB_File * db, int num)
-{
- E_Menu *menu;
- char buf[PATH_MAX];
- int num2, i2;
-
- D_ENTER;
-
- snprintf(buf, PATH_MAX, "/menu/%i/count", num);
- if (!e_db_int_get(db, buf, &num2))
- D_RETURN_(NULL);
- menu = e_menu_new();
- e_menu_set_padding_icon(menu, 2);
- e_menu_set_padding_state(menu, 2);
- for (i2 = 0; i2 < num2; i2++)
- {
- E_Menu_Item *menuitem;
- char *text, *icon, *exe, *script;
- int ok, sub, sep;
-
- snprintf(buf, PATH_MAX, "/menu/%i/%i/text", num, i2);
- text = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/menu/%i/%i/icon", num, i2);
- icon = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/menu/%i/%i/command", num, i2);
- exe = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/menu/%i/%i/script", num, i2);
- script = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/menu/%i/%i/submenu", num, i2);
- ok = e_db_int_get(db, buf, &sub);
- sep = 0;
- snprintf(buf, PATH_MAX, "/menu/%i/%i/separator", num, i2);
- e_db_int_get(db, buf, &sep);
- menuitem = e_menu_item_new(text);
- e_menu_item_set_icon(menuitem, icon);
- if ((icon) && (text))
- e_menu_item_set_scale_icon(menuitem, 1);
- IF_FREE(text);
- IF_FREE(icon);
- if (sep)
- e_menu_item_set_separator(menuitem, 1);
- else
- {
- if (ok)
- {
- E_Menu *menu2;
-
- menu2 = e_build_menu_db_build_number(bm, db, sub);
- e_menu_item_set_submenu(menuitem, menu2);
- }
- }
- if (exe)
- {
- e_menu_item_set_callback(menuitem, e_build_menu_cb_exec, exe);
- bm->commands = evas_list_prepend(bm->commands, exe);
- }
- if (script)
- {
- e_menu_item_set_callback(menuitem, e_build_menu_cb_script, script);
- bm->commands = evas_list_prepend(bm->commands, script);
- }
- e_menu_add_item(menu, menuitem);
- }
- bm->menus = evas_list_prepend(bm->menus, menu);
-
- D_RETURN_(menu);
-}
-
-static void
-e_build_menu_db_build(E_Build_Menu * bm)
-{
- E_DB_File *db;
- int num;
-
- D_ENTER;
-
- e_db_flush();
- db = e_db_open_read(bm->file);
- if (!db)
- D_RETURN;
-
- if (!e_db_int_get(db, "/menu/count", &num))
- goto error;
- if (num > 0)
- bm->menu = e_build_menu_db_build_number(bm, db, 0);
- error:
- e_db_close(db);
-
- D_RETURN;
-}
-
-/* BUILD from GNOME APPS directory structure */
-
-static E_Menu *
-e_build_menu_gnome_apps_build_dir(E_Build_Menu * bm, char *dir)
-{
- E_Menu *menu = NULL;
- Evas_List *l, *entries = NULL;
-
- D_ENTER;
-
- menu = e_menu_new();
- e_menu_set_padding_icon(menu, 2);
- e_menu_set_padding_state(menu, 2);
- /* build the order of things to scan ... */
- {
- FILE *f;
- char buf[PATH_MAX];
- Evas_List * dirlist = NULL;
-
- /* read .order file */
- snprintf(buf, PATH_MAX, "%s/.order", dir);
- f = fopen(buf, "rb");
- if (f)
- {
- while (fgets(buf, PATH_MAX, f))
- {
- int buf_len;
-
- buf_len = strlen(buf);
- if (buf_len > 0)
- {
- if (buf[buf_len - 1] == '\n')
- buf[buf_len - 1] = 0;
- entries = evas_list_append(entries, strdup(buf));
- }
- }
- fclose(f);
- }
- /* read dir listing in alphabetical order and use that to suppliment */
- dirlist = e_file_ls(dir);
- for (l = dirlist; l; l = l->next)
- {
- char *s;
-
- s = l->data;
- /* if it isnt a "dot" file or dir */
- if (s[0] != '.')
- {
- Evas_List * ll;
- int have_it;
-
- have_it = 0;
- for (ll = entries; ll; ll = ll->next)
- {
- if (!strcmp(ll->data, s))
- {
- have_it = 1;
- break;
- }
- }
- if (!have_it)
- entries = evas_list_append(entries, strdup(s));
- }
- FREE(s);
- }
- if (dirlist)
- evas_list_free(dirlist);
- }
- /* now go thru list... */
- for (l = entries; l; l = l->next)
- {
- char *s;
- char buf[PATH_MAX];
- E_Menu_Item *menuitem;
- char *icon, *name, *exe;
- E_Menu *sub;
- FILE *f;
-
- f = NULL;
- icon = NULL;
- exe = NULL;
- name = NULL;
- sub = NULL;
- s = l->data;
- snprintf(buf, PATH_MAX, "%s/%s", dir, s);
- /* if its a subdir... */
- if (e_file_is_dir(buf))
- {
- sub = e_build_menu_gnome_apps_build_dir(bm, buf);
- snprintf(buf, PATH_MAX, "%s/%s/.directory", dir, s);
-
- f = fopen(buf, "rb");
- }
- /* regular file */
- else if (e_file_exists(buf))
- {
- snprintf(buf, PATH_MAX, "%s/%s", dir, s);
-
- f = fopen(buf, "rb");
- }
- /* doesnt exist at all? next item */
- else
- continue;
- if (f)
- {
- while (fgets(buf, PATH_MAX, f))
- {
- int buf_len;
-
- buf_len = strlen(buf);
- if (buf_len > 0)
- {
- if (buf[buf_len - 1] == '\n')
- buf[buf_len - 1] = 0;
- /* look for Name= */
- if ((!name) &&
- (((e_util_glob_matches(buf, "Name[en]=*")) ||
- (e_util_glob_matches(buf, "Name=*")))))
- {
- char *eq;
-
- eq = strchr(buf, '=');
- if (eq)
- name = strdup(eq + 1);
- }
- /* look for Icon= */
- else if ((!icon) &&
- ((e_util_glob_matches(buf, "Icon=*"))))
- {
- char *eq;
-
- eq = strchr(buf, '=');
- if (eq)
- {
- char buf2[PATH_MAX];
-
- snprintf(buf2, PATH_MAX,
- "/usr/share/pixmaps/%s", eq + 1);
- icon = strdup(buf2);
- }
- }
- /* look for Icon= */
- else if ((!exe) &&
- ((e_util_glob_matches(buf, "Exec=*"))))
- {
- char *eq;
-
- eq = strchr(buf, '=');
- if (eq)
- exe = strdup(eq + 1);
- }
- }
- }
- fclose(f);
- }
-
- if (!name)
- name = strdup(s);
- menuitem = e_menu_item_new(name);
- if (icon)
- e_menu_item_set_icon(menuitem, icon);
- if ((icon) && (name))
- e_menu_item_set_scale_icon(menuitem, 1);
- if (exe)
- {
- e_menu_item_set_callback(menuitem, e_build_menu_cb_exec, exe);
- bm->commands = evas_list_prepend(bm->commands, exe);
- }
- if (sub)
- e_menu_item_set_submenu(menuitem, sub);
- e_menu_add_item(menu, menuitem);
-
- IF_FREE(name);
- IF_FREE(icon);
- free(s);
- }
- if (entries)
- evas_list_free(entries);
- bm->menus = evas_list_prepend(bm->menus, menu);
-
- D_RETURN_(menu);
-}
-
-static void
-e_build_menu_gnome_apps_build(E_Build_Menu * bm)
-{
- E_Menu *menu;
-
- D_ENTER;
-
- menu = e_build_menu_gnome_apps_build_dir(bm, bm->file);
- bm->menu = menu;
-
- D_RETURN;
-}
-
-static void
-e_build_menu_cleanup(E_Build_Menu * bm)
-{
- D_ENTER;
-
- ecore_del_event_timer(bm->file);
- e_build_menu_unbuild(bm);
- IF_FREE(bm->file);
- build_menus = evas_list_remove(build_menus, bm);
-
- /* Call the destructor of the base class */
- e_object_cleanup(E_OBJECT(bm));
-
- D_RETURN;
-}
-
-E_Build_Menu *
-e_build_menu_new_from_db(char *file)
-{
- E_Build_Menu *bm;
-
- D_ENTER;
-
- if (!file)
- D_RETURN_(NULL);
- bm = NEW(E_Build_Menu, 1);
- ZERO(bm, E_Build_Menu, 1);
-
- e_object_init(E_OBJECT(bm), (E_Cleanup_Func) e_build_menu_cleanup);
-
- bm->file = strdup(file);
-
- build_menus = evas_list_prepend(build_menus, bm);
- e_build_menu_db_poll(0, bm);
-
- D_RETURN_(bm);
-}
-
-E_Build_Menu *
-e_build_menu_new_from_gnome_apps(char *dir)
-{
- E_Build_Menu *bm;
-
- D_ENTER;
-
- if (!dir)
- D_RETURN_(NULL);
- bm = NEW(E_Build_Menu, 1);
- ZERO(bm, E_Build_Menu, 1);
-
- e_object_init(E_OBJECT(bm), (E_Cleanup_Func) e_build_menu_cleanup);
-
- bm->file = strdup(dir);
-
- build_menus = evas_list_prepend(build_menus, bm);
- e_build_menu_gnome_apps_poll(0, bm);
-
- D_RETURN_(bm);
-}
-
-/*------------------------- iconified borders menu ----------------*/
-
-E_Build_Menu *
-e_build_menu_new_from_iconified_borders()
-{
- E_Build_Menu *bm;
- Evas_List * l;
-
- D_ENTER;
-
- bm = NEW(E_Build_Menu, 1);
- ZERO(bm, E_Build_Menu, 1);
-
-/* e_observer_init(E_OBSERVER(bm), E_EVENT_BORDER_ICONIFY | E_EVENT_BORDER_UNICONIFY | E_EVENT_BORDER_NEW, e_build_menu_iconified_borders_changed, (E_Cleanup_Func) e_build_menu_cleanup);*/
-
- e_observer_init(E_OBSERVER(bm), E_EVENT_BORDER_ALL,
- (E_Notify_Func) e_build_menu_iconified_borders_changed,
- (E_Cleanup_Func) e_build_menu_cleanup);
-
-
- for (l = e_border_get_borders_list(); l; l = l->next)
- {
- E_Border *b = l->data;
-
- e_observer_register_observee(E_OBSERVER(bm), E_OBSERVEE(b));
- }
- bm->menu = e_build_menu_iconified_borders_build(bm);
-
- build_menus = evas_list_prepend(build_menus, bm);
-
- D_RETURN_(bm);
-}
-
-void
-e_build_menu_iconified_borders_rebuild(E_Build_Menu * bm)
-{
- D_ENTER;
-
- e_build_menu_unbuild(bm);
- bm->menu = e_build_menu_iconified_borders_build(bm);
-
- bm->changed = 0;
- D_RETURN;
-}
-
-static void
-e_build_menu_iconified_borders_changed(E_Observer * observer,
- E_Observee * observee,
- E_Event_Type event, void *data)
-{
- E_Build_Menu *bm;
-
- D_ENTER;
-
- if (event & E_EVENT_BORDER_NEW)
- {
- D("catch new border, register it\n");
- e_observer_register_observee(E_OBSERVER(observer),
- E_OBSERVEE(observee));
- }
-
- else if (event & E_EVENT_BORDER_DELETE)
- {
- bm = (E_Build_Menu *) observer;
- bm->changed = 1;
- }
- else if (event & (E_EVENT_BORDER_ICONIFY | E_EVENT_BORDER_UNICONIFY))
- {
- D("catch iconify, set menu to changed\n");
- bm = (E_Build_Menu *) observer;
-
- bm->changed = 1;
- }
- D_RETURN;
- UN(data);
-}
-
-static E_Menu *
-e_build_menu_iconified_borders_build(E_Build_Menu * bm)
-{
- E_Menu *menu = NULL;
- Evas_List * l;
-
- D_ENTER;
-
- menu = e_menu_new();
- e_menu_set_padding_icon(menu, 2);
- e_menu_set_padding_state(menu, 2);
-
- for (l = e_border_get_borders_list(); l; l = l->next)
- {
- E_Border *b;
- char *name = NULL;
- E_Menu_Item *menuitem;
-
- b = l->data;
-
- if (b->client.iconified)
- {
- e_strdup(name, b->client.title);
- D("adding menu item: %s\n", name);
- menuitem = e_menu_item_new(name);
- e_menu_item_set_callback(menuitem, e_build_menu_cb_uniconify, b);
- e_menu_add_item(menu, menuitem);
-
- IF_FREE(name);
- }
- }
- bm->menus = evas_list_prepend(bm->menus, menu);
-
- D_RETURN_(menu);
-}
+++ /dev/null
-#ifndef E_MENU_BUILD_H
-#define E_MENU_BUILD_H
-
-#include "e.h"
-#include "object.h"
-#include "observer.h"
-#include "menu.h"
-
-typedef struct _E_Build_Menu E_Build_Menu;
-
-struct _E_Build_Menu
-{
- E_Observer o;
-
- char *file;
- time_t mod_time;
-
- E_Menu *menu;
-
- Evas_List * menus;
- Evas_List * commands;
-
- int changed;
-};
-
-E_Build_Menu *e_build_menu_new_from_db(char *file);
-E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
-E_Build_Menu *e_build_menu_new_from_iconified_borders();
-
-void e_build_menu_iconified_borders_rebuild(E_Build_Menu * bm);
-#endif
+++ /dev/null
-#include "debug.h"
-#include "object.h"
-
-void
-e_object_init(E_Object * obj, E_Cleanup_Func cleanup_func)
-{
- D_ENTER;
-
- if (!obj)
- D_RETURN;
-
- memset(obj, 0, sizeof(E_Object));
- obj->references = 1;
- obj->cleanup_func = cleanup_func;
-
- D_RETURN;
-}
-
-void
-e_object_cleanup(E_Object * obj)
-{
- D_ENTER;
-
- if (!obj)
- D_RETURN;
-
- FREE(obj);
-
- D_RETURN;
-}
-
-void
-e_object_ref(E_Object * obj)
-{
- D_ENTER;
-
- if (!obj)
- D_RETURN;
-
- obj->references++;
- D("++ refcount on %p, now %i\n", obj, obj->references);
-
- D_RETURN;
-}
-
-int
-e_object_unref(E_Object * obj)
-{
- D_ENTER;
-
- if (!obj)
- D_RETURN_(-1);
-
- obj->references--;
-
- D("-- refcount on %p, now %i\n", obj, obj->references);
-
- if (obj->references == 0 && obj->cleanup_func)
- {
- D("Refcount is zero, freeing.\n");
- obj->cleanup_func(obj);
- D_RETURN_(0);
- }
-
- D_RETURN_(obj->references);
-}
-
-int
-e_object_get_usecount(E_Object * obj)
-{
- D_ENTER;
-
- if (!obj)
- D_RETURN_(-1);
-
- D_RETURN_(obj->references);
-}
+++ /dev/null
-#ifndef E_OBJECT_H
-#define E_OBJECT_H
-
-#include <Evas.h>
-#include <Ecore.h>
-
-#define E_OBJECT(x) ((E_Object*)(x))
-
-typedef void (*E_Cleanup_Func) (void *object);
-
-typedef struct _e_object
-{
- int references;
- E_Cleanup_Func cleanup_func;
-
-}
-E_Object;
-
-/**
- * e_object_init - Initializes an E object
- * @obj: The object to initalize
- * @cleanup_func: The destructor function for this object
- *
- * This function initializes an E object. It registers
- * the @cleanup_func that is to be called when the use
- * count on this object drops to zero. This destructor
- * then cleans up the object, from the derived classes up
- * the hierarchy to the highest ancestor, E_Object. You
- * MUST call the destructor of the base class at the end
- * of a destructor, or you're creating a leak. Moreover,
- * those destructors MUST NOT call free() on the object
- * itself, only clean up things that are pointed to etc.
- * The final free() call has to happen in the root class,
- * here, it happens in e_object_cleanup().
- */
-void e_object_init(E_Object * obj, E_Cleanup_Func cleanup_func);
-
-/**
- * e_object_cleanup - Cleanup function for E_Objects
- * @obj: The object to clean up
- *
- * This is the most basic destructor function, the only
- * one which does not call another base class destructor
- * at the end. This is the place where the final free()
- * call occurs.
- */
-void e_object_cleanup(E_Object * obj);
-
-/**
- * e_object_ref - Increment the reference count of this object
- * @obj: The object whose reference count to increase
- */
-void e_object_ref(E_Object * obj);
-
-/**
- * e_object_unref - Decrememnt the reference count of this object
- * @obj: The object whose reference count to decrease
- *
- * This function decreases an object's reference counter. If
- * the counter drops to zero, the objects cleanup_func()
- * that was passed with e_object_init() is called. This function
- * is the destructor of the most derived class of this object,
- * and works its way back to the root class's destructor,
- * e_object_cleanup().
- */
-int e_object_unref(E_Object * obj);
-
-/**
- * e_object_get_usecount - Returns the current use count
- * @obj: The object whose use count to return
- *
- * This function returns the use count of an object. Use this
- * function when you want to perform tasks before an object
- * gets cleaned up by checking if the use count is one,
- * cleaning up, and then calling e_object_unref().
- */
-int e_object_get_usecount(E_Object * obj);
-
-#endif
+++ /dev/null
-#include <string.h>
-
-#include "debug.h"
-#include "observer.h"
-
-static Evas_List * observers;
-
-void
-e_observer_init(E_Observer * obs, E_Event_Type event,
- E_Notify_Func notify_func, E_Cleanup_Func cleanup_func)
-{
- D_ENTER;
-
- if (!obs)
- D_RETURN;
-
- memset(obs, 0, sizeof(E_Observer));
-
- obs->watched = NULL;
- obs->event = event;
- obs->notify_func = notify_func;
-
- e_object_init(E_OBJECT(obs), cleanup_func);
-
- observers = evas_list_append(observers, obs);
-
- D_RETURN;
-}
-
-void
-e_observer_cleanup(E_Observer * obs)
-{
- E_Observee *o = NULL;
-
- D_ENTER;
-
- if (!obs)
- D_RETURN;
-
- while (obs->watched)
- {
- o = E_OBSERVEE(obs->watched->data);
- e_observer_unregister_observee(obs, o);
- }
-
- evas_list_remove(observers, obs);
- /* Call the destructor of the base class */
- e_object_cleanup(E_OBJECT(obs));
-
- D_RETURN;
-}
-
-void
-e_observer_register_observee(E_Observer * observer, E_Observee * observee)
-{
- D_ENTER;
-
- if (!observer || !observee)
- D_RETURN;
-
- observee->observers = evas_list_append(observee->observers, observer);
- observer->watched = evas_list_append(observer->watched, observee);
- D_RETURN;
-}
-
-void
-e_observer_unregister_observee(E_Observer * observer, E_Observee * observee)
-{
- D_ENTER;
-
- if (!observer || !observee)
- D_RETURN;
-
- observee->observers = evas_list_remove(observee->observers, observer);
- observer->watched = evas_list_remove(observer->watched, observee);
-
- D_RETURN;
-}
-
-/* --------------------- Observee code below */
-
-void
-e_observee_init(E_Observee * obs, E_Cleanup_Func cleanup_func)
-{
- D_ENTER;
-
- if (!obs)
- D_RETURN;
-
- memset(obs, 0, sizeof(E_Observee));
-
- e_object_init(E_OBJECT(obs), cleanup_func);
-
- D_RETURN;
-}
-
-void
-e_observee_notify_observers(E_Observee * o, E_Event_Type event, void *data)
-{
- Evas_List * obs_list = NULL;
- E_Observer *obs = NULL;
-
- D_ENTER;
-
- if (!o)
- D_RETURN;
-
- for (obs_list = o->observers; obs_list; obs_list = obs_list->next)
- {
- obs = E_OBSERVER(obs_list->data);
-
- /* check bit mask */
- if (obs->event & event)
- {
- obs->notify_func(obs, o, event, data);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_observee_notify_all_observers(E_Observee * o, E_Event_Type event, void *data)
-{
- Evas_List * obs_list = NULL;
- E_Observer *obs = NULL;
-
- D_ENTER;
-
- if (!o)
- D_RETURN;
-
- for (obs_list = observers; obs_list; obs_list = obs_list->next)
- {
- obs = E_OBSERVER(obs_list->data);
-
- /* check bit mask */
- if (obs->event & event)
- {
- obs->notify_func(obs, o, event, data);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_observee_cleanup(E_Observee * obs)
-{
- E_Observer *observer = NULL;
-
- D_ENTER;
-
- if (!obs)
- D_RETURN;
-
- if (e_object_get_usecount(E_OBJECT(obs)) == 1)
- {
- while (obs->observers)
- {
- observer = E_OBSERVER(obs->observers->data);
- e_observer_unregister_observee(observer, obs);
- }
- }
-
- /* Call the destructor of the base class */
- e_object_cleanup(E_OBJECT(obs));
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_OBSERVER_H
-#define E_OBSERVER_H
-
-#include <Ecore.h>
-
-#include "e.h"
-#include "object.h"
-
-#define E_OBSERVER(x) ((E_Observer*)(x))
-#define E_OBSERVEE(x) ((E_Observee*)(x))
-
-typedef struct _e_observer E_Observer;
-typedef struct _e_observee E_Observee;
-
-typedef enum _e_event_type
-{
- /* basic event types */
- E_EVENT_BORDER_NEW = 1 << 0,
- E_EVENT_BORDER_DELETE = 1 << 1,
- E_EVENT_BORDER_FOCUS_IN = 1 << 2,
- E_EVENT_BORDER_FOCUS_OUT = 1 << 3,
- E_EVENT_BORDER_ICONIFY = 1 << 4,
- E_EVENT_BORDER_UNICONIFY = 1 << 5,
- E_EVENT_BORDER_MAXIMIZE = 1 << 6,
- E_EVENT_BORDER_UNMAXIMIZE = 1 << 7,
- E_EVENT_BORDER_MOVE = 1 << 8,
- E_EVENT_BORDER_RESIZE = 1 << 9,
- E_EVENT_BORDER_RAISE = 1 << 10,
- E_EVENT_BORDER_LOWER = 1 << 11,
-
- E_EVENT_DESKTOP_NEW = 1 << 12,
- E_EVENT_DESKTOP_DELETE = 1 << 13,
- E_EVENT_DESKTOP_SWITCH = 1 << 14,
- E_EVENT_DESKTOP_SCROLL = 1 << 15,
-
- E_EVENT_FILE_ADD = 1 << 16,
- E_EVENT_FILE_CHANGE = 1 << 17,
- E_EVENT_FILE_DELETE = 1 << 18,
- E_EVENT_FILE_INFO = 1 << 19,
-
- E_EVENT_BG_CHANGED = 1 << 20,
- E_EVENT_ICB_CHANGED = 1 << 21,
- E_EVENT_LAYOUT_CHANGED = 1 << 22,
-
- /* meta event types */
- E_EVENT_BORDER_ALL = E_EVENT_BORDER_NEW |
- E_EVENT_BORDER_DELETE | E_EVENT_BORDER_FOCUS_IN |
- E_EVENT_BORDER_ICONIFY | E_EVENT_BORDER_UNICONIFY |
- E_EVENT_BORDER_MAXIMIZE | E_EVENT_BORDER_UNMAXIMIZE,
- E_EVENT_DESKTOP_ALL = E_EVENT_DESKTOP_NEW |
- E_EVENT_DESKTOP_DELETE | E_EVENT_DESKTOP_SWITCH,
-
- /* ALL events */
- E_EVENT_MAX = 0xFFFFFFFF
-}
-E_Event_Type;
-
-typedef void (*E_Notify_Func) (E_Observer * observer,
- E_Observee * observee,
- E_Event_Type event,
- void *data);
-
-struct _e_observer
-{
- E_Object obj;
-
- Evas_List * watched; /* list<E_Observee> */
- E_Event_Type event;
- E_Notify_Func notify_func;
-};
-
-struct _e_observee
-{
- E_Object obj;
-
- Evas_List * observers; /* list<E_Observer> */
-};
-
-/**
- * e_observer_init - Initializes an observer
- * @obs: The observer to initialize
- * @event: The Ecore event for which this observer will be responsible
- * @notify_func: The function the observer calls when it gets notified
- * @cleanup_func: The destructor function to pass to the E_Object initializer
- *
- * This function initializes an observer. Observees can register observers,
- * which will call the given @notify_func when an observer issues an
- * e_observee_notify_observers() call. Observers are derived from
- * E_Objects, therefore, this function also handles E_Object initalization.
- */
-void e_observer_init(E_Observer * obs, E_Event_Type event,
- E_Notify_Func notify_func,
- E_Cleanup_Func cleanup_func);
-
-/**
- * e_observer_cleanup - Cleans up an observer.
- * @obs: The observer to clean up
- *
- * This function cleans up an observer by unregistering all observees.
- */
-void e_observer_cleanup(E_Observer * obs);
-
-/**
- * e_observer_register_observee - Registers an observee
- * @observer: The observer which registers the observee
- * @observee: The observee which registers the observer
- *
- * This function registers the observer in the observee and vice versa.
- */
-void e_observer_register_observee(E_Observer * observer,
- E_Observee * observee);
-
-/**
- * e_observer_unregister_observee - Unregisters an observee
- * @observer: The observer which unregisters the observee
- * @observee: The observee which unregisters the observer
- *
- * This function unregisters the observer in the observee and vice versa.
- */
-void e_observer_unregister_observee(E_Observer * observer,
- E_Observee * observee);
-
-/**
- * e_observee_init - Initializes an observee.
- * @obs: The observee to initialize
- * @cleanup_func: The destructor function for cleaning this observee up
- *
- * This function initializes an observee. Observees are derived
- * from E_Objects, which is why this function gets the destructor
- * function as a parameter. It is passed on to e_object_init().
- */
-void e_observee_init(E_Observee * obs,
- E_Cleanup_Func cleanup_func);
-
-/**
- * e_observee_cleanup - Cleans up an observee.
- * @obs: The observee to clean up
- *
- * This function cleans up an observee by unregistering it from all observers.
- */
-void e_observee_cleanup(E_Observee * obs);
-
-/**
- * e_observee_notify_observers - Notify observers of a given Ecore event
- * @o: The observee which notifies its observers
- * @event: The event by which to filter the observers
- * @data: arbitrary data attached to the event
- *
- * This function scans the registered observers in the observee
- * and calls the notify_func() of the observers that are
- * responsible for the given @event.
- */
-void e_observee_notify_observers(E_Observee * o,
- E_Event_Type event,
- void *data
- );
-
-/**
- * e_observee_notify_all_observers - Notify all observers of a given E event
- * regardless of whether they are registered or not.
- *
- * @o: The observee which notifies the observers
- * @event: The event by which to filter the observers
- * @data: arbitrary data attached to the event
- *
- * This function scans ALL observers in the observee
- * and calls the notify_func() of the observers that are
- * responsible for the given @event. Useful for situations where the observee
- * is just being created and you want to notify observers of its existence.
- * If they are looking for this type of NEW event, then they can register
- * it as a legitimate observee.
- */
-void e_observee_notify_all_observers(E_Observee * o,
- E_Event_Type event,
- void *data);
-#endif
+++ /dev/null
-#include "e.h"
+++ /dev/null
-#include "debug.h"
-#include "config.h"
-#include "place.h"
-#include "actions.h"
-#include "guides.h"
-#include "util.h"
-
-static void e_mouse_down(Ecore_Event * ev);
-static void e_mouse_up(Ecore_Event * ev);
-static void e_mouse_move(Ecore_Event * ev);
-
-static int prx, pry;
-static Window win_place = 0;
-
-static void
-e_mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Down *e;
-
- D_ENTER;
-
- e = ev->event;
- if (!win_place)
- D_RETURN;
-
- D_RETURN;
-}
-
-static void
-e_mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- D_ENTER;
-
- e = ev->event;
- if (!win_place)
- D_RETURN;
- e_action_stop("Window_Place", ACT_MOUSE_UP, 1, NULL,
- ECORE_EVENT_KEY_MODIFIER_NONE, NULL, NULL, e->x, e->y, e->rx,
- e->ry);
- ecore_window_destroy(win_place);
- win_place = 0;
-
- D_RETURN;
-}
-
-static void
-e_mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
-
- D_ENTER;
-
- e = ev->event;
- if (!win_place)
- D_RETURN;
- e_action_cont("Window_Place", ACT_MOUSE_MOVE, 1, NULL,
- ECORE_EVENT_KEY_MODIFIER_NONE, NULL, NULL, e->x, e->y, e->rx,
- e->ry, e->rx - prx, e->ry - pry);
- prx = e->rx;
- pry = e->ry;
-
- D_RETURN;
-}
-
-static int
-e_place_manual(E_Border * b, E_Desktop * desk, int *x, int *y)
-{
- int w, h;
- int mx, my, rx, ry;
- int move_mode = E_GUIDES_BOX;
-
- D_ENTER;
-
- move_mode = config_data->window->move_mode;
- w = b->current.requested.w;
- h = b->current.requested.h;
-
- if (!win_place)
- {
- win_place = ecore_window_input_new(0, 0, 0, desk->real.w, desk->real.h);
- ecore_window_set_events(win_place, XEV_MOUSE_MOVE | XEV_BUTTON);
- ecore_window_raise(win_place);
- ecore_window_show(win_place);
- }
- else
- {
- e_action_stop_by_type("Window_Place");
- }
-
- /* get mouse coords */
- /* ecore_pointer_xy(desk->win.main, &mx, &my); */
- ecore_pointer_xy(0, &mx, &my);
- rx = mx;
- ry = my;
- prx = rx;
- pry = ry;
- /* grab mouse to desktop */
- ecore_pointer_ungrab(CurrentTime);
- ecore_pointer_grab(win_place, CurrentTime);
-
- *x = mx - (w / 2);
- *y = my - (h / 2);
-
- /* start a move mode */
- e_action_stop_by_type("Window_Place");
- e_action_start("Window_Place", ACT_MOUSE_CLICK, 1, NULL,
- ECORE_EVENT_KEY_MODIFIER_NONE, E_OBJECT(b), NULL, mx, my, rx,
- ry);
-
- if (move_mode != E_GUIDES_OPAQUE)
- D_RETURN_(0);
- D_RETURN_(1);
-}
-
-static int
-e_place_smart(E_Border * b, E_Desktop * desk, int *x, int *y)
-{
- int w, h;
- int a_w = 0, a_h = 0;
- int *a_x = NULL, *a_y = NULL;
- Evas_List * l;
-
- D_ENTER;
-
- w = b->current.requested.w;
- h = b->current.requested.h;
- a_w = 2;
- a_h = 2;
- a_x = NEW(int, 2);
- a_y = NEW(int, 2);
-
- a_x[0] = 0;
- a_x[1] = desk->real.w;
- a_y[0] = 0;
- a_y[1] = desk->real.h;
-
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *bd;
-
- bd = l->data;
- if ((bd != b) && (bd->current.visible))
- {
- if (INTERSECTS(bd->current.x, bd->current.y,
- bd->current.w, bd->current.h,
- 0, 0, desk->real.w, desk->real.h))
- {
- int i, j;
-
- for (i = 0; i < a_w; i++)
- {
- int ok = 1;
-
- if (bd->current.x > 0)
- {
- if (a_x[i] == bd->current.x)
- ok = 0;
- else if (a_x[i] > bd->current.x)
- {
- a_w++;
- 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->current.x;
- ok = 0;
- }
- }
- if (!ok)
- break;
- }
- for (i = 0; i < a_w; i++)
- {
- int ok = 1;
-
- if (bd->current.x + bd->current.w < desk->real.w)
- {
- if (a_x[i] == bd->current.x + bd->current.w)
- ok = 0;
- else if (a_x[i] > bd->current.x + bd->current.w)
- {
- a_w++;
- 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->current.x + bd->current.w;
- ok = 0;
- }
- }
- if (!ok)
- break;
- }
- for (i = 0; i < a_h; i++)
- {
- int ok = 1;
-
- if (bd->current.y > 0)
- {
- if (a_y[i] == bd->current.y)
- ok = 0;
- else if (a_y[i] > bd->current.y)
- {
- a_h++;
- 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->current.y;
- ok = 0;
- }
- }
- if (!ok)
- break;
- }
- for (i = 0; i < a_h; i++)
- {
- int ok = 1;
-
- if (bd->current.y + bd->current.h < desk->real.h)
- {
- if (a_y[i] == bd->current.y + bd->current.h)
- ok = 0;
- else if (a_y[i] > bd->current.y + bd->current.h)
- {
- a_h++;
- 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->current.y + bd->current.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] < (desk->real.w - w)) &&
- (a_y[j] < (desk->real.h - h)))
- {
- int ar = 0;
-
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *bd;
- int x1, y1, w1, h1, x2, y2, w2, h2;
-
- bd = l->data;
- x1 = a_x[i];
- y1 = a_y[j];
- w1 = w;
- h1 = h;
- x2 = bd->current.x;
- y2 = bd->current.y;
- w2 = bd->current.w;
- h2 = bd->current.h;
- if ((bd != b) && (bd->current.visible) &&
- 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;
- *x = a_x[i];
- *y = a_y[j];
- if (ar == 0)
- goto done;
- }
- }
- if ((a_x[i + 1] - w > 0) && (a_y[j] < (desk->real.h - h)))
- {
- int ar = 0;
-
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *bd;
- int x1, y1, w1, h1, x2, y2, w2, h2;
-
- bd = l->data;
- x1 = a_x[i + 1] - w;
- y1 = a_y[j];
- w1 = w;
- h1 = h;
- x2 = bd->current.x;
- y2 = bd->current.y;
- w2 = bd->current.w;
- h2 = bd->current.h;
- if ((bd != b) && (bd->current.visible) &&
- 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;
- *x = a_x[i + 1] - w;
- *y = 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 = desk->windows; l; l = l->next)
- {
- E_Border *bd;
- int x1, y1, w1, h1, x2, y2, w2, h2;
-
- bd = l->data;
- x1 = a_x[i + 1] - w;
- y1 = a_y[j + 1] - h;
- w1 = w;
- h1 = h;
- x2 = bd->current.x;
- y2 = bd->current.y;
- w2 = bd->current.w;
- h2 = bd->current.h;
- if ((bd != b) && (bd->current.visible) &&
- 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;
- *x = a_x[i + 1] - w;
- *y = a_y[j + 1] - h;
- if (ar == 0)
- goto done;
- }
- }
- if ((a_x[i] < (desk->real.w - w)) && (a_y[j + 1] - h > 0))
- {
- int ar = 0;
-
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *bd;
- int x1, y1, w1, h1, x2, y2, w2, h2;
-
- bd = l->data;
- x1 = a_x[i];
- y1 = a_y[j + 1] - h;
- w1 = w;
- h1 = h;
- x2 = bd->current.x;
- y2 = bd->current.y;
- w2 = bd->current.w;
- h2 = bd->current.h;
- if ((bd != b) && (bd->current.visible) &&
- 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;
- *x = a_x[i];
- *y = a_y[j + 1] - h;
- if (ar == 0)
- goto done;
- }
- }
- }
- }
- }
- done:
- FREE(a_x);
- FREE(a_y);
-
- D_RETURN_(1);
-}
-
-static int
-e_place_middle(E_Border * b, E_Desktop * desk, int *x, int *y)
-{
- int w, h;
-
- D_ENTER;
-
- w = b->current.requested.w;
- h = b->current.requested.h;
- *x = (desk->real.w - w) / 2;
- *y = (desk->real.h - h) / 2;
-
- D_RETURN_(1);
-}
-
-static int
-e_place_cascade(E_Border * b, E_Desktop * desk, int *x, int *y)
-{
- int w, h;
- static int count_x = 0;
- static int count_y = 0;
- int pl, pr, pt, pb;
-
- D_ENTER;
-
- pl = pr = pt = pb = 0;
- if (b->bits.b)
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
- w = b->current.requested.w;
- h = b->current.requested.h;
- if ((count_x + w) > desk->real.w)
- count_x = 0;
- if ((count_y + h) > desk->real.h)
- count_y = 0;
- *x = count_x;
- *y = count_y;
- count_x += pl;
- count_y += pt;
-
- D_RETURN_(1);
-}
-
-static int
-e_place_random(E_Border * b, E_Desktop * desk, int *x, int *y)
-{
- int w, h;
-
- D_ENTER;
-
- w = b->current.requested.w;
- h = b->current.requested.h;
-
- if (w < desk->real.w)
- *x = (rand() % (desk->real.w - w));
- else
- *x = 0;
-
- if (h < desk->real.h)
- *y = (rand() % (desk->real.h - h));
- else
- *y = 0;
-
- D_RETURN_(1);
-}
-
-int
-e_place_border(E_Border * b, E_Desktop * desk, int *x, int *y,
- E_Placement_Mode mode)
-{
- int result = 1;
-
- D_ENTER;
-
- if (b->client.no_place)
- D_RETURN_(1);
-
- switch (mode)
- {
- case E_PLACE_MANUAL:
- result = e_place_manual(b, desk, x, y);
- break;
- case E_PLACE_SMART:
- result = e_place_smart(b, desk, x, y);
- break;
- case E_PLACE_MIDDLE:
- result = e_place_middle(b, desk, x, y);
- break;
- case E_PLACE_CASCADE:
- result = e_place_cascade(b, desk, x, y);
- break;
- case E_PLACE_RANDOM:
- result = e_place_random(b, desk, x, y);
- break;
- default:
- break;
- }
-
- D_RETURN_(result);
-}
-
-void
-e_place_init(void)
-{
- D_ENTER;
-
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_PLACE_H
-#define E_PLACE_H
-
-#include "e.h"
-#include "border.h"
-#include "desktops.h"
-
-typedef enum e_placement_mode
-{
- E_PLACE_MANUAL,
- E_PLACE_SMART,
- E_PLACE_MIDDLE,
- E_PLACE_CASCADE,
- E_PLACE_RANDOM
-}
-E_Placement_Mode;
-
-/**
- * e_place_init - window placement initialization
- *
- * This function registers the event handlers necessary
- * to be able to manage window placement strategies.
- */
-void e_place_init(void);
-
-/**
- * e_place_border - calculates window coordinates with given strategy
- * @b: The border if the window for which to calculate coordinates
- * @desk: The desktop on which to perform the calculation
- * @x: Result pointer to an integer which gets the resulting x coordinate
- * @y: Result pointer to an integer which gets the resulting y coordinate
- * @mode: The placement mode. Any of the values in the E_Placement_Mode enum.
- *
- * This function calculates coordinates for a given window border
- * and returns them in the @x and @y pointers. It does not actually
- * place the window.
- */
-int e_place_border(E_Border * b, E_Desktop * desk, int *x,
- int *y, E_Placement_Mode mode);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "resist.h"
-#include "config.h"
-#include "desktops.h"
-#include "util.h"
-
-void
-e_resist_border(E_Border * b)
-{
- int resist = 1;
- int desk_resist = 32;
- int win_resist = 12;
-
- /* int ok = 0; */
- int dx, dy, d;
- int resist_x = 0, resist_y = 0;
- Evas_List *l, *rects = NULL;
- E_Rect *r;
-
- D_ENTER;
-
- resist = config_data->move->resist;
- desk_resist = config_data->move->desk_resist;
- win_resist = config_data->move->win_resist;
- if (!resist)
- {
- b->current.x = b->current.requested.x;
- b->current.y = b->current.requested.y;
- D_RETURN;
- }
- if (!b->desk)
- D_RETURN;
- dx = b->current.requested.x - b->previous.requested.x;
- dy = b->current.requested.y - b->previous.requested.y;
- /* edges of screen */
-#define OBSTACLE(_x, _y, _w, _h, _resist) \
-{ \
-r = NEW(E_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 + b->desk->real.w, 1000000,
- desk_resist);
- OBSTACLE(-1000000, -1000000, 1000000, 2000000 + b->desk->real.h,
- desk_resist);
- OBSTACLE(-1000000, b->desk->real.h, 2000000 + b->desk->real.w, 1000000,
- desk_resist);
- OBSTACLE(b->desk->real.w, -1000000, 1000000, 2000000 + b->desk->real.h,
- desk_resist);
- /* 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. */
-
- {
- if (b->desk->iconbar)
- evas_list_append(rects,
- e_iconbar_get_resist_rect(b->desk->iconbar));
- }
-
- for (l = b->desk->windows; l; l = l->next)
- {
- E_Border *bd;
-
- bd = l->data;
- if (bd->current.visible)
- {
- if (bd != b)
- {
- r = NEW(struct _E_Rect, 1);
-
- r->x = bd->current.x;
- r->y = bd->current.y;
- r->w = bd->current.w;
- r->h = bd->current.h;
- r->v1 = win_resist;
- rects = evas_list_append(rects, r);
- }
- }
- }
- for (l = rects; l; l = l->next)
- {
- r = l->data;
- if (SPANS_COMMON(r->y, r->h, b->current.requested.y, b->current.h))
- {
- if (dx > 0)
- {
- /* moving right - check left edge of windows against right */
- d = r->x - (b->current.requested.x + b->current.w);
- if ((d < 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 = b->current.requested.x - (r->x + r->w);
- if ((d < 0) && (d >= -r->v1))
- {
- if (resist_x > d)
- resist_x = -d;
- }
- }
- }
- if (SPANS_COMMON(r->x, r->w, b->current.requested.x, b->current.w))
- {
- if (dy > 0)
- {
- /* moving down - check top edge of windows against bottom */
- d = r->y - (b->current.requested.y + b->current.h);
- if ((d < 0) && (d >= 2 - r->v1))
- {
- if (resist_y > d)
- resist_y = d;
- }
- }
- else if (dy < 0)
- {
- /* moving up - check bottom edge of windows against top */
- d = b->current.requested.y - (r->y + r->h);
- if ((d < 0) && (d >= -r->v1))
- {
- if (resist_y > d)
- resist_y = -d;
- }
- }
- }
- }
- if (rects)
- {
- for (l = rects; l; l = l->next)
- {
- FREE(l->data);
- }
- evas_list_free(rects);
- }
- if (dx != 0)
- {
- if ((b->previous.requested.x != b->previous.x) &&
- (((b->previous.requested.dx < 0) && (b->current.requested.dx > 0))
- || ((b->previous.requested.dx > 0)
- && (b->current.requested.dx < 0))))
- b->current.requested.x = b->current.x;
- else
- b->current.x = b->current.requested.x + resist_x;
- }
- if (dy != 0)
- {
- if ((b->previous.requested.y != b->previous.y) &&
- (((b->previous.requested.dy < 0) && (b->current.requested.dy > 0))
- || ((b->previous.requested.dy > 0)
- && (b->current.requested.dy < 0))))
- b->current.requested.y = b->current.y;
- else
- b->current.y = b->current.requested.y + resist_y;
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_RESIST_H
-#define E_RESIST_H
-
-#include "e.h"
-#include "border.h"
-
-typedef struct _E_Rect E_Rect;
-
-struct _E_Rect
-{
- int x, y, w, h;
- int v1, v2, v3, v4;
-};
-
-void e_resist_border(E_Border * b);
-
-#endif
+++ /dev/null
-#include "debug.h"
-#include "scrollbar.h"
-#include "config.h"
-#include "util.h"
-#include "view.h"
-
-static void e_scrollbar_recalc(E_Scrollbar * sb);
-static void e_scrollbar_setup_bits(E_Scrollbar * sb);
-static void e_sb_base_down_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_sb_base_up_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_sb_bar_down_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_sb_bar_up_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy, int ow,
- int oh);
-static void e_sb_bar_move_cb(void *data, Ebits_Object o, char *class,
- int bt, int x, int y, int ox, int oy,
- int ow, int oh);
-static void e_sb_scroll_timer(int val, void *data);
-static void e_scrollbar_cleanup(E_Scrollbar * sb);
-
-static void
-e_scrollbar_recalc(E_Scrollbar * sb)
-{
- D_ENTER;
-
- if (sb->base)
- {
- double x, y, w, h;
-
- ebits_get_named_bit_geometry(sb->base, "Trough_Area", &x, &y, &w, &h);
- sb->bar_area.x = x + sb->x;
- sb->bar_area.y = y + sb->y;
- sb->bar_area.w = w;
- sb->bar_area.h = h;
- if (sb->direction)
- {
- sb->bar_pos.w = sb->bar_area.w;
- sb->bar_pos.h = (sb->bar_area.h * sb->range) / sb->max;
- sb->bar_pos.x = sb->bar_area.x;
- sb->bar_pos.y = sb->bar_area.y +
- ((sb->bar_area.h * sb->val) / (sb->max - 1));
- }
- else
- {
- sb->bar_pos.w = (sb->bar_area.w * sb->range) / sb->max;
- sb->bar_pos.h = sb->bar_area.h;
- sb->bar_pos.x = sb->bar_area.x +
- ((sb->bar_area.w * sb->val) / (sb->max - 1));
- sb->bar_pos.y = sb->bar_area.y;
- }
- }
- else
- {
- sb->bar_area.x = sb->x;
- sb->bar_area.y = sb->y;
- sb->bar_area.w = sb->w;
- sb->bar_area.h = sb->h;
- sb->bar_pos.x = sb->bar_area.x;
- sb->bar_pos.y = sb->bar_area.y;
- sb->bar_pos.w = sb->bar_area.w;
- sb->bar_pos.h = sb->bar_area.h;
- }
-
- D_RETURN;
- UN(sb);
-}
-
-static void
-e_scrollbar_setup_bits(E_Scrollbar * sb)
-{
- char buf[PATH_MAX];
-
- D_ENTER;
-
- if (sb->direction == 1)
- {
- /* load from the current dir's layout */
- snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_v.bits.db",
- sb->view->dir->dir);
- sb->base = ebits_load(buf);
-
- /* if not loaded, load defaults */
- if (!sb->base)
- {
- snprintf(buf, PATH_MAX, "%s/scroll_base_v.bits.db",
- e_config_get("scrollbars"));
- sb->base = ebits_load(buf);
- }
-
- /* load from current dir's layout */
- snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_v.bits.db",
- sb->view->dir->dir);
- sb->bar = ebits_load(buf);
-
- /* if not loaded, load defaults */
- if (!sb->bar)
- {
- snprintf(buf, PATH_MAX, "%s/scroll_bar_v.bits.db",
- e_config_get("scrollbars"));
- sb->bar = ebits_load(buf);
- }
- }
- else
- {
- /* load from the current dir's layout */
- snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_base_h.bits.db",
- sb->view->dir->dir);
- sb->base = ebits_load(buf);
-
- /* if not loaded, load defaults */
- if (!sb->base)
- {
- snprintf(buf, PATH_MAX, "%s/scroll_base_h.bits.db",
- e_config_get("scrollbars"));
- sb->base = ebits_load(buf);
- }
-
- /* load from current dir's layout */
- snprintf(buf, PATH_MAX, "%s/.e_layout/scroll_bar_h.bits.db",
- sb->view->dir->dir);
- sb->bar = ebits_load(buf);
-
- /* if not loaded, load defaults */
- if (!sb->bar)
- {
- snprintf(buf, PATH_MAX, "%s/scroll_bar_h.bits.db",
- e_config_get("scrollbars"));
- sb->bar = ebits_load(buf);
- }
- }
- if (sb->base)
- {
- int w, h;
-
- ebits_add_to_evas(sb->base, sb->evas);
- ebits_get_min_size(sb->base, &w, &h);
- sb->w = w;
- sb->h = h;
-
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Trough",
- EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
- sb);
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Trough",
- EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow1",
- EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
- sb);
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow1",
- EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow2",
- EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
- sb);
- ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow2",
- EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
- }
- if (sb->bar)
- {
- ebits_add_to_evas(sb->bar, sb->evas);
- ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar",
- EVAS_CALLBACK_MOUSE_DOWN, e_sb_bar_down_cb,
- sb);
- ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar",
- EVAS_CALLBACK_MOUSE_UP, e_sb_bar_up_cb, sb);
- ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar",
- EVAS_CALLBACK_MOUSE_MOVE, e_sb_bar_move_cb,
- sb);
- }
-
- D_RETURN;
-}
-
-static void
-e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Scrollbar *sb;
- double prev;
- char name[PATH_MAX];
- int inc;
-
- D_ENTER;
-
- sb = data;
- if (sb->mouse_down)
- D_RETURN;
- sb->mouse_down = bt;
- if (!class)
- D_RETURN;
- prev = sb->val;
-
- D("x %d y %d bt %d\n", x, y, bt);
- D("val %f range %f max %f\n", sb->val, sb->range, sb->max);
- D("sb x %f y %f w %f h %f\n", sb->x, sb->y, sb->w, sb->h);
- D("sb area x %f y %f w %f h %f\n", sb->bar_area.x, sb->bar_area.y,
- sb->bar_area.w, sb->bar_area.h);
- D("sb pos x %f y %f w %f h %f\n", sb->bar_pos.x, sb->bar_pos.y,
- sb->bar_pos.w, sb->bar_pos.h);
-
- if (!strcmp(class, "Scrollbar_Arrow1"))
- {
- sb->scroll_step = -16;
- sb->scroll_speed = 0.01;
-
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction,
- sb->view->name);
- ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb);
- }
-
- else if (!strcmp(class, "Scrollbar_Arrow2"))
- {
- sb->scroll_step = 16;
- sb->scroll_speed = 0.01;
-
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction,
- sb->view->name);
- ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb);
- }
-
- else if (!strcmp(class, "Scrollbar_Trough"))
- {
- if (bt == 1)
- {
- if (sb->direction) /* vertical */
- {
- sb->scroll_step = sb->bar_area.h;
- inc = y - sb->bar_pos.y;
- }
- else /* horizontal */
- {
- sb->scroll_step = sb->bar_area.w;
- inc = x - sb->bar_pos.x;
- }
-
- if (inc < 0) /* scroll up (or left) */
- {
- sb->scroll_step = -sb->scroll_step;
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction,
- sb->view->name);
- }
- else /* scroll down (or right) */
- {
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction,
- sb->view->name);
- }
-
- /* scroll once in the chosen direction */
- sb->val += sb->scroll_step;
- if (sb->val < 0)
- sb->val = 0;
- if ((sb->val + sb->range) > sb->max)
- sb->val = sb->max - sb->range;
-
- /* set a timer to keep on scrolling */
- sb->scroll_speed = 0.1;
- ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0,
- sb);
- }
-
- else
- {
- if (sb->direction)
- sb->val =
- (y - sb->bar_area.y) * sb->max / sb->bar_area.h -
- sb->bar_area.h / 2;
- else
- sb->val =
- (x - sb->bar_area.x) * sb->max / sb->bar_area.w -
- sb->bar_area.w / 2;
-
- if (sb->val < 0)
- sb->val = 0;
- if ((sb->val + sb->range) > sb->max)
- sb->val = sb->max - sb->range;
- }
- }
-
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
- if (prev != sb->val)
- {
- if (sb->func_change)
- sb->func_change(sb->func_data, sb, sb->val);
- }
-
- D_RETURN;
- UN(o);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Scrollbar *sb;
- char name[PATH_MAX];
-
- D_ENTER;
-
- sb = data;
- if (bt == sb->mouse_down)
- sb->mouse_down = 0;
- else
- D_RETURN;
- if (!class)
- D_RETURN;
-
- if (!strcmp(class, "Scrollbar_Arrow1"))
- {
- sb->scroll_step = 0;
-
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction,
- sb->view->name);
- ecore_del_event_timer(name);
- }
-
- else if (!strcmp(class, "Scrollbar_Arrow2"))
- {
- sb->scroll_step = 0;
-
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction,
- sb->view->name);
- ecore_del_event_timer(name);
- }
-
- else if (!strcmp(class, "Scrollbar_Trough"))
- {
- if (sb->scroll_step < 0)
- {
- sb->scroll_step = 0;
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction,
- sb->view->name);
- ecore_del_event_timer(name);
- }
- else if (sb->scroll_step > 0)
- {
- sb->scroll_step = 0;
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction,
- sb->view->name);
- ecore_del_event_timer(name);
- }
- }
-
- D_RETURN;
- UN(o);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_sb_bar_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Scrollbar *sb;
-
- D_ENTER;
-
- sb = data;
- if (sb->mouse_down)
- D_RETURN;
- sb->mouse_down = bt;
- sb->down_x = x;
- sb->down_y = y;
- sb->mouse_x = x;
- sb->mouse_y = y;
- sb->view->changed = 1;
-
- D_RETURN;
- UN(o);
- UN(class);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_sb_bar_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Scrollbar *sb;
-
- D_ENTER;
-
- sb = data;
- if (bt == sb->mouse_down)
- sb->mouse_down = 0;
- else
- D_RETURN;
-
- sb->view->changed = 1;
-
- D_RETURN;
- UN(o);
- UN(class);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_sb_bar_move_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
- int ox, int oy, int ow, int oh)
-{
- E_Scrollbar *sb;
- int dx, dy;
- double prev;
-
- D_ENTER;
- sb = data;
- if (!sb->mouse_down)
- D_RETURN;
- dx = x - sb->mouse_x;
- dy = y - sb->mouse_y;
- sb->mouse_x = x;
- sb->mouse_y = y;
- prev = sb->val;
- if (sb->direction)
- {
- if (sb->bar_area.h > sb->bar_pos.h)
- sb->val += ((double)dy * sb->max) / sb->bar_area.h;
- else
- sb->val = 0;
- }
- else
- {
- if (sb->bar_area.w > sb->bar_pos.w)
- sb->val += ((double)dx * sb->max) / sb->bar_area.w;
- else
- sb->val = 0;
- }
- if (sb->val < 0)
- sb->val = 0;
- if ((sb->val + sb->range) > sb->max)
- sb->val = sb->max - sb->range;
- if (prev != sb->val)
- {
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
- if (sb->func_change)
- sb->func_change(sb->func_data, sb, sb->val);
- }
-
- D_RETURN;
- UN(o);
- UN(class);
- UN(bt);
- UN(x);
- UN(y);
- UN(ox);
- UN(oy);
- UN(ow);
- UN(oh);
-}
-
-static void
-e_sb_scroll_timer(int val, void *data)
-{
- E_Scrollbar *sb;
- char name[PATH_MAX];
-
- D_ENTER;
-
- sb = data;
-
- if (sb->scroll_step < 0)
- {
- sb->val += sb->scroll_step;
- if (sb->val < 0)
- sb->val = 0;
-
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction,
- sb->view->name);
- ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb);
- }
-
- else if (sb->scroll_step > 0)
- {
- sb->val += sb->scroll_step;
- if ((sb->val + sb->range) > sb->max)
- sb->val = sb->max - sb->range;
-
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction,
- sb->view->name);
- ecore_add_event_timer(name, sb->scroll_speed, e_sb_scroll_timer, 0, sb);
- }
-
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
- if (sb->func_change)
- sb->func_change(sb->func_data, sb, sb->val);
-
- D_RETURN;
- UN(val);
-}
-
-E_Scrollbar *
-e_scrollbar_new(E_View * v)
-{
- E_Scrollbar *sb;
-
- D_ENTER;
-
- sb = NEW(E_Scrollbar, 1);
- ZERO(sb, E_Scrollbar, 1);
-
- e_object_init(E_OBJECT(sb), (E_Cleanup_Func) e_scrollbar_cleanup);
-
- sb->view = v;
-
- sb->range = 1.0;
- sb->max = 1.0;
- sb->w = 12;
- sb->h = 64;
-
- D_RETURN_(sb);
-}
-
-static void
-e_scrollbar_cleanup(E_Scrollbar * sb)
-{
- char name[PATH_MAX];
-
- D_ENTER;
-
- if (sb->evas)
- {
- if (sb->base)
- ebits_free(sb->base);
- if (sb->bar)
- ebits_free(sb->bar);
- }
-
- snprintf(name, PATH_MAX, "scroll_up.%i.%s", sb->direction, sb->view->name);
- ecore_del_event_timer(name);
- snprintf(name, PATH_MAX, "scroll_down.%i.%s", sb->direction, sb->view->name);
- ecore_del_event_timer(name);
-
- e_object_cleanup(E_OBJECT(sb));
-
- D_RETURN;
-}
-
-void
-e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas * evas)
-{
- D_ENTER;
-
- if (sb->evas)
- {
- if (sb->base)
- ebits_free(sb->base);
- if (sb->bar)
- ebits_free(sb->bar);
- }
- sb->evas = evas;
- if (sb->evas)
- {
- e_scrollbar_setup_bits(sb);
- if (sb->base)
- ebits_set_layer(sb->base, sb->layer);
- if (sb->bar)
- ebits_set_layer(sb->bar, sb->layer);
- if (sb->base)
- ebits_move(sb->base, sb->x, sb->y);
- if (sb->base)
- ebits_resize(sb->base, sb->w, sb->h);
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
- if (sb->visible)
- {
- if (sb->base)
- ebits_show(sb->base);
- if (sb->bar)
- ebits_show(sb->bar);
- }
- }
-
- D_RETURN;
-}
-
-void
-e_scrollbar_show(E_Scrollbar * sb)
-{
- D_ENTER;
-
- if (sb->visible)
- D_RETURN;
- sb->visible = 1;
- if (sb->base)
- ebits_show(sb->base);
- if (sb->bar)
- ebits_show(sb->bar);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_hide(E_Scrollbar * sb)
-{
- D_ENTER;
-
- if (!sb->visible)
- D_RETURN;
- sb->visible = 0;
- if (sb->base)
- ebits_hide(sb->base);
- if (sb->bar)
- ebits_hide(sb->bar);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_raise(E_Scrollbar * sb)
-{
- D_ENTER;
-
- if (sb->base)
- ebits_raise(sb->base);
- if (sb->bar)
- ebits_raise(sb->bar);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_lower(E_Scrollbar * sb)
-{
- D_ENTER;
-
- if (sb->bar)
- ebits_lower(sb->bar);
- if (sb->base)
- ebits_lower(sb->base);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_layer(E_Scrollbar * sb, int l)
-{
- D_ENTER;
-
- if (l == sb->layer)
- D_RETURN;
- sb->layer = l;
- if (sb->base)
- ebits_set_layer(sb->base, sb->layer);
- if (sb->bar)
- ebits_set_layer(sb->bar, sb->layer);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_direction(E_Scrollbar * sb, int d)
-{
- D_ENTER;
-
- if (d == sb->direction)
- D_RETURN;
- sb->direction = d;
- if (sb->evas)
- {
- Evas * evas;
-
- if (sb->base)
- ebits_free(sb->base);
- if (sb->bar)
- ebits_free(sb->bar);
- evas = sb->evas;
- sb->evas = NULL;
- e_scrollbar_add_to_evas(sb, evas);
- }
-
- D_RETURN;
-}
-
-void
-e_scrollbar_move(E_Scrollbar * sb, double x, double y)
-{
- D_ENTER;
-
- if ((x == sb->x) && (y == sb->y))
- D_RETURN;
- sb->x = x;
- sb->y = y;
- if (sb->base)
- ebits_move(sb->base, sb->x, sb->y);
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_resize(E_Scrollbar * sb, double w, double h)
-{
- D_ENTER;
-
- if ((w == sb->w) && (h == sb->h))
- D_RETURN;
- sb->w = w;
- sb->h = h;
- if (sb->base)
- ebits_resize(sb->base, sb->w, sb->h);
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_change_func(E_Scrollbar * sb,
- void (*func_change) (void *_data, E_Scrollbar * sb,
- double val), void *data)
-{
- D_ENTER;
-
- sb->func_change = func_change;
- sb->func_data = data;
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_value(E_Scrollbar * sb, double val)
-{
- D_ENTER;
-
- if (val > sb->max - sb->range)
- val = sb->max - sb->range;
- if (val < 0)
- val = 0;
- if (sb->val == val)
- D_RETURN;
- sb->val = val;
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
- if (sb->func_change)
- sb->func_change(sb->func_data, sb, sb->val);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_range(E_Scrollbar * sb, double range)
-{
- D_ENTER;
-
- if (sb->range == range)
- D_RETURN;
- sb->range = range;
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
-
- D_RETURN;
-}
-
-void
-e_scrollbar_set_max(E_Scrollbar * sb, double max)
-{
- D_ENTER;
-
- if (sb->max == max)
- D_RETURN;
- sb->max = max;
- e_scrollbar_recalc(sb);
- if (sb->bar)
- ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
- if (sb->bar)
- ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
-
- D_RETURN;
-}
-
-double
-e_scrollbar_get_value(E_Scrollbar * sb)
-{
- D_ENTER;
-
- D_RETURN_(sb->val);
-}
-
-double
-e_scrollbar_get_range(E_Scrollbar * sb)
-{
- D_ENTER;
-
- D_RETURN_(sb->range);
-}
-
-double
-e_scrollbar_get_max(E_Scrollbar * sb)
-{
- D_ENTER;
-
- D_RETURN_(sb->max);
-}
-
-void
-e_scrollbar_get_geometry(E_Scrollbar * sb, double *x, double *y, double *w,
- double *h)
-{
- D_ENTER;
-
- if (x)
- *x = sb->x;
- if (y)
- *y = sb->y;
- if (w)
- *w = sb->w;
- if (h)
- *h = sb->h;
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_SCROLLBAR_H
-#define E_SCROLLBAR_H
-
-#include "e.h"
-#include "object.h"
-#include "view.h"
-
-#ifndef E_SCROLLBAR_TYPEDEF
-#define E_SCROLLBAR_TYPEDEF
-typedef struct _E_Scrollbar E_Scrollbar;
-#endif
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-struct _E_Scrollbar
-{
- E_Object o;
-
- /* I<---val--->|<==range==>|<-->I<-max */
- double val;
- double max;
- double range;
-
- E_View *view;
- Evas * evas;
-
- Ebits_Object bar;
- Ebits_Object base;
-
- int visible;
- int layer;
- int direction;
- double x, y, w, h;
-
- int mouse_down;
- int down_x, down_y;
- int mouse_x, mouse_y;
-
- int scroll_step;
- double scroll_speed;
-
- struct
- {
- double x, y, w, h;
- }
- bar_area;
- struct
- {
- double x, y, w, h;
- }
- bar_pos;
-
- void (*func_change) (void *_data, E_Scrollbar * sb,
- double val);
- void *func_data;
-};
-
-E_Scrollbar *e_scrollbar_new(E_View * v);
-void e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas * evas);
-void e_scrollbar_show(E_Scrollbar * sb);
-void e_scrollbar_hide(E_Scrollbar * sb);
-void e_scrollbar_raise(E_Scrollbar * sb);
-void e_scrollbar_lower(E_Scrollbar * sb);
-void e_scrollbar_set_layer(E_Scrollbar * sb, int l);
-void e_scrollbar_set_direction(E_Scrollbar * sb, int d);
-void e_scrollbar_move(E_Scrollbar * sb, double x, double y);
-void e_scrollbar_resize(E_Scrollbar * sb, double w, double h);
-void e_scrollbar_set_change_func(E_Scrollbar * sb,
- void (*func_change) (void
- *_data,
- E_Scrollbar
- * sb,
- double
- val),
- void *data);
-void e_scrollbar_set_value(E_Scrollbar * sb, double val);
-void e_scrollbar_set_range(E_Scrollbar * sb, double range);
-void e_scrollbar_set_max(E_Scrollbar * sb, double max);
-double e_scrollbar_get_value(E_Scrollbar * sb);
-double e_scrollbar_get_range(E_Scrollbar * sb);
-double e_scrollbar_get_max(E_Scrollbar * sb);
-void e_scrollbar_get_geometry(E_Scrollbar * sb, double *x,
- double *y, double *w, double *h);
-
-#endif
+++ /dev/null
-#include "e.h"
+++ /dev/null
-#include "debug.h"
-#include "text.h"
-#include "util.h"
-
-E_Text *
-e_text_new(Evas * evas, char *text, char *class)
-{
- E_Text *t;
-
- D_ENTER;
-
- t = NEW(E_Text, 1);
- ZERO(t, E_Text, 1);
- t->state = strdup("normal");
- if (class)
- t->class = strdup(class);
- else
- t->class = strdup("");
- if (text)
- t->text = strdup(text);
- else
- t->text = strdup("");
- t->evas = evas;
- t->obj.o1 = evas_object_text_add(t->evas);
- evas_object_text_font_set(t->obj.o1, "text", 8);
- evas_object_text_text_set(t->obj.o1, t->text);
-
- t->obj.o2 = evas_object_text_add(t->evas);
- evas_object_text_font_set(t->obj.o2, "text", 8);
- evas_object_text_text_set(t->obj.o2, t->text);
-
- t->obj.o3 = evas_object_text_add(t->evas);
- evas_object_text_font_set(t->obj.o3, "text", 8);
- evas_object_text_text_set(t->obj.o3, t->text);
-
- t->obj.o4 = evas_object_text_add(t->evas);
- evas_object_text_font_set(t->obj.o4, "text", 8);
- evas_object_text_text_set(t->obj.o4, t->text);
-
- t->obj.text = evas_object_text_add(t->evas);
- evas_object_text_font_set(t->obj.text, "text", 8);
- evas_object_text_text_set(t->obj.text, t->text);
-
- evas_object_pass_events_set(t->obj.o1, 1);
- evas_object_pass_events_set(t->obj.o2, 1);
- evas_object_pass_events_set(t->obj.o3, 1);
- evas_object_pass_events_set(t->obj.o4, 1);
- evas_object_pass_events_set(t->obj.text, 1);
- evas_object_color_set(t->obj.o1, 0, 0, 0, 255);
- evas_object_color_set(t->obj.o2, 0, 0, 0, 255);
- evas_object_color_set(t->obj.o3, 0, 0, 0, 255);
- evas_object_color_set(t->obj.o4, 0, 0, 0, 255);
- evas_object_color_set(t->obj.text, 255, 255, 255, 255);
- evas_object_move(t->obj.o1, t->x + 1, t->y);
- evas_object_move(t->obj.o2, t->x, t->y + 1);
- evas_object_move(t->obj.o3, t->x + 2, t->y + 1);
- evas_object_move(t->obj.o4, t->x + 1, t->y + 2);
- evas_object_move(t->obj.text, t->x + 1, t->y + 1);
- t->color.r = 255;
- t->color.g = 255;
- t->color.b = 255;
- t->color.a = 255;
- evas_object_geometry_get(t->obj.text, NULL, NULL, &t->w, &t->h);
- t->w += 2;
- t->h += 2;
-
- t->min.w = t->w + 2;
- t->min.h = t->h + 2;
- t->max.w = t->w + 2;
- t->max.h = t->h + 2;
-
- D_RETURN_(t);
-}
-
-void
-e_text_free(E_Text * t)
-{
- D_ENTER;
-
- IF_FREE(t->state);
- IF_FREE(t->class);
- IF_FREE(t->text);
-
- if ((t->evas) && (t->obj.text))
- {
- evas_object_del(t->obj.o1);
- evas_object_del(t->obj.o2);
- evas_object_del(t->obj.o3);
- evas_object_del(t->obj.o4);
- evas_object_del(t->obj.text);
- }
- FREE(t);
-
- D_RETURN;
-}
-
-void
-e_text_set_text(E_Text * t, char *text)
-{
- D_ENTER;
-
- if (!text)
- text = "";
- if (!strcmp(t->text, text))
- D_RETURN;
- FREE(t->text);
- t->text = strdup(text);
- evas_object_text_text_set(t->obj.o1, t->text);
- evas_object_text_text_set(t->obj.o2, t->text);
- evas_object_text_text_set(t->obj.o3, t->text);
- evas_object_text_text_set(t->obj.o4, t->text);
- evas_object_text_text_set(t->obj.text, t->text);
- evas_object_geometry_get(t->obj.text, NULL, NULL, &t->w, &t->h);
- t->w += 2;
- t->h += 2;
-
- t->min.w = t->w + 2;
- t->min.h = t->h + 2;
- t->max.w = t->w + 2;
- t->max.h = t->h + 2;
-
- D_RETURN;
-}
-
-void
-e_text_set_layer(E_Text * t, int l)
-{
- D_ENTER;
-
- if (t->layer == l)
- D_RETURN;
- t->layer = l;
- evas_object_layer_set(t->obj.o1, t->layer);
- evas_object_layer_set(t->obj.o2, t->layer);
- evas_object_layer_set(t->obj.o3, t->layer);
- evas_object_layer_set(t->obj.o4, t->layer);
- evas_object_layer_set(t->obj.text, t->layer);
-
- D_RETURN;
-}
-
-void
-e_text_set_clip(E_Text * t, Evas_Object * clip)
-{
- D_ENTER;
-
- evas_object_clip_set(t->obj.o1, clip);
- evas_object_clip_set(t->obj.o2, clip);
- evas_object_clip_set(t->obj.o3, clip);
- evas_object_clip_set(t->obj.o4, clip);
- evas_object_clip_set(t->obj.text, clip);
-
- D_RETURN;
-}
-
-void
-e_text_unset_clip(E_Text * t)
-{
- D_ENTER;
-
- evas_object_clip_unset(t->obj.o1);
- evas_object_clip_unset(t->obj.o2);
- evas_object_clip_unset(t->obj.o3);
- evas_object_clip_unset(t->obj.o4);
- evas_object_clip_unset(t->obj.text);
-
- D_RETURN;
-}
-
-void
-e_text_raise(E_Text * t)
-{
- D_ENTER;
-
- evas_object_raise(t->obj.o1);
- evas_object_raise(t->obj.o2);
- evas_object_raise(t->obj.o3);
- evas_object_raise(t->obj.o4);
- evas_object_raise(t->obj.text);
-
- D_RETURN;
-}
-
-void
-e_text_lower(E_Text * t)
-{
- D_ENTER;
-
- evas_object_lower(t->obj.text);
- evas_object_lower(t->obj.o4);
- evas_object_lower(t->obj.o3);
- evas_object_lower(t->obj.o2);
- evas_object_lower(t->obj.o1);
-
- D_RETURN;
-}
-
-void
-e_text_show(E_Text * t)
-{
- D_ENTER;
-
- if (t->visible)
- D_RETURN;
- t->visible = 1;
- evas_object_show(t->obj.o1);
- evas_object_show(t->obj.o2);
- evas_object_show(t->obj.o3);
- evas_object_show(t->obj.o4);
- evas_object_show(t->obj.text);
-
- D_RETURN;
-}
-
-void
-e_text_hide(E_Text * t)
-{
- D_ENTER;
-
- if (!t->visible)
- D_RETURN;
- t->visible = 0;
- evas_object_hide(t->obj.o1);
- evas_object_hide(t->obj.o2);
- evas_object_hide(t->obj.o3);
- evas_object_hide(t->obj.o4);
- evas_object_hide(t->obj.text);
-
- D_RETURN;
-}
-
-void
-e_text_set_color(E_Text * t, int r, int g, int b, int a)
-{
- D_ENTER;
-
- if ((r == t->color.r) &&
- (g == t->color.g) && (b == t->color.b) && (a == t->color.a))
- D_RETURN;
- t->color.r = r;
- t->color.g = g;
- t->color.b = b;
- t->color.a = a;
- evas_object_color_set(t->obj.text, t->color.r, t->color.g, t->color.b,
- t->color.a);
-
- D_RETURN;
-}
-
-void
-e_text_move(E_Text * t, double x, double y)
-{
- D_ENTER;
-
- if ((t->x == x) && (t->y == y))
- D_RETURN;
- t->x = x;
- t->y = y;
- evas_object_move(t->obj.o1, t->x + 1, t->y);
- evas_object_move(t->obj.o2, t->x, t->y + 1);
- evas_object_move(t->obj.o3, t->x + 2, t->y + 1);
- evas_object_move(t->obj.o4, t->x + 1, t->y + 2);
- evas_object_move(t->obj.text, t->x + 1, t->y + 1);
-
- D_RETURN;
-}
-
-void
-e_text_resize(E_Text * t, double w, double h)
-{
- D_ENTER;
-
- D_RETURN;
- UN(t);
- UN(w);
- UN(h);
-}
-
-void
-e_text_get_geometry(E_Text * t, double *x, double *y, double *w, double *h)
-{
- D_ENTER;
-
- if (x)
- *x = t->x;
- if (y)
- *y = t->y;
- if (w)
- *w = t->w;
- if (h)
- *h = t->h;
-
- D_RETURN;
-}
-
-void
-e_text_get_min_size(E_Text * t, double *w, double *h)
-{
- D_ENTER;
-
- if (w)
- *w = t->min.w;
- if (h)
- *h = t->min.h;
-
- D_RETURN;
-}
-
-void
-e_text_get_max_size(E_Text * t, double *w, double *h)
-{
- D_ENTER;
-
- if (w)
- *w = t->max.w;
- if (h)
- *h = t->max.h;
-
- D_RETURN;
-}
-
-void
-e_text_set_state(E_Text * t, char *state)
-{
- D_ENTER;
-
- UN(t);
- UN(state);
-
- D_RETURN;
-}
-
-void
-e_text_set_class(E_Text * t, char *class)
-{
- D_ENTER;
-
- UN(t);
- UN(class);
-
- D_RETURN;
-}
-
-void
-e_text_update_class(E_Text * t)
-{
- D_ENTER;
-
- D_RETURN;
- UN(t);
-}
+++ /dev/null
-#ifndef E_TEXT_H
-#define E_TEXT_H
-
-#include "e.h"
-
-typedef struct _E_Text E_Text;
-
-struct _E_Text
-{
- char *text;
- char *class;
- char *state;
-
- int visible;
- double x, y, w, h;
- struct
- {
- double w, h;
- }
- min , max;
- struct
- {
- int r, g, b, a;
- }
- color;
- int layer;
-
- Evas * evas;
- struct
- {
- Evas_Object * text;
- Evas_Object * o1;
- Evas_Object * o2;
- Evas_Object * o3;
- Evas_Object * o4;
- }
- obj;
-};
-
-E_Text *e_text_new(Evas * evas, char *text, char *class);
-void e_text_free(E_Text * t);
-void e_text_set_text(E_Text * t, char *text);
-void e_text_set_layer(E_Text * t, int l);
-void e_text_set_clip(E_Text * t, Evas_Object * clip);
-void e_text_unset_clip(E_Text * t);
-void e_text_raise(E_Text * t);
-void e_text_lower(E_Text * t);
-void e_text_show(E_Text * t);
-void e_text_hide(E_Text * t);
-void e_text_set_color(E_Text * t, int r, int g, int b, int a);
-void e_text_move(E_Text * t, double x, double y);
-void e_text_resize(E_Text * t, double w, double h);
-void e_text_get_geometry(E_Text * t, double *x, double *y,
- double *w, double *h);
-void e_text_get_min_size(E_Text * t, double *w, double *h);
-void e_text_get_max_size(E_Text * t, double *w, double *h);
-void e_text_set_state(E_Text * t, char *state);
-void e_text_set_class(E_Text * t, char *class);
-void e_text_update_class(E_Text * t);
-#endif
+++ /dev/null
-#include "debug.h"
-#include "util.h"
-#include "Evas.h"
-#include "Evas_Engine_Software_X11.h"
-
-void
-e_util_set_env(char *variable, char *content)
-{
- char env[PATH_MAX];
-
- D_ENTER;
-
- snprintf(env, PATH_MAX, "%s=%s", variable, content);
- putenv(env);
-
- D_RETURN;
-}
-
-char *
-e_util_get_user_home(void)
-{
- static char *home = NULL;
-
- D_ENTER;
-
- if (home)
- D_RETURN_(home);
- home = getenv("HOME");
- if (!home)
- home = getenv("TMPDIR");
- if (!home)
- home = "/tmp";
-
- D_RETURN_(home);
-}
-
-void *
-e_util_memdup(void *data, int size)
-{
- void *data_dup;
-
- D_ENTER;
-
- data_dup = malloc(size);
- if (!data_dup)
- D_RETURN_(NULL);
- memcpy(data_dup, data, size);
-
- D_RETURN_(data_dup);
-}
-
-int
-e_util_glob_matches(char *str, char *glob)
-{
- D_ENTER;
-
- if (!fnmatch(glob, str, 0))
- D_RETURN_(1);
-
- D_RETURN_(0);
-}
-
-/*
- * Function to take a URL of the form
- * file://dir1/dir2/file
- *
- * Test that 'file:' exists.
- * Return a pointer to /dir1/...
- *
- * todo:
- */
-char *
-e_util_de_url_and_verify(const char *fi)
-{
- char *wk;
-
- D_ENTER;
-
- wk = strstr(fi, "file:");
-
- /* Valid URL contains "file:" */
- if (!wk)
- D_RETURN_(NULL);
-
- /* Need some form of hostname to continue */
- /* if( !hostn )
- * * D_RETURN_ (NULL);
- */
-
- /* Do we contain hostname? */
- /* wk = strstr( fi, hostn );
- */
-
- /* Hostname mismatch, reject file */
- /* if( !wk )
- * * D_RETURN_ (NULL);
- */
-
- /* Local file name starts after "hostname" */
- wk = strchr(wk, '/');
-
- if (!wk)
- D_RETURN_(NULL);
-
- D_RETURN_(wk);
-}
-
-
-Evas *
-e_evas_new_all(Display *disp, Window parent_window,
- int x, int y, int win_w, int win_h,
- char *font_dir)
-{
- Evas *e;
-
- e = evas_new();
- evas_output_method_set(e, evas_render_method_lookup("software_x11"));
- evas_output_size_set(e, win_w, win_h);
- evas_output_viewport_set(e, 0, 0, win_w, win_h);
- {
- Evas_Engine_Info_Software_X11 *einfo;
- XSetWindowAttributes att;
- Window window;
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(e);
-
- /* the following is specific to the engine */
- einfo->info.display = disp;
- einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
- einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
-
- att.background_pixmap = None;
- att.colormap = /*colormap*/ DefaultColormap(disp, DefaultScreen(disp));
- att.border_pixel = 0;
- att.event_mask = 0;
- window = XCreateWindow(disp,
- parent_window,
- x, y, win_w, win_h, 0,
- DefaultDepth(disp, DefaultScreen(disp)),
- /*imlib_get_visual_depth(display, visual),*/
- InputOutput,
- einfo->info.visual,
- CWColormap | CWBorderPixel | CWEventMask | CWBackPixmap,
- &att);
-
- einfo->info.drawable = window /*win*/;
- einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
- einfo->info.rotation = 0;
- einfo->info.debug = 0;
- evas_engine_info_set(e, (Evas_Engine_Info *) einfo);
- }
-
- evas_image_cache_set(e, 0);
- evas_font_cache_set(e, 0);
- evas_font_path_append(e, font_dir);
-
- return e;
-}
-
-Evas_List *
-e_evas_get_mask(Evas *evas, Pixmap pmap, Pixmap mask)
-{
- int w, h;
- Pixmap old_pmap, old_mask;
- Evas_List *updates;
- Evas_Engine_Info_Software_X11 *info;
-
- info = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
-
- old_pmap = info->info.drawable;
- old_mask = info->info.mask;
-
- info->info.drawable = pmap;
- info->info.mask = mask;
-
- evas_engine_info_set(evas, (Evas_Engine_Info *) info);
- evas_output_size_get(evas, &w, &h);
- evas_damage_rectangle_add(evas, 0, 0, w, h);
- evas_render(evas);
- evas_damage_rectangle_add(evas, 0, 0, w, h);
-
- info->info.drawable = old_pmap;
- info->info.mask = old_mask;
- evas_engine_info_set(evas, (Evas_Engine_Info *) info);
-
- return updates;
-}
-
-
-Window
-e_evas_get_window(Evas *evas)
-{
- Window win;
- Evas_Engine_Info_Software_X11 *einfo;
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
-
- /* the following is specific to the engine */
- win = einfo->info.drawable;
-
- return win;
-}
+++ /dev/null
-#ifndef E_UTIL_H
-#define E_UTIL_H
-
-#include "e.h"
-
-void e_util_set_env(char *variable, char *content);
-char *e_util_get_user_home(void);
-void *e_util_memdup(void *data, int size);
-int e_util_glob_matches(char *str, char *glob);
-char *e_util_de_url_and_verify(const char *fi);
-Window e_evas_get_window(Evas *evas);
-Evas_List *e_evas_get_mask(Evas *evas, Pixmap pmap, Pixmap mask);
-Evas *e_evas_new_all(Display *disp, Window win,
- int x, int y, int win_w, int win_h,
- char *font_dir);
-
-#define RENDER_METHOD_ALPHA_SOFTWARE 0
-
-#define e_strdup(__dest, __var) \
-{ \
-if (!__var) __dest = NULL; \
-else { \
-__dest = malloc(strlen(__var) + 1); \
-if (__dest) strcpy(__dest, __var); \
-} }
-
-/* misc util macros */
-#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
-(((x) < ((xx) + (ww))) && \
-((y) < ((yy) + (hh))) && \
-(((x) + (w)) > (xx)) && \
-(((y) + (h)) > (yy)))
-#define SPANS_COMMON(x1, w1, x2, w2) \
-(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
-#define UN(_blah) _blah = 0
-#define MIN(v1, v2) (v1 < v2 ? v1 : v2)
-
-#define STRNCPY(d, s, l) \
-do \
-{ \
- int __c; \
- for (__c = 0; (__c < (l)) && ((d)[__c] = (s)[__c]); __c++); \
- (d)[(l) - 1] = 0; \
-} \
-while (0)
-
-#endif
+++ /dev/null
-#include <libefsd.h>
-
-#include "debug.h"
-#include "view.h"
-#include "cursors.h"
-#include "config.h"
-#include "border.h"
-#include "menu.h"
-#include "menubuild.h"
-#include "fs.h"
-#include "file.h"
-#include "util.h"
-#include "icons.h"
-#include "e_dir.h"
-#include "e_view_machine.h"
-#include "e_file.h"
-#include "globals.h"
-#include <Ebg.h>
-
-static Ecore_Event *current_ev = NULL;
-
-static char **dnd_files = NULL;
-static int dnd_num_files = 0;
-static E_dnd_enum dnd_pending_mode;
-static E_View *v_dnd_source;
-
-static void e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o,
- void *event_info);
-static void e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o,
- void *event_info);
-static void e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o,
- void *event_info);
-static void e_idle(void *data);
-static void e_wheel(Ecore_Event * ev);
-static void e_key_down(Ecore_Event * ev);
-static void e_key_up(Ecore_Event * ev);
-static void e_mouse_down(Ecore_Event * ev);
-static void e_mouse_up(Ecore_Event * ev);
-static void e_mouse_move(Ecore_Event * ev);
-static void e_mouse_in(Ecore_Event * ev);
-static void e_mouse_out(Ecore_Event * ev);
-static void e_window_expose(Ecore_Event * ev);
-static void e_configure(Ecore_Event * ev);
-static void e_property(Ecore_Event * ev);
-static void e_unmap(Ecore_Event * ev);
-static void e_visibility(Ecore_Event * ev);
-static void e_focus_in(Ecore_Event * ev);
-static void e_focus_out(Ecore_Event * ev);
-static void e_delete(Ecore_Event * ev);
-static void e_dnd_status(Ecore_Event * ev);
-static void e_dnd_data_request(Ecore_Event * ev);
-static void e_dnd_drop_end(Ecore_Event * ev);
-static void e_dnd_drop_position(Ecore_Event * ev);
-static void e_dnd_drop(Ecore_Event * ev);
-static void e_dnd_drop_request(Ecore_Event * ev);
-static void e_dnd_drop_request_free(void);
-static void e_dnd_handle_drop(E_View * v);
-static void e_view_resort_timeout(int val, void *data);
-static int e_view_restart_alphabetical_qsort_cb(const void *data1,
- const void *data2);
-static void e_view_geometry_record_timeout(int val, void *data);
-static void e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar * sb,
- double val);
-static void e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar * sb,
- double val);
-static void e_view_write_icon_xy_timeout(int val, void *data);
-
-static void
-e_view_write_icon_xy_timeout(int val, void *data)
-{
- E_View *v;
- Evas_List * l;
- E_Icon *ic;
- double t_in;
-
- D_ENTER;
-
- v = data;
- /* FIXME: this is a problem if we have 1000's of icons */
- t_in = ecore_get_time();
- for (l = v->icons; l; l = l->next)
- {
- ic = l->data;
- if (ic->q.write_xy)
- {
- char buf[PATH_MAX];
-
- ic->q.write_xy = 0;
- /* FIXME */
- snprintf(buf, PATH_MAX, "%s/%s", ic->view->dir->dir,
- ic->file->file);
-
- D("write meta xy for icon for file %s\n", ic->file->file);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/pos/x", buf, ic->geom.x);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/pos/y", buf, ic->geom.y);
- }
- if ((ecore_get_time() - t_in) > 0.10)
- {
- char name[PATH_MAX];
-
- snprintf(name, PATH_MAX, "icon_xy_record.%s", v->dir->dir);
- ecore_add_event_timer(name, 0.01, e_view_write_icon_xy_timeout, 0,
- v);
- D_RETURN;
- }
- }
-
- D_RETURN;
- UN(val);
-}
-
-void
-e_view_selection_update(E_View * v)
-{
- D_ENTER;
-
- if ((v->select.on) && (!v->select.obj.middle))
- {
- /* create select objects */
- v->select.obj.middle = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.middle,
- v->select.config.middle.r,
- v->select.config.middle.g,
- v->select.config.middle.b, v->select.config.middle.a);
- evas_object_layer_set(v->select.obj.middle, 300);
- v->select.obj.edge_l = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.edge_l,
- v->select.config.edge_l.r,
- v->select.config.edge_l.g,
- v->select.config.edge_l.b, v->select.config.edge_l.a);
- evas_object_layer_set(v->select.obj.edge_l, 300);
- v->select.obj.edge_r = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.edge_r,
- v->select.config.edge_r.r,
- v->select.config.edge_r.g,
- v->select.config.edge_r.b, v->select.config.edge_r.a);
- evas_object_layer_set(v->select.obj.edge_r, 300);
- v->select.obj.edge_t = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.edge_t,
- v->select.config.edge_t.r,
- v->select.config.edge_t.g,
- v->select.config.edge_t.b, v->select.config.edge_t.a);
- evas_object_layer_set(v->select.obj.edge_t, 300);
- v->select.obj.edge_b = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.edge_b,
- v->select.config.edge_b.r,
- v->select.config.edge_b.g,
- v->select.config.edge_b.b, v->select.config.edge_b.a);
- evas_object_layer_set(v->select.obj.edge_b, 300);
-
- v->select.obj.grad_l = evas_object_gradient_add(v->evas);
- evas_object_gradient_angle_set(v->select.obj.grad_l, 270);
- evas_object_gradient_color_add(v->select.obj.grad_l,
- v->select.config.grad_l.r,
- v->select.config.grad_l.g,
- v->select.config.grad_l.b,
- v->select.config.grad_l.a, 8);
- evas_object_gradient_color_add(v->select.obj.grad_l,
- v->select.config.grad_l.r,
- v->select.config.grad_l.g,
- v->select.config.grad_l.b, 0, 8);
- evas_object_layer_set(v->select.obj.grad_l, 300);
- v->select.obj.grad_r = evas_object_gradient_add(v->evas);
- evas_object_gradient_angle_set(v->select.obj.grad_r, 90);
- evas_object_gradient_color_add(v->select.obj.grad_r,
- v->select.config.grad_r.r,
- v->select.config.grad_r.g,
- v->select.config.grad_r.b,
- v->select.config.grad_r.a, 8);
- evas_object_gradient_color_add(v->select.obj.grad_r,
- v->select.config.grad_r.r,
- v->select.config.grad_r.g,
- v->select.config.grad_r.b, 0, 8);
- evas_object_layer_set(v->select.obj.grad_r, 300);
- v->select.obj.grad_t = evas_object_gradient_add(v->evas);
- evas_object_gradient_angle_set(v->select.obj.grad_t, 0);
- evas_object_gradient_color_add(v->select.obj.grad_t,
- v->select.config.grad_t.r,
- v->select.config.grad_t.g,
- v->select.config.grad_t.b,
- v->select.config.grad_t.a, 8);
- evas_object_gradient_color_add(v->select.obj.grad_t,
- v->select.config.grad_t.r,
- v->select.config.grad_t.g,
- v->select.config.grad_t.b, 0, 8);
- evas_object_layer_set(v->select.obj.grad_t, 300);
- v->select.obj.grad_b = evas_object_gradient_add(v->evas);
- evas_object_gradient_angle_set(v->select.obj.grad_b, 180);
- evas_object_gradient_color_add(v->select.obj.grad_b,
- v->select.config.grad_b.r,
- v->select.config.grad_b.g,
- v->select.config.grad_b.b,
- v->select.config.grad_b.a, 8);
- evas_object_gradient_color_add(v->select.obj.grad_b,
- v->select.config.grad_b.r,
- v->select.config.grad_b.g,
- v->select.config.grad_b.b, 0, 8);
- evas_object_layer_set(v->select.obj.grad_b, 300);
- v->select.obj.clip = evas_object_rectangle_add(v->evas);
- evas_object_color_set(v->select.obj.clip, 255, 255, 255, 255);
- evas_object_clip_set(v->select.obj.grad_l, v->select.obj.clip);
- evas_object_clip_set(v->select.obj.grad_r, v->select.obj.clip);
- evas_object_clip_set(v->select.obj.grad_t, v->select.obj.clip);
- evas_object_clip_set(v->select.obj.grad_b, v->select.obj.clip);
- }
- if ((!v->select.on) && (v->select.obj.middle))
- {
- /* destroy select objects */
- evas_object_del(v->select.obj.middle);
- evas_object_del(v->select.obj.edge_l);
- evas_object_del(v->select.obj.edge_r);
- evas_object_del(v->select.obj.edge_t);
- evas_object_del(v->select.obj.edge_b);
- evas_object_del(v->select.obj.grad_l);
- evas_object_del(v->select.obj.grad_r);
- evas_object_del(v->select.obj.grad_t);
- evas_object_del(v->select.obj.grad_b);
- evas_object_del(v->select.obj.clip);
- v->select.obj.middle = NULL;
- v->changed = 1;
- D_RETURN;
- }
- if (!v->select.on)
- D_RETURN;
- /* move & resize select objects */
- {
- evas_object_move(v->select.obj.edge_l, v->select.x, v->select.y + 1);
- evas_object_resize(v->select.obj.edge_l, 1, v->select.h - 1);
- evas_object_move(v->select.obj.edge_r, v->select.x + v->select.w - 1,
- v->select.y);
- evas_object_resize(v->select.obj.edge_r, 1, v->select.h - 1);
- evas_object_move(v->select.obj.edge_t, v->select.x, v->select.y);
- evas_object_resize(v->select.obj.edge_t, v->select.w - 1, 1);
- evas_object_move(v->select.obj.edge_b, v->select.x + 1,
- v->select.y + v->select.h - 1);
- evas_object_resize(v->select.obj.edge_b, v->select.w - 1, 1);
- evas_object_move(v->select.obj.middle, v->select.x + 1,
- v->select.y + 1);
- evas_object_resize(v->select.obj.middle, v->select.w - 1 - 1,
- v->select.h - 1 - 1);
- evas_object_move(v->select.obj.grad_l, v->select.x + 1,
- v->select.y + 1);
- evas_object_resize(v->select.obj.grad_l, v->select.config.grad_size.l,
- v->select.h - 1 - 1);
- evas_object_move(v->select.obj.grad_r,
- v->select.x + v->select.w - 1 - v->select.config.grad_size.r,
- v->select.y + 1);
- evas_object_resize(v->select.obj.grad_r, v->select.config.grad_size.r,
- v->select.h - 1 - 1);
- evas_object_move(v->select.obj.grad_t, v->select.x + 1,
- v->select.y + 1);
- evas_object_resize(v->select.obj.grad_t, v->select.w - 1 - 1,
- v->select.config.grad_size.t);
- evas_object_move(v->select.obj.grad_b, v->select.x + 1,
- v->select.y + v->select.h - 1 - v->select.config.grad_size.b);
- evas_object_resize(v->select.obj.grad_b, v->select.w - 1 - 1,
- v->select.config.grad_size.b);
- evas_object_move(v->select.obj.clip, v->select.x + 1, v->select.y + 1);
- evas_object_resize(v->select.obj.clip, v->select.w - 1 - 1,
- v->select.h - 1 - 1);
- }
-
- evas_object_show(v->select.obj.middle);
- evas_object_show(v->select.obj.edge_l);
- evas_object_show(v->select.obj.edge_r);
- evas_object_show(v->select.obj.edge_t);
- evas_object_show(v->select.obj.edge_b);
- evas_object_show(v->select.obj.grad_l);
- evas_object_show(v->select.obj.grad_r);
- evas_object_show(v->select.obj.grad_t);
- evas_object_show(v->select.obj.grad_b);
- evas_object_show(v->select.obj.clip);
- v->changed = 1;
- D_RETURN;
-}
-
-static void
-e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar * sb, double val)
-{
- E_View *v;
-
- D_ENTER;
-
- v = _data;
- e_view_scroll_to(v, v->scroll.x, v->spacing.window.t - sb->val);
-
- D_RETURN;
- UN(val);
-}
-
-static void
-e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar * sb, double val)
-{
- E_View *v;
-
- D_ENTER;
-
- v = _data;
- e_view_scroll_to(v, v->spacing.window.l - sb->val, v->scroll.y);
-
- D_RETURN;
- UN(val);
-}
-
-static void
-e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- Ecore_Event_Mouse_Down *ev;
- E_View *v;
- Evas_Event_Mouse_Down *ev_info = event_info;
-
- D_ENTER;
-
- if (!current_ev)
- D_RETURN;
- ev = current_ev->event;
- v = _data;
-
- if (!(ev->mods & (multi_select_mod | range_select_mod)))
- {
- v->select.last_count = v->select.count;
- e_view_deselect_all(v);
- }
-
- if (ev_info->button == 1)
- {
- v->select.down.x = ev_info->output.x;
- v->select.down.y = ev_info->output.y;
- v->select.on = 1;
- if (ev_info->output.x < v->select.down.x)
- {
- v->select.x = ev_info->output.x;
- v->select.w = v->select.down.x - v->select.x + 1;
- }
- else
- {
- v->select.x = v->select.down.x;
- v->select.w = ev_info->output.x - v->select.down.x + 1;
- }
- if (ev_info->output.y < v->select.down.y)
- {
- v->select.y = ev_info->output.y;
- v->select.h = v->select.down.y - v->select.y + 1;
- }
- else
- {
- v->select.y = v->select.down.y;
- v->select.h = ev_info->output.y - v->select.down.y + 1;
- }
- e_view_selection_update(v);
- }
-
- if (ev_info->button == 2 && ev->double_click)
- ecore_event_loop_quit();
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- Ecore_Event_Mouse_Up *ev;
- E_View *v;
- int dx, dy;
- Evas_Event_Mouse_Up *ev_info = event_info;
-
- D_ENTER;
-
- if (!current_ev)
- D_RETURN;
- ev = current_ev->event;
- v = _data;
- dx = 0;
- dy = 0;
-
- if (v->select.on)
- {
- dx = v->select.down.x - ev_info->output.x;
- dy = v->select.down.y - ev_info->output.y;
- if (dx < 0)
- dx = -dx;
- if (dy < 0)
- dy = -dy;
- if (ev_info->button == 1)
- v->select.on = 0;
- e_view_selection_update(v);
- }
-
- if ((ev_info->button == 1) && ((dx > 3) || (dy > 3)))
- {
- Evas_List * l;
-
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if (INTERSECTS(v->select.x, v->select.y, v->select.w, v->select.h,
- v->scroll.x + ic->geom.x,
- v->scroll.y + ic->geom.y, ic->geom.w, ic->geom.h))
- {
- if (ic->state.visible)
- {
- e_icon_invert_selection(ic);
- }
- }
- }
- }
- else if (v->select.last_count == 0)
- {
- if (ev_info->button == 1)
- {
- if (!(ev->mods & (multi_select_mod | range_select_mod)))
- {
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- char *apps_menu_db;
-
- apps_menu_db = e_config_get("apps_menu");
- if (apps_menu_db)
- buildmenu = e_build_menu_new_from_db(apps_menu_db);
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
- if (menu)
- {
- e_menu_show_at_mouse(menu, ev->rx, ev->ry,
- ev->time);
- }
- }
- }
- }
- else if (ev_info->button == 2)
- {
-#if 1
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- D("building iconified windows menu\n");
- buildmenu = e_build_menu_new_from_iconified_borders();
- }
- if (buildmenu && buildmenu->changed)
- {
- D("buildmenu changed! rebuild!\n");
- e_build_menu_iconified_borders_rebuild(buildmenu);
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
-
- if (menu)
- {
- D("showing iconified window menu\n");
- e_menu_show_at_mouse(menu, ev->rx, ev->ry, ev->time);
- }
- }
-#endif
- }
- else if (ev_info->button == 3)
- {
- static E_Build_Menu *buildmenu = NULL;
-
- if (!buildmenu)
- {
- buildmenu =
- e_build_menu_new_from_gnome_apps("/usr/share/gnome/apps");
- }
- if (buildmenu)
- {
- static E_Menu *menu = NULL;
-
- menu = buildmenu->menu;
- if (menu)
- e_menu_show_at_mouse(menu, ev->rx, ev->ry, ev->time);
- }
- }
- }
- if (ev_info->button == 1)
- {
- v->select.x = ev_info->output.x;
- v->select.y = ev_info->output.y;
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-static void
-e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
-{
- Ecore_Event_Mouse_Down *ev;
- E_View *v;
- Evas_Event_Mouse_Move *ev_info = event_info;
-
- D_ENTER;
-
- if (!current_ev)
- D_RETURN;
- ev = current_ev->event;
- v = _data;
- if (v->select.on)
- {
- if (ev_info->cur.output.x < v->select.down.x)
- {
- v->select.x = ev_info->cur.output.x;
- v->select.w = v->select.down.x - v->select.x + 1;
- }
- else
- {
- v->select.x = v->select.down.x;
- v->select.w = ev_info->cur.output.x - v->select.down.x + 1;
- }
- if (ev_info->cur.output.y < v->select.down.y)
- {
- v->select.y = ev_info->cur.output.y;
- v->select.h = v->select.down.y - v->select.y + 1;
- }
- else
- {
- v->select.y = v->select.down.y;
- v->select.h = ev_info->cur.output.y - v->select.down.y + 1;
- }
- e_view_selection_update(v);
-
- }
-
- D_RETURN;
- UN(_e);
- UN(_o);
-}
-
-void
-e_view_deselect_all(E_View * v)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- e_icon_deselect(ic);
- }
-
- D_RETURN;
-}
-
-void
-e_view_deselect_all_except(E_Icon * not_ic)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = not_ic->view->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if (ic != not_ic)
- e_icon_deselect(ic);
- }
-
- D_RETURN;
-}
-
-void
-e_view_icons_get_extents(E_View * v, int *min_x, int *min_y, int *max_x,
- int *max_y)
-{
- Evas_List * l;
- int x1, x2, y1, y2;
-
- D_ENTER;
-
- x1 = v->extents.x1;
- x2 = v->extents.x2;
- y1 = v->extents.y1;
- y2 = v->extents.y2;
- if (!v->extents.valid)
- {
- x1 = 999999999;
- x2 = -999999999;
- y1 = 999999999;
- y2 = -999999999;
- if (!v->icons)
- {
- if (min_x)
- *min_x = 0;
- if (min_y)
- *min_y = 0;
- if (max_x)
- *max_x = 1;
- if (max_y)
- *max_y = 1;
- D_RETURN;
- }
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if (ic->geom.x < x1)
- x1 = ic->geom.x;
- if (ic->geom.y < y1)
- y1 = ic->geom.y;
- if (ic->geom.x + ic->geom.w > x2)
- x2 = ic->geom.x + ic->geom.w;
- if (ic->geom.y + ic->geom.h > y2)
- y2 = ic->geom.y + ic->geom.h;
- }
- v->extents.x1 = x1;
- v->extents.y1 = y1;
- v->extents.x2 = x2;
- v->extents.y2 = y2;
- }
- v->extents.valid = 1;
- if (x1 > 0)
- x1 = 0;
- if (y1 > 0)
- y1 = 0;
- if (min_x)
- *min_x = x1;
- if (min_y)
- *min_y = y1;
- if (max_x)
- *max_x = x2 - 1;
- if (max_y)
- *max_y = y2 - 1;
-
- D_RETURN;
-}
-
-void
-e_view_icons_apply_xy(E_View * v)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- e_icon_apply_xy(ic);
- }
-
- v->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_view_scroll_to(E_View * v, int sx, int sy)
-{
- int min_x, min_y, max_x, max_y;
-
- D_ENTER;
-
- e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
-
- if (sx < v->size.w - v->spacing.window.r - max_x)
- sx = v->size.w - v->spacing.window.r - max_x;
- if (sx > v->spacing.window.l - min_x)
- sx = v->spacing.window.l - min_x;
- if (sy < v->size.h - v->spacing.window.b - max_y)
- sy = v->size.h - v->spacing.window.b - max_y;
- if (sy > v->spacing.window.t - min_y)
- sy = v->spacing.window.t - min_y;
-
- if ((sx == v->scroll.x) && (v->scroll.y == sy))
- D_RETURN;
- v->scroll.x = sx;
- v->scroll.y = sy;
- e_view_icons_apply_xy(v);
- if (v->bg)
- e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
- v->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_view_scroll_by(E_View * v, int sx, int sy)
-{
- D_ENTER;
-
- e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy);
-
- D_RETURN;
-}
-
-void
-e_view_scroll_to_percent(E_View * v, double psx, double psy)
-{
- int min_x, min_y, max_x, max_y;
- int sx, sy;
-
- D_ENTER;
-
- e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
- sx = (psx * ((double)max_x - (double)min_x)) - min_x;
- sy = (psy * ((double)max_y - (double)min_y)) - min_y;
-
- if (sx < v->size.w - v->spacing.window.r - max_x)
- sx = v->size.w - v->spacing.window.r - max_x;
- if (sx > v->spacing.window.l - min_x)
- sx = v->spacing.window.l - min_x;
- if (sy < v->size.h - v->spacing.window.b - max_y)
- sy = v->size.h - v->spacing.window.b - max_y;
- if (sy > v->spacing.window.t - min_y)
- sy = v->spacing.window.t - min_y;
-
- if ((sx == v->scroll.x) && (v->scroll.y == sy))
- D_RETURN;
- v->scroll.x = sx;
- v->scroll.y = sy;
- e_view_icons_apply_xy(v);
- if (v->bg)
- e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
-
- D_RETURN;
-}
-
-void
-e_view_get_viewable_percentage(E_View * v, double *vw, double *vh)
-{
- int min_x, min_y, max_x, max_y;
- double p;
-
- D_ENTER;
-
- e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
- if (min_x == max_x)
- {
- if (vw)
- *vw = 0;
- }
- else
- {
- p = ((double)(v->size.w - v->spacing.window.l - v->spacing.window.r)) /
- ((double)(max_x - min_x));
- if (vw)
- *vw = p;
- }
- if (min_y == max_y)
- {
- if (vh)
- *vh = 0;
- }
- else
- {
- p = ((double)(v->size.h - v->spacing.window.t - v->spacing.window.b)) /
- ((double)(max_y - min_y));
- if (vh)
- *vh = p;
- }
-
- D_RETURN;
-}
-
-void
-e_view_get_position_percentage(E_View * v, double *vx, double *vy)
-{
- int min_x, min_y, max_x, max_y;
- double p;
-
- D_ENTER;
-
- e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
- if (min_x == max_x)
- {
- if (vx)
- *vx = 0;
- }
- else
- {
- p = ((double)(v->scroll.x - min_x)) / ((double)(max_x - min_x));
- if (vx)
- *vx = p;
- }
- if (min_y == max_y)
- {
- if (vy)
- *vy = 0;
- }
- else
- {
- p = ((double)(v->scroll.y - min_y)) / ((double)(max_y - min_y));
- if (vy)
- *vy = p;
- }
-
- D_RETURN;
-}
-
-static void
-e_idle(void *data)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = VM->views; l; l = l->next)
- {
- E_View *v;
-
- v = l->data;
- e_view_update(v);
- }
-
- D_RETURN;
- UN(data);
-}
-
-void
-e_view_geometry_record(E_View * v)
-{
- D_ENTER;
-
- if (e_fs_get_connection())
- {
- int left, top;
-
- D("Record geom for view\n");
- ecore_window_get_frame_size(v->win.base, &left, NULL, &top, NULL);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/view/x", v->dir->dir, v->location.x - left);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/view/y", v->dir->dir, v->location.y - top);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/view/w", v->dir->dir, v->size.w);
- efsd_set_metadata_int(e_fs_get_connection(),
- "/view/h", v->dir->dir, v->size.h);
- }
-
- D_RETURN;
-}
-
-static void
-e_view_geometry_record_timeout(int val, void *data)
-{
- E_View *v;
-
- D_ENTER;
-
- v = data;
- e_view_geometry_record(v);
-
- D_RETURN;
- UN(val);
-}
-
-void
-e_view_queue_geometry_record(E_View * v)
-{
- char name[PATH_MAX];
-
- D_ENTER;
-
- snprintf(name, PATH_MAX, "geometry_record.%s", v->dir->dir);
- ecore_add_event_timer(name, 0.10, e_view_geometry_record_timeout, 0, v);
-
- D_RETURN;
-}
-
-void
-e_view_queue_icon_xy_record(E_View * v)
-{
- char name[PATH_MAX];
-
- D_ENTER;
-
- snprintf(name, PATH_MAX, "icon_xy_record.%s", v->dir->dir);
- ecore_add_event_timer(name, 0.10, e_view_write_icon_xy_timeout, 0, v);
-
- D_RETURN;
-}
-
-static void
-e_configure(Ecore_Event * ev)
-{
- Ecore_Event_Window_Configure *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (!e || !e->win)
- D_RETURN;
- v = e_view_machine_get_view_by_base_window(e->win);
- if (!v)
- D_RETURN;
- /* win, root, x, y, w, h, wm_generated */
- D("Configure for view: %s\n", v->name);
- if (e->wm_generated)
- {
- D("wm generated %i %i, %ix%i\n", e->x, e->y, e->w, e->h);
- if ((e->x != v->location.x) || (e->y != v->location.y))
- {
- D("new spot!\n");
- v->location.x = e->x;
- v->location.y = e->y;
- }
- }
- D("size %ix%i\n", e->w, e->h);
- if ((e->w != v->size.w) || (e->h != v->size.h) || (v->size.force))
- {
- v->size.force = 0;
- D("... a new size!\n");
- v->size.w = e->w;
- v->size.h = e->h;
- if (v->pmap)
- ecore_pixmap_free(v->pmap);
- v->pmap = 0;
- ecore_window_resize(v->win.main, v->size.w, v->size.h);
- if (v->options.back_pixmap)
- {
- Evas_Engine_Info_Software_X11 *info;
-
- v->pmap =
- ecore_pixmap_new(v->win.main, v->size.w, v->size.h,
- 0);
- info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
- info->info.drawable = v->pmap;
- evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
- ecore_window_set_background_pixmap(v->win.main, v->pmap);
- ecore_window_clear(v->win.main);
- }
- if (v->bg)
- e_bg_resize(v->bg, v->size.w, v->size.h);
- D("evas_set_output_viewpor(%p)\n", v->evas);
- evas_output_viewport_set(v->evas, 0, 0, v->size.w, v->size.h);
- evas_output_size_set(v->evas, v->size.w, v->size.h);
- e_view_scroll_to(v, v->scroll.x, v->scroll.y);
- e_view_arrange(v);
- e_view_layout_update(v->layout);
- }
- D_RETURN;
-}
-
-static void
-e_property(Ecore_Event * ev)
-{
- Ecore_Event_Window_Configure *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_unmap(Ecore_Event * ev)
-{
- Ecore_Event_Window_Unmap *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_visibility(Ecore_Event * ev)
-{
- Ecore_Event_Window_Unmap *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_focus_in(Ecore_Event * ev)
-{
- Ecore_Event_Window_Focus_In *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_focus_out(Ecore_Event * ev)
-{
- Ecore_Event_Window_Focus_Out *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_delete(Ecore_Event * ev)
-{
- Ecore_Event_Window_Delete *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- e_object_unref(E_OBJECT(v));
- D_RETURN;
- }
- }
-
- D_RETURN;
-}
-
-/*
- * dnd status handler
- *
- */
-static void
-e_dnd_status(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Drop_Status *e;
-
- /*
- * typedef struct _ecore_event_dnd_drop_status
- * {
- * Window win, root, source_win;
- * int x, y, w, h;
- * int copy, link, move, private;
- * int all_position_msgs;
- * int ok;
- * } Ecore_Event_Dnd_Drop_Status;
- */
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- if (dnd_pending_mode != E_DND_DELETED &&
- dnd_pending_mode != E_DND_COPIED)
- {
- if (e->copy)
- dnd_pending_mode = E_DND_COPY;
- else if (e->move)
- dnd_pending_mode = E_DND_MOVE;
- else if (e->link)
- dnd_pending_mode = E_DND_LINK;
- else
- dnd_pending_mode = E_DND_ASK;
- }
-
- ecore_window_dnd_ok(e->ok);
-
- v->changed = 1;
- v->drag.icon_hide = 1;
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_wheel(Ecore_Event * ev)
-{
- Ecore_Event_Wheel *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_key_down(Ecore_Event * ev)
-{
- Ecore_Event_Key_Down *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win))
- || (v = e_view_machine_get_view_by_base_window(e->win)))
- {
- if (!strcmp(e->key, "Up"))
- {
- e_scrollbar_set_value(v->scrollbar.v,
- v->scrollbar.v->val - 8);
- }
- else if (!strcmp(e->key, "Down"))
- {
- e_scrollbar_set_value(v->scrollbar.v,
- v->scrollbar.v->val + 8);
- }
- else if (!strcmp(e->key, "Left"))
- {
- e_scrollbar_set_value(v->scrollbar.h,
- v->scrollbar.h->val - 8);
- }
- else if (!strcmp(e->key, "Right"))
- {
- e_scrollbar_set_value(v->scrollbar.h,
- v->scrollbar.h->val + 8);
- }
- else if (!strcmp(e->key, "Escape"))
- {
- }
- else
- {
- char *type;
-
- type = ecore_keypress_translate_into_typeable(e);
- if (type)
- {
- }
- }
- D_RETURN;
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_key_up(Ecore_Event * ev)
-{
- Ecore_Event_Key_Up *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Down *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- int focus_mode;
-
- focus_mode = config_data->window->focus_mode;
- if (focus_mode == 2)
- ecore_focus_to_window(v->win.base);
- evas_event_feed_mouse_down(v->evas, e->button);
- current_ev = NULL;
- D_RETURN;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-static void
-e_mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- evas_event_feed_mouse_up(v->evas, e->button);
- current_ev = NULL;
- D_RETURN;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-static void
-e_mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- evas_event_feed_mouse_move(v->evas, e->x, e->y);
- current_ev = NULL;
- D_RETURN;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-static void
-e_mouse_in(Ecore_Event * ev)
-{
- Ecore_Event_Window_Enter *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- if (v->is_desktop)
- {
- evas_event_feed_mouse_in(v->evas);
- }
- current_ev = NULL;
- D_RETURN;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-static void
-e_mouse_out(Ecore_Event * ev)
-{
- Ecore_Event_Window_Leave *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- evas_event_feed_mouse_out(v->evas);
- current_ev = NULL;
- D_RETURN;
- }
- }
- current_ev = NULL;
-
- D_RETURN;
-}
-
-static void
-e_window_expose(Ecore_Event * ev)
-{
- Ecore_Event_Window_Expose *e;
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- current_ev = ev;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_main_window(e->win)))
- {
- if (!(v->pmap))
- evas_damage_rectangle_add(v->evas, e->x, e->y, e->w, e->h);
- v->changed = 1;
- D_RETURN;
- }
- }
-
- D_RETURN;
-}
-
-Ecore_Event *
-e_view_get_current_event(void)
-{
- D_ENTER;
-
- D_RETURN_(current_ev);
-}
-
-int
-e_view_filter_file(E_View * v, char *file)
-{
- D_ENTER;
-
- if (file[0] == '.')
- D_RETURN_(0);
-
- D_RETURN_(1);
- UN(v);
-}
-
-static int
-e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
-{
- E_Icon *ic, *ic2;
-
- D_ENTER;
-
- ic = *((E_Icon **) data1);
- ic2 = *((E_Icon **) data2);
-
- D_RETURN_(strcmp(ic->file->file, ic2->file->file));
-}
-
-void
-e_view_resort_alphabetical(E_View * v)
-{
- Evas_List *icons = NULL, *l;
- E_Icon **array;
- int i, count;
-
- D_ENTER;
-
- if (!v->icons)
- D_RETURN;
- for (count = 0, l = v->icons; l; l = l->next)
- count++;
- array = malloc(sizeof(E_Icon *) * count);
- for (i = 0, l = v->icons; l; l = l->next)
- array[i++] = l->data;
- D("qsort %i elements...\n", count);
- qsort(array, count, sizeof(E_Icon *), e_view_restart_alphabetical_qsort_cb);
- for (i = 0; i < count; i++)
- icons = evas_list_append(icons, array[i]);
- FREE(array);
-
- evas_list_free(v->icons);
- v->icons = icons;
-
- D("done...\n");
-
- D_RETURN;
-}
-
-void
-e_view_arrange(E_View * v)
-{
- Evas_List * l;
- int x, y;
- int x1, x2, y1, y2;
- double sv, sr, sm;
-
- D_ENTER;
-
- x = v->spacing.window.l;
- y = v->spacing.window.t;
-
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- if ((x != v->spacing.window.l) &&
- ((x + ic->geom.w) > v->size.w - v->spacing.window.r))
- {
- x = v->spacing.window.l;
- y += ic->geom.h + v->spacing.icon.b;
- }
- ic->geom.x = x;
- ic->geom.y = y;
- e_icon_apply_xy(ic);
- x += ic->geom.w + v->spacing.icon.s;
- }
-
- e_view_icons_get_extents(v, &x1, &y1, &x2, &y2);
-
- sv = -(v->scroll.y - v->spacing.window.t);
- sr = v->size.h - v->spacing.window.t - v->spacing.window.b;
- sm = y2 - y1;
- if (sr > sm)
- sr = sm;
- e_scrollbar_set_range(v->scrollbar.v, sr);
- e_scrollbar_set_max(v->scrollbar.v, sm);
- e_scrollbar_set_value(v->scrollbar.v, sv);
- if (sr < sm)
- e_scrollbar_show(v->scrollbar.v);
- else
- e_scrollbar_hide(v->scrollbar.v);
-
- sv = -(v->scroll.x - v->spacing.window.l);
- sr = v->size.w - v->spacing.window.l - v->spacing.window.r;
- sm = x2 - x1;
- if (sr > sm)
- sr = sm;
- e_scrollbar_set_range(v->scrollbar.h, sr);
- e_scrollbar_set_max(v->scrollbar.h, sm);
- e_scrollbar_set_value(v->scrollbar.h, sv);
- if (sr < sm)
- e_scrollbar_show(v->scrollbar.h);
- else
- e_scrollbar_hide(v->scrollbar.h);
-
- v->changed = 1;
- D_RETURN;
-}
-
-void
-e_view_resort(E_View * v)
-{
- D_ENTER;
-
- e_view_resort_alphabetical(v);
- e_view_arrange(v);
-
- D_RETURN;
-}
-
-static void
-e_view_resort_timeout(int val, void *data)
-{
- E_View *v;
-
- D_ENTER;
-
- v = data;
- e_view_resort(v);
- v->have_resort_queued = 0;
-
- D_RETURN;
- UN(val);
-}
-
-static void
-e_view_layout_reload_timeout(int val, void *data)
-{
- E_View *v;
- D_ENTER;
- v = data;
- e_view_layout_reload(v);
- D_RETURN;
- UN(val);
-}
-
-static void
-e_view_bg_reload_timeout(int val, void *data)
-{
- E_View *v;
- D_ENTER;
- v = data;
- e_view_bg_reload(v);
- D_RETURN;
- UN(val);
-}
-
-static void
-e_view_ib_reload_timeout(int val, void *data)
-{
- E_View *v;
- D_ENTER;
- v = data;
- e_view_ib_reload(v);
- D_RETURN;
- UN(val);
-}
-
-void
-e_view_queue_resort(E_View * v)
-{
- char name[PATH_MAX];
-
- D_ENTER;
-
- if (v->have_resort_queued)
- D_RETURN;
- v->have_resort_queued = 1;
- snprintf(name, PATH_MAX, "resort_timer.%s", v->name);
- ecore_add_event_timer(name, 1.0, e_view_resort_timeout, 0, v);
-
- D_RETURN;
-}
-
-static void
-e_view_cleanup(E_View * v)
-{
- char name[PATH_MAX];
-
- D_ENTER;
- /* write geometry to metadata. This is done directly and
- * not via a timeout, because we will destroy the object after this.*/
- e_view_geometry_record(v);
-
- if (v->bg)
- e_bg_free(v->bg);
- if (v->scrollbar.h)
- e_object_unref(E_OBJECT(v->scrollbar.h));
- if (v->scrollbar.v)
- e_object_unref(E_OBJECT(v->scrollbar.v));
- if (v->layout)
- e_object_unref(E_OBJECT(v->layout));
-
- ecore_window_destroy(v->win.base);
-
- snprintf(name, PATH_MAX, "resort_timer.%s", v->name);
- ecore_del_event_timer(name);
-
- /* unregister with the underlying dir and the global list of views */
- e_observer_unregister_observee(E_OBSERVER(v), E_OBSERVEE(v->dir));
- e_object_unref(E_OBJECT(v->dir));
- v->dir = NULL;
- e_view_machine_unregister_view(v);
- /* FIXME: clean up the rest!!! this leaks ... */
-
- /* Call the destructor of the base class */
- e_observer_cleanup(E_OBSERVER(v));
- D_RETURN;
-}
-
-void
-e_view_file_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data)
-{
- E_View *v = (E_View *) obs;
- E_File *f = (E_File *) data;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- if (event & E_EVENT_FILE_ADD)
- e_view_file_add(v, f);
- else if (event & E_EVENT_FILE_DELETE)
- e_view_file_delete(v, f);
- else if (event & E_EVENT_FILE_CHANGE)
- e_view_file_changed(v, f);
- else if (event & E_EVENT_FILE_INFO)
- e_view_file_try_to_show(v, f);
- else if (event & E_EVENT_BG_CHANGED)
- {
- snprintf(buf, PATH_MAX, "background_reload:%s", v->name);
- e_view_bg_reload(v);
- //ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
- }
- else if (event & E_EVENT_ICB_CHANGED)
- {
- snprintf(buf, PATH_MAX, "iconbar_reload:%s", v->name);
- ecore_add_event_timer(buf, 0.5, e_view_ib_reload_timeout, 0, v);
- }
- else if (event & E_EVENT_LAYOUT_CHANGED)
- {
- snprintf(buf, PATH_MAX, "layout_reload:%s", v->name);
- ecore_add_event_timer(buf, 0.5, e_view_layout_reload_timeout, 0, v);
- }
-
- D_RETURN;
- UN(o);
-}
-
-E_View *
-e_view_new(void)
-{
- E_View *v;
-
- D_ENTER;
-
- v = NEW(E_View, 1);
- ZERO(v, E_View, 1);
-
- e_observer_init(E_OBSERVER(v),
- E_EVENT_FILE_ADD | E_EVENT_FILE_DELETE | E_EVENT_FILE_CHANGE
- | E_EVENT_FILE_INFO | E_EVENT_BG_CHANGED | E_EVENT_ICB_CHANGED
- | E_EVENT_LAYOUT_CHANGED ,
- (E_Notify_Func) e_view_file_event_handler,
- (E_Cleanup_Func) e_view_cleanup);
-
-
-#define SOFT_DESK
-/* #define X_DESK */
-/* #define GL_DESK */
-
-#ifdef SOFT_DESK
- /* ONLY alpha software can be "backing stored" */
- /*v->options.render_method = RENDER_METHOD_ALPHA_SOFTWARE;*/
- v->options.back_pixmap = 0;
-#else
-#ifdef X_DESK
- /*v->options.render_method = RENDER_METHOD_BASIC_HARDWARE;*/
- v->options.back_pixmap = 0;
-#else
- /*v->options.render_method = RENDER_METHOD_3D_HARDWARE;*/
- v->options.back_pixmap = 0;
-#endif
-#endif
- v->select.config.grad_size.l = 8;
- v->select.config.grad_size.r = 8;
- v->select.config.grad_size.t = 8;
- v->select.config.grad_size.b = 8;
-#define SETCOL(_member, _r, _g, _b, _a) \
-_member.r = _r; _member.g = _g; _member.b = _b; _member.a = _a;
- SETCOL(v->select.config.edge_l, 0, 0, 0, 255);
- SETCOL(v->select.config.edge_r, 0, 0, 0, 255);
- SETCOL(v->select.config.edge_t, 0, 0, 0, 255);
- SETCOL(v->select.config.edge_b, 0, 0, 0, 255);
- SETCOL(v->select.config.middle, 255, 255, 255, 100);
- SETCOL(v->select.config.grad_l, 255, 255, 255, 100);
- SETCOL(v->select.config.grad_r, 255, 255, 255, 100);
- SETCOL(v->select.config.grad_t, 255, 255, 255, 100);
- SETCOL(v->select.config.grad_b, 255, 255, 255, 100);
-
- v->spacing.window.l = 3;
- v->spacing.window.r = 15;
- v->spacing.window.t = 3;
- v->spacing.window.b = 15;
- v->spacing.icon.s = 7;
- v->spacing.icon.g = 7;
- v->spacing.icon.b = 7;
-
- e_view_machine_register_view(v);
-
-
- D_RETURN_(v);
-}
-
-void
-e_view_set_look(E_View * v, char *path)
-{
- E_View_Look *l = NULL;
- char buf[PATH_MAX];
- D_ENTER;
-
- if (v->look)
- e_object_unref(E_OBJECT(v->look));
-
- if(!path)
- {
- /*
- * no path specified, lets look in the view's dir. If
- * there is a e_layout dir there, use whats in there.
- * Otherwise use the default dir.
- */
- snprintf(buf, PATH_MAX, "%s/.e_layout", v->dir->dir);
- if (e_file_exists(buf) && e_file_is_dir(buf))
- path = buf;
- else
- {
- snprintf(buf, PATH_MAX, "%s/appearance", e_config_user_dir());
- path = buf;
- }
- }
-
- if ( !(l=e_view_machine_look_lookup(path)) )
- {
- v->look = e_view_look_new();
- e_view_look_set_dir (v->look, path);
- }
- else
- {
- v->look = l;
- e_object_ref(E_OBJECT(v->look));
- }
- if(v->look)
- {
- e_observer_register_observee(E_OBSERVER(v), E_OBSERVEE(v->look->obj));
-
- e_view_bg_reload(v);
- e_view_layout_reload(v);
- e_view_ib_reload(v);
- }
- D_RETURN;
-}
-
-void
-e_view_set_dir(E_View * v, char *path)
-{
- E_Dir *d = NULL;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- if (!v || !path || *path == 0)
- D_RETURN;
-
- if (!(d = e_view_machine_dir_lookup(path)))
- {
- D("Model for this dir doesn't exist, make a new one\n");
- d = e_dir_new();
- e_dir_set_dir(d, path);
- }
- else
- e_object_ref(E_OBJECT(d));
-
- if (d)
- {
- v->dir = d;
- e_observer_register_observee(E_OBSERVER(v), E_OBSERVEE(d));
- /* FIXME do a real naming scheme here */
- snprintf(buf, PATH_MAX, "%s:%d", v->dir->dir, e_object_get_usecount(E_OBJECT(v->dir)));
- e_strdup(v->name, buf);
- D("assigned name to view: %s\n", v->name);
-
- /* Request metadata via efsd */
- v->geom_get.x = efsd_get_metadata(e_fs_get_connection(),
- "/view/x", v->dir->dir, EFSD_INT);
- v->geom_get.y = efsd_get_metadata(e_fs_get_connection(),
- "/view/y", v->dir->dir, EFSD_INT);
- v->geom_get.w = efsd_get_metadata(e_fs_get_connection(),
- "/view/w", v->dir->dir, EFSD_INT);
- v->geom_get.h = efsd_get_metadata(e_fs_get_connection(),
- "/view/h", v->dir->dir, EFSD_INT);
- v->geom_get.busy = 1;
- }
- else
- {
- D("Couldnt set dir for view! Bad!");
- }
- D_RETURN;
-}
-
-void
-e_view_realize(E_View * v)
-{
- char *font_dir;
-
- D_ENTER;
- if (v->evas)
- D_RETURN;
- v->win.base = ecore_window_new(0,
- v->location.x, v->location.y,
- v->size.w, v->size.h);
- ecore_window_set_delete_inform(v->win.base);
- font_dir = e_config_get("fonts");
-
- v->evas = e_evas_new_all(ecore_display_get(),
- v->win.base,
- 0, 0, v->size.w, v->size.h,
- font_dir);
- v->win.main = e_evas_get_window(v->evas);
- e_cursors_display_in_window(v->win.main, "View");
- evas_event_feed_mouse_move(v->evas, -999999, -999999);
- ecore_window_set_events(v->win.base,
- XEV_VISIBILITY | XEV_CONFIGURE |
- XEV_PROPERTY | XEV_FOCUS);
- ecore_window_set_events(v->win.main,
- XEV_EXPOSE | XEV_MOUSE_MOVE |
- XEV_BUTTON | XEV_IN_OUT | XEV_KEY);
- if (v->options.back_pixmap)
- {
- Evas_Engine_Info_Software_X11 *info;
-
- v->pmap = ecore_pixmap_new(v->win.main, v->size.w, v->size.h, 0);
- info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
- info->info.drawable = v->pmap;
- evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
- ecore_window_set_background_pixmap(v->win.main, v->pmap);
- ecore_window_clear(v->win.main);
- }
- v->scrollbar.v = e_scrollbar_new(v);
- e_scrollbar_set_change_func(v->scrollbar.v, e_view_scrollbar_v_change_cb, v);
- e_scrollbar_set_direction(v->scrollbar.v, 1);
- e_scrollbar_add_to_evas(v->scrollbar.v, v->evas);
- e_scrollbar_set_layer(v->scrollbar.v, 2000);
- e_scrollbar_set_value(v->scrollbar.v, 0.0);
- e_scrollbar_set_range(v->scrollbar.v, 1.0);
- e_scrollbar_set_max(v->scrollbar.v, 1.0);
-
- v->scrollbar.h = e_scrollbar_new(v);
- e_scrollbar_set_change_func(v->scrollbar.h, e_view_scrollbar_h_change_cb, v);
- e_scrollbar_set_direction(v->scrollbar.h, 0);
- e_scrollbar_add_to_evas(v->scrollbar.h, v->evas);
- e_scrollbar_set_layer(v->scrollbar.h, 2000);
- e_scrollbar_set_value(v->scrollbar.h, 0.0);
- e_scrollbar_set_range(v->scrollbar.h, 1.0);
- e_scrollbar_set_max(v->scrollbar.h, 1.0);
-
- /* I support dnd */
- ecore_window_dnd_advertise(v->win.base);
- ecore_window_show(v->win.main);
-
- v->changed = 1;
- D_RETURN;
-}
-
-void
-e_view_populate(E_View * v)
-{
- Evas_List * l;
-
- /* populate with icons for all files in the dir we are monitoring.
- * This has to be called _after_ view_realize because
- * view_add_file needs the evas to be intialized */
- for (l = v->dir->files; l; l = l->next)
- {
- E_File *f = (E_File *) l->data;
-
- e_view_file_add(v, f);
- /* try to show the icons for the file. If this is not the first for
- * the dir this will succeed because filetype and stat info have
- * already been received. If not, it'll be shown when those arrive. */
- e_view_file_try_to_show(v, f);
- }
-}
-
-void
-e_view_update(E_View * v)
-{
- Evas_List * l;
-
- D_ENTER;
-
- if (!v->changed)
- D_RETURN;
-
- if (v->drag.icon_hide)
- {
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- e_icon_hide_delete_pending(ic);
- }
- v->drag.icon_hide = 0;
- v_dnd_source = v;
- }
- if (v->drag.icon_show)
- {
- for (l = v->icons; l; l = l->next)
- {
- E_Icon *ic;
-
- ic = l->data;
- e_icon_show_delete_end(ic, dnd_pending_mode);
- }
- dnd_pending_mode = E_DND_NONE;
- v->drag.icon_show = 0;
- }
- if (v->drag.update)
- {
- ecore_window_move(v->drag.win, v->drag.x, v->drag.y);
- v->drag.update = 0;
- }
- if (v->options.back_pixmap)
- {
- Evas_List *up, *fp;
- Evas_Rectangle *u;
-
- fp = up = evas_render_updates(v->evas);
- /* special code to handle if we are double buffering to a pixmap */
- /* and clear sections of the window if they got updated */
- while (up)
- {
- u = up->data;
- ecore_window_clear_area(v->win.main, u->x, u->y, u->w, u->h);
- up = evas_list_next(up);
- }
- evas_render_updates_free(fp);
- }
- else
- evas_render(v->evas);
-
- v->changed = 0;
-
- D_RETURN;
-}
-
-void
-e_view_file_add(E_View * v, E_File * f)
-{
- D_ENTER;
-
- if (!e_icon_find_by_file(v, f->file))
- {
- E_Icon *ic;
-
- ic = e_icon_new();
- ic->view = v;
- ic->file = f;
- ic->changed = 1;
- /* this basically allocates the obj.icon struct. Its image will be
- * set later in icon_update_state */
- ic->obj.icon = evas_object_image_add(ic->view->evas);
- ic->obj.text = e_text_new(ic->view->evas, f->file, "filename");
- v->icons = evas_list_append(v->icons, ic);
- v->extents.valid = 0;
- }
- e_view_queue_resort(v);
- v->changed = 1;
-
- D_RETURN;
-}
-
-void
-e_view_file_changed(E_View * v, E_File * f)
-{
- E_Icon *ic;
-
- D_ENTER;
-
- ic = e_icon_find_by_file(v, f->file);
- if (ic)
- {
- e_icon_update_state(ic);
- }
- v->changed = 1;
- D_RETURN;
-}
-
-void
-e_view_file_try_to_show(E_View * v, E_File * f)
-{
- E_Icon *ic;
-
- D_ENTER;
- ic = e_icon_find_by_file(v, f->file);
- if (ic)
- {
- e_icon_update_state(ic);
- e_icon_initial_show(ic);
- }
- v->changed = 1;
- D_RETURN;
-}
-
-void
-e_view_file_delete(E_View * v, E_File * f)
-{
- E_Icon *ic;
-
- D_ENTER;
-
- ic = e_icon_find_by_file(v, f->file);
- if (ic)
- {
- e_icon_hide(ic);
- v->icons = evas_list_remove(v->icons, ic);
- e_object_unref(E_OBJECT(ic));
- v->changed = 1;
- v->extents.valid = 0;
- e_view_queue_resort(v);
- }
- D_RETURN;
-}
-
-void
-e_view_layout_reload(E_View * v)
-{
- D_ENTER;
- if (!v || !v->look)
- D_RETURN;
-
- if (e_object_unref(E_OBJECT(v->layout)) == 0)
- v->layout = NULL;
-
- /* try load a new layout */
- v->layout = e_view_layout_new(v);
-
- /* if the layout loaded and theres an evas - we're realized */
- /* so realize the layout */
- if ((v->layout) && (v->evas))
- e_view_layout_realize(v->layout);
-
- e_view_layout_update(v->layout);
-
- v->changed = 1;
- D_RETURN;
-}
-
-
-void
-e_view_ib_reload(E_View * v)
-{
- D_ENTER;
-
-
- /* if we have an iconbar.. well nuke it */
- if (e_object_unref(E_OBJECT(v->iconbar)) == 0)
- v->iconbar = NULL;
-
- /* no iconbar in our look */
- if(!v->look->obj->icb || !v->look->obj->icb_bits)
- D_RETURN;
-
- /* try load a new iconbar */
- if (!v->iconbar)
- v->iconbar = e_iconbar_new(v);
-
- /* if the iconbar loaded and theres an evas - we're realized */
- /* so realize the iconbar */
- if ((v->iconbar) && (v->evas))
- e_iconbar_realize(v->iconbar);
-
- D_RETURN;
-}
-
-void
-e_view_bg_reload(E_View * v)
-{
- E_Background bg = NULL;
-
- /* This should only be called if the background did really
- * change in the underlying dir. We dont check again
- * here. */
- D_ENTER;
-
- if (!v || !v->look)
- D_RETURN;
-
- /* nuke the old one */
- if (v->bg)
- {
- int size;
-
- e_bg_free(v->bg);
- v->bg = NULL;
- if (v->evas)
- {
- size = evas_image_cache_get(v->evas);
- evas_image_cache_flush(v->evas);
- evas_image_cache_set(v->evas, size);
- }
- e_db_flush();
- }
- if(v->look->obj->bg)
- {
- bg = e_bg_load(v->look->obj->bg);
- }
- else
- {
- /* Our look doesnt provide a bg, falls back */
- char buf[PATH_MAX];
- if(v->is_desktop)
- snprintf(buf, PATH_MAX, "%s/default.bg.db", e_config_get("backgrounds"));
- else
- snprintf(buf, PATH_MAX, "%s/view.bg.db", e_config_get("backgrounds"));
-
- bg = e_bg_load(buf);
- }
- if (bg)
- {
- v->bg = bg;
- if (v->evas)
- {
- e_bg_add_to_evas(v->bg, v->evas);
- e_bg_set_scroll(v->bg, v->scroll.x, v->scroll.y);
- e_bg_set_layer(v->bg, 100);
- e_bg_resize(v->bg, v->size.w, v->size.h);
-
- e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_UP, e_bg_up_cb, v);
- e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
- e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_MOVE, e_bg_move_cb, v);
-
- e_bg_show(v->bg);
- }
- }
- v->changed = 1;
- D_RETURN;
-}
-
-void
-e_view_init(void)
-{
- D_ENTER;
-
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_IN, e_mouse_in);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_OUT, e_mouse_out);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_WHEEL, e_wheel);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_CONFIGURE, e_configure);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_PROPERTY, e_property);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_UNMAP, e_unmap);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_VISIBILITY, e_visibility);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_IN, e_focus_in);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_OUT, e_focus_out);
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_DELETE, e_delete);
- /* dnd source handlers */
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_STATUS, e_dnd_status);
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DATA_REQUEST,
- e_dnd_data_request);
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_END, e_dnd_drop_end);
- /* dnd target handlers */
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_POSITION,
- e_dnd_drop_position);
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP, e_dnd_drop);
- ecore_event_filter_handler_add(ECORE_EVENT_DND_DROP_REQUEST,
- e_dnd_drop_request);
-
- ecore_event_filter_idle_handler_add(e_idle, NULL);
-
- D_RETURN;
-}
-
-/*
- * send the dnd data to the target app
- *
- * uri-list (http://www.faqs.org/rfcs/rfc2483.html)
- * URL formatting per RFC 1738
- * (or not. Looks like a lot of apps ignore this. So do we! )
- */
-static void
-e_dnd_data_request(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Data_Request *e;
-
- /*
- * typedef struct _ecore_event_dnd_data_request
- * {
- * Window win, root, source_win;
- * int plain_text;
- * Atom destination_atom;
- * } Ecore_Event_Dnd_Data_Request;
- */
- E_View *v;
- Evas_List * ll;
- char *data = NULL;
-
- D_ENTER;
- /* Me, my null, and an extra for the end '/r/n'... */
- e_strdup(data, "");
-
- e = ev->event;
- if (!(v = e_view_machine_get_view_by_base_window(e->win)))
- D_RETURN;
-
- if (e->uri_list)
- {
- int first = 1;
-
- for (ll = v->icons; ll; ll = ll->next)
- {
- E_Icon *ic;
-
- ic = ll->data;
- if (ic->state.selected)
- {
- int size;
- char buf[PATH_MAX];
-
- if (first)
- {
- /*FIXME */
- snprintf(buf, PATH_MAX, "file:%s/%s", v->dir->dir,
- ic->file->file);
- first = 0;
- }
- else
- /* FIXME */
- snprintf(buf, PATH_MAX, "\r\nfile:%s/%s", v->dir->dir,
- ic->file->file);
- size = strlen(data) + strlen(buf) + 1;
- REALLOC(data, char, size);
-
- strncat(data, buf, size);
- }
- }
- ecore_dnd_send_data(e->source_win, e->win,
- data, strlen(data) + 1,
- e->destination_atom, DND_TYPE_URI_LIST);
- }
- else if (e->plain_text)
- {
- int first = 1;
-
- for (ll = v->icons; ll; ll = ll->next)
- {
- E_Icon *ic;
-
- ic = ll->data;
- if (ic->state.selected)
- {
- int size;
- char buf[PATH_MAX];
-
- if (first)
- {
- /*FIXME */
- snprintf(buf, PATH_MAX, "%s/%s\n", v->dir->dir,
- ic->file->file);
- first = 0;
- }
- else
- /*FIXME */
- snprintf(buf, PATH_MAX, "\n%s/%s", v->dir->dir,
- ic->file->file);
- size = strlen(data) + strlen(buf) + 1;
- REALLOC(data, char, size);
-
- strncat(data, buf, size);
- }
- }
- ecore_dnd_send_data(e->source_win, e->win,
- data, strlen(data) + 1,
- e->destination_atom, DND_TYPE_PLAIN_TEXT);
- }
- else /* if (e->moz_url) */
- {
- FREE(data);
- data = NULL;
-
- for (ll = v->icons; ll; ll = ll->next)
- {
- E_Icon *ic;
-
- ic = ll->data;
- if (ic->state.selected)
- {
- char buf[16384];
-
- /* FIXME */
- snprintf(buf, PATH_MAX, "file:%s/%s", v->dir->dir,
- ic->file->file);
- data = strdup(buf);
- break;
- }
- }
- if (data)
- {
- ecore_dnd_send_data(e->source_win, e->win,
- data, strlen(data) + 1,
- e->destination_atom, DND_TYPE_NETSCAPE_URL);
- }
- }
- IF_FREE(data);
- D_RETURN;
-}
-
-static void
-e_dnd_drop_end(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Drop_End *e;
-
- /*
- * * typedef struct _ecore_event_dnd_drop_end
- * * {
- * * Window win, root, source_win;
- * * } Ecore_Event_Dnd_Drop_End;
- */
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- if (v_dnd_source)
- {
- if (dnd_pending_mode != E_DND_DELETED &&
- dnd_pending_mode != E_DND_COPIED)
- {
- dnd_pending_mode = E_DND_COPIED;
- }
- if (v_dnd_source->drag.matching_drop_attempt)
- {
- v_dnd_source->drag.matching_drop_attempt = 0;
- dnd_pending_mode = E_DND_COPIED;
- }
- v_dnd_source->changed = 1;
- v_dnd_source->drag.icon_show = 1;
- }
-
- e_dnd_drop_request_free();
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_dnd_drop_position(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Drop_Position *e;
-
- /*
- * typedef struct _ecore_event_dnd_drop_position
- * {
- * Window win, root, source_win;
- * int x, y;
- * } Ecore_Event_Dnd_Drop_Position;
- */
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- if (v->iconbar)
- {
- if (e->x >= v->iconbar->icon_area.x &&
- e->x <= v->iconbar->icon_area.x + v->iconbar->icon_area.w
- && e->y >= v->iconbar->icon_area.y
- && e->y <=
- v->iconbar->icon_area.y + v->iconbar->icon_area.h)
- {
- v->iconbar->dnd.x = e->x;
- v->iconbar->dnd.y = e->y;
- /* for iconbar drops, allow from same view */
- v->drag.matching_drop_attempt = 0;
- dnd_pending_mode = E_DND_ICONBAR_ADD;
- }
- }
-
- /* send XdndStatus (even to same view, we'll */
- /* ignore actions within the same view later */
- /* during the drop action.) */
- ecore_window_dnd_send_status_ok(v->win.base, e->source_win,
- v->location.x, v->location.y,
- v->size.w, v->size.h);
-
- /* todo - cache window extents, don't send again within these extents. */
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_dnd_drop(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Drop *e;
-
- /*
- * typedef struct _ecore_event_dnd_drop
- * {
- * Window win, root, source_win;
- * } Ecore_Event_Dnd_Drop;
- */
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- /* Dropped! Handle data */
- /* Same view or same underlying dir? Mark to skip action */
- if (e->win == e->source_win || v->dir == v_dnd_source->dir)
- v_dnd_source->drag.matching_drop_attempt = 1;
- /* Perform the action... */
- e_dnd_handle_drop(v);
-
- ecore_window_dnd_send_finished(v->win.base, e->source_win);
- e_dnd_drop_request_free();
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_dnd_drop_request(Ecore_Event * ev)
-{
- Ecore_Event_Dnd_Drop_Request *e;
-
- /*
- * typedef struct _ecore_event_dnd_drop_request
- * {
- * Window win, root, source_win;
- * int num_files;
- * char **files;
- * int copy, link, move;
- * } Ecore_Event_Dnd_Drop_Request;
- */
- E_View *v;
-
- D_ENTER;
-
- e = ev->event;
- if (e && e->win)
- {
- if ((v = e_view_machine_get_view_by_base_window(e->win)))
- {
- /* if it exists, we already have the data... */
- if ((!dnd_files) && (e->num_files > 0))
- {
- int i;
-
- dnd_files = NEW_PTR(e->num_files);
-
- /* copy the file list locally, for use in a dnd_drop */
- for (i = 0; i < e->num_files; i++)
- dnd_files[i] = strdup(e->files[i]);
-
- dnd_num_files = e->num_files;
-
- /* if the dnd source is e itself then dont use the event mode */
- if ((v ==
- e_view_machine_get_view_by_base_window(e->source_win)))
- {
- dnd_pending_mode = v->drag.drop_mode;
- }
- else
- {
- if (e->copy)
- dnd_pending_mode = E_DND_COPY;
- else if (e->move)
- dnd_pending_mode = E_DND_MOVE;
- else if (e->link)
- dnd_pending_mode = E_DND_LINK;
- else
- dnd_pending_mode = E_DND_ASK;
- }
- }
- }
- }
-
- D_RETURN;
-}
-
-static void
-e_dnd_drop_request_free(void)
-{
- D_ENTER;
-
- if (dnd_files)
- {
- int i;
-
- for (i = 0; i < dnd_num_files; i++)
- FREE(dnd_files[i]);
-
- FREE(dnd_files);
-
- dnd_num_files = 0;
- }
- D_RETURN;
-}
-
-static void
-e_dnd_handle_drop(E_View * v)
-{
- int in, out;
- char *filename;
-
- D_ENTER;
-
- /* Make space for destination in file list */
- dnd_num_files++;
- REALLOC_PTR(dnd_files, dnd_num_files);
- dnd_files[dnd_num_files - 1] = NULL;
-
- /* Verify files are local, convert to non-URL */
- for (in = 0, out = 0; in < dnd_num_files - 1; in++)
- {
- filename = e_util_de_url_and_verify(dnd_files[in]);
- /* Need a overlap safe copy here, like memmove() */
- if (filename)
- memmove(dnd_files[out++], filename, strlen(filename) + 1);
- }
-
- /* Append destination for efsd */
- if (dnd_files[out])
- FREE(dnd_files[out]);
-
- dnd_files[out++] = strdup(v->dir->dir);
-
- switch (dnd_pending_mode)
- {
- case E_DND_COPY:
- /* Copy files */
- efsd_copy(e_fs_get_connection(), out, dnd_files, efsd_ops(0));
- dnd_pending_mode = E_DND_COPIED;
- break;
- case E_DND_MOVE:
- efsd_move(e_fs_get_connection(), out, dnd_files, efsd_ops(0));
- dnd_pending_mode = E_DND_DELETED;
- break;
- case E_DND_ICONBAR_ADD:
- e_iconbar_dnd_add_files(v, v_dnd_source, out, dnd_files);
- /*FIXME: should this be ICONBAR_ADDED? */
- dnd_pending_mode = E_DND_NONE;
- default:
- /* nothing yet */
- break;
- }
-
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_VIEW_H
-#define E_VIEW_H
-
-#include "e.h"
-/*#include "background.h"*/
-#include "scrollbar.h"
-#include "fs.h"
-#include "iconbar.h"
-#include "object.h"
-#include "e_view_look.h"
-#include "e_dir.h"
-#include "e_file.h"
-#include "view_layout.h"
-#include "observer.h"
-
-/*typedef int EVAS_RENDER_METHOD;*/
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-#ifndef E_ICON_TYPEDEF
-#define E_ICON_TYPEDEF
-typedef struct _E_Icon E_Icon;
-#endif
-
-#ifndef E_ICONBAR_TYPEDEF
-#define E_ICONBAR_TYPEDEF
-typedef struct _E_Iconbar E_Iconbar;
-#endif
-
-#ifndef E_DIR_TYPEDEF
-#define E_DIR_TYPEDEF
-typedef struct _E_Dir E_Dir;
-#endif
-
-#ifndef E_VIEW_LAYOUT_TYPEDEF
-#define E_VIEW_LAYOUT_TYPEDEF
-typedef struct _E_View_Layout E_View_Layout;
-typedef struct _E_View_Layout_Element E_View_Layout_Element;
-#endif
-
-#ifndef E_SCROLLBAR_TYPEDEF
-#define E_SCROLLBAR_TYPEDEF
-typedef struct _E_Scrollbar E_Scrollbar;
-#endif
-
-#ifndef E_VIEW_LOOK_TYPEDEF
-#define E_VIEW_LOOK_TYPEDEF
-typedef struct _E_View_Look E_View_Look;
-typedef struct _E_View_Look_Objects E_View_Look_Objects;
-#endif
-
-
-typedef enum
-{
- E_DND_NONE,
- E_DND_COPY,
- E_DND_MOVE,
- E_DND_LINK,
- E_DND_ASK,
- E_DND_DELETED,
- E_DND_COPIED,
- E_DND_ICONBAR_ADD
-}
-E_dnd_enum;
-
-struct _E_View
-{
- E_Observer o;
-
- char *name;
-
- E_Dir *dir;
-
- struct
- {
- /* Evas_Render_Method render_method;*/
- int back_pixmap;
- }
- options;
-
- Evas * evas;
- struct
- {
- Window base;
- Window main;
- }
- win;
- Pixmap pmap;
- struct
- {
- int w, h;
- int force;
- }
- size;
- struct
- {
- int x, y;
- }
- scroll;
- struct
- {
- int x, y;
- }
- location;
-
- struct
- {
- /* +-----------------+
- * | Wt |
- * | +-----------+ |
- * |Wl| |Wr|
- * | | [I] Is | |
- * | | Ig | |
- * | | [txt] | |
- * | | Ib | |
- * | +-----------+ |
- * | Wb |
- * +-----------------+
- */
- struct
- {
- int l, r, t, b;
- }
- window;
- struct
- {
- int s, g, b;
- }
- icon;
- }
- spacing;
- struct
- {
- int on;
- /* The number of selected icons. */
- int count;
- /* The number of icons we selected the last time.
- * If this is > 0, we don't pop up menus when
- * the user clicks in a view. */
- int last_count;
- int x, y, w, h;
- struct
- {
- int x, y;
- }
- down;
-
- struct
- {
- struct
- {
- int r, g, b, a;
- }
- edge_l , edge_r, edge_t, edge_b,
- middle, grad_l, grad_r, grad_t, grad_b;
- struct
- {
- int l, r, t, b;
- }
- grad_size;
- }
- config;
- struct
- {
- Evas_Object * clip;
- Evas_Object * edge_l;
- Evas_Object * edge_r;
- Evas_Object * edge_t;
- Evas_Object * edge_b;
- Evas_Object * middle;
- Evas_Object * grad_l;
- Evas_Object * grad_r;
- Evas_Object * grad_t;
- Evas_Object * grad_b;
- }
- obj;
- }
- select;
-
- struct
- {
- int started;
- Window win;
- int x, y;
- struct
- {
- int x, y;
- }
- offset;
- int update;
- int drop_mode;
- int icon_hide;
- int icon_show;
- int matching_drop_attempt;
- }
- drag;
- struct
- {
- int valid;
- double x1, x2, y1, y2;
- }
- extents;
-
- E_Background bg;
- E_View_Layout *layout;
-
- struct
- {
- EfsdCmdId x, y, w, h;
- int busy;
- }
- geom_get;
-
- EfsdCmdId getbg;
-
- struct
- {
- E_Scrollbar *h, *v;
- }
- scrollbar;
-
- int is_listing;
-
- int is_desktop;
-
- E_Iconbar *iconbar;
-
- Evas_List * icons;
-
- int have_resort_queued;
-
- int changed;
-
- Evas_List * epplet_contexts;
- Ebits_Object epplet_layout;
-
- E_View_Look *look;
-};
-
-/**
- * e_view_init - View event handlers initialization.
- *
- * This function registers event handlers for the views.
- * Views are the windows in which e as a desktop shell
- * displays file icons.
- */
-void e_view_init(void);
-
-void e_view_selection_update(E_View * v);
-void e_view_deselect_all(E_View *v);
-void e_view_deselect_all_except(E_Icon * not_ic);
-Ecore_Event *e_view_get_current_event(void);
-int e_view_filter_file(E_View * v, char *file);
-void e_view_icons_get_extents(E_View * v, int *min_x, int *min_y,
- int *max_x, int *max_y);
-void e_view_icons_apply_xy(E_View * v);
-void e_view_scroll_to(E_View * v, int sx, int sy);
-void e_view_scroll_by(E_View * v, int sx, int sy);
-void e_view_scroll_to_percent(E_View * v, double psx,
- double psy);
-void e_view_get_viewable_percentage(E_View * v, double *vw,
- double *vh);
-void e_view_get_position_percentage(E_View * v, double *vx,
- double *vy);
-
-void e_view_resort_alphabetical(E_View * v);
-void e_view_arrange(E_View * v);
-void e_view_resort(E_View * v);
-void e_view_queue_geometry_record(E_View * v);
-void e_view_queue_icon_xy_record(E_View * v);
-void e_view_queue_resort(E_View * v);
-
-/**
- * e_view_new - Creates a new view object
- *
- * This function creates a new view and sets default
- * properties on it, such as colors and icon spacings.
- */
-E_View *e_view_new(void);
-
-/**
- * e_view_set_dir - Sets view to a given directory
- * @v The view for which to set the directory
- * @dir The directory to set the view to
- *
- * This function sets a view to a directory, loading the
- * view's metadata (view window coordinates etc). If a dir already
- * exists for this dir, it is reused, otherwise a new on is created.
- */
-void e_view_set_dir(E_View * v, char *dir);
-
-/**
- * e_view_set_look - Sets view to a given look
- * @v The view for which to set the directory
- * @dir The directory that contains the look
- *
- * This function sets a directory containing layout information and background
- * and iconbar dbs for the view. */
-void e_view_set_look(E_View * v, char *dir);
-
-/**
- * e_view_populate - Draws icons for all files in view
- * @v The view to populate
- *
- * Goes through the list of files in the underlying dir and calls
- * view_add_file for each one. This results in icons being created for each
- * file.
- */
-void e_view_populate(E_View * v);
-
-/**
- * e_view_realize - Initializes a view's graphics and content
- * @v: The view to initialize
- *
- * This function initializes a created view by loading
- * all the graphics and creating the evas.
- */
-void e_view_realize(E_View * v);
-
-/**
- * e_view_update - Redraws a view
- * @v: The view to redraw
- *
- * If the contents of the view have changed, this function redraws it.
- */
-void e_view_update(E_View * v);
-
-void e_view_bg_reload(E_View * v);
-void e_view_ib_reload(E_View * v);
-void e_view_layout_reload(E_View * v);
-
-void e_view_file_add(E_View * v, E_File * file);
-void e_view_file_changed(E_View * v, E_File * file);
-void e_view_file_delete(E_View * v, E_File * file);
-void e_view_file_try_to_show(E_View * v, E_File * file);
-
-void e_view_close_all(void);
-
-#endif
+++ /dev/null
-#include "e.h"
-#include "desktops.h"
-#include "util.h"
-
-static void e_view_layout_cleanup(E_View_Layout *layout);
-static int e_view_layout_add_element(E_View_Layout *layout, char *name);
-
-E_View_Layout *
-e_view_layout_new(E_Desktop *d)
-{
- E_View_Layout *layout;
-
- D_ENTER;
-
- layout = NEW(E_View_Layout, 1);
- ZERO(layout, E_View_Layout, 1);
-
- e_object_init(E_OBJECT(layout), (E_Cleanup_Func) e_view_layout_cleanup);
-
- layout->desktop = d;
-
- D_RETURN_(layout);
-}
-
-static void
-e_view_layout_cleanup(E_View_Layout *layout)
-{
- Evas_List * l;
-
- D_ENTER;
-
- /* cleanup the elements */
- for (l = layout->elements; l; l = l->next)
- {
- E_View_Layout_Element *el = l->data;
- if (el)
- {
- D("cleanup element: %s\n", el->name);
- if (el->name) FREE(el->name);
- FREE(el);
- }
- }
- evas_list_free(layout->elements);
-
- /* free the bits */
- if (layout->bits) ebits_free(layout->bits);
- /* cleanup the base object */
- e_object_cleanup(E_OBJECT(layout));
-
- D_RETURN;
-}
-
-void
-e_view_layout_realize(E_View_Layout *layout)
-{
- Ebits_Object bits;
- Evas_List * l;
-
- if (!layout) D_RETURN;
-
- D_ENTER;
-
- if (layout->desktop->look->obj->layout)
- bits = ebits_load(layout->desktop->look->obj->layout);
- else
- {
- /* Our look doesnt provide a layout, falls back */
- char buf[PATH_MAX];
- snprintf(buf, PATH_MAX, "%sdesktop.bits.db", e_config_get("layout"));
-
- bits = ebits_load(buf);
- }
- if (bits)
- {
- D("layout bits loaded!\n")
- layout->bits = bits;
- layout->mod_time = ecore_get_time();
- if (layout->desktop->evas)
- {
- ebits_add_to_evas(layout->bits, layout->desktop->evas);
- ebits_move(layout->bits, 0, 0);
- ebits_resize(layout->bits, layout->desktop->real.w,
- layout->desktop->real.h);
- D("add layout- w:%i, h:%i\n", layout->desktop->real.w,
- layout->desktop->real.h);
- for (l = ebits_get_bit_names(layout->bits); l; l = l->next)
- {
- char *name = l->data;
-
- e_view_layout_add_element(layout, name);
- }
- }
- }
- else
- {
- D("ERROR: can't load layout\n");
- }
- D_RETURN;
-}
-
-static int
-e_view_layout_add_element(E_View_Layout *layout, char *name)
-{
- E_View_Layout_Element *el;
- Evas_List * l;
- double x, y, w, h;
-
- D_ENTER;
-
- el = NEW(E_View_Layout_Element, 1);
- ZERO(el, E_View_Layout_Element, 1);
-
- e_strdup(el->name, name);
-
- for (l = ebits_get_bit_names(layout->bits); l; l = l->next)
- {
- char *name = l->data;
- if (!strcmp(name, el->name))
- {
- ebits_get_named_bit_geometry(layout->bits, el->name, &x, &y, &w, &h);
-
- el->x = x;
- el->y = y;
- el->w = w;
- el->h = h;
-
- D("add element: %s, %f, %f, %f, %f\n", el->name, x, y, w, h);
-
- layout->elements = evas_list_append(layout->elements, el);
- D_RETURN_(1);
- }
- }
-
- D("no element of with this name\n");
- FREE(el->name);
- FREE(el);
- D_RETURN_(0);
-}
-
-int
-e_view_layout_delete_element(E_View_Layout *layout, char *name)
-{
- Evas_List * l;
-
- D_ENTER;
-
- for (l = layout->elements; l; l = l->next)
- {
- E_View_Layout_Element *el = l->data;
-
- if (!strcmp(name, el->name))
- {
- FREE(el->name);
- layout->elements = evas_list_remove(layout->elements, el);
- FREE(el);
-
- D_RETURN_(1);
- }
- }
-
- D("no element of with this name\n");
- D_RETURN_(0);
-}
-int
-e_view_layout_get_element_geometry(E_View_Layout *layout, char *name,
- double *x, double *y, double *w, double *h)
-{
- Evas_List * l;
- D_ENTER;
- if (layout && name)
- {
- for (l = layout->elements; l; l = l->next)
- {
- E_View_Layout_Element *el = l->data;
-
- if (!strcmp(name, el->name))
- {
-
- if (x) *x = el->x;
- if (y) *y = el->y;
- if (w) *w = el->w;
- if (h) *h = el->h;
-
- D_RETURN_(1);
- }
- }
- }
- D_RETURN_(0);
-}
-
-void
-e_view_layout_update(E_View_Layout *layout)
-{
- Evas_List * l;
- double x, y, w, h;
- D_ENTER;
-
- if (!layout || !layout->bits)
- D_RETURN;
- /* move/resize bits */
- ebits_move(layout->bits, 0, 0);
- ebits_resize(layout->bits, layout->desktop->real.w, layout->desktop->real.h);
- D("update layout- w:%i, h:%i\n", layout->desktop->real.w,
- layout->desktop->real.h);
-
- /* update elements */
- for (l = layout->elements; l; l = l->next)
- {
- E_View_Layout_Element *el = l->data;
- double x, y, w, h;
-
- ebits_get_named_bit_geometry(layout->bits, el->name, &x, &y, &w, &h);
-
- el->x = x;
- el->y = y;
- el->w = w;
- el->h = h;
- }
-
- /* FIXME: the icon layout should probably be totally redone */
- if (e_view_layout_get_element_geometry(layout, "Icons",
- &x, &y, &w, &h))
- {
- /* layout->desktop->spacing.window.l = x;
- layout->desktop->spacing.window.r = layout->desktop->size.w - (x + w);
- layout->desktop->spacing.window.t = y;
- layout->desktop->spacing.window.b = layout->desktop->size.h - (y + h);
- */
- }
- if (e_view_layout_get_element_geometry(layout, "Scrollbar_H",
- &x, &y, &w, &h))
- {
- /* e_scrollbar_move(layout->desktop->scrollbar.h, x, y);
- e_scrollbar_resize(layout->desktop->scrollbar.h, w, h); */
- }
-
- if (e_view_layout_get_element_geometry(layout, "Scrollbar_V",
- &x, &y, &w, &h))
- {
- /* e_scrollbar_move(layout->desktop->scrollbar.v, x, y);
- e_scrollbar_resize(layout->desktop->scrollbar.v, w, h); */
- }
-
- if (layout->desktop->iconbar)
- e_iconbar_fix(layout->desktop->iconbar);
- D_RETURN;
-}
+++ /dev/null
-#ifndef E_VIEW_LAYOUT_H
-#define E_VIEW_LAYOUT_H
-
-#include "e.h"
-#include "e_view_look.h"
-#include "object.h"
-
-#ifndef E_VIEW_LAYOUT_TYPEDEF
-#define E_VIEW_LAYOUT_TYPEDEF
-typedef struct _E_View_Layout E_View_Layout;
-typedef struct _E_View_Layout_Element E_View_Layout_Element;
-#endif
-
-#ifndef E_VIEW_TYPEDEF
-#define E_VIEW_TYPEDEF
-typedef struct _E_View E_View;
-#endif
-
-struct _E_View_Layout
-{
- E_Object o;
-
- E_Desktop *desktop;
-
- Ebits_Object bits;
-
- Evas_List * elements;
-
- time_t mod_time;
-};
-
-struct _E_View_Layout_Element
-{
- char *name;
- double x, y, w, h;
-};
-
-E_View_Layout *e_view_layout_new(E_Desktop *d);
-void e_view_layout_realize(E_View_Layout *layout);
-void e_view_layout_update(E_View_Layout *layout);
-
-void e_view_layout_add_new_element(E_View_Layout *layout, char *name);
-
-/**
- * e_view_layout_get_element_geometry - Get element geometry
- *
- * This function returns 1 if the element exists, and 0 if it doesn't.
- * It also sets the passed pointers (x, y, w, h) to the values of an
- * elements geometry.
- */
-int e_view_layout_get_element_geometry(E_View_Layout *layout, char *element,
- double *x, double *y, double *w,
- double *h);
-
-#endif
+++ /dev/null
-e_ipc_client
-Makefile.in
-Makefile
-.libs
-.deps
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-
-INCLUDES = \
- @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ebg_cflags@
-
-bin_PROGRAMS = e_img_import e_img_export e_setup
-
-e_img_import_SOURCES = \
-e_img_import.c
-
-e_img_import_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ -lm
-
-e_img_export_SOURCES = \
-e_img_export.c
-
-e_img_export_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ -lm
-
-e_setup_SOURCES = \
-e_setup.c
-
-e_setup_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @ebg_libs@ -lm
+++ /dev/null
-#include <X11/Xlib.h>
-#include <Imlib2.h>
-#include <Edb.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-static int sort_compare(const void *v1, const void *v2);
-
-static int
-sort_compare(const void *v1, const void *v2)
-{
- return strcmp(*(char **)v1, *(char **)v2);
-}
-
-int main(int argc, char **argv)
-{
- Imlib_Image im;
-
- if (argc == 1)
- {
- printf("usage:\n\t%s src.db:/key/in/db dest_image\n", argv[0]);
- printf("usage:\n\t%s src.db\n", argv[0]);
- exit(-1);
- }
- if (argc == 2)
- {
- E_DB_File *db;
- char **keys;
- int keys_num;
- int i;
-
- db = e_db_open_read(argv[1]);
- if (!db)
- {
- printf("Cannot load db:\n");
- printf(" %s\n", argv[1]);
- exit(0);
- }
- keys_num = 0;
- keys = e_db_dump_key_list(argv[1], &keys_num);
- qsort(keys, keys_num, sizeof(char *), sort_compare);
- printf("Possible images in db file:\n");
- printf(" %s\n", argv[1]);
- printf("Possible entries: %i\n", keys_num);
- printf(" filtering out known non-image entries...\n");
- printf("---\n");
- for (i = 0; i < keys_num; i++)
- {
- char *t;
- char *type;
-
- type = e_db_type_get(db, keys[i]);
- if (
- (!type) ||
- (
- (!(!strcmp(type, "int"))) &&
- (!(!strcmp(type, "float"))) &&
- (!(!strcmp(type, "str")))
- )
- )
- printf("%s:%s\n", argv[1], keys[i]);
- if (type) free(type);
- }
- e_db_close(db);
- e_db_flush();
- exit(0);
- }
- im = imlib_load_image(argv[1]);
- if (im)
- {
- imlib_context_set_image(im);
- imlib_image_attach_data_value("compression", NULL, 9, NULL);
- imlib_image_set_format("png");
- imlib_save_image(argv[2]);
- }
- return 0;
-}
+++ /dev/null
-#include <X11/Xlib.h>
-#include <Imlib2.h>
-
-int main(int argc, char **argv)
-{
- Imlib_Image im;
-
- if (argc == 1)
- {
- printf("usage:\n\t%s source_image.png dest.db:/key/in/db\n", argv[0]);
- exit(-1);
- }
- im = imlib_load_image(argv[1]);
- if (im)
- {
- imlib_context_set_image(im);
- imlib_image_attach_data_value("compression", NULL, 9, NULL);
- imlib_image_set_format("db");
- imlib_save_image(argv[2]);
- }
- return 0;
-}
+++ /dev/null
-#include <X11/Xlib.h>
-#include <Evas.h>
-#include <Evas_Engine_Software_X11.h>
-#include <Ebits.h>
-#include <Ecore.h>
-#include <Edb.h>
-#include <Ebg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <math.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <fnmatch.h>
-#include <errno.h>
-#include "../config.h"
-
-#ifndef PATH_MAX
-#define PATH_MAX 4096
-#endif
-
-/* stuff we want from e */
-#define OBJ_PROPERTIES \
-int references; \
-void (*e_obj_free) (void *e_obj);
-#define OBJ_INIT(_e_obj, _e_obj_free_func) \
-{ \
- _e_obj->references = 1; \
- _e_obj->e_obj_free = (void *) _e_obj_free_func; \
-}
-#define OBJ_REF(_e_obj) _e_obj->references++
-#define OBJ_UNREF(_e_obj) _e_obj->references--
-#define OBJ_IF_FREE(_e_obj) if (_e_obj->references == 0)
-#define OBJ_FREE(_e_obj) _e_obj->e_obj_free(_e_obj);
-#define OBJ_DO_FREE(_e_obj) \
-{ \
- OBJ_UNREF(_e_obj); \
- OBJ_IF_FREE(_e_obj) \
- { \
- OBJ_FREE(_e_obj); \
- } \
-}
-#define e_strdup(__dest, __var) \
-{ \
-if (!__var) __dest = NULL; \
-else { \
-__dest = malloc(strlen(__var) + 1); \
-if (__dest) strcpy(__dest, __var); \
-} }
-
-#define RENDER_METHOD_ALPHA_SOFTWARE 0
-
-Evas *
-e_evas_new_all(Display *disp, Window parent_window,
- int x, int y, int win_w, int win_h,
- int render,
- int max_colors, int fc, int ic,
- char *font_dir);
-Window
-e_evas_get_window(Evas *evas);
-
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-/* */
-
-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;
-}
-
-char *
-e_file_home(void)
-{
- static char *home = NULL;
-
- if (home) return home;
- home = getenv("HOME");
- if (!home) home = getenv("TMPDIR");
- if (!home) home = "/tmp";
- return home;
-}
-
-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;
-}
-
-void
-e_file_mkdirs(char *s)
-{
- char ss[PATH_MAX];
- int i, ii;
-
- i = 0;
- ii = 0;
- while (s[i])
- {
- ss[ii++] = s[i];
- ss[ii] = 0;
- if (s[i] == '/')
- {
- if (!e_file_exists(ss))
- e_file_mkdir(ss);
- else if (!e_file_is_dir(ss))
- return;
- }
- i++;
- }
-}
-
-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;
-}
-
-void
-e_file_delete(char *s)
-{
- unlink(s);
-}
-
-void
-e_file_rename(char *s, char *ss)
-{
- rename(s, ss);
-}
-
-int
-e_glob_matches(char *str, char *glob)
-{
- if (!fnmatch(glob, str, 0)) return 1;
- return 0;
-}
-
-char *
-e_file_get_file(char *file)
-{
- char *p;
- char *f;
-
- p = strrchr(file, '/');
- if (!p)
- {
- e_strdup(f, file);
- return f;
- }
- e_strdup(f, &(p[1]));
- return f;
-}
-
-char *
-e_file_get_dir(char *file)
-{
- char *p;
- char *f;
- char buf[PATH_MAX];
-
- strcpy(buf, file);
- p = strrchr(buf, '/');
- if (!p)
- {
- e_strdup(f, file);
- return f;
- }
- *p = 0;
- e_strdup(f, buf);
- return f;
-}
-
-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_link(char *link)
-{
- char buf[PATH_MAX];
- char *f;
- int count;
-
- if ((count = readlink(link, buf, sizeof(buf))) < 0) return NULL;
- buf[count] = 0;
- e_strdup(f, buf);
- return f;
-}
-
-Evas_List *
-e_file_list_dir(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)
- {
- e_strdup(f, dp->d_name);
- list = evas_list_prepend_relative(list, f, l->data);
- break;
- }
- }
- /* nowhwre to go? just append it */
- e_strdup(f, dp->d_name);
- if (!l) list = evas_list_append(list, f);
- }
- }
- closedir(dirp);
- return list;
-}
-
-void
-e_file_list_dir_free(Evas_List * list)
-{
- while (list)
- {
- FREE(list->data);
- list = evas_list_remove(list, list->data);
- }
-}
-
-/* */
-/* */
-/* */
-
-typedef struct _text_zone Text_Zone;
-typedef struct _text_zone_button Text_Zone_Button;
-
-struct _text_zone
-{
- double x, y;
-
- Evas_Object * clip;
- Ebits_Object *bg;
-
- struct {
- double x, y, w, h;
- } l;
- struct {
- double x, y, w, h;
- } b;
-
- struct {
- double dx, dy;
- int go;
- } move;
- Evas_List * lines;
- Evas_List * buttons;
-};
-
-struct _text_zone_button
-{
- Evas_Object * label;
- Ebits_Object *bg;
-
- double x, y, w, h;
- void (*func) (void *data);
- void *func_data;
-};
-
-Window win_main;
-Window win_evas;
-Evas *evas;
-double scr_w, scr_h;
-Evas_Object * pointer;
-
-/* our stuff */
-void idle(void *data);
-void window_expose(Ecore_Event * ev);
-void mouse_move(Ecore_Event * ev);
-void mouse_down(Ecore_Event * ev);
-void mouse_up(Ecore_Event * ev);
-void key_down(Ecore_Event * ev);
-void child_exit(Ecore_Event *ev);
-void setup(void);
-Text_Zone *txz_new(double x, double y, char *text);
-void txz_free(Text_Zone *txz);
-void txz_show(Text_Zone *txz);
-void txz_hide(Text_Zone *txz);
-void txz_move(Text_Zone *txz, double x, double y);
-void txz_text(Text_Zone *txz, char *text);
-void txz_button(Text_Zone *txz, char *text, void (*func) (void *data), void *data);
-void txz_adjust_txt(Text_Zone *txz);
-void animate_logo(int v, void *data);
-
-void
-idle(void *data)
-{
- evas_render(evas);
-}
-
-void
-window_expose(Ecore_Event * ev)
-{
- Ecore_Event_Window_Expose *e;
-
- e = (Ecore_Event_Window_Expose *)ev->event;
- evas_damage_rectangle_add(evas, e->x, e->y, e->w, e->h);
-}
-
-void
-mouse_move(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Move *e;
-
- e = (Ecore_Event_Mouse_Move *)ev->event;
- evas_object_move(pointer,
- evas_coord_screen_x_to_world(evas, e->x),
- evas_coord_screen_y_to_world(evas, e->y));
- evas_event_feed_mouse_move(evas, e->x, e->y);
-}
-
-void
-mouse_down(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Down *e;
-
- e = (Ecore_Event_Mouse_Down *)ev->event;
- evas_event_feed_mouse_down(evas, e->button);
-}
-
-void
-mouse_up(Ecore_Event * ev)
-{
- Ecore_Event_Mouse_Up *e;
-
- e = (Ecore_Event_Mouse_Up *)ev->event;
- evas_event_feed_mouse_up(evas, e->button);
-}
-
-void
-key_down(Ecore_Event * ev)
-{
- Ecore_Event_Key_Down *e;
-
- e = ev->event;
- if (!strcmp(e->key, "Escape"))
- {
- exit(0);
- }
-}
-
-void
-child_exit(Ecore_Event *ev)
-{
- Ecore_Event_Child *e;
-
- e = ev->event;
-/*
- e->pid;
- e->exit_code;
- */
-}
-
-void
-setup(void)
-{
- int root_w, root_h;
- E_Background bg;
-
- ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, window_expose);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, mouse_move);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, mouse_down);
- ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, mouse_up);
- ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, key_down);
- ecore_event_filter_handler_add(ECORE_EVENT_CHILD, child_exit);
-
- ecore_event_filter_idle_handler_add(idle, NULL);
-
- ecore_window_get_geometry(0, NULL, NULL, &root_w, &root_h);
- win_main = ecore_window_override_new(0, 0, 0, root_w, root_h);
- evas = e_evas_new_all(ecore_display_get(),
- win_main,
- 0, 0, root_w, root_w,
- RENDER_METHOD_ALPHA_SOFTWARE,
- 216, 1024 * 1024, 16 * 1024 * 1024,
- PACKAGE_DATA_DIR"/data/fonts/");
-
- bg = e_bg_load(PACKAGE_DATA_DIR"/data/setup/setup.bg.db");
- if (!bg)
- {
- /* FIXME: must detect this error better and tell user */
- printf("ERROR: Enlightenment not installed properly\n");
- exit(-1);
- }
- e_bg_add_to_evas(bg, evas);
- e_bg_resize(bg, root_w, root_h);
- e_bg_show(bg);
-
- pointer = evas_object_image_add(evas);
- evas_object_image_file_set(pointer,
- PACKAGE_DATA_DIR"/data/setup/pointer.png",
- NULL);
- evas_object_pass_events_set(pointer, 1);
- evas_object_layer_set(pointer, 1000000);
- evas_object_show(pointer);
-
- win_evas = e_evas_get_window(evas);
- ecore_window_set_events(win_evas, XEV_EXPOSE | XEV_BUTTON | XEV_MOUSE_MOVE | XEV_KEY);
- ecore_set_blank_pointer(win_evas);
-
- ecore_window_show(win_evas);
- ecore_window_show(win_main);
- ecore_keyboard_grab(win_evas);
-
- {
- Evas_Object * o;
- int w, h;
-
- o = evas_object_image_add(evas);
- evas_object_image_file_set(o,
- PACKAGE_DATA_DIR"/data/setup/logo.png",
- NULL);
- evas_object_image_size_get(o, &w, &h);
- evas_object_move(o, (root_w - w) / 2, -32);
- evas_object_layer_set(o, 20);
- evas_object_show(o);
- evas_object_pass_events_set(o, 1);
- }
- {
- Text_Zone *txz;
-
- txz = txz_new
- ((root_w - 512) / 2, 130,
- "7c Enlightenment\n"
- "4c \n"
- "4c Welcome to Enlightenment 0.17 (pre-release). This is the setup\n"
- "4c program. It will help you get a base configuration initialised\n"
- "4c for your user and do some initial tweaks and system queries.\n"
- "4c \n"
- "4c Please be patient and read the dialogs carefully, as your answers\n"
- "4c to questions posed will affect your initial setup of Enlightenment,\n"
- "4c and so your initial impressions.\n"
- "4c \n"
- "4c N.B. - during pre-release stages, this setup program may come up\n"
- "4c more than just once, as new setups need to be installed\n"
- );
- txz_button(txz, "OK", NULL, NULL);
- txz_button(txz, "Cancel", NULL, NULL);
-
- }
- {
- Evas_Object * o;
-
- o = evas_object_image_add(evas);
- evas_object_image_file_set(o,
- PACKAGE_DATA_DIR"/data/setup/anim/e001.png",
- NULL);
-
- evas_object_move(o, root_w - 120, -15);
- evas_object_layer_set(o, 30);
- evas_object_show(o);
- animate_logo(0, o);
- evas_object_pass_events_set(o, 1);
- }
- scr_w = root_w;
- scr_h = root_h;
-}
-
-static void
-_txz_cb_show(void *data)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- evas_object_show(l->data);
- }
- evas_object_show(txz->clip);
- }
-}
-
-static void
-_txz_cb_hide(void *data)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- evas_object_hide(l->data);
- }
- evas_object_hide(txz->clip);
- }
-}
-
-static void
-_txz_cb_move(void *data, double x, double y)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- txz->l.x = x;
- txz->l.y = y;
-}
-
-static void
-_txz_cb_resize(void *data, double w, double h)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- txz->l.w = w;
- txz->l.h = h;
-}
-
-static void
-_txz_cb_raise(void *data)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- evas_object_raise(l->data);
- }
- }
-}
-
-static void
-_txz_cb_lower(void *data)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- evas_object_lower(l->data);
- }
- }
-}
-
-static void
-_txz_cb_set_layer(void *data, int lay)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- evas_object_layer_set(l->data, lay);
- }
- }
-}
-
-static void
-_txz_cb_get_min_size(void *data, double *minw, double *minh)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- *minw = 0;
- *minh = 0;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- double w, h;
-
- evas_object_geometry_get(l->data, NULL, NULL, &w, &h);
- if (w > *minw) *minw = w;
- *minh += h;
- }
- }
- *minw += 8;
- *minh += 8;
-}
-
-static void
-_txz_cb_get_max_size(void *data, double *maxw, double *maxh)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- *maxw = 0;
- *maxh = 0;
- {
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- {
- double w, h;
-
- evas_object_geometry_get(l->data, NULL, NULL, &w, &h);
- if (w > *maxw) *maxw = w;
- *maxh += h;
- }
- }
- *maxw += 8;
- *maxh += 8;
-}
-
-static void
-_txz_cb_tb_move(void *data, double x, double y)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- txz->b.x = x;
- txz->b.y = y;
-}
-
-static void
-_txz_cb_tb_resize(void *data, double w, double h)
-{
- Text_Zone *txz;
-
- txz = (Text_Zone *)data;
- txz->b.w = w;
- txz->b.h = h;
-}
-
-static void
-_txz_cb_title_down(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- Text_Zone *txz;
-
- txz = _data;
- txz->move.go = 1;
- txz->move.dx = _x - txz->x;
- txz->move.dy = _y - txz->y;
-}
-
-static void
-_txz_cb_title_up(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- Text_Zone *txz;
-
- txz = _data;
- txz->move.go = 0;
-}
-
-static void
-_txz_cb_title_move(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- Text_Zone *txz;
-
- txz = _data;
- if (txz->move.go)
- {
- txz_move(txz, _x - txz->move.dx, _y - txz->move.dy);
- }
-}
-
-Text_Zone *
-txz_new(double x, double y, char *text)
-{
- Text_Zone *txz;
-
- txz = NEW(Text_Zone, 1);
- ZERO(txz, Text_Zone, 1);
-
- txz->x = 0;
- txz->y = 0;
-
- txz->clip = evas_object_rectangle_add(evas);
- evas_object_color_set(txz->clip, 255, 255, 255, 255);
- txz->bg = ebits_load(PACKAGE_DATA_DIR"/data/setup/textzone.bits.db");
- if (txz->bg)
- {
- ebits_add_to_evas(txz->bg, evas);
- ebits_set_layer(txz->bg, 9);
- ebits_set_named_bit_replace(txz->bg, "Contents",
- _txz_cb_show,
- _txz_cb_hide,
- _txz_cb_move,
- _txz_cb_resize,
- _txz_cb_raise,
- _txz_cb_lower,
- _txz_cb_set_layer,
- NULL,
- NULL,
- _txz_cb_get_min_size,
- _txz_cb_get_max_size,
- txz);
- ebits_set_named_bit_replace(txz->bg, "Button_Area",
- NULL,
- NULL,
- _txz_cb_tb_move,
- _txz_cb_tb_resize,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- txz);
- ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- EVAS_CALLBACK_MOUSE_DOWN,
- _txz_cb_title_down,
- txz);
- ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- EVAS_CALLBACK_MOUSE_UP,
- _txz_cb_title_up,
- txz);
- ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- EVAS_CALLBACK_MOUSE_MOVE,
- _txz_cb_title_move,
- txz);
- }
-
- txz_text(txz, text);
- txz_move(txz, x, y);
- txz_show(txz);
- return txz;
-}
-
-void
-txz_free(Text_Zone *txz)
-{
- Evas_List * l;
-
- if (txz->bg)
- ebits_free(txz->bg);
- evas_object_del(txz->clip);
- for (l = txz->lines; l; l = l->next)
- evas_object_del((Evas_Object *)l->data);
- if (txz->lines) evas_list_free(txz->lines);
- FREE(txz);
-}
-
-void
-txz_show(Text_Zone *txz)
-{
- Evas_List * l;
-
- if (txz->bg)
- ebits_show(txz->bg);
- for (l = txz->lines; l; l = l->next)
- evas_object_show((Evas_Object *)l->data);
- for (l = txz->buttons; l; l = l->next)
- {
- Text_Zone_Button *tb;
-
- tb = l->data;
- if (tb->bg) ebits_show(tb->bg);
- evas_object_show(tb->label);
- }
- txz_adjust_txt(txz);
-}
-
-void
-txz_hide(Text_Zone *txz)
-{
- Evas_List * l;
-
- if (txz->bg)
- ebits_hide(txz->bg);
- for (l = txz->lines; l; l = l->next)
- evas_object_hide((Evas_Object *)l->data);
- for (l = txz->buttons; l; l = l->next)
- {
- Text_Zone_Button *tb;
-
- tb = l->data;
- if (tb->bg) ebits_hide(tb->bg);
- evas_object_hide(tb->label);
- }
- txz_adjust_txt(txz);
-}
-
-void
-txz_move(Text_Zone *txz, double x, double y)
-{
- Evas_List * l;
-
- txz->x = x;
- txz->y = y;
- if (txz->bg)
- {
- ebits_move(txz->bg, txz->x, txz->y);
- }
- txz_adjust_txt(txz);
-}
-
-void
-txz_text(Text_Zone *txz, char *text)
-{
- char *p, *tok;
- double ypos;
- Evas_List * l;
-
- for (l = txz->lines; l; l = l->next)
- evas_object_del((Evas_Object *)l->data);
- if (txz->lines) evas_list_free(txz->lines);
- txz->lines = NULL;
-
- p = text;
- ypos = txz->y;
- while ((p[0] != 0) && (tok = strchr(p, '\n')))
- {
- char line[4096], size[2], align[2], *str;
- int sz;
- double tw, th, hadv, vadv;
- Evas_Object * o;
-
- strncpy(line, p, (tok - p));
- line[tok - p] = 0;
- size[0] = line[0];
- size[1] = 0;
- align[0] = line[1];
- align[1] = 0;
- str = &(line[3]);
-
- sz = atoi(size);
- sz = 4 + (sz * 2);
- o = evas_object_text_add(evas);
- evas_object_text_font_set(o, "nationff", sz);
- evas_object_text_text_set(o, str);
- evas_object_layer_set(o, 9);
- evas_object_color_set(o, 0, 0, 0, 255);
- txz->lines = evas_list_append(txz->lines, o);
- evas_object_geometry_get(o, NULL, NULL, &tw, &th);
- hadv = evas_object_text_horiz_advance_get(o);
- vadv = evas_object_text_vert_advance_get(o);
- if (align[0] == 'l')
- evas_object_move(o, txz->x, ypos);
- else if (align[0] == 'r')
- evas_object_move(o, txz->x + 512 - tw, ypos);
- else
- evas_object_move(o, txz->x + ((512 - tw) / 2), ypos);
- evas_object_clip_set(o, txz->clip);
- evas_object_data_set(o, "align", (void *)((int)align[0]));
- ypos += th;
-
- p = tok + 1;
- }
- if (txz->bg)
- {
- int minw, minh;
-
- ebits_get_real_min_size(txz->bg, &minw, &minh);
- ebits_resize(txz->bg, minw + 8, minh + 8);
- ebits_show(txz->bg);
- ebits_set_layer(txz->bg, 9);
- }
- txz_adjust_txt(txz);
-}
-
-void
-txz_button(Text_Zone *txz, char *text, void (*func) (void *data), void *data)
-{
- Text_Zone_Button *tb;
-
- tb = NEW(Text_Zone_Button, 1);
- ZERO(tb, Text_Zone_Button, 1);
-
- txz->buttons = evas_list_append(txz->buttons, tb);
- tb->label = evas_object_text_add(evas);
- evas_object_text_font_set(tb->label,"nationff", 12);
- evas_object_text_text_set(tb->label, text);
- evas_object_pass_events_set(tb->label, 1);
- evas_object_color_set(tb->label, 0, 0, 0, 255);
- evas_object_layer_set(tb->label, 12);
- tb->bg = ebits_load(PACKAGE_DATA_DIR"/data/setup/textzone_button.bits.db");
- if (tb->bg)
- ebits_add_to_evas(tb->bg, evas);
- txz_adjust_txt(txz);
-}
-
-void
-txz_adjust_txt(Text_Zone *txz)
-{
- Evas_List * l;
- double ypos;
- double xpos;
-
- ypos = txz->l.y + 4;
- evas_object_move(txz->clip, txz->l.x, txz->l.y);
- evas_object_resize(txz->clip, txz->l.w, txz->l.h);
- for (l = txz->lines; l; l = l->next)
- {
- Evas_Object * o;
- double tw, th;
- double x;
- char align;
-
- o = l->data;
- align = (char)((int)evas_object_data_get(o, "align"));
- x = txz->l.x + 4;
- evas_object_geometry_get(o, NULL, NULL, &tw, &th);
- if (align == 'c') x = txz->l.x + 4 + ((txz->l.w - 8 - tw) / 2);
- else if (align == 'r') x = txz->l.x + 4 + (txz->l.w - 8 - tw);
- evas_object_move(o, x, ypos);
- ypos += th;
- }
- xpos = 0;
- for (l = txz->buttons; l; l = l->next)
- {
- Text_Zone_Button *tb;
- double tw, th;
-
- tb = l->data;
- evas_object_geometry_get(tb->label, NULL, NULL, &tw, &th);
- if (tb->bg)
- {
- int pl, pr, pt, pb;
-
- pl = pr = pt = pb = 0;
- ebits_get_insets(tb->bg, &pl, &pr, &pt, &pb);
- ebits_set_layer(tb->bg, 11);
- ebits_show(tb->bg);
- ebits_resize(tb->bg, tw + pl + pr, txz->b.h);
- ebits_move(tb->bg, txz->b.x + xpos, txz->b.y);
- evas_object_move(tb->label, txz->b.x + pl + xpos, txz->b.y + pt + ((txz->b.h - pt - pb - th) / 2));
- evas_object_show(tb->label);
- xpos += tw + pl + pr;
- }
- }
-}
-
-void
-animate_logo(int v, void *data)
-{
- Evas_Object * o;
- double t;
- static double start_t;
- char buf[4096];
- int frame;
-
- o = (Evas_Object *)data;
- if (v == 0) start_t = ecore_get_time();
- t = ecore_get_time() - start_t;
- frame = (int)(t * 25);
- frame = frame % 120;
- frame++;
- if (frame < 10) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e00%i.png", frame);
- else if (frame < 100) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e0%i.png", frame);
- else if (frame < 1000) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e%i.png", frame);
- evas_object_image_file_set(o, buf, NULL);
- ecore_add_event_timer("animate_logo", 0.01, animate_logo, 1, data);
-}
-
-
-Evas *
-e_evas_new_all(Display *disp, Window parent_window,
- int x, int y, int win_w, int win_h,
- int render,
- int max_colors, int fc, int ic,
- char *font_dir)
-{
- Evas *e;
-
- e = evas_new();
- evas_output_method_set(e, evas_render_method_lookup("software_x11"));
- evas_output_size_set(e, win_w, win_h);
- evas_output_viewport_set(e, 0, 0, win_w, win_h);
- {
- Evas_Engine_Info_Software_X11 *einfo;
- XSetWindowAttributes att;
- Window window;
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(e);
-
- /* the following is specific to the engine */
- einfo->info.display = disp;
- einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
- einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
-
- att.background_pixmap = None;
- att.colormap = /*colormap*/ DefaultColormap(disp, DefaultScreen(disp));
- att.border_pixel = 0;
- att.event_mask = 0;
- window = XCreateWindow(disp,
- parent_window,
- x, y, win_w, win_h, 0,
- DefaultDepth(disp, DefaultScreen(disp)),
- /*imlib_get_visual_depth(display, visual),*/
- InputOutput,
- einfo->info.visual,
- CWColormap | CWBorderPixel | CWEventMask | CWBackPixmap,
- &att);
-
- einfo->info.drawable = window /*win*/;
- einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
- einfo->info.rotation = 0;
- einfo->info.debug = 0;
- evas_engine_info_set(e, (Evas_Engine_Info *) einfo);
- }
-
- evas_image_cache_set(e, 0);
- evas_font_cache_set(e, 0);
- evas_font_path_append(e, font_dir);
-
- return e;
-}
-
-Window
-e_evas_get_window(Evas *evas)
-{
- Window win;
- Evas_Engine_Info_Software_X11 *einfo;
-
- einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
-
- /* the following is specific to the engine */
- win = einfo->info.drawable;
-
- return win;
-}
-
-int
-main(int argc, char **argv)
-{
- ecore_display_init(NULL);
- ecore_event_signal_init();
- ecore_event_filter_init();
- ecore_event_x_init();
-
- setup();
-
- ecore_event_loop();
-}