been working offline.. wheeeheee! :)

SVN revision: 5374
This commit is contained in:
Carsten Haitzler 2001-09-24 21:21:25 +00:00
parent f98201f9af
commit ed40162775
42 changed files with 1509 additions and 199 deletions

93
README
View File

@ -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 want to compile & install E 0.17 you probably install the packages
Enlightenment needs in this order:
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.
(*) imlib2
(*) edb
(*) imlib2_loaders
(*) evas
(*) ebits
(*) ecore
(*) efsd
(*) ferite (optional for now, but recommended)
(*) e17
I hope that clears things up for now.
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.
In the meantime - have fun.
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

140
config.h.in Normal file
View File

@ -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

View File

@ -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

View File

@ -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.

BIN
data/cursors/Close.db Normal file

Binary file not shown.

BIN
data/cursors/Default.db Normal file

Binary file not shown.

BIN
data/cursors/Iconify.db Normal file

Binary file not shown.

BIN
data/cursors/Max_Size.db Normal file

Binary file not shown.

BIN
data/cursors/Menu.db Normal file

Binary file not shown.

BIN
data/cursors/Resize.db Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
data/cursors/Title_Bar.db Normal file

Binary file not shown.

BIN
data/cursors/View_Icon.db Normal file

Binary file not shown.

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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);
}

View File

@ -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),

View File

@ -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);
}
}

View File

@ -115,6 +115,8 @@ struct _E_Border
int first_expose;
int hold_changes;
int changed;
};
@ -143,6 +145,10 @@ void e_border_init(void);
void e_border_adopt_children(Window win);
E_Border *e_border_current_focused(void);
void e_border_focus_grab_ended(void);
void e_border_raise_next(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);
#endif

View File

@ -22,8 +22,10 @@ static char cfg_menus_dir[4096] = "";
static char cfg_entries_dir[4096] = "";
static char cfg_selections_dir[4096] = "";
static char cfg_scrollbars_dir[4096] = "";
static char cfg_guides_dir[4096] = "";
static char cfg_user_dir[4096] = "";
static char cfg_images_dir[4096] = "";
static char cfg_cursors_dir[4096] = "";
static char cfg_backgrounds_dir[4096] = "";
static char cfg_fonts_dir[4096] = "";
@ -63,8 +65,12 @@ e_config_get(char *type)
PACKAGE_DATA_DIR"/data/config/appearance/default/selections/");
E_CONF("scrollbars", cfg_scrollbars_dir,
PACKAGE_DATA_DIR"/data/config/appearance/default/scrollbars/");
E_CONF("guides", cfg_guides_dir,
PACKAGE_DATA_DIR"/data/config/appearance/default/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,
@ -115,8 +121,10 @@ e_config_set_user_dir(char *dir)
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 */

238
src/cursors.c Normal file
View File

@ -0,0 +1,238 @@
#include "cursors.h"
#include "config.h"
#include "util.h"
typedef struct _e_cursor E_Cursor;
struct _e_cursor
{
char *type;
Cursor cursor;
time_t mod;
};
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;
if (!cursor_change) 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;
}
static void
e_cursors_set(char *type)
{
e_cursors_display_in_window(0, type);
}
static E_Cursor *
e_cursors_find(char *type)
{
Evas_List l;
for (l = cursors; l; l = l->next)
{
E_Cursor *c;
c = l->data;
if (!strcmp(c->type, type))
{
char buf[4096];
sprintf(buf, "%s/%s.db", e_config_get("cursors"), type);
if (e_file_modified_time(buf) > c->mod)
{
cursors = evas_list_remove(cursors, c);
IF_FREE(c->type);
e_cursor_free(c->cursor);
FREE(c);
return NULL;
}
return c;
}
}
return NULL;
}
void
e_cursors_display_in_window(Window win, char *type)
{
E_Cursor *c;
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[4096];
Imlib_Image im;
c = NEW(E_Cursor, 1);
ZERO(c, E_Cursor, 1);
e_strdup(c->type, type);
sprintf(buf, "%s/%s.db", e_config_get("cursors"), type);
c->mod = e_file_modified_time(buf);
E_DB_INT_GET(buf, "/cursor/x", hx, ok);
E_DB_INT_GET(buf, "/cursor/y", hy, ok);
sprintf(buf, "%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 = e_pixmap_new(0, w, h, 1);
mask = e_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 = e_gc_new(pmap);
gcf = e_gc_new(pmap);
e_gc_set_fg(gcb, 0);
e_gc_set_fg(gcf, 1);
/* fill out cursor pixmap with 0's (bg) */
e_fill_rectangle(pmap, gcb, 0, 0, w, h);
e_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)
{
e_draw_point(mask, gcf, x, y);
if ((r == fr) && (g == fg) && (b == fb))
e_draw_point(pmap, gcf, x, y);
}
}
}
done2:
/* clean up */
e_gc_free(gcb);
e_gc_free(gcf);
imlib_image_put_back_data(data);
imlib_free_image();
}
else
{
IF_FREE(c->type);
FREE(c);
c = NULL;
}
if (c)
{
c->cursor = e_cursor_new(pmap, mask, hx, hy, fr, fg, fb, br, bg, bb);
e_pixmap_free(pmap);
e_pixmap_free(mask);
cursors = evas_list_append(cursors, c);
}
}
if (c)
e_cursor_set(win, c->cursor);
else
e_cursors_display_in_window(win, "Default");
}
void
e_cursors_display(char *type)
{
IF_FREE(cur_cursor);
e_strdup(cur_cursor, type);
printf("%s\n", type);
cursor_change = 1;
}
void
e_cursors_init(void)
{
e_event_filter_idle_handler_add(e_cursors_idle, NULL);
e_cursors_set("Default");
}

