e 0.17 ...... :)


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
commit dfe5d7091a
  1. 1
      AUTHORS
  2. 20
      COPYING
  3. 0
      ChangeLog
  4. 14
      INSTALL
  5. 31
      Makefile.am
  6. 0
      NEWS
  7. 3
      README
  8. 148
      autogen.sh
  9. 133
      config.h.in
  10. 74
      configure.in
  11. 66
      e.spec
  12. 0
      po/ChangeLog
  13. 3
      po/POTFILES.in
  14. 15
      po/e.pot
  15. 20
      src/Makefile.am
  16. 748
      src/actions.c
  17. 1803
      src/border.c
  18. 508
      src/desktops.c
  19. 337
      src/e.h
  20. 403
      src/icccm.c
  21. 55
      src/main.c
  22. 129
      src/resist.c
  23. 10
      src/util.c

@ -0,0 +1 @@
The Rasterman <raster@rasterman.com>

@ -0,0 +1,20 @@
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.

@ -0,0 +1,14 @@
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 Etcher for it to run properly.

@ -0,0 +1,31 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = intl po src
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)/data; \
for d in $(srcdir)/data/*; do \
if test -f $$d; then \
$(INSTALL_DATA) $$d $(DESTDIR)$(pkgdatadir)/data; \
fi \
done \
fi
dist-hook:
if test -d data; then \
mkdir $(distdir)/data; \
for d in data/*; do \
if test -f $$d; then \
cp -p $$d $(distdir)/d; \
fi \
done \
fi
EXTRA_DIST = README AUTHORS COPYING e.spec

@ -0,0 +1,3 @@
-------------------------------------------------------------------------------
Enlightenment 0.17.0 PRE-RELEASE....
-------------------------------------------------------------------------------

@ -0,0 +1,148 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
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
}
}
grep "^AM_GNU_GETTEXT" $srcdir/configure.in >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
grep "^AM_GNOME_GETTEXT" $srcdir/configure.in >/dev/null && {
grep "sed.*POTFILES" $srcdir/configure.in >/dev/null || \
(gettext --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`gettext' installed."
echo "Get ftp://alpha.gnu.org/gnu/gettext-0.10.35.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.3.tar.gz"
echo "(or a newer version if it is available)"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.in -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then
if grep "sed.*POTFILES" configure.in >/dev/null; then
: do nothing -- we still have an old unmodified configure.in
else
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
fi
if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
echo "no" | gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt
echo "Running autoconf ..."
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
else
echo Skipping configure process.
fi

@ -0,0 +1,133 @@
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
/* Define to empty if the keyword does not work. */
#undef const
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
This function is required for alloca.c support on those systems. */
#undef CRAY_STACKSEG_END
/* Define if you have alloca, as a function or macro. */
#undef HAVE_ALLOCA
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define as __inline if that's what the C compiler calls it. */
#undef inline
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define if you need to in order for stat and other things to work. */
#undef _POSIX_SOURCE
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* If using the C implementation of alloca, define if you know the
direction of stack growth for your system; otherwise it will be
automatically deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#undef STACK_DIRECTION
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
#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
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT
/* Define if you have the __argz_next function. */
#undef HAVE___ARGZ_NEXT
/* Define if you have the __argz_stringify function. */
#undef HAVE___ARGZ_STRINGIFY
/* Define if you have the dcgettext function. */
#undef HAVE_DCGETTEXT
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
/* Define if you have the getpagesize function. */
#undef HAVE_GETPAGESIZE
/* Define if you have the munmap function. */
#undef HAVE_MUNMAP
/* Define if you have the putenv function. */
#undef HAVE_PUTENV
/* Define if you have the setenv function. */
#undef HAVE_SETENV
/* Define if you have the setlocale function. */
#undef HAVE_SETLOCALE
/* Define if you have the stpcpy function. */
#undef HAVE_STPCPY
/* Define if you have the strcasecmp function. */
#undef HAVE_STRCASECMP
/* Define if you have the strchr function. */
#undef HAVE_STRCHR
/* Define if you have the strdup function. */
#undef HAVE_STRDUP
/* Define if you have the <argz.h> header file. */
#undef HAVE_ARGZ_H
/* Define if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
/* Define if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <nl_types.h> header file. */
#undef HAVE_NL_TYPES_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if you have the i library (-li). */
#undef HAVE_LIBI
/* Name of package */
#undef PACKAGE
/* Version number of package */
#undef VERSION
/* Define if using the dmalloc debugging malloc package */
#undef WITH_DMALLOC

