been working offline.. wheeeheee! :)


			
			
				devs/princeamd/enlightenment-0.17-elive
			
			
		
Carsten Haitzler 22 years ago
parent f98201f9af
commit ed40162775
  1. 99
      README
  2. 140
      config.h.in
  3. 63
      configure.ac
  4. 57
      configure.in
  5. BIN
      data/backgrounds/view.bg.db
  6. BIN
      data/config/appearance/default/guides/display.bits.db
  7. BIN
      data/config/appearance/default/menus/default/separator.bits.db
  8. BIN
      data/config/behavior/default/actions.db
  9. BIN
      data/config/behavior/default/apps_menu.db
  10. BIN
      data/config/behavior/default/grabs.db
  11. BIN
      data/config/behavior/default/settings.db
  12. BIN
      data/cursors/Close.db
  13. BIN
      data/cursors/Default.db
  14. BIN
      data/cursors/Iconify.db
  15. BIN
      data/cursors/Max_Size.db
  16. BIN
      data/cursors/Menu.db
  17. BIN
      data/cursors/Resize.db
  18. BIN
      data/cursors/Resize_Horizontal.db
  19. BIN
      data/cursors/Resize_Vertical.db
  20. BIN
      data/cursors/Title_Bar.db
  21. BIN
      data/cursors/View_Icon.db
  22. 8
      data/scripts/build_app_menu_db.sh
  23. 37
      data/scripts/build_db.sh
  24. 16
      src/Makefile.am
  25. 200
      src/actions.c
  26. 1
      src/actions.h
  27. 139
      src/border.c
  28. 8
      src/border.h
  29. 8
      src/config.c
  30. 238
      src/cursors.c
  31. 11
      src/cursors.h
  32. 29
      src/delayed.c
  33. 27
      src/delayed.h
  34. 34
      src/desktops.c
  35. 72
      src/e.h
  36. 38
      src/e_ferite.fec
  37. 2
      src/embed.c
  38. 12
      src/entry.c
  39. 319
      src/guides.c
  40. 81
      src/main.c
  41. 12
      src/text.c
  42. 53
      src/view.c

@ -1,15 +1,15 @@
-------------------------------------------------------------------------------
Enlightenment 0.17.pre CVS Code....
-------------------------------------------------------------------------------
The Rasterman - raster@valinux.com, raster@rasterman.com
+-----------------------------------------------------------------------------+
| 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.
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
@ -19,9 +19,9 @@ 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 asnwer is the same
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 havily hacking on the code, or whose curiosity is too much to resist
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
@ -42,19 +42,10 @@ 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 does not check for previously running Window Managers right
now - so you need to make sure no other WM is running - E will not do that
for you.
Enlightenment has no keybindings right now, but does have a primitve menu for
launching some applications. It is configurable - it's in a database file
and tere is a script that builds this menu - you could build a new one after
editing the script or do whatever your like.
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
@ -62,42 +53,42 @@ 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.
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 plan on working on the code... STOP! don't rush in and work on it -
even if you have CVS commit access - EXPECT me (Raster) to revert any changes
you make if you do this - regardless of the changes and how much work you
put into them. First read the code well and LEARN it. If you have questions
about some of the more obscure hidden program flow - ASK - but don't go
tampering with it - Enlightenment 0.17's code is much more complex and
intricate than E 0.16 - but at the same time it's much cleaner and more
object oriented. Learn it well first. Some parts of E 0.17 are "hacked" with
hard-coded stuff, just so, for now, it works. They will be virtualized and
imporved over time. If you have plans - tell me about them first - discuss
them before you go impliment them - once you've discussed them and we all
aree on how it should be done, you can go ahead and do it. I know I already
have a lot of the components of E 0.17's code planned in my head - but I
won't get to them for a while - and if people go impliment or hack bad stuff
in, it means I have to spend lots of time fixing something that is bad in the
first place, or we end up doing duplicate work. There *IS* a plan - believe
it or not - but to be honest - it's more complex and large than I can just
write down in a README, so talk about your ideas first. I'm going to be
ruthless in keeping the code neat, clean and free of nasty hacks (except ones
I put in as temporary stop-gap measures to make the thing work - since I know
where those are and what I need to do to do it right). If you can't find me
or I don't reply to your e-mail - don't get impatient - just wait. I currently
have no network access at home, so I'm doing a chunk of code offline. I'll
get to your mail and queries as time allows.
If you have problems with the code or bugs to report, kindly forward them to
/dev/null (the code is in now way or form ready for bug reports - I don't
want crap filling my mailbox), unless its a patch hat fixes a silly bug
somewhere. Only experienced people should in any way consider sending a bug
report as I need useful reports, not junk cluttering my mailbox.
I hope that clears things up for now.
In the meantime - have fun.
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