11
src/cursors.h Normal file
View File

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

29
src/delayed.c Normal file
View File

@ -0,0 +1,29 @@
#include "delayed.h"
void
e_delayed_action_start(void *obs, void *obj)
{
char event_name[1024];
E_Delayed_Action *eda = obs;
snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", eda->e_event);
e_add_event_timer(event_name, eda->delay, eda->delay_func, 0, obj);
}
void
e_delayed_action_cancel(void *obs)
{
E_Delayed_Action *eda = obs;
char event_name[1024];
snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", eda->e_event);
e_del_event_timer(event_name);
}
void
e_delayed_action_free(void *obs)
{
e_delayed_action_cancel(obs);
free(obs);
}

27
src/delayed.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef E_DELAYED_H
#define E_DELAYED_H
#include "e.h"
typedef struct _E_Delayed_Action E_Delayed_Action;
struct _E_Delayed_Action {
OBS_PROPERTIES;
double delay;
void (*delay_func)(int val, void *obj);
};
#define E_DELAYED_ACT_INIT(_e_da, _e_act, _e_delay, _e_act_cb) \
{ \
OBS_INIT(_e_da, _e_act, e_delayed_action_start, e_delayed_action_free); \
_e_da->delay = _e_delay; \
_e_da->delay_func = _e_act_cb; \
}
void e_delayed_action_start(void *obs, void *obj);
void e_delayed_action_cancel(void *obs);
void e_delayed_action_free(void *obs);
#endif

View File

@ -59,7 +59,7 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
desk->y -= dy;
xd = yd = wd = hd = 0;
grav = NorthWestGravity;
grav_stick= SouthEastGravity;
grav_stick = SouthEastGravity;
if ((dx <= 0) && (dy <= 0))
{
grav = NorthWestGravity;
@ -104,7 +104,8 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
/* if sticky */
if (b->client.sticky)
e_window_gravity_set(b->win.main, StaticGravity);
e_window_gravity_set(b->win.main, grav);
else
e_window_gravity_set(b->win.main, grav);
}
grav_stick = StaticGravity;
e_window_gravity_set(desk->win.desk, grav_stick);
@ -118,7 +119,12 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
E_Border *b;
b = l->data;
e_window_gravity_set(b->win.main, grav_stick);
/* if sticky */
if (b->client.sticky)
e_window_gravity_set(b->win.main, StaticGravity);
else
e_window_gravity_set(b->win.main, grav_stick);
/* e_window_gravity_set(b->win.main, grav_stick);*/
}
e_window_move_resize(desk->win.container, 0, 0, screen_w, screen_h);
e_window_gravity_reset(desk->win.desk);
@ -128,17 +134,19 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
b = l->data;
e_window_gravity_reset(b->win.main);
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->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->changed = 1;
if (!b->client.sticky)
{
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->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->changed = 1;
}
}
e_sync();
}
void

72
src/e.h
View File

