Sorry guys.. I had to revert a bunch of changes.. that's life.. but READ the

following (it's in the README now)

-------------------------------------------------------------------------------
                       Enlightenment 0.17.0 CVS Code....
-------------------------------------------------------------------------------
       The Rasterman - raster@valinux.com, raster@rasterman.com


*******************************************************************************
**************** READ THIS! It is of the UTMOST IMPORTANCE! *******************
*******************************************************************************

This is the source code for Enlightenment 0.17 - If you got this you got it
from Enlightenment's CVS repository - or from someone who took it out of
the CVS repository.

The CVS repository is full of code *IN DEVELOPMENT* - that often means it's
in the middle of being worked on and may install strange things in strange
places, make a mess, and may not even be compatible with a final release. If
you at all use this code, you are HEAVILY URGED, when it is finally released,
to remove all traces of anything this CVS code base has installed on your
system (it is COMPLETELY up to you to keep track of that - do NOT expect any
help), and then install the full release on a cleaned system. Don't come
asking "can I just keep using CVS" oonce things are released - thqat is the
reason I pu this paragraph here - so you don't ask. The asnwer 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.

Now we have that warning over and done with. How to build and install from
CVS?

$ ./autogen.sh && make
$ su
Password:
<- as root ->
# make install

You should be able to use the binary of enlightenment as a window manager.

you might be advised for cleanliness to do
$ ./autogen.sh --prefix=/usr/local/e-17

so it installs relative to the /usr/local/e-17 directory and keeps all the
e-17 development code and data in that tree so it is easily removed when the
time codes.



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 menus or keybindings or any way of launching
applications right now - you'll have to figure out an alternative way of
doing it.

Enlightenment only handles a small subset of ICCCM and thus will have bugs -
some applications will not behave correctly and may apear in odd spots or
not resize or place themselves properly etc. Expect this - it's code being
worked on. Just be happy it does as much as it already does.

Enlightenment RELIES on lots of libraires that have been written. Ecore,
Ebits, Evas, Edb, Imlib2 just to mention a few. Especially Ebits, Ecore 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. 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).

I hope that clears things up for now.


SVN revision: 3976
This commit is contained in:
Carsten Haitzler 2000-12-11 20:08:38 +00:00
parent 603ae6abfd
commit 22aa9d2a5d
20 changed files with 1912 additions and 1158 deletions

View File

@ -11,4 +11,4 @@ Then to compile:
To install (run this as root, or the user who handles installs):
make install
NOTE: You MUST make install Etcher for it to run properly.
NOTE: You MUST make install Enlightenment for it to run properly.

View File

@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = intl po src
SUBDIRS = intl po src lib
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \

95
README
View File

@ -1,3 +1,96 @@
-------------------------------------------------------------------------------
Enlightenment 0.17.0 PRE-RELEASE....
Enlightenment 0.17.0 CVS Code....
-------------------------------------------------------------------------------
The Rasterman - raster@valinux.com, raster@rasterman.com
*******************************************************************************
**************** READ THIS! It is of the UTMOST IMPORTANCE! *******************
*******************************************************************************
This is the source code for Enlightenment 0.17 - If you got this you got it
from Enlightenment's CVS repository - or from someone who took it out of
the CVS repository.
The CVS repository is full of code *IN DEVELOPMENT* - that often means it's
in the middle of being worked on and may install strange things in strange
places, make a mess, and may not even be compatible with a final release. If
you at all use this code, you are HEAVILY URGED, when it is finally released,
to remove all traces of anything this CVS code base has installed on your
system (it is COMPLETELY up to you to keep track of that - do NOT expect any
help), and then install the full release on a cleaned system. Don't come
asking "can I just keep using CVS" oonce things are released - thqat is the
reason I pu this paragraph here - so you don't ask. The asnwer 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.
Now we have that warning over and done with. How to build and install from
CVS?
$ ./autogen.sh && make
$ su
Password:
<- as root ->
# make install
You should be able to use the binary of enlightenment as a window manager.
you might be advised for cleanliness to do
$ ./autogen.sh --prefix=/usr/local/e-17
so it installs relative to the /usr/local/e-17 directory and keeps all the
e-17 development code and data in that tree so it is easily removed when the
time codes.
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 menus or keybindings or any way of launching
applications right now - you'll have to figure out an alternative way of
doing it.
Enlightenment only handles a small subset of ICCCM and thus will have bugs -
some applications will not behave correctly and may apear in odd spots or
not resize or place themselves properly etc. Expect this - it's code being
worked on. Just be happy it does as much as it already does.
Enlightenment RELIES on lots of libraires that have been written. Ecore,
Ebits, Evas, Edb, Imlib2 just to mention a few. Especially Ebits, Ecore 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. 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).
I hope that clears things up for now.