@ -0,0 +1,140 @@
/* 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 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
/* 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

@ -1,7 +1,6 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([configure.in])
AC_INIT(configure.in)
ENLIGHTENMENT_MAJOR=0
ENLIGHTENMENT_MINOR=17
@ -90,6 +89,19 @@ if test "x$GCC" = "xyes"; then
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>],
@ -177,8 +189,51 @@ AM_CONDITIONAL(USE_FERITE, test "x$ferite" = "xyes")
AC_SUBST(CP_OPTIONS)
AC_CONFIG_FILES([
if test "x$ferite" = "xyes"; then
pushd $packagesrcdir/src >& /dev/null
echo "... building ferite binding c code ...";
rm -f e_ferite_gen_*;
$FEBUILDER -m e_ferite_gen e_ferite.fec;
mv e_ferite_gen_core.c e_ferite_gen_core.c.old;
cat e_ferite_gen_core.c.old | sed -e "s/module_init/e_ferite_register/g" > e_ferite_gen_core.c;
rm e_ferite_gen_core.c.old;
echo "done.";
popd >& /dev/null
fi
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.))
AC_OUTPUT([
Makefile src/Makefile lib/Makefile client/Makefile intl/Makefile po/Makefile.in
])
AC_OUTPUT

@ -89,6 +89,19 @@ if test "x$GCC" = "xyes"; then
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>],
@ -176,6 +189,50 @@ AM_CONDITIONAL(USE_FERITE, test "x$ferite" = "xyes")
AC_SUBST(CP_OPTIONS)
if test "x$ferite" = "xyes"; then
pushd $packagesrcdir/src >& /dev/null
echo "... building ferite binding c code ...";
rm -f e_ferite_gen_*;
$FEBUILDER -m e_ferite_gen e_ferite.fec;
mv e_ferite_gen_core.c e_ferite_gen_core.c.old;
cat e_ferite_gen_core.c.old | sed -e "s/module_init/e_ferite_register/g" > e_ferite_gen_core.c;
rm e_ferite_gen_core.c.old;
echo "done.";
popd >& /dev/null
fi
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.))
AC_OUTPUT([
Makefile src/Makefile lib/Makefile client/Makefile intl/Makefile po/Makefile.in
])

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -114,10 +114,10 @@ entry text 'Reboot' 'sudo -S /sbin/shutdown -r now'
end_menu
menu 3
entry script 'Goto Desktop 1' 'e.flipToDesktop(1);'
entry script 'Goto Desktop 2' 'e.flipToDesktop(2);'
entry script 'Goto Desktop 3' 'e.flipToDesktop(3);'
entry script 'Goto Desktop 4' 'e.flipToDesktop(4);'
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

@ -1,4 +1,4 @@
# enumerated variables
# enumerated variables - don't touch these
ACT_MOUSE_IN=0
ACT_MOUSE_OUT=1
ACT_MOUSE_CLICK=2
@ -22,6 +22,14 @@ 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
GUIDES_LOC_WIN=0
GUIDES_LOC_SCR=1
# actions defining how to react to things
DB="./actions.db"
NUM=0
@ -161,6 +169,14 @@ 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 ""
@ -293,12 +309,19 @@ edb_ed $DB add "/actions/count" int $NUM
# basic settings
DB="./settings.db"
edb_ed $DB add "/focus/mode " int $FOCUS_POINTER
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 "/focus/mode " int $FOCUS_POINTER
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/raise/auto" int 0
edb_ed $DB add "/window/raise/delay" float 0.5
edb_ed $DB add "/window/move/mode" int $WINDOW_MODE_BOX
edb_ed $DB add "/window/resize/mode" int $WINDOW_MODE_BOX
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
DB="./grabs.db"

@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
CLEANFILES = e_ferite_gen_*
DISTCLEANFILES = e_ferite_gen_*
INCLUDES = \
-I$(top_srcdir)/intl \
@ -8,11 +8,13 @@ INCLUDES = \
bin_PROGRAMS = enlightenment
EXTRA_DIST = e_ferite.fec
if USE_FERITE
ferite_c = e_ferite_gen_core.c \
e_ferite_gen_header.h \
e_ferite_gen_e.c \
e_ferite_gen_Window.c \
e_ferite_gen_window.c \
e_ferite.h e_ferite.c
endif
@ -21,6 +23,8 @@ enlightenment_SOURCES = \
background.h background.c \
border.h border.c \
config.h config.c \
cursors.c cursors.h \
delayed.h delayed.c \
desktops.h desktops.c \
embed.c embed.h \
entry.h entry.c \
@ -36,6 +40,7 @@ enlightenment_SOURCES = \
menu.h menu.c \
menubuild.h menubuild.c \
pack.c \
place.c place.h \
resist.h resist.c \
scrollbar.h scrollbar.c \
shelf.c \
@ -45,10 +50,3 @@ enlightenment_SOURCES = \
e.h
enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ferite_libs@ -lm -lc $(INTLLIBS)
e_ferite_gen_core.c: e_ferite.fec
rm -f e_ferite_gen_* ; \
@FEBUILDER@ -m e_ferite_gen e_ferite.fec ; \
mv e_ferite_gen_core.c e_ferite_gen_core.c.old ; \
cat e_ferite_gen_core.c.old | sed -e "s/module_init/e_ferite_register/g" > e_ferite_gen_core.c ; \
rm e_ferite_gen_core.c.old

@ -7,6 +7,7 @@
#include "keys.h"
#include "view.h"
#include "util.h"
#include "guides.h"
static Evas_List action_protos = NULL;
static Evas_List current_actions = NULL;
@ -64,6 +65,7 @@ static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, in
static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
static void e_act_raise_next_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
#define SET_BORDER_GRAVITY(_b, _grav) \
e_window_gravity_set(_b->win.container, _grav); \
@ -385,6 +387,34 @@ e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
}
}
void
e_action_stop_by_type(char *action)
{
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) &&
(action) && (!strcmp(action, a->name)))
{
E_Object *obj;
if (a->object)
{
obj = a->object;
OBJ_UNREF(obj);
}
a->action_proto->func_stop(a->object, a, NULL, 0, 0, 0, 0);
a->started = 0;
}
}
}
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),
@ -486,6 +516,7 @@ e_action_init(void)
e_action_add_proto("Winodw_Snap", e_act_snap_start, NULL, NULL);
e_action_add_proto("Window_Zoom", e_act_zoom_start, NULL, NULL);
e_action_add_proto("Desktop", e_act_desk_start, NULL, NULL);
e_action_add_proto("Window_Next", e_act_raise_next_start, NULL, NULL);
}
@ -508,15 +539,43 @@ static void
e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
int move_mode = E_GUIDES_BOX;
double align_x = 0.5;
double align_y = 0.5;
int display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
E_CFG_INT(cfg_window_move_mode, "settings", "/window/move/mode", E_GUIDES_BOX);
E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
E_CFG_INT(cfg_guides_display_location, "settings", "/guides/display/location", E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
E_CONFIG_INT_GET(cfg_window_move_mode, move_mode);
E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x);
E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y);
E_CONFIG_INT_GET(cfg_guides_display_location, display_loc);
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
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[4096];
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);
sprintf(buf, "%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();
}
return;
UN(a);
UN(data);
@ -534,6 +593,7 @@ e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
b = o;
if (!b) b = e_border_current_focused();
if (!b) 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;
@ -542,7 +602,11 @@ e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
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();
return;
UN(a);
UN(data);
@ -566,6 +630,14 @@ e_act_move_go (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
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);
}
return;
UN(a);
UN(data);
@ -580,11 +652,25 @@ static void
e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
int resize_mode = E_GUIDES_BOX;
double align_x = 0.5;
double align_y = 0.5;
int display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", E_GUIDES_BOX);
E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
E_CFG_INT(cfg_guides_display_location, "settings", "/guides/display/location", E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode);
E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x);
E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y);
E_CONFIG_INT_GET(cfg_guides_display_location, display_loc);
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
e_window_gravity_set(b->win.client, StaticGravity);
e_window_gravity_set(b->win.l, NorthWestGravity);
e_window_gravity_set(b->win.r, SouthEastGravity);
@ -625,6 +711,20 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
/* e_window_gravity_set(b->win.container, NorthWestGravity); */
}
}
{
char buf[4096];
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);
sprintf(buf, "%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();
}
return;
UN(a);
UN(data);
@ -641,6 +741,7 @@ e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) 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;
@ -650,6 +751,7 @@ e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int
e_border_adjust_limits(b);
e_window_gravity_set(b->win.client, NorthWestGravity);
SET_BORDER_GRAVITY(b, NorthWestGravity);
e_guides_hide();
return;
UN(a);
UN(data);
@ -694,6 +796,14 @@ e_act_resize_go (void *o, E_Action *a, void *data, int x, int y, int rx, int
}
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);
}
return;
UN(a);
UN(data);
@ -708,11 +818,25 @@ 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;
int resize_mode = E_GUIDES_BOX;
double align_x = 0.5;
double align_y = 0.5;
int display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", E_GUIDES_BOX);
E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
E_CFG_INT(cfg_guides_display_location, "settings", "/guides/display/location", E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode);
E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x);
E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y);
E_CONFIG_INT_GET(cfg_guides_display_location, display_loc);
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
e_window_gravity_set(b->win.client, StaticGravity);
e_window_gravity_set(b->win.l, NorthWestGravity);
e_window_gravity_set(b->win.r, SouthEastGravity);
@ -731,6 +855,20 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
b->mode.resize = 5;
/* SET_BORDER_GRAVITY(b, NorthEastGravity);*/
}
{
char buf[4096];
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);
sprintf(buf, "%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();
}
return;
UN(a);
UN(data);
@ -748,6 +886,7 @@ e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) 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;
@ -757,6 +896,7 @@ e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_border_adjust_limits(b);
e_window_gravity_set(b->win.client, NorthWestGravity);
SET_BORDER_GRAVITY(b, NorthWestGravity);
e_guides_hide();
return;
UN(a);
UN(data);
@ -786,6 +926,14 @@ e_act_resize_h_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
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);
}
return;
UN(a);
UN(data);
@ -801,11 +949,25 @@ 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;
int resize_mode = E_GUIDES_BOX;
double align_x = 0.5;
double align_y = 0.5;
int display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode", E_GUIDES_BOX);
E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
E_CFG_INT(cfg_guides_display_location, "settings", "/guides/display/location", E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
E_CONFIG_INT_GET(cfg_window_resize_mode, resize_mode);
E_CONFIG_FLOAT_GET(cfg_guides_display_x, align_x);
E_CONFIG_FLOAT_GET(cfg_guides_display_y, align_y);
E_CONFIG_INT_GET(cfg_guides_display_location, display_loc);
b = o;
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) return;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
e_window_gravity_set(b->win.client, StaticGravity);
e_window_gravity_set(b->win.l, NorthWestGravity);
e_window_gravity_set(b->win.r, SouthEastGravity);
@ -826,6 +988,20 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
b->mode.resize = 7;
/* SET_BORDER_GRAVITY(b, SouthWestGravity);*/
}
{
char buf[4096];
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);
sprintf(buf, "%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();
}
return;
UN(a);
UN(data);
@ -843,6 +1019,7 @@ e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
if (!b) b = e_border_current_focused();
if (!b) return;
if (b->current.shaded != 0) 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;
@ -852,6 +1029,7 @@ e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_window_gravity_set(b->win.client, NorthWestGravity);
SET_BORDER_GRAVITY(b, NorthWestGravity);
b->changed = 1;
e_guides_hide();
return;
UN(a);
UN(data);
@ -881,6 +1059,14 @@ e_act_resize_v_go (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
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);
}
return;
UN(a);
UN(data);
@ -1320,3 +1506,17 @@ e_act_desk_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
UN(ry);
}
static void
e_act_raise_next_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
{
e_border_raise_next();
return;
UN(o);
UN(a);
UN(data);
UN(x);
UN(y);
UN(rx);
UN(ry);
}