@ -92,11 +92,64 @@ printf("%3.3f : %s()\n", __p->total, __p->func); \
#define E_PROF_DUMP
#endif
/* Observer macros */
#define OBS_PROPERTIES \
Evas_List watched; \
Eevent_Type e_event; \
void (*e_obs_notify)(void *_e_obs, void *_e_obj); \
void (*e_obs_free)(void *_e_obs);
#define OBS_INIT(_e_obs, _e_event, _e_obs_notify, _e_obs_free) \
{ \
_e_obs->watched = NULL; \
_e_obs->e_event = _e_event; \
_e_obs->e_obs_notify = _e_obs_notify; \
_e_obs->e_obs_free = _e_obs_free; \
}
#define OBS_REGISTER(_e_obs, _e_obj) \
{ \
_e_obj->observers = evas_list_append(_e_obj->observers, _e_obs); \
_e_obs->watched = evas_list_append(_e_obs->watched, _e_obj); \
}
#define OBS_UNREGISTER(_e_obj, _e_obs) \
{ \
_e_obj->observers = evas_list_remove(_e_obj->observers, _e_obs); \
_e_obs->watched = evas_list_remove(_e_obs->watched, _e_obj); \
}
#define OBS_NOTIFY(_e_obj, _e_event) \
{ \
Evas_List obs; \
obs = _e_obj->observers; \
while (obs) { \
if (((E_Observer *)obs->data)->e_event == EV_MAX || \
((E_Observer *)obs->data)->e_event == _e_event) \
((E_Observer *)obs->data)->e_obs_notify(obs->data, _e_obj); \
obs = obs->next; \
} \
}
#define OBS_FREE(_e_obs) \
{ \
E_Object *_e_obj; \
E_Observer *_notify; \
while (_e_obs->watched) { \
_e_obj = _e_obj->watched->data; \
OBS_UNREGISTER(_e_obj, _e_obs); \
_e_obs->e_obs_free(_notify); \
} \
}
/* object macros */
#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_FREE(_e_obj) \
{ \
E_Observer *act; \
while (_e_obj->observers) { \
act = _e_obj->observers->data; \
OBS_UNREGISTER(_e_obj, act); \
} \
_e_obj->e_obj_free(_e_obj); \
}
#define OBJ_DO_FREE(_e_obj) \
OBJ_UNREF(_e_obj); \
OBJ_IF_FREE(_e_obj) \
@ -105,7 +158,8 @@ OBJ_FREE(_e_obj); \
}
#define OBJ_PROPERTIES \
int references; \
void (*e_obj_free) (void *e_obj);
void (*e_obj_free) (void *e_obj); \
Evas_List observers;
#define OBJ_INIT(_e_obj, _e_obj_free_func) \
{ \
_e_obj->references = 1; \
@ -114,16 +168,17 @@ _e_obj->e_obj_free = (void *) _e_obj_free_func; \
/* 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))
(((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
/* data type prototypes... not actually used */
typedef struct _E_Object E_Object;
typedef struct _E_Observer E_Observer;
/* actual data struct members */
struct _E_Object
@ -131,4 +186,9 @@ struct _E_Object
OBJ_PROPERTIES;
};
struct _E_Observer
{
OBS_PROPERTIES;
};
#endif

View File