View File

@ -8,3 +8,4 @@
#undef PACKAGE_DATA_DIR
#undef PACKAGE_SOURCE_DIR
#undef PACKAGE_BIN_DIR
#undef PACKAGE_LIB_DIR

View File

@ -53,6 +53,7 @@
#undef PACKAGE_DATA_DIR
#undef PACKAGE_SOURCE_DIR
#undef PACKAGE_BIN_DIR
#undef PACKAGE_LIB_DIR
/* Define if you have the __argz_count function. */
#undef HAVE___ARGZ_COUNT

View File

@ -8,6 +8,9 @@ AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_C_CONST
AM_ENABLE_SHARED
AM_PROG_LIBTOOL
AM_WITH_DMALLOC
@ -36,12 +39,23 @@ fi
dnl Set PACKAGE_BIN_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/bin'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin/${PACKAGE}")
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${ac_default_prefix}/bin")
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin/${PACKAGE}")
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${prefix}/bin")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}/${PACKAGE}")
AC_DEFINE_UNQUOTED(PACKAGE_BIN_DIR, "${bindir}")
fi
dnl Set PACKAGE_LIB_DIR in config.h.
if test "x${datadir}" = 'x${prefix}/lib'; then
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${ac_default_prefix}/lib")
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${prefix}/lib")
fi
else
AC_DEFINE_UNQUOTED(PACKAGE_LIB_DIR, "${libdir}")
fi
dnl Set PACKAGE_SOURCE_DIR in config.h.
@ -79,6 +93,7 @@ AC_SUBST(ecore_libs)
AC_OUTPUT([
Makefile
src/Makefile
lib/Makefile
intl/Makefile
po/Makefile.in
])

28
e.spec
View File