@ -63,6 +63,7 @@ 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);
void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
void e_action_stop_by_type(char *action);
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),

@ -1,10 +1,12 @@
#include "border.h"
#include "config.h"
#include "actions.h"
#include "delayed.h"
#include "desktops.h"
#include "resist.h"
#include "icccm.h"
#include "util.h"
#include "place.h"
/* Window border rendering, querying, setting & modification code */
@ -21,6 +23,9 @@ static int border_mouse_buttons = 0;
static Eevent *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(Eevent * ev);
static void e_configure_request(Eevent * ev);
@ -100,7 +105,8 @@ e_map_request(Eevent * ev)
b = e_border_find_by_window(e->win);
if (!b)
{
b = e_border_adopt(e->win, 0);
if (e_window_exists(e->win))
b = e_border_adopt(e->win, 0);
}
}
current_ev = NULL;
@ -390,6 +396,7 @@ e_focus_in(Eevent * ev)
b->current.selected = 1;
e_border_focus_grab_ended();
b->changed = 1;
OBS_NOTIFY(b, EV_WINDOW_FOCUS_IN);
}
}
current_ev = NULL;
@ -437,6 +444,7 @@ e_focus_out(Eevent * ev)
}
b->changed = 1;
}
e_delayed_action_cancel(delayed_window_raise);
}
current_ev = NULL;
}
@ -742,6 +750,8 @@ e_cb_mouse_in(void *data, Ebits_Object o, char *class, int bt, int x, int y, int
if (border_mouse_buttons) 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) return;
e_action_stop(class, ACT_MOUSE_IN, 0, NULL, EV_KEY_MODIFIER_NONE, b, NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_IN, 0, NULL, EV_KEY_MODIFIER_NONE, b, NULL, x, y, border_mouse_x, border_mouse_y);
@ -764,6 +774,7 @@ e_cb_mouse_out(void *data, Ebits_Object o, char *class, int bt, int x, int y, in
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
if (!current_ev) return;
e_cursors_display_in_window(b->win.main, "Default");
e_action_stop(class, ACT_MOUSE_OUT, 0, NULL, EV_KEY_MODIFIER_NONE, b, NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_OUT, 0, NULL, EV_KEY_MODIFIER_NONE, b, NULL, x, y, border_mouse_x, border_mouse_y);
return;
@ -1138,6 +1149,7 @@ e_border_adopt(Window win, int use_client_pos)
{
E_Border *b;
int bw;
int show = 1;
/* create the struct */
b = e_border_new();
@ -1187,6 +1199,7 @@ e_border_adopt(Window win, int use_client_pos)
e_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 */
e_window_reparent(win, b->win.container, 0, 0);
@ -1201,6 +1214,7 @@ e_border_adopt(Window win, int use_client_pos)
b->current.requested.y += pt;
b->changed = 1;
}
if (!use_client_pos)
{
int x, y;
int pl, pr, pt, pb;
@ -1238,7 +1252,7 @@ e_border_adopt(Window win, int use_client_pos)
break;
case SouthWestGravity:
x = b->client.pos.x + pl;
y = b->client.pos.y - pb;
y = b->client.pos.y - pb + bw;
break;
case WestGravity:
x = b->client.pos.x + pl;
@ -1264,8 +1278,9 @@ e_border_adopt(Window win, int use_client_pos)
}
else
{
x = rand()%600 + pl;
y = rand()%400 + pt;
show = e_place_border(b, b->desk, &x, &y, E_PLACE_SMART);
x += pl;
y += pt;
}
b->current.requested.x = x - pl;
b->current.requested.y = y - pt;
@ -1299,6 +1314,7 @@ e_border_new(void)
ZERO(b, E_Border, 1);
OBJ_INIT(b, e_border_free);
OBS_REGISTER(delayed_window_raise, b);
b->current.requested.w = 1;
b->current.requested.h = 1;
@ -1321,6 +1337,7 @@ e_border_new(void)
b->win.main = e_window_override_new(desk->win.container, 0, 0, 1, 1);
b->win.input = e_window_input_new(b->win.main, 0, 0, 1, 1);
b->win.container = e_window_override_new(b->win.main, 0, 0, 1, 1);
e_cursors_display_in_window(b->win.container, "Application");
e_window_set_events_propagate(b->win.input, 1);
e_window_set_events(b->win.input, XEV_MOUSE_MOVE | XEV_BUTTON);
e_window_set_events(b->win.main, XEV_IN_OUT);
@ -1368,6 +1385,10 @@ e_border_new(void)
font_dir);
b->win.b = evas_get_window(b->evas.b);
e_add_child(b->win.main, b->win.b);
e_cursors_display_in_window(b->win.l, "Default");
e_cursors_display_in_window(b->win.r, "Default");
e_cursors_display_in_window(b->win.t, "Default");
e_cursors_display_in_window(b->win.b, "Default");
b->obj.title.l = evas_add_text(b->evas.l, "borzoib", 8, "");
b->obj.title.r = evas_add_text(b->evas.r, "borzoib", 8, "");
@ -1847,6 +1868,7 @@ e_border_update(E_Border *b)
int visibility_changed = 0;
int state_changed = 0;
if (b->hold_changes) return;
if (!b->changed) return;
b->current.visible = b->current.requested.visible;
@ -2120,6 +2142,17 @@ e_border_set_layer(E_Border *b, int layer)
else e_border_raise(b);
}
static void
e_border_raise_delayed(int val, void *b)
{
int auto_raise = 0;
E_CFG_INT(cfg_auto_raise, "settings", "/window/raise/auto", 0);
E_CONFIG_INT_GET(cfg_auto_raise, auto_raise);
if (auto_raise)
e_border_raise((E_Border *)b);
}
void
e_border_raise(E_Border *b)
{
@ -2221,6 +2254,11 @@ e_border_lower_below(E_Border *b, E_Border *below)
void
e_border_init(void)
{
double raise_delay = 0.5;
E_CFG_FLOAT(cfg_raise_delay, "settings", "/window/raise/delay", 0.5);
E_CONFIG_FLOAT_GET(cfg_raise_delay, raise_delay);
e_event_filter_handler_add(EV_MOUSE_DOWN, e_mouse_down);
e_event_filter_handler_add(EV_MOUSE_UP, e_mouse_up);
e_event_filter_handler_add(EV_MOUSE_MOVE, e_mouse_move);
@ -2241,6 +2279,9 @@ e_border_init(void)
e_event_filter_handler_add(EV_COLORMAP, e_colormap);
e_event_filter_idle_handler_add(e_idle, NULL);
delayed_window_raise = NEW(E_Delayed_Action, 1);
E_DELAYED_ACT_INIT(delayed_window_raise, EV_WINDOW_FOCUS_IN, raise_delay, e_border_raise_delayed);
e_add_event_timer("e_border_poll()", 1.00, e_border_poll, 0, NULL);
}
@ -2311,3 +2352,93 @@ e_border_focus_grab_ended(void)
b->current.select_lost_from_grab = 0;
}
}
int
e_border_viewable(E_Border *b)
{
if (b->desk != e_desktops_get(e_desktops_get_current()))
return 0;
if (b->current.x + b->current.w < b->desk->x)
return 0;
if (b->current.x > b->desk->x + b->desk->real.w)
return 0;
if (b->current.y + b->current.h < b->desk->y)
return 0;
if (b->current.y > b->desk->y + b->desk->real.h)
return 0;
return 1;
}
void
e_border_send_pointer(E_Border *b)
{
XWarpPointer(e_display_get(), None, b->win.main, 0, 0, 0, 0, b->current.w / 2, b->current.h / 2);
}
void
e_border_raise_next(void)
{
Evas_List next;
E_Border *current;
if (!borders)
return;
current = e_border_current_focused();
/* Find the current border on the list of borders */
for (next = borders; 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 = borders;
current = (E_Border *)next->data;
while (next && !e_border_viewable(current))
{
next = next->next;
if (!next)
next = borders;
current = (E_Border *)next->data;
}
printf("current desk coords %d, %d, real dim %d, %d\n", current->desk->x,
current->desk->y, current->desk->real.w, current->desk->real.h);
printf("current coords %d, %d\n", current->current.x,
current->current.y);
e_border_raise(current);
e_border_send_pointer(current);
}
void
e_border_print_pos(char *buf, E_Border *b)
{
sprintf(buf, "%i, %i",
b->current.x, b->current.y);
}
void
e_border_print_size(char *buf, E_Border *b)
{
if ((b->client.step.w > 1) || (b->client.step.h > 1))
{
sprintf(buf, "%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
{
sprintf(buf, "%i x %i",
b->client.w,
b->client.h);
}
}

8