@ -5,34 +5,34 @@
%}
class Window {
class window {
function getName();
function getTitle();
function getClass();
function getX();
function getY();
function getWidth();
function getHeight();
function get_name();
function get_title();
function get_class();
function get_x();
function get_y();
function get_width();
function get_height();
function move( number x, number y );
function resize( number width, number height );
function show();
function hide();
function isVisible();
function is_visible();
function shade();
function unshade();
function isShaded();
function is_shaded();
function iconify();
function uniconify();
function isIconic();
function is_iconic();
function isMapped();
function isTransient();
function isShaped();
function is_mapped();
function is_transient();
function is_shaped();
function delete();
function kill();
@ -41,25 +41,25 @@ class Window {
namespace e {
function flipToDesktop( number desk )
function flip_to_desktop( number desk )
%{
e_desktops_goto( (long)desk );
%}
function getCurrentDesktop()
function get_current_desktop()
%{
int retval = e_desktops_get_current();
FE_RETURN_INT( retval );
%}
function getDesktopCount()
function get_desktop_count()
%{
int retval = e_desktops_get_num();
FE_RETURN_INT( retval );
%}
function getWidth();
function getHeight();
function get_width();
function get_height();
// shutdown enlightenment
function shutdown()

View File

@ -269,6 +269,8 @@ e_embed_image_func_get_min_size(void *_data, double *w, double *h)
int iw, ih;
em = _data;
iw = 0;
ih = 0;
evas_get_image_size(em->evas, em->image_obj, &iw, &ih);
if (w) *w = iw;
if (h) *h = ih;

View File

@ -379,7 +379,7 @@ e_entry_new(void)
entry = NEW(E_Entry, 1);
ZERO(entry, E_Entry, 1);
entry->buffer=strdup("");
e_strdup(entry->buffer, "");
entry->select.start = -1;
entry->end_width = 4;
entries = evas_list_prepend(entries, entry);
@ -473,7 +473,7 @@ e_entry_handle_keypress(E_Entry *entry, Ev_Key_Down *e)
{
char *str2;
str2 = strdup(e_entry_get_text(entry));
e_strdup(str2, e_entry_get_text(entry));
str2[entry->cursor_pos] = 0;
e_entry_set_text(entry, str2);
free(str2);
@ -689,7 +689,7 @@ void
e_entry_set_text(E_Entry *entry, const char *text)
{
IF_FREE(entry->buffer);
entry->buffer = strdup(text);
e_strdup(entry->buffer, text);
evas_set_text(entry->evas, entry->text, entry->buffer);
if (entry->cursor_pos > (int)strlen(entry->buffer))
entry->cursor_pos = strlen(entry->buffer);
@ -769,7 +769,7 @@ e_entry_clear_selection(E_Entry *entry)
if (entry->select.start >= 0)
{
str2 = strdup(e_entry_get_text(entry));
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]));
@ -786,7 +786,7 @@ e_entry_delete_to_left(E_Entry *entry)
{
char *str2;
str2 = strdup(e_entry_get_text(entry));
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);
@ -798,7 +798,7 @@ e_entry_delete_to_right(E_Entry *entry)
{
char *str2;
str2 = strdup(e_entry_get_text(entry));
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);

View File

@ -2,6 +2,7 @@
#include "text.h"
#include "config.h"
#include "embed.h"
#include "util.h"
static struct
{
@ -35,6 +36,10 @@ static struct
Evas_Object icon;
Imlib_Image image;
} disp;
struct {
Embed icon;
Embed text;
} embed;
} guides;
static void e_guides_idle(void *data);
@ -65,11 +70,16 @@ e_guides_update(void)
{
if (!guides.win.display)
{
guides.win.display = e_window_new(0, 0, 0, 1, 1);
guides.win.l = e_window_new(0, 0, 0, 1, 1);
guides.win.r = e_window_new(0, 0, 0, 1, 1);
guides.win.t = e_window_new(0, 0, 0, 1, 1);
guides.win.b = e_window_new(0, 0, 0, 1, 1);
guides.win.display = e_window_override_new(0, 0, 0, 1, 1);
guides.win.l = e_window_override_new(0, 0, 0, 1, 1);
guides.win.r = e_window_override_new(0, 0, 0, 1, 1);
guides.win.t = e_window_override_new(0, 0, 0, 1, 1);
guides.win.b = e_window_override_new(0, 0, 0, 1, 1);
e_window_save_under(guides.win.display);
e_window_save_under(guides.win.l);
e_window_save_under(guides.win.r);
e_window_save_under(guides.win.t);
e_window_save_under(guides.win.b);
redraw = 1;
}
if (!guides.disp.evas)
@ -100,9 +110,18 @@ e_guides_update(void)
e_window_destroy(guides.win.r);
e_window_destroy(guides.win.t);
e_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)
@ -132,9 +151,7 @@ e_guides_update(void)
if ((guides.win.display) && (redraw))
{
int dx, dy, dw, dh;
int iw, ih;
double tw, th;
int dx, dy, dw, dh, sw, sh, mw, mh;
char file[4096];
if (!guides.disp.text)
@ -143,16 +160,6 @@ e_guides_update(void)
e_text_set_layer(guides.disp.text, 100);
e_text_show(guides.disp.text);
}
if (!guides.disp.bg)
{
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);
}
}
if ((!guides.current.display.icon) && (guides.disp.icon))
{
evas_del_object(guides.disp.evas, guides.disp.icon);
@ -161,18 +168,264 @@ e_guides_update(void)
if ((guides.current.display.icon) && (!guides.disp.icon))
{
guides.disp.icon = evas_add_image_from_file(guides.disp.evas, guides.current.display.icon);
evas_show(guides.disp.evas, guides.disp.icon);
}
if (guides.disp.icon)
{
evas_set_image_file(guides.disp.evas, guides.disp.icon, guides.current.display.icon);
evas_get_image_size(guides.disp.evas, guides.disp.icon, &iw, &ih);
}
evas_set_image_file(guides.disp.evas, guides.disp.icon, guides.current.display.icon);
e_text_set_text(guides.disp.text, guides.current.display.text);
e_text_get_min_size(guides.disp.text, &tw, &th);
if (!guides.disp.bg)
{
char *dir;
dir = e_config_get("guides");
sprintf(file, "%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)
{
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)
{
e_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;
}
guides.disp.image = imlib_create_image(dw, dh);
imlib_context_set_image(guides.disp.image);
imlib_image_set_has_alpha(1);
imlib_image_clear();
evas_set_output_image(guides.disp.evas, guides.disp.image);
evas_set_output_size(guides.disp.evas, dw, dh);
evas_set_output_viewport(guides.disp.evas, 0, 0, dw, dh);
evas_update_rect(guides.disp.evas, 0, 0, dw, dh);
evas_render(guides.disp.evas);
{
Pixmap pmap, mask;
pmap = e_pixmap_new(guides.win.display, dw, dh, 0);
mask = e_pixmap_new(guides.win.display, dw, dh, 1);
imlib_context_set_image(guides.disp.image);
imlib_context_set_dither_mask(1);
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);
e_window_set_background_pixmap(guides.win.display, pmap);
e_window_set_shape_mask(guides.win.display, mask);
e_window_clear(guides.win.display);
e_pixmap_free(pmap);
e_pixmap_free(mask);
}
e_window_move(guides.win.display, dx, dy);
e_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 = e_pixmap_new(guides.win.l, w, h, 0);
mask = e_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();
e_window_move(guides.win.l, x, y);
e_window_resize(guides.win.l, w, h);
e_window_set_background_pixmap(guides.win.l, pmap);
e_window_set_shape_mask(guides.win.l, mask);
e_window_clear(guides.win.l);
e_pixmap_free(pmap);
e_pixmap_free(mask);
}
else
{
e_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 = e_pixmap_new(guides.win.r, w, h, 0);
mask = e_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();
e_window_move(guides.win.r, x, y);
e_window_resize(guides.win.r, w, h);
e_window_set_background_pixmap(guides.win.r, pmap);
e_window_set_shape_mask(guides.win.r, mask);
e_window_clear(guides.win.r);
e_pixmap_free(pmap);
e_pixmap_free(mask);
}
else
{
e_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 = e_pixmap_new(guides.win.t, w, h, 0);
mask = e_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();
e_window_move(guides.win.t, x, y);
e_window_resize(guides.win.t, w, h);
e_window_set_background_pixmap(guides.win.t, pmap);
e_window_set_shape_mask(guides.win.t, mask);
e_window_clear(guides.win.t);
e_pixmap_free(pmap);
e_pixmap_free(mask);
}
else
{
e_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 = e_pixmap_new(guides.win.b, w, h, 0);
mask = e_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();
e_window_move(guides.win.b, x, y);
e_window_resize(guides.win.b, w, h);
e_window_set_background_pixmap(guides.win.b, pmap);
e_window_set_shape_mask(guides.win.b, mask);
e_window_clear(guides.win.b);
e_pixmap_free(pmap);
e_pixmap_free(mask);
}
else
{
e_window_resize(guides.win.b, 0, 0);
}
}
}
@ -180,8 +433,25 @@ e_guides_update(void)
{
if (guides.current.visible)
{
if (guides.current.mode != E_GUIDES_OPAQUE)
{
e_window_raise(guides.win.l);
e_window_show(guides.win.l);
e_window_raise(guides.win.r);
e_window_show(guides.win.r);
e_window_raise(guides.win.t);
e_window_show(guides.win.t);
e_window_raise(guides.win.b);
e_window_show(guides.win.b);
}
e_window_raise(guides.win.display);
e_window_show(guides.win.display);
}
}
if (guides.current.mode != guides.prev.mode)
{
if (guides.current.mode == E_GUIDES_BOX)
{
e_window_raise(guides.win.l);
e_window_show(guides.win.l);
e_window_raise(guides.win.r);
@ -191,6 +461,13 @@ e_guides_update(void)
e_window_raise(guides.win.b);
e_window_show(guides.win.b);
}
else if (guides.prev.mode == E_GUIDES_OPAQUE)
{
e_window_hide(guides.win.l);
e_window_hide(guides.win.r);
e_window_hide(guides.win.t);
e_window_hide(guides.win.b);
}
}
guides.prev = guides.current;
}
@ -240,8 +517,7 @@ e_guides_display_text(char *text)
IF_FREE(guides.current.display.text);
guides.current.display.text = NULL;
guides.prev.display.text = (char *)1;
if (text)
guides.current.display.text = strdup(text);
e_strdup(guides.current.display.text, text);
}
void
@ -253,8 +529,7 @@ e_guides_display_icon(char *icon)
IF_FREE(guides.current.display.icon);
guides.current.display.icon = NULL;
guides.prev.display.icon = (char *)1;
if (icon)
guides.current.display.icon = strdup(icon);
e_strdup(guides.current.display.icon, icon);
}
void