@ -0,0 +1,74 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(enlightenment, 0.17.0)
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AM_WITH_DMALLOC
dnl Add the languages which your application supports here.
ALL_LINGUAS=""
AM_GNU_GETTEXT
dnl Set PACKAGE_LOCALE_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale")
else
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale")
fi
dnl Set PACKAGE_DATA_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/share'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${ac_default_prefix}/share/${PACKAGE}")
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${prefix}/share/${PACKAGE}")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${datadir}/${PACKAGE}")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}")
dnl Use -Wall if we have gcc.
changequote(,)dnl
if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
esac
fi
changequote([,])dnl
evas_cflags=`evas-config --cflags`
evas_libs=`evas-config --libs`
edb_cflags=`edb-config --cflags`
edb_libs=`edb-config --libs`
ebits_cflags=`ebits-config --cflags`
ebits_libs=`ebits-config --libs`
ecore_cflags=`ecore-config --cflags`
ecore_libs=`ecore-config --libs`
AC_SUBST(evas_cflags)
AC_SUBST(evas_libs)
AC_SUBST(edb_cflags)
AC_SUBST(edb_libs)
AC_SUBST(ebits_cflags)
AC_SUBST(ebits_libs)
AC_SUBST(ecore_cflags)
AC_SUBST(ecore_libs)
AC_OUTPUT([
Makefile
src/Makefile
intl/Makefile
po/Makefile.in
])