@ -1,30 +1,28 @@
# Note that this is NOT a relocatable package
%define ver 1.0
%define ver 0.17.0
%define rel 1
%define prefix /usr/local
Summary: Enlightenment DR0.17's new "bit" editor
Name: etcher
Summary: Enlightenment DR0.17 CVS
Name: enlightenment
Version: %ver
Release: %rel
Copyright: BSD
Group: X11/Libraries
Source: ftp://ftp.enlightenment.org/pub/enlightenment/etcher-%{ver}.tar.gz
BuildRoot: /var/tmp/etcher-root
Packager: Term <kempler@utdallas.edu>
Source: ftp://ftp.enlightenment.org/pub/enlightenment/enlightenment-%{ver}.tar.gz
BuildRoot: /var/tmp/enlightenment-root
Packager: The Rasterman <raster@rasterman.com>
URL: http://www.enlightenment.org/
Requires: evas >= 0.0.1
Requires: evas >= 0.0.2
Requires: edb >= 1.0.0
Requires: imlib2 >= 1.0.0
Requires: ebits >= 0.0.0
Requires: ecore >= 0.0.1
Docdir: %{prefix}/doc
%description
Etcher is a new application devised to assist would-be theme developers in
designin "bits", that is, window borders, icons, whatever, for
Enlightenment. Since Enlightenment DR0.17 uses drag-and-drop instead of
texual configuration files, this application will become instrumental for
themeing under the new Enlightenment version.
Errrrrrr - E17. You go figure.
%prep
%setup
@ -54,13 +52,13 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README COPYING ChangeLog
%attr(755,root,root) %{prefix}/bin/etcher
%{prefix}/share/etcher/*
%attr(755,root,root) %{prefix}/bin/enlightenment
%{prefix}/share/enlightenment/*
%doc AUTHORS
%doc COPYING
%doc README
%changelog
* Mon Aug 28 2000 Lyle Kempler <kempler@utdallas.edu>
* The Rasterman <raster@rasterman.com>
- Created spec file

20
lib/Makefile.am Normal file
View File

@ -0,0 +1,20 @@
## Process this file with automake to produce Makefile.in
AUTOMAKE_OPTIONS = 1.4 foreign
# A list of all the files in the current directory which can be regenerated
MAINTAINERCLEANFILES = Makefile.in
LDFLAGS = -L/usr/X11R6/lib -L/usr/local/lib
INCLUDES = -I/usr/X11R6/include -I/usr/local/include \
$(X_CFLAGS) -I$(includedir)
lib_LTLIBRARIES = libehack.la
include_HEADERS =
libehack_la_SOURCES = \
e_hack.c \
e_hack.h
libehack_la_LIBADD = -lX11 -ldl $(LDFLAGS)
libehack_la_DEPENDENCIES = $(top_builddir)/config.h
libehack_la_LDFLAGS = -version-info 0:1:0

206
lib/e_hack.c Normal file
View File

@ -0,0 +1,206 @@
#include "config.h"
#include "e_hack.h"
/* prototypes */
static void __e_hack_set_properties(Display *display, Window window);
/* dlopened xlib so we can find the symbols in the real xlib to call them */
static void *lib_xlib = NULL;
/* the function that actually sets the properties on toplevel window */
static void
__e_hack_set_properties(Display *display, Window window)
{
static Atom a_launch_id = 0;
static Atom a_launch_path = 0;
static Atom a_user_id = 0;
static Atom a_process_id = 0;
static Atom a_p_process_id = 0;
static Atom a_machine_name = 0;
static Atom a_user_name = 0;
char *env = NULL;
if (!a_launch_id) a_launch_id = XInternAtom(display, "_E_HACK_LAUNCH_ID", False);
if (!a_launch_path) a_launch_path = XInternAtom(display, "_E_HACK_LAUNCH_PATH", False);
if (!a_user_id) a_user_id = XInternAtom(display, "_E_HACK_USER_ID", False);
if (!a_process_id) a_process_id = XInternAtom(display, "_E_HACK_PROCESS_ID", False);
if (!a_p_process_id) a_p_process_id = XInternAtom(display, "_E_HACK_PARENT_PROCESS_ID", False);
if (!a_machine_name) a_machine_name = XInternAtom(display, "_E_HACK_MACHINE_NAME", False);
if (!a_user_name) a_user_name = XInternAtom(display, "_E_HACK_USER_NAME", False);
if ((env = getenv("E_HACK_LAUNCH_ID")))
XChangeProperty(display, window, a_launch_id, XA_STRING, 8, PropModeReplace, env, strlen(env));
if ((env = getenv("E_HACK_LAUNCH_PATH")))
XChangeProperty(display, window, a_launch_path, XA_STRING, 8, PropModeReplace, env, strlen(env));
{
uid_t uid;
pid_t pid, ppid;
struct utsname ubuf;
char buf[4096];
uid = getuid();
pid = getpid();
ppid = getppid();
snprintf(buf, sizeof(buf), "%i", uid);
XChangeProperty(display, window, a_user_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
snprintf(buf, sizeof(buf), "%i", pid);
XChangeProperty(display, window, a_process_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
snprintf(buf, sizeof(buf), "%i", ppid);
XChangeProperty(display, window, a_p_process_id, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
if (!uname(&ubuf))
{
snprintf(buf, sizeof(buf), "%s", ubuf.nodename);
XChangeProperty(display, window, a_machine_name, XA_STRING, 8, PropModeReplace, buf, strlen(buf));
}
else
XChangeProperty(display, window, a_machine_name, XA_STRING, 8, PropModeReplace, " ", 1);
}
if ((env = getenv("USER")))
XChangeProperty(display, window, a_user_name, XA_STRING, 8, PropModeReplace, env, strlen(env));
}
/* XCreateWindow intercept hack */
Window
XCreateWindow(
Display *display,
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int border_width,
int depth,
unsigned int class,
Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes
)
{
static Window (*func)
(
Display *display,
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int border_width,
int depth,
unsigned int class,
Visual *visual,
unsigned long valuemask,
XSetWindowAttributes *attributes
) = NULL;
int i;
/* find the real Xlib and the real X function */
if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
if (!func) func = dlsym (lib_xlib, "XCreateWindow");
/* multihead screen handling loop */
for (i = 0; i < ScreenCount(display); i++)
{
/* if the window is created as a toplevel window */
if (parent == RootWindow(display, i))
{
Window window;
/* create it */
window = (*func) (display, parent, x, y, width, height,
border_width, depth, class, visual, valuemask,
attributes);
/* set properties */
__e_hack_set_properties(display, window);
/* return it */
return window;
}
}
/* normal child window - create as usual */
return (*func) (display, parent, x, y, width, height, border_width, depth,
class, visual, valuemask, attributes);
}
/* XCreateSimpleWindow intercept hack */
Window
XCreateSimpleWindow(
Display *display,
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int border_width,
unsigned long border,
unsigned long background
)
{
static Window (*func)
(
Display *display,
Window parent,
int x, int y,
unsigned int width, unsigned int height,
unsigned int border_width,
unsigned long border,
unsigned long background
) = NULL;
int i;
/* find the real Xlib and the real X function */
if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
if (!func) func = dlsym (lib_xlib, "XCreateSimpleWindow");
/* multihead screen handling loop */
for (i = 0; i < ScreenCount(display); i++)
{
/* if the window is created as a toplevel window */
if (parent == RootWindow(display, i))
{
Window window;
/* create it */
window = (*func) (display, parent, x, y, width, height,
border_width, border, background);
/* set properties */
__e_hack_set_properties(display, window);
/* return it */
return window;
}
}
/* normal child window - create as usual */
return (*func) (display, parent, x, y, width, height,
border_width, border, background);
}
/* XReparentWindow intercept hack */
int
XReparentWindow(
Display *display,
Window window,
Window parent,
int x, int y
)
{
static int (*func)
(
Display *display,
Window window,
Window parent,
int x, int y
) = NULL;
int i;
/* find the real Xlib and the real X function */
if (!lib_xlib) lib_xlib = dlopen("libX11.so", RTLD_GLOBAL | RTLD_LAZY);
if (!func) func = dlsym (lib_xlib, "XReparentWindow");
/* multihead screen handling loop */
for (i = 0; i < ScreenCount(display); i++)
{
/* if the window is created as a toplevel window */
if (parent == RootWindow(display, i))
{
/* set properties */
__e_hack_set_properties(display, window);
/* reparent it */
return (*func) (display, window, parent, x, y);
}
}
/* normal child window reparenting - reparent as usual */
return (*func) (display, window, parent, x, y);
}

12
lib/e_hack.h Normal file
View File

@ -0,0 +1,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <dlfcn.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/utsname.h>
#include <X11/Xlib.h>
#include <X11/X.h>
#include <X11/Xatom.h>

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,8 @@ e_idle(void *data)
e_desktops_update(desk);
}
e_db_runtime_flush();
return;
UN(data);
}
/* handling mouse down events */
@ -54,6 +56,8 @@ e_mouse_down(Eevent * ev)
x = e->rx - x;
y = e->ry - y;
evas_event_button_down(evas, x, y, e->button);
if (e->button == 3)
e_exec_restart();
return;
}
}
@ -341,7 +345,22 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
void
e_desktops_free(E_Desktop *desk)
{
while (desk->windows)
{
E_Border *b;
b = desk->windows->data;
e_action_stop_by_object(b, NULL, 0, 0, 0, 0);
OBJ_UNREF(b);
OBJ_IF_FREE(b)
{
e_window_reparent(b->win.client, 0, 0, 0);
e_icccm_release(b->win.client);
OBJ_FREE(b);
}
}
e_window_destroy(desk->win.main);
if (desk->evas.pmap) e_pixmap_free(desk->evas.pmap);
IF_FREE(desk->name);
IF_FREE(desk->dir);
FREE(desk);
@ -443,6 +462,7 @@ e_desktops_delete(E_Desktop *d)
void
e_desktops_show(E_Desktop *d)
{
e_desktops_update(d);
e_window_show(d->win.main);
}
@ -491,7 +511,6 @@ e_desktops_update(E_Desktop *desk)
{
Imlib_Updates u;
printf("rendered desktop\n");
for (u = up; u; u = imlib_updates_get_next(u))
{
int x, y, w, h;

24
src/e.h
View File

@ -1,6 +1,3 @@
#ifndef __E_H_
#define __E_H_
#include "../config.h"
#include <X11/Xlib.h>
#include <Imlib2.h>
@ -20,6 +17,9 @@
#include <dirent.h>
#include <errno.h>
#include <signal.h>
#ifdef WITH_DMALLOC
#include <dmalloc.h>
#endif
#define E_PROF 1
#ifdef E_PROF
@ -100,6 +100,7 @@ _e_obj->e_obj_free = (void *) _e_obj_free_func; \
#define SPANS_COMMON(x1, w1, x2, w2) \
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
#define UN(_blah) _blah = 0
#define ACT_MOUSE_IN 0
#define ACT_MOUSE_OUT 1
@ -178,16 +179,19 @@ struct _E_Border
char *class;
char *command;
Window group;
int takes_focus;
int sticky;
Colormap colormap;
int fixed;
int arrange_ignore;
int shaded;
int hidden;
int iconified;
int borderless;
int titlebar;
int border;
int handles;
int w, h;
} client;
struct {
@ -199,6 +203,8 @@ struct _E_Border
int ignore_unmap;
int placed;
Evas_List grabs;
E_Desktop *desk;
@ -299,7 +305,8 @@ void e_border_lower(E_Border *b);
void e_border_raise_above(E_Border *b, E_Border *above);
void e_border_lower_below(E_Border *b, E_Border *below);
void e_border_init(void);
void e_border_adopt_children(Window win);
void e_icccm_move_resize(Window win, int x, int y, int w, int h);
void e_icccm_delete(Window win);
void e_icccm_state_mapped(Window win);
@ -314,6 +321,8 @@ void e_icccm_set_frame_size(Window win, int l, int r, int t, int b);
void e_icccm_set_desk_area(Window win, int ax, int ay);
void e_icccm_set_desk_area_size(Window win, int ax, int ay);
void e_icccm_set_desk(Window win, int d);
void e_icccm_handle_property_change(Atom a, E_Border *b);
void e_icccm_handle_client_message(Ev_Message *e);
void e_icccm_advertise_e_compat(void);
void e_icccm_advertise_mwm_compat(void);
void e_icccm_advertise_gnome_compat(void);
@ -338,6 +347,11 @@ void e_desktops_update(E_Desktop *desk);
void e_resist_border(E_Border *b);
time_t e_file_modified_time(char *file);
void e_set_env(char *variable, char *content);
#endif
void e_exec_set_args(int argc, char **argv);
void e_exec_restart(void);
pid_t e_exec_run(char *exe);
pid_t e_exec_run_in_dir(char *exe, char *dir);
pid_t e_run_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, char *launch_path);

View File

@ -1,5 +1,46 @@
#include "e.h"
#include "icccm.h"
/* Motif window hints */
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)
/* bit definitions for MwmHints.functions */
#define MWM_FUNC_ALL (1L << 0)
#define MWM_FUNC_RESIZE (1L << 1)
#define MWM_FUNC_MOVE (1L << 2)
#define MWM_FUNC_MINIMIZE (1L << 3)
#define MWM_FUNC_MAXIMIZE (1L << 4)
#define MWM_FUNC_CLOSE (1L << 5)
/* bit definitions for MwmHints.decorations */
#define MWM_DECOR_ALL (1L << 0)
#define MWM_DECOR_BORDER (1L << 1)
#define MWM_DECOR_RESIZEH (1L << 2)
#define MWM_DECOR_TITLE (1L << 3)
#define MWM_DECOR_MENU (1L << 4)
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)
/* bit definitions for MwmHints.inputMode */
#define MWM_INPUT_MODELESS 0
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
#define MWM_INPUT_SYSTEM_MODAL 2
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
#define PROP_MWM_HINTS_ELEMENTS 5
/* Motif window hints */
typedef struct _mwmhints
{
int flags;
int functions;
int decorations;
int inputMode;
int status;
}
MWMHints;
void
e_icccm_move_resize(Window win, int x, int y, int w, int h)
@ -105,8 +146,6 @@ e_icccm_get_size_info(Window win, E_Border *b)
x = 0; y = 0; w = 0; h = 0;
e_window_get_geometry(win, &x, &y, &w, &h);
printf("window at %i %i\n", x, y);
grav = NorthWestGravity;
mask = 0;
min_w = 0;
@ -121,14 +160,27 @@ e_icccm_get_size_info(Window win, E_Border *b)
base_h = 0;
if (e_window_get_wm_size_hints(win, &hint, &mask))
{
if (hint.flags & PWinGravity) grav = hint.win_gravity;
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
if (!b->placed)
{
if (hint.flags & PWinGravity) grav = hint.win_gravity;
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
{
}
else
{
/* get x,y location of client */
x = rand()%640;
y = rand()%480;
}
}
else
{
x = rand()%640;
y = rand()%480;
int pl, pr, pt, pb;
pl = pr = pt = pb = 0;
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
x = b->current.x + pl;
y = b->current.y + pt;
}
if (hint.flags & PMinSize)
{
@ -171,15 +223,27 @@ e_icccm_get_size_info(Window win, E_Border *b)
}
else
{
/* get x,y location of client */
x = rand()%640;
y = rand()%480;
if (!b->placed)
{
/* get x,y location of client */
x = rand()%640;
y = rand()%480;
}
else
{
int pl, pr, pt, pb;
pl = pr = pt = pb = 0;
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
x = b->current.x + pl;
y = b->current.y + pt;
}
}
{
int pl, pr, pt, pb;
pl = pr = pt = pb = 0;
if (b->bits.l) ebits_get_insets(b->bits.l, &pl, &pr, &pt, &pb);
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
b->current.requested.x = x - pl;
b->current.requested.y = y - pt;
b->current.requested.w = w + pl + pr;
@ -210,7 +274,7 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
mwmhints = e_window_property_get(win, a_motif_wm_hints, a_motif_wm_hints, &size);
if (mwmhints)
{
int i, num;
int num;
num = size / sizeof(int);
if (num < PROP_MWM_HINTS_ELEMENTS)
@ -249,7 +313,7 @@ e_icccm_get_layer(Window win, E_Border *b)
props = e_window_property_get(win, a_win_layer, XA_CARDINAL, &size);
if (props)
{
int i, num;
int num;
num = size / sizeof(int);
if (num > 0) b->client.layer = props[0];
@ -306,6 +370,23 @@ e_icccm_set_desk(Window win, int d)
e_window_property_set(win, a_win_workspace, XA_CARDINAL, 32, props, 1);
}
void
e_icccm_handle_property_change(Atom a, E_Border *b)
{
static Atom a_wm_normal_hints = 0;
E_ATOM(a_wm_normal_hints, "WM_NORMAL_HINTS");
if (a == a_wm_normal_hints) e_icccm_get_size_info(b->win.client, b);
}
void
e_icccm_handle_client_message(Ev_Message *e)
{
return;
UN(e);
}
void
e_icccm_advertise_e_compat(void)
{
@ -335,14 +416,14 @@ e_icccm_advertise_gnome_compat(void)
Window win;
E_ATOM(a_win_protocols, "_WIN_PROTOCOLS");
E_ATOM(a_win_protocols, "_WIN_LAYER");
E_ATOM(a_win_layer, "_WIN_LAYER");
props[0] = a_win_protocols;
e_window_property_set(0, a_win_protocols, XA_ATOM, 32, props, 1);
E_ATOM(a_win_wm_name, "_WIN_WM_NAME");
e_window_property_set(win, a_win_wm_name, XA_STRING, 8, "Enlightenment", strlen("Enlightenment"));
e_window_property_set(0, a_win_wm_name, XA_STRING, 8, "Enlightenment", strlen("Enlightenment"));
E_ATOM(a_win_wm_version, "_WIN_WM_VERSION");
e_window_property_set(win, a_win_wm_version, XA_STRING, 8, "0.17.0", strlen("0.17.0"));
e_window_property_set(0, a_win_wm_version, XA_STRING, 8, "0.17.0", strlen("0.17.0"));
E_ATOM(a_win_supporting_wm_check, "_WIN_SUPPORTING_WM_CHECK");
win = e_window_override_new(0, 0, 0, 7, 7);

View File

@ -1,46 +0,0 @@
#ifndef __ICCCM_H_
#define __ICCCM_H_
/* Motif window hints */
#define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1)
#define MWM_HINTS_INPUT_MODE (1L << 2)
#define MWM_HINTS_STATUS (1L << 3)
/* bit definitions for MwmHints.functions */
#define MWM_FUNC_ALL (1L << 0)
#define MWM_FUNC_RESIZE (1L << 1)
#define MWM_FUNC_MOVE (1L << 2)
#define MWM_FUNC_MINIMIZE (1L << 3)
#define MWM_FUNC_MAXIMIZE (1L << 4)
#define MWM_FUNC_CLOSE (1L << 5)
/* bit definitions for MwmHints.decorations */
#define MWM_DECOR_ALL (1L << 0)
#define MWM_DECOR_BORDER (1L << 1)
#define MWM_DECOR_RESIZEH (1L << 2)
#define MWM_DECOR_TITLE (1L << 3)
#define MWM_DECOR_MENU (1L << 4)
#define MWM_DECOR_MINIMIZE (1L << 5)
#define MWM_DECOR_MAXIMIZE (1L << 6)
/* bit definitions for MwmHints.inputMode */
#define MWM_INPUT_MODELESS 0
#define MWM_INPUT_PRIMARY_APPLICATION_MODAL 1
#define MWM_INPUT_SYSTEM_MODAL 2
#define MWM_INPUT_FULL_APPLICATION_MODAL 3
#define PROP_MWM_HINTS_ELEMENTS 5
/* Motif window hints */
typedef struct _mwmhints
{
int flags;
int functions;
int decorations;
int inputMode;
int status;
}
MWMHints;
#endif

View File

@ -7,7 +7,6 @@ Evas_List __e_profiles = NULL;
static void cb_exit(void);
static void cb_exit(void)
{
printf("cb_exit\n");
E_PROF_DUMP;
}
@ -21,6 +20,8 @@ static void ch_col(int val, void *data)
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);
}
void setup(void);
@ -37,6 +38,8 @@ setup(void)
int
main(int argc, char **argv)
{
e_exec_set_args(argc, argv);
atexit(cb_exit);
e_display_init(NULL);
e_ev_signal_init();
@ -52,4 +55,6 @@ main(int argc, char **argv)
e_event_loop();
return 0;
UN(argc);
UN(argv);
}

View File

@ -6,7 +6,7 @@ e_resist_border(E_Border *b)
int resist = 1;
int desk_resist = 32;
int win_resist = 12;
int ok;
int ok = 0;
int dx, dy, d;
int resist_x = 0, resist_y = 0;
char *settings_db = "./settings.db";
@ -112,16 +112,18 @@ rects = evas_list_append(rects, r); \
}
if (dx != 0)
{
if (((b->previous.requested.dx < 0) && (b->current.requested.dx > 0)) ||
((b->previous.requested.dx > 0) && (b->current.requested.dx < 0)))
if ((b->previous.requested.x != b->previous.x) &&
(((b->previous.requested.dx < 0) && (b->current.requested.dx > 0)) ||
((b->previous.requested.dx > 0) && (b->current.requested.dx < 0))))
b->current.requested.x = b->current.x;
else
b->current.x = b->current.requested.x + resist_x;
}
if (dy != 0)
{
if (((b->previous.requested.dy < 0) && (b->current.requested.dy > 0)) ||
((b->previous.requested.dy > 0) && (b->current.requested.dy < 0)))
if ((b->previous.requested.y != b->previous.y) &&
(((b->previous.requested.dy < 0) && (b->current.requested.dy > 0)) ||
((b->previous.requested.dy > 0) && (b->current.requested.dy < 0))))
b->current.requested.y = b->current.y;
else
b->current.y = b->current.requested.y + resist_y;

View File

@ -8,3 +8,12 @@ e_file_modified_time(char *file)
if (stat(file, &st) < 0) return 0;
return st.st_mtime;
}
void
e_set_env(char *variable, char *content)
{
char env[4096];
sprintf(env, "%s=%s", variable, content);
putenv(env);
}