View File

@ -26,28 +26,16 @@ static void cb_exit(void)
E_PROF_DUMP;
}
static void ch_col(int val, void *data);
static void ch_col(int val, void *data)
{
E_Desktop *desk;
double v;
v = (double)val / 10;
desk = e_desktops_get(e_desktops_get_current());
e_desktops_scroll(desk, (int)(8 * sin(v)), (int)(8 * cos(v)));
e_add_event_timer("time", 0.02, ch_col, val + 1, NULL);
return;
UN(data);
}
static void wm_running_error(Display * d, XErrorEvent * ev);
static void
wm_running_error(Display * d, XErrorEvent * ev)
{
if ((ev->request_code == X_ChangeWindowAttributes) && (ev->error_code == BadAccess))
if ((ev->request_code == X_ChangeWindowAttributes) &&
(ev->error_code == BadAccess))
{
fprintf(stderr, "A WM is alreayd running. no point running now is there?\n");
exit(1);
fprintf(stderr, "A window manager is already running. No point running now is there?\n");
fprintf(stderr, "Exiting Enlightenment. Error.\n");
exit(-2);
}
UN(d);
}
@ -60,7 +48,6 @@ setup(void)
e_sync();
e_border_adopt_children(0);
e_ungrab();
/* e_add_event_timer("timer", 0.02, ch_col, 0, NULL);*/
}
int
@ -69,6 +56,7 @@ main(int argc, char **argv)
char *display = NULL;
int i;
srand(time(NULL));
atexit(cb_exit);
e_exec_set_args(argc, argv);
@ -77,33 +65,38 @@ main(int argc, char **argv)
/* Check command line options here: */
for (i = 1; i < argc; i++)
{
if ((!strcmp("-display", argv[i])) && (argc - i > 1))
{
display = argv[++i];
}
else if ((!strcmp("-help", argv[i]))
|| (!strcmp("--help", argv[i]))
|| (!strcmp("-h", argv[i])) || (!strcmp("-?", argv[i])))
{
printf("enlightenment options: \n"
"\t-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]))
|| (!strcmp("-v", argv[i])))
{
printf("Enlightenment Version: %s\n", ENLIGHTENMENT_VERSION);
exit(0);
}
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 (!e_display_init(display))
{
fprintf(stderr, "cannot connect to display!\n");
exit(1);
fprintf(stderr, "Enlightenment Error: cannot connect to display!\n");
fprintf(stderr, "Exiting Enlightenment. Error.\n");
exit(-1);
}
e_ev_signal_init();
@ -128,6 +121,8 @@ main(int argc, char **argv)
e_entry_init();
e_keys_init();
e_guides_init();
e_place_init();
e_cursors_init();
#ifdef USE_FERITE
e_ferite_init();
@ -142,6 +137,4 @@ main(int argc, char **argv)
#endif
return 0;
UN(argc);
UN(argv);
}

View File

@ -66,13 +66,17 @@ e_text_set_text(E_Text *t, char *text)
if (!strcmp(t->text, text)) return;
IF_FREE(t->text);
t->text = strdup(text);
evas_set_text(t->evas, t->obj.o1, t->text);
evas_set_text(t->evas, t->obj.o2, t->text);
evas_set_text(t->evas, t->obj.o3, t->text);
evas_set_text(t->evas, t->obj.o4, t->text);
evas_set_text(t->evas, t->obj.text, t->text);
t->w = evas_get_text_width(t->evas, t->obj.text) + 2;
t->h = evas_get_text_height(t->evas, t->obj.text) + 2;
t->min.w = t->w;
t->min.h = t->h;
t->max.w = t->w;
t->max.h = t->h;
t->min.w = t->w + 2;
t->min.h = t->h + 2;
t->max.w = t->w + 2;
t->max.h = t->h + 2;
}
void