@ -0,0 +1,66 @@
# Note that this is NOT a relocatable package
%define ver 1.0
%define rel 1
%define prefix /usr/local
Summary: Enlightenment DR0.17's new "bit" editor
Name: etcher
Version: %ver
Release: %rel
Copyright: BSD
Group: X11/Libraries
Source: ftp://ftp.enlightenment.org/pub/enlightenment/etcher-%{ver}.tar.gz
BuildRoot: /var/tmp/etcher-root
Packager: Term <kempler@utdallas.edu>
URL: http://www.enlightenment.org/
Requires: evas >= 0.0.1
Requires: edb >= 1.0.0
Requires: imlib2 >= 1.0.0
Docdir: %{prefix}/doc
%description
Etcher is a new application devised to assist would-be theme developers in
designin "bits", that is, window borders, icons, whatever, for
Enlightenment. Since Enlightenment DR0.17 uses drag-and-drop instead of
texual configuration files, this application will become instrumental for
themeing under the new Enlightenment version.
%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/etcher
%{prefix}/share/etcher/*
%doc AUTHORS
%doc COPYING
%doc README
%changelog
* Mon Aug 28 2000 Lyle Kempler <kempler@utdallas.edu>
- Created spec file

@ -0,0 +1,3 @@
# List of source files containing translatable strings.
src/main.c

@ -0,0 +1,15 @@
# 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"

@ -0,0 +1,20 @@
## Process this file with automake to produce Makefile.in
INCLUDES = \
-I$(top_srcdir)/intl \
@evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@
bin_PROGRAMS = e
e_SOURCES = \
actions.c \
border.c \
desktops.c \
icccm.c \
main.c \
resist.c \
util.c \
e.h
e_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ -lecore -lm $(INTLLIBS)

@ -0,0 +1,748 @@
#include "e.h"
static Evas_List action_protos = NULL;
static Evas_List current_actions = NULL;
static void _e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o);
static void _e_action_free(E_Action *a);
static void e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_move_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
static void e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_exec_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void
_e_action_find(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o)
{
char *actions_db = "./actions.db";
E_DB_File *db;
int i, num;
char *a_name = NULL;
char *a_action = NULL;
char *a_params = NULL;
int a_event = 0;
int a_button = 0;
char *a_key = NULL;
int a_modifiers = 0;
E_Action *a;
db = e_db_open_read(actions_db);
if (!db) return;
if (!e_db_int_get(db, "/actions/count", &num)) goto error;
for (i = 0; i < num; i++)
{
char buf[4096];
Evas_List l;
a = NULL;
a = NULL;
sprintf(buf, "/actions/%i/name", i);
a_name = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/action", i);
a_action = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/params", i);
a_params = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/event", i);
e_db_int_get(db, buf, &a_event);
sprintf(buf, "/actions/%i/button", i);
e_db_int_get(db, buf, &a_button);
sprintf(buf, "/actions/%i/key", i);
a_key = e_db_str_get(db, buf);
sprintf(buf, "/actions/%i/modifiers", i);
e_db_int_get(db, buf, &a_modifiers);
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 (l = action_protos; l; l = l->next)
{
E_Action_Proto *ap;
ap = l->data;
if (!strcmp(ap->action, a_action))
{
a = NEW(E_Action, 1);
ZERO(a, E_Action, 1);
OBJ_INIT(a, _e_action_free);
a->name = a_name;
a->action = a_action;
a->params = a_params;
a->event = a_event;
a->button = a_button;
a->key = a_key;
a->modifiers = a_modifiers;
a->action_proto = ap;
a->object = o;
a->started = 0;
current_actions = evas_list_append(current_actions, a);
}
}
next:
if (!a)
{
IF_FREE(a_name);
IF_FREE(a_action);
IF_FREE(a_params);
IF_FREE(a_key);
}
}
error:
e_db_close(db);
}
static void
_e_action_free(E_Action *a)
{
IF_FREE(a->name);
IF_FREE(a->action);
IF_FREE(a->params);
IF_FREE(a->key);
FREE(a);
}
void
e_action_start(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry)
{
Evas_List l;
_e_action_find(action, act, button, key, mods, o);
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if (!a->started)
{
if (a->action_proto->func_stop)
a->started = 1;
if (a->action_proto->func_start)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
if (a->started)
OBJ_REF(obj);
}
a->action_proto->func_start(a->object, a, data, x, y, rx, ry);
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
}
}
void
e_action_stop(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry)
{
Evas_List l;
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->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)
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
}
}
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
}
}
void
e_action_go(char *action, int act, int button, char *key, Ev_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
Evas_List l;
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if ((a->started) && (a->action_proto->func_go))
a->action_proto->func_go(a->object, a, data, x, y, rx, ry, dx, dy);
}
}
void
e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
{
Evas_List l;
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
if ((a->started) && (o == a->object))
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
if (a->action_proto->func_stop)
a->action_proto->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
current_actions = evas_list_remove(current_actions, a);
OBJ_DO_FREE(a);
goto again;
}
}
}
void
e_action_add_proto(char *action,
void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
void (*func_go) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy))
{
E_Action_Proto *ap;
ap = NEW(E_Action_Proto, 1);
OBJ_INIT(ap, NULL);
ap->action = strdup(action);
ap->func_start = func_start;
ap->func_stop = func_stop;
ap->func_go = func_go;
action_protos = evas_list_append(action_protos, ap);
}
void
e_actions_init(void)
{
e_action_add_proto("Window_Move", e_act_move_start, e_act_move_stop, e_act_move_go);
e_action_add_proto("Window_Resize", e_act_resize_start, e_act_resize_stop, e_act_resize_go);
e_action_add_proto("Window_Resize_Horizontal", e_act_resize_h_start, e_act_resize_h_stop, e_act_resize_h_go);
e_action_add_proto("Window_Resize_Vertical", e_act_resize_v_start, e_act_resize_v_stop, e_act_resize_v_go);
e_action_add_proto("Window_Close", e_act_close_start, NULL, NULL);
e_action_add_proto("Window_Kill", e_act_kill_start, NULL, NULL);
e_action_add_proto("Window_Shade", e_act_shade_start, NULL, NULL);
e_action_add_proto("Window_Raise", e_act_raise_start, NULL, NULL);
e_action_add_proto("Window_Lower", e_act_lower_start, NULL, NULL);
e_action_add_proto("Window_Raise_Lower", e_act_raise_lower_start, NULL, NULL);
e_action_add_proto("Execute", e_act_exec_start, NULL, NULL);
e_action_add_proto("Menu", e_act_menu_start, NULL, NULL);
e_action_add_proto("Exit", e_act_exit_start, NULL, NULL);
e_action_add_proto("Restart", e_act_restart_start, NULL, NULL);
e_action_add_proto("Window_Stick", e_act_stick_start, NULL, NULL);
e_action_add_proto("Sound", e_act_sound_start, NULL, NULL);
e_action_add_proto("Window_Iconify", e_act_iconify_start, NULL, NULL);
e_action_add_proto("Window_Max_Size", e_act_max_start, NULL, NULL);
e_action_add_proto("Winodw_Snap", e_act_snap_start, NULL, NULL);
e_action_add_proto("Window_Zoom", e_act_zoom_start, NULL, NULL);
}
static void
e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
b->mode.move = 1;
b->current.requested.dx = 0;
b->current.requested.dy = 0;
b->previous.requested.dx = 0;
b->previous.requested.dy = 0;
}
static void
e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
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;
e_border_adjust_limits(b);
}
static void
e_act_move_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
b = o;
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);
}
static void
e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
/* 0 | 1 */
/* --+-- */
/* 2 | 3 */
if (x > (b->current.w / 2))
{
if (y > (b->current.h / 2))
{
b->mode.resize = 3;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 1;
SET_BORDER_GRAVITY(b, SouthWestGravity);
}
}
else
{
if (y > (b->current.h / 2))
{
b->mode.resize = 2;
SET_BORDER_GRAVITY(b, NorthEastGravity);
}
else
{
b->mode.resize = 0;
SET_BORDER_GRAVITY(b, SouthEastGravity);
}
}
}
static void
e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
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);
}
static void
e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
b = o;
if (b->mode.resize == 0)
{
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 == 1)
{
b->current.requested.w += dx;
b->current.requested.h -= dy;
b->current.requested.y += dy;
}
else if (b->mode.resize == 2)
{
b->current.requested.w -= dx;
b->current.requested.h += dy;
b->current.requested.x += dx;
}
else if (b->mode.resize == 3)
{
b->current.requested.w += dx;
b->current.requested.h += dy;
}
b->changed = 1;
e_border_adjust_limits(b);
}
static void
e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
/* 4 | 5 */
if (x > (b->current.w / 2))
{
b->mode.resize = 5;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 4;
SET_BORDER_GRAVITY(b, NorthEastGravity);
}
}
static void
e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
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);
}
static void
e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
b = o;
if (b->mode.resize == 4)
{
b->current.requested.w -= dx;
b->current.requested.x += dx;
}
else if (b->mode.resize == 5)
{
b->current.requested.w += dx;
}
b->changed = 1;
e_border_adjust_limits(b);
}
static void
e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
/* 6 */
/* - */
/* 7 */
if (y > (b->current.h / 2))
{
b->mode.resize = 7;
SET_BORDER_GRAVITY(b, NorthWestGravity);
}
else
{
b->mode.resize = 6;
SET_BORDER_GRAVITY(b, SouthWestGravity);
}
}
static void
e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
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);
b->changed = 1;
}
static void
e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
b = o;
if (b->mode.resize == 6)
{
b->current.requested.h -= dy;
b->current.requested.y += dy;
}
else if (b->mode.resize == 7)
{
b->current.requested.h += dy;
}
e_border_adjust_limits(b);
b->changed = 1;
}
static void
e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
if (b->win.client) e_icccm_delete(b->win.client);
}
static void
e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
if (b->win.client) e_window_kill_client(b->win.client);
}
static void
e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
e_border_raise(b);
}
static void
e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
e_border_lower(b);
}
static void
e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_exec_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
exit(0);
}
static void
e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}
static void
e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
b = o;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,508 @@
#include "e.h"
static Evas_List desktops = NULL;
static Window e_base_win = 0;
static int screen_w, screen_h;
static int current_desk = 0;
static void e_idle(void *data);
static void e_mouse_down(Eevent * ev);
static void e_mouse_up(Eevent * ev);
static void e_mouse_in(Eevent * ev);
static void e_mouse_out(Eevent * ev);
static void e_window_expose(Eevent * ev);
static void
e_idle(void *data)
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
e_desktops_update(desk);
}
e_db_runtime_flush();
}
/* handling mouse down events */
static void
e_mouse_down(Eevent * ev)
{
Ev_Mouse_Down *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_button_down(evas, x, y, e->button);
return;
}
}
}
}
/* handling mouse up events */
static void
e_mouse_up(Eevent * ev)
{
Ev_Mouse_Up *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_button_up(evas, x, y, e->button);
return;
}
}
}
}
/* handling mouse move events */
static void
e_mouse_move(Eevent * ev)
{
Ev_Mouse_Move *e;
e = ev->event;
{
Evas_List l;
for (l = desktops; l; l = l->next)
{
E_Desktop *desk;
desk = l->data;
if (desk->win.desk == e->win)
{
Evas evas;
int x, y;
evas = desk->evas.desk;
e_window_get_root_relative_location(evas_get_window(evas),
&x, &y);
x = e->rx - x;
y = e->ry - y;
evas_event_move(evas, x, y);
return;
}
}
}
}
/* handling mouse enter events */
static void
e_mouse_in(Eevent * ev)
{
Ev_Window_Enter *e;