View File

@ -21,6 +21,8 @@ static void e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int
static void e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void e_idle(void *data);
static void e_wheel(Eevent * ev);
@ -241,6 +243,7 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ev_Mouse_Down *ev;
E_View *v;
if (!current_ev) return;
ev = current_ev->event;
v = _data;
if (!(ev->mods & (mulit_select_mod | range_select_mod)))
@ -285,6 +288,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
E_View *v;
int dx, dy;
if (!current_ev) return;
ev = current_ev->event;
v = _data;
dx = 0;
@ -379,6 +383,7 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ev_Mouse_Down *ev;
E_View *v;
if (!current_ev) return;
ev = current_ev->event;
v = _data;
if (v->select.on)
@ -772,6 +777,7 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ev_Mouse_Down *e;
ev = e_view_get_current_event();
if (!ev) return;
e = ev->event;
ic = _data;
ic->view->select.down.x = _x;
@ -820,6 +826,7 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ev_Mouse_Up *e;
ev = e_view_get_current_event();
if (!ev) return;
e = ev->event;
ic = _data;
if (ic->view->drag.started)
@ -860,6 +867,34 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
UN(_y);
}
static void
e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Icon *ic;
ic = _data;
e_cursors_display_in_window(ic->view->win.main, "View_Icon");
UN(_e);
UN(_o);
UN(_b);
UN(_x);
UN(_y);
}
static void
e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Icon *ic;
ic = _data;
e_cursors_display_in_window(ic->view->win.main, "View");
UN(_e);
UN(_o);
UN(_b);
UN(_x);
UN(_y);
}
static void
e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
@ -868,6 +903,7 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ev_Mouse_Move *e;
ev = e_view_get_current_event();
if (!ev) return;
e = ev->event;
ic = _data;
if (!ic->state.clicked) return;
@ -961,6 +997,10 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
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);
for (l = views; l; l = l->next)
{
E_View *v;
@ -1033,6 +1073,7 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
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();
}
@ -1439,6 +1480,7 @@ e_mouse_move(Eevent * ev)
if (e->win == v->win.main)
{
evas_event_move(v->evas, e->x, e->y);
current_ev = NULL;
return;
}
}
@ -1452,6 +1494,7 @@ e_mouse_in(Eevent * ev)
Evas_List l;
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
{
E_View *v;
@ -1466,9 +1509,11 @@ e_mouse_in(Eevent * ev)
e_focus_to_window(e->win);
evas_event_enter(v->evas);
}
current_ev = NULL;
return;
}
}
current_ev = NULL;
}
static void
@ -1478,6 +1523,7 @@ e_mouse_out(Eevent * ev)
Evas_List l;
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
{
E_View *v;
@ -1486,9 +1532,11 @@ e_mouse_out(Eevent * ev)
if (e->win == v->win.main)
{
evas_event_leave(v->evas);
current_ev = NULL;
return;
}
}
current_ev = NULL;
}
static void
@ -1625,9 +1673,13 @@ e_view_icon_show(E_Icon *ic)
evas_set_color(ic->view->evas, ic->obj.event2, 0, 0, 0, 0);
evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_DOWN, e_icon_down_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_UP, e_icon_up_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_IN, e_icon_in_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_OUT, e_icon_out_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_MOVE, e_icon_move_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_DOWN, e_icon_down_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_UP, e_icon_up_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_IN, e_icon_in_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_OUT, e_icon_out_cb, ic);
evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_MOVE, e_icon_move_cb, ic);
}
evas_set_layer(ic->view->evas, ic->obj.icon, 200);
@ -2234,6 +2286,7 @@ e_view_realize(E_View *v)
image_cache,
font_dir);
v->win.main = evas_get_window(v->evas);
e_cursors_display_in_window(v->win.main, "View");
evas_event_move(v->evas, -999999, -999999);
e_add_child(v->win.base, v->win.main);
e_window_set_events(v->win.base,