aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcpk <cpk>2001-11-02 17:07:52 +0000
committercpk <cpk@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2001-11-02 17:07:52 +0000
commit02379472ae1b4c15b2704505e1056da458719c28 (patch)
tree0144ab4ec0d3c75818568952103be74c9e071a0d
parent59eda55bb749d28daa39245b16a952752a1ba4da (diff)
downloadenlightenment-02379472ae1b4c15b2704505e1056da458719c28.tar.gz
enlightenment-02379472ae1b4c15b2704505e1056da458719c28.tar.xz
enlightenment-02379472ae1b4c15b2704505e1056da458719c28.zip
Alright, I spent some time now reading e17's code. Here's what
I've changed, this is big, so read this carefully :) * I've added debugging macros for messages and function call tracing. Usage: D("Creating item %i %i %i\n", x, y, z); Define DEBUG to use the D macro. D_ENTER; D_RETURN; D_RETURN_(x); These are for call tracing. Use D_RETURN_(x) when returning something from a function. Define DEBUG_NEST to use this. * added iconbar header file to Makefile.am * added proper new()/cleanup() calls for E_Delayed_Action; * I've completely rewritten the object and observer handling. Bye bye macros, this was nasty. It'll be hard enough to avoid leaks with usecounting in C. We now basically have the same system as gtk. There's a clear separation of observer and object code now. An E_Object by itself has nothing to do with observing or being observed, therefore, there are now E_Observers and E_Observees that are derived from E_Object. IMPORTANT: The cleanup system now reflects the reference count system, therefore, all ..._free() calls are now static, because the destructor should never be called explicitly, but implicitly through e_object_unref(). The object handling now is as follows: - The cleanup functions clean up everything that is contained in a struct, but NOT the struct itself. Instead of the final free() call, they call the destructor of the base class. The calls will walk up the hierarchy and clean up what's contained in every struct, and the final e_object_cleanup() will free the structure itself. E_Delayed_Action is a good example. - The only calls that influence the reference count are e_object_ref() and e_object_unref(). If you need to do things before an object gets destroyed, you can query the use count using e_object_get_usecount() and check if it's equal to 1. So this: OBJ_UNREF(b); OBJ_IF_FREE(b) { ecore_window_reparent(e->win, 0, 0, 0); e_icccm_release(e->win); OBJ_FREE(b); } now is this: if (e_object_get_usecount(E_OBJECT(b)) == 1) { ecore_window_reparent(e->win, 0, 0, 0); e_icccm_release(e->win); } e_object_unref(E_OBJECT(b)); object.h and observer.h are completely commented, it shouldn't be too hard to understand. This'll need to be documented in the manual anyway. * E_Objects are now used in lots of places where void* were used as pointers to objects before, especially in the actions code. This is obviously better, as it will generate compiler warnings when people want to pass things to functions that expect E_Objects. This could probably be more restrictive. * Added typedefs for the function prototypes in E_Action_Impl. Those fat signatures were just painful to read in the function declarations/implementations. * I've also tried to give parameters more useful names. Calling an object "o" is a lot of fun when you want to grep for it. * Included is also Graham's latest menu.c patch. Sorry for the delay, Graham. * I've added checks to the menu code that make sure that menus don't pop up when they're empty (which resulted in a little useless rectangle). I guess that's it for now. Sorry if I broke anything, but this was necessary imho. SVN revision: 5605
-rw-r--r--config.h.in224
-rwxr-xr-xdata/scripts/build_iconbar_db.sh2
-rw-r--r--doc/manual.raw3
-rw-r--r--po/ChangeLog12
-rw-r--r--po/Makefile.in.in186
-rw-r--r--src/Makefile.am14
-rw-r--r--src/actions.c740
-rw-r--r--src/actions.h70
-rw-r--r--src/background.c52
-rw-r--r--src/background.h10
-rw-r--r--src/border.c547
-rw-r--r--src/border.h7
-rw-r--r--src/config.c52
-rw-r--r--src/cursors.c33
-rw-r--r--src/debug.c86
-rw-r--r--src/debug.h64
-rw-r--r--src/delayed.c62
-rw-r--r--src/delayed.h29
-rw-r--r--src/desktops.c106
-rw-r--r--src/desktops.h3
-rw-r--r--src/e.h91
-rw-r--r--src/e_ferite.c23
-rw-r--r--src/embed.c101
-rw-r--r--src/entry.c183
-rw-r--r--src/exec.c30
-rw-r--r--src/fs.c47
-rw-r--r--src/guides.c69
-rw-r--r--src/icccm.c133
-rw-r--r--src/iconbar.c216
-rw-r--r--src/iconbar.h6
-rw-r--r--src/keys.c21
-rw-r--r--src/main.c13
-rw-r--r--src/match.c5
-rw-r--r--src/menu.c460
-rw-r--r--src/menu.h6
-rw-r--r--src/menubuild.c87
-rw-r--r--src/menubuild.h4
-rw-r--r--src/object.c79
-rw-r--r--src/object.h78
-rw-r--r--src/observer.c146
-rw-r--r--src/observer.h107
-rw-r--r--src/place.c78
-rw-r--r--src/place.h21
-rw-r--r--src/resist.c10
-rw-r--r--src/scrollbar.c144
-rw-r--r--src/text.c90
-rw-r--r--src/util.c107
-rw-r--r--src/view.c449
-rw-r--r--src/view.h7
49 files changed, 3934 insertions, 1179 deletions
diff --git a/config.h.in b/config.h.in
index aa79be36e..de4217ab6 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,48 +1,4 @@
-/* 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
-
+/* config.h.in. Generated automatically from configure.ac by autoheader. */
#undef ENLIGHTENMENT_VERSION
#undef ENLIGHTENMENT_MAJOR
#undef ENLIGHTENMENT_MINOR
@@ -60,81 +16,191 @@
#undef PACKAGE_LIB_DIR
#undef USE_FERITE
-/* Define if you have the __argz_count function. */
-#undef HAVE___ARGZ_COUNT
+/* 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 the __argz_next function. */
-#undef HAVE___ARGZ_NEXT
+/* Define if using `alloca.c'. */
+#undef C_ALLOCA
-/* Define if you have the __argz_stringify function. */
-#undef HAVE___ARGZ_STRINGIFY
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
+
+/* 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 the dcgettext function. */
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the `dcgettext' function. */
#undef HAVE_DCGETTEXT
-/* Define if you have the getcwd function. */
+/* Define if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define if you have the `feof_unlocked' function. */
+#undef HAVE_FEOF_UNLOCKED
+
+/* Define if you have the `fgets_unlocked' function. */
+#undef HAVE_FGETS_UNLOCKED
+
+/* Define if you have the `getcwd' function. */
#undef HAVE_GETCWD
-/* Define if you have the getpagesize function. */
+/* Define if you have the `getegid' function. */
+#undef HAVE_GETEGID
+
+/* Define if you have the `geteuid' function. */
+#undef HAVE_GETEUID
+
+/* Define if you have the `getgid' function. */
+#undef HAVE_GETGID
+
+/* Define if you have the `getpagesize' function. */
#undef HAVE_GETPAGESIZE
-/* Define if you have the munmap function. */
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define if you have the `getuid' function. */
+#undef HAVE_GETUID
+
+/* Define if you have the iconv() function. */
+#undef HAVE_ICONV
+
+/* Define if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
+
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* 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 <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the `mempcpy' function. */
+#undef HAVE_MEMPCPY
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the `munmap' function. */
#undef HAVE_MUNMAP
-/* Define if you have the putenv function. */
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the `putenv' function. */
#undef HAVE_PUTENV
-/* Define if you have the setenv function. */
+/* Define if you have the `setenv' function. */
#undef HAVE_SETENV
-/* Define if you have the setlocale function. */
+/* Define if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
-/* Define if you have the stpcpy function. */
+/* Define if you have the <stddef.h> header file. */
+#undef HAVE_STDDEF_H
+
+/* Define if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the `stpcpy' function. */
#undef HAVE_STPCPY
-/* Define if you have the strcasecmp function. */
+/* Define if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
-/* Define if you have the strchr function. */
+/* Define if you have the `strchr' function. */
#undef HAVE_STRCHR
-/* Define if you have the strdup function. */
+/* 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 <strings.h> header file. */
+#undef HAVE_STRINGS_H
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
-/* Define if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
+/* Define if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
-/* Define if you have the <nl_types.h> header file. */
-#undef HAVE_NL_TYPES_H
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
-/* Define if you have the <sys/param.h> header file. */
-#undef HAVE_SYS_PARAM_H
+/* Define if you have the `tsearch' function. */
+#undef HAVE_TSEARCH
-/* Define if you have the <unistd.h> header file. */
+/* Define if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define if you have the i library (-li). */
-#undef HAVE_LIBI
+/* 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 as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
/* Name of package */
#undef PACKAGE
+/* 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
+
/* Version number of package */
#undef VERSION
/* Define if using the dmalloc debugging malloc package */
#undef WITH_DMALLOC
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/data/scripts/build_iconbar_db.sh b/data/scripts/build_iconbar_db.sh
index 1ad009a6b..663e271f8 100755
--- a/data/scripts/build_iconbar_db.sh
+++ b/data/scripts/build_iconbar_db.sh
@@ -5,7 +5,7 @@ BIT=$1"/.e_iconbar.bits.db"
setup ()
{
- PREFIX="/usr/local"
+ PREFIX="/usr/local/e17"
SYSIC="/usr/share/pixmaps"
USRIC=$HOME"/stuff/icons"
NUM=0
diff --git a/doc/manual.raw b/doc/manual.raw
index cc90e95a3..c6dd0fff8 100644
--- a/doc/manual.raw
+++ b/doc/manual.raw
@@ -133,6 +133,9 @@
!Isrc/iconbar.c
!Isrc/menu.h
!Isrc/menu.c
+!Isrc/object.h
+!Isrc/observer.h
+!Isrc/place.h
!Isrc/view.h
</section>
diff --git a/po/ChangeLog b/po/ChangeLog
index f394d3ab9..69891f6c0 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -1,3 +1,15 @@
+2001-10-22 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.39.
+
+2001-10-21 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.39.
+
+2001-10-21 gettextize <bug-gnu-utils@gnu.org>
+
+ * Makefile.in.in: Upgrade to gettext-0.10.39.
+
2001-10-13 gettextize <bug-gnu-utils@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.10.39.
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index cf3aa8cb7..28726a21f 100644
--- a/po/Makefile.in.in
+++ b/po/Makefile.in.in
@@ -1,14 +1,18 @@
# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000, 2001 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
#
# This file file be copied and used freely without restrictions. It can
-# be used in projects which are not available under the GNU Public License
+# be used in projects which are not available under the GNU General Public License
# but which still want to provide support for the GNU gettext functionality.
# Please note that the actual code is *not* freely available.
PACKAGE = @PACKAGE@
VERSION = @VERSION@
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
SHELL = /bin/sh
@SET_MAKE@
@@ -18,24 +22,20 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
-datadir = $(prefix)/@DATADIRNAME@
+datadir = @datadir@
localedir = $(datadir)/locale
-gnulocaledir = $(prefix)/share/locale
-gettextsrcdir = $(prefix)/share/gettext/po
-subdir = po
-
-DESTDIR =
+gettextsrcdir = $(datadir)/gettext/po
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
CC = @CC@
-GENCAT = @GENCAT@
-GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
+GMSGFMT = @GMSGFMT@
MSGFMT = @MSGFMT@
-XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
-MSGMERGE = PATH=../src:$$PATH msgmerge
+XGETTEXT = @XGETTEXT@
+MSGMERGE = msgmerge
DEFS = @DEFS@
CFLAGS = @CFLAGS@
@@ -45,20 +45,17 @@ INCLUDES = -I.. -I$(top_srcdir)/intl
COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
-SOURCES = cat-id-tbl.c
POFILES = @POFILES@
GMOFILES = @GMOFILES@
DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
-stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+$(POFILES) $(GMOFILES)
POTFILES = \
CATALOGS = @CATALOGS@
-CATOBJEXT = @CATOBJEXT@
-INSTOBJEXT = @INSTOBJEXT@
.SUFFIXES:
-.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+.SUFFIXES: .c .o .po .pox .gmo .mo
.c.o:
$(COMPILE) $<
@@ -72,19 +69,19 @@ INSTOBJEXT = @INSTOBJEXT@
.po.gmo:
file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
- && rm -f $$file && $(GMSGFMT) -o $$file $<
-
-.po.cat:
- sed -f ../intl/po2msg.sed < $< > $*.msg \
- && rm -f $@ && $(GENCAT) $@ $*.msg
+ && rm -f $$file && $(GMSGFMT) --statistics -o $$file $<
all: all-@USE_NLS@
-all-yes: cat-id-tbl.c $(CATALOGS)
+all-yes: $(CATALOGS)
all-no:
-$(srcdir)/$(PACKAGE).pot: $(POTFILES)
+# Note: Target 'all' must not depend on target '$(srcdir)/$(PACKAGE).pot',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+$(srcdir)/$(PACKAGE).pot: $(POTFILES) $(srcdir)/POTFILES.in
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in \
@@ -92,78 +89,35 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES)
|| ( rm -f $(srcdir)/$(PACKAGE).pot \
&& mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot )
-$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
-$(srcdir)/stamp-cat-id: $(PACKAGE).pot
- rm -f cat-id-tbl.tmp
- sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
- | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
- if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
- rm cat-id-tbl.tmp; \
- else \
- echo cat-id-tbl.c changed; \
- rm -f $(srcdir)/cat-id-tbl.c; \
- mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
- fi
- cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
-
install: install-exec install-data
install-exec:
install-data: install-data-@USE_NLS@
-install-data-no: all
-install-data-yes: all
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \
+ if test "$(PACKAGE)" = "gettext"; then \
+ $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
+ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
+ $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \
+ : ; \
fi
+install-data-no: all
+install-data-yes: all
+ $(mkinstalldirs) $(DESTDIR)$(datadir)
@catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
- case "$$cat" in \
- *.gmo) destdir=$(DESTDIR)$(gnulocaledir);; \
- *) destdir=$(DESTDIR)$(localedir);; \
- esac; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- dir=$$destdir/$$lang/LC_MESSAGES; \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $$dir; \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \
- fi; \
+ lang=`echo $$cat | sed 's/\.gmo$$//'`; \
+ dir=$(localedir)/$$lang/LC_MESSAGES; \
+ $(mkinstalldirs) $(DESTDIR)$$dir; \
if test -r $$cat; then \
- $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
- echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+ echo "installing $$cat as $(DESTDIR)$$dir/$(PACKAGE).mo"; \
else \
- $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ $(INSTALL_DATA) $(srcdir)/$$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
- fi; \
- if test -r $$cat.m; then \
- $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- if test -r $(srcdir)/$$cat.m ; then \
- $(INSTALL_DATA) $(srcdir)/$$cat.m \
- $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
- echo "installing $(srcdir)/$$cat as" \
- "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
- else \
- true; \
- fi; \
+ "$(DESTDIR)$$dir/$(PACKAGE).mo"; \
fi; \
done
- if test "$(PACKAGE)" = "gettext"; then \
- if test -r "$(MKINSTALLDIRS)"; then \
- $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \
- else \
- $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \
- fi; \
- $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
- $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
- else \
- : ; \
- fi
# Define this as empty until I found a useful application.
installcheck:
@@ -172,76 +126,68 @@ uninstall:
catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
- rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ lang=`echo $$cat | sed 's/\.gmo$$//'`; \
+ rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE).mo; \
done
- rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in
+ if test "$(PACKAGE)" = "gettext"; then \
+ rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
+ else \
+ : ; \
+ fi
check: all
-cat-id-tbl.o: ../intl/libgettext.h
-
dvi info tags TAGS ID:
mostlyclean:
- rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -f core core.* *.pox $(PACKAGE).po *.new.po
rm -fr *.o
clean: mostlyclean
distclean: clean
- rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
+ rm -f Makefile Makefile.in POTFILES *.mo
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(GMOFILES)
-distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir: update-po $(DISTFILES)
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+ $(MAKE) update-po
+ @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: $(DISTFILES)
dists="$(DISTFILES)"; \
for file in $$dists; do \
- ln $(srcdir)/$$file $(distdir) 2> /dev/null \
- || cp -p $(srcdir)/$$file $(distdir); \
+ if test -f $$file; then dir=.; else dir=$(srcdir); fi; \
+ cp -p $$dir/$$file $(distdir); \
done
update-po: Makefile
$(MAKE) $(PACKAGE).pot
- PATH=`pwd`/../src:$$PATH; \
+ if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
cd $(srcdir); \
- catalogs='$(CATALOGS)'; \
+ catalogs='$(GMOFILES)'; \
for cat in $$catalogs; do \
cat=`basename $$cat`; \
- lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
- mv $$lang.po $$lang.old.po; \
+ lang=`echo $$cat | sed 's/\.gmo$$//'`; \
echo "$$lang:"; \
- if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
- rm -f $$lang.old.po; \
+ if $(MSGMERGE) $$lang.po $(PACKAGE).pot -o $$lang.new.po; then \
+ mv -f $$lang.new.po $$lang.po; \
else \
echo "msgmerge for $$cat failed!"; \
- rm -f $$lang.po; \
- mv $$lang.old.po $$lang.po; \
+ rm -f $$lang.new.po; \
fi; \
done
+ $(MAKE) update-gmo
-POTFILES: POTFILES.in
- ( if test 'x$(srcdir)' != 'x.'; then \
- posrcprefix='$(top_srcdir)/'; \
- else \
- posrcprefix="../"; \
- fi; \
- rm -f $@-t $@ \
- && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
- | sed -e '$$s/\\$$//') > $@-t \
- && chmod a-w $@-t \
- && mv $@-t $@ )
-
-Makefile: Makefile.in.in ../config.status POTFILES
- cd .. \
+update-gmo: Makefile $(GMOFILES)
+ @:
+
+Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
+ cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
$(SHELL) ./config.status
diff --git a/src/Makefile.am b/src/Makefile.am
index 408ab11db..dd35496e7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,9 +2,14 @@
DISTCLEANFILES = e_ferite_gen_*
+## Enable -DDEBUG for debugging messages, -DDEBUG_NEST
+## for call tracing. Caution -- this will produce a *lot*
+## of output!
+DEBUGFLAGS = -g -DDEBUG -DDEBUG_NEST
+
INCLUDES = \
-I$(top_srcdir)/intl \
- @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ferite_cflags@
+ @evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ferite_cflags@ $(DEBUGFLAGS)
bin_PROGRAMS = enlightenment
@@ -24,6 +29,7 @@ enlightenment_SOURCES = \
border.h border.c \
config.h config.c \
cursors.c cursors.h \
+ debug.c debug.h \
delayed.h delayed.c \
desktops.h desktops.c \
embed.c embed.h \
@@ -33,6 +39,7 @@ enlightenment_SOURCES = \
$(ferite_c) \
guides.h guides.c \
icccm.h icccm.c \
+ iconbar.h iconbar.c\
icons.c \
ipc.h ipc.c \
keys.h keys.c \
@@ -40,6 +47,8 @@ enlightenment_SOURCES = \
match.c match.h \
menu.h menu.c \
menubuild.h menubuild.c \
+ object.h object.c \
+ observer.h observer.c\
pack.c \
place.c place.h \
resist.h resist.c \
@@ -48,7 +57,6 @@ enlightenment_SOURCES = \
text.h text.c \
util.h util.c \
view.h view.c \
- e.h \
- iconbar.c
+ e.h
enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ferite_libs@ -lm -lc $(INTLLIBS)
diff --git a/src/actions.c b/src/actions.c
index 732d86e2e..f92a825fb 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -1,5 +1,6 @@
#include "actions.h"
#include "config.h"
+#include "debug.h"
#include "border.h"
#include "desktops.h"
#include "exec.h"
@@ -13,62 +14,103 @@ static Evas_List action_impls = NULL;
static Evas_List current_actions = NULL;
static Evas_List current_timers = NULL;
-static void e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, void *o);
-static void e_action_free(E_Action *a);
+static void e_action_find(char *action, E_Action_Type act, int button, char *key,
+ Ecore_Event_Key_Modifiers mods, E_Object *object);
+static void e_action_cleanup(E_Action *a);
-static void e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_move_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
+static void e_act_move_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
+static void e_act_move_stop (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_h_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
+static void e_act_move_cont (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry, int dx, int dy);
-static void e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
-static void e_act_resize_v_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
+static void e_act_resize_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_stop (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_cont (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry, int dx, int dy);
-static void e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_h_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_h_stop (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_h_cont (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry, int dx, int dy);
-static void e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_v_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_exec_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_v_stop (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_resize_v_cont (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry, int dx, int dy);
-static void e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_close_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_kill_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_shade_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_raise_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_lower_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_raise_lower_start (E_Object *object, E_Action *a,
+ void *data, int x, int y, int rx, int ry);
-static void e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_exec_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-static void e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+static void e_act_menu_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
-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);
+static void e_act_exit_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_restart_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_stick_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_sound_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_iconify_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_max_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_snap_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_zoom_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_desk_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
+
+static void e_act_raise_next_start (E_Object *object, E_Action *a, void *data,
+ int x, int y, int rx, int ry);
static void
-e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, void *o)
+e_action_find(char *action, E_Action_Type act, int button,
+ char *key, Ecore_Event_Key_Modifiers mods, E_Object *object)
{
char *actions_db;
E_DB_File *db;
@@ -85,21 +127,30 @@ e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Even
static Evas_List actions = NULL;
E_CFG_FILE(cfg_actions, "actions");
+ D_ENTER;
+
E_CONFIG_CHECK_VALIDITY(cfg_actions, "actions");
+
/* if we had a previous list - nuke it */
+
+ /* FIXME: this has potential to segfault if reference
+ counting is actually used and those actions are
+ referenced in more than one place --cK.
+ */
+
if (actions)
{
for (l = actions; l; l = l->next)
{
a = l->data;
- if (a) e_action_free(a);
+ if (a) e_action_cleanup(a);
}
actions = evas_list_free(actions);
}
/* now build the list again */
actions_db = e_config_get("actions");
db = e_db_open_read(actions_db);
- if (!db) return;
+ if (!db) D_RETURN;
if (!e_db_int_get(db, "/actions/count", &num)) goto error;
for (i = 0; i < num; i++)
{
@@ -123,7 +174,7 @@ e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Even
a = NEW(E_Action, 1);
ZERO(a, E_Action, 1);
- OBJ_INIT(a, e_action_free);
+ e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup);
a->name = a_name;
a->action = a_action;
@@ -184,7 +235,7 @@ e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Even
aa = NEW(E_Action, 1);
ZERO(aa, E_Action, 1);
- OBJ_INIT(aa, e_action_free);
+ e_object_init(E_OBJECT(aa), (E_Cleanup_Func) e_action_cleanup);
e_strdup(aa->name, a->name);
e_strdup(aa->action, a->action);
@@ -194,18 +245,22 @@ e_action_find(char *action, E_Action_Type act, int button, char *key, Ecore_Even
e_strdup(aa->key, a->key);
aa->modifiers = a->modifiers;
aa->action_impl = ap;
- aa->object = o;
+ aa->object = object;
aa->started = 0;
current_actions = evas_list_append(current_actions, aa);
}
}
next:
}
+
+ D_RETURN;
}
static void
-e_action_free(E_Action *a)
+e_action_cleanup(E_Action *a)
{
+ D_ENTER;
+
/* it's a key? lets ungrab it! */
if ((a->key) && (strlen(a->key) > 0) && (a->grabbed))
{
@@ -214,20 +269,28 @@ e_action_free(E_Action *a)
else
e_keys_ungrab(a->key, (Ecore_Event_Key_Modifiers)a->modifiers, 0);
}
+
IF_FREE(a->name);
IF_FREE(a->action);
IF_FREE(a->params);
IF_FREE(a->key);
- FREE(a);
+
+ e_object_cleanup(E_OBJECT(a));
+
+ D_RETURN;
}
int
-e_action_start(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry)
+e_action_start(char *action, E_Action_Type act, int button,
+ char *key, Ecore_Event_Key_Modifiers mods,
+ E_Object *object, void *data, int x, int y, int rx, int ry)
{
Evas_List l;
int started_long_action = 0;
- e_action_find(action, act, button, key, mods, o);
+ D_ENTER;
+
+ e_action_find(action, act, button, key, mods, object);
again:
for (l = current_actions; l; l = l->next)
{
@@ -249,7 +312,7 @@ e_action_start(char *action, E_Action_Type act, int button, char *key, Ecore_Eve
{
obj = a->object;
if (a->started)
- OBJ_REF(obj);
+ e_object_ref(obj);
}
a->action_impl->func_start(a->object, a, data, x, y, rx, ry);
}
@@ -257,18 +320,23 @@ e_action_start(char *action, E_Action_Type act, int button, char *key, Ecore_Eve
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
- OBJ_DO_FREE(a);
+ e_object_unref(E_OBJECT(a));
goto again;
}
}
- return started_long_action;
+
+ D_RETURN_(started_long_action);
}
void
-e_action_stop(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods, void *o, void *data, int x, int y, int rx, int ry)
+e_action_stop(char *action, E_Action_Type act, int button,
+ char *key, Ecore_Event_Key_Modifiers mods, E_Object *object,
+ void *data, int x, int y, int rx, int ry)
{
Evas_List l;
+ D_ENTER;
+
again:
for (l = current_actions; l; l = l->next)
{
@@ -312,7 +380,7 @@ e_action_stop(char *action, E_Action_Type act, int button, char *key, Ecore_Even
if (a->object)
{
obj = a->object;
- OBJ_UNREF(obj);
+ e_object_unref(obj);
}
a->action_impl->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
@@ -321,22 +389,27 @@ e_action_stop(char *action, E_Action_Type act, int button, char *key, Ecore_Even
if (!a->started)
{
current_actions = evas_list_remove(current_actions, a);
- OBJ_DO_FREE(a);
+
+ e_object_unref(E_OBJECT(a));
goto again;
}
}
- return;
+
+ D_RETURN;
UN(action);
UN(mods);
- UN(o);
+ UN(object);
}
void
-e_action_cont(char *action, E_Action_Type act, int button, char *key, Ecore_Event_Key_Modifiers mods,
- void *o, void *data, int x, int y, int rx, int ry, int dx, int dy)
+e_action_cont(char *action, E_Action_Type act, int button, char *key,
+ Ecore_Event_Key_Modifiers mods, E_Object *object, void *data,
+ int x, int y, int rx, int ry, int dx, int dy)
{
Evas_List l;
+ D_ENTER;
+
for (l = current_actions; l; l = l->next)
{
E_Action *a;
@@ -345,44 +418,47 @@ e_action_cont(char *action, E_Action_Type act, int button, char *key, Ecore_Even
if ((a->started) && (a->action_impl->func_cont))
a->action_impl->func_cont(a->object, a, data, x, y, rx, ry, dx, dy);
}
- return;
+
+ D_RETURN;
UN(action);
UN(act);
UN(button);
UN(key);
UN(mods);
- UN(o);
+ UN(object);
}
void
-e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry)
+e_action_stop_by_object(E_Object *object, void *data, int x, int y, int rx, int ry)
{
Evas_List l;
- e_action_del_timer_object(o);
+ e_action_del_timer_object(object);
again:
for (l = current_actions; l; l = l->next)
{
E_Action *a;
a = l->data;
- if ((a->started) && (o == a->object))
+ if ((a->started) && (object == a->object))
{
E_Object *obj;
if (a->object)
{
obj = a->object;
- OBJ_UNREF(obj);
+ e_object_unref(obj);
}
if (a->action_impl->func_stop)
a->action_impl->func_stop(a->object, a, data, x, y, rx, ry);
a->started = 0;
current_actions = evas_list_remove(current_actions, a);
- OBJ_DO_FREE(a);
+ e_object_unref(E_OBJECT(a));
goto again;
}
}
+
+ D_RETURN;
}
void
@@ -390,6 +466,8 @@ e_action_stop_by_type(char *action)
{
Evas_List l;
+ D_ENTER;
+
for (l = current_actions; l; l = l->next)
{
E_Action *a;
@@ -403,38 +481,57 @@ e_action_stop_by_type(char *action)
if (a->object)
{
obj = a->object;
- OBJ_UNREF(obj);
+ e_object_unref(obj);
}
a->action_impl->func_stop(a->object, a, NULL, 0, 0, 0, 0);
a->started = 0;
}
}
+
+ D_RETURN;
+}
+
+
+static void
+e_action_impl_cleanup(E_Action_Impl *eai)
+{
+ D_ENTER;
+
+ e_object_cleanup(E_OBJECT(eai));
+
+ D_RETURN;
}
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_cont) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy),
- void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry))
+e_action_add_impl(char *action, E_Action_Start_Func func_start,
+ E_Action_Cont_Func func_cont, E_Action_Stop_Func func_stop)
{
E_Action_Impl *ap;
+ D_ENTER;
+
ap = NEW(E_Action_Impl, 1);
-
- OBJ_INIT(ap, NULL);
+ ZERO(ap, E_Action_Impl, 1);
+
+ e_object_init(E_OBJECT(ap), (E_Cleanup_Func) e_action_impl_cleanup);
e_strdup(ap->action, action);
ap->func_start = func_start;
ap->func_cont = func_cont;
ap->func_stop = func_stop;
action_impls = evas_list_append(action_impls, ap);
+
+ D_RETURN;
}
+
void
-e_action_del_timer(void *o, char *name)
+e_action_del_timer(E_Object *object, char *name)
{
Evas_List l;
+
+ D_ENTER;
again:
for (l = current_timers; l; l = l->next)
@@ -442,7 +539,7 @@ e_action_del_timer(void *o, char *name)
E_Active_Action_Timer *at;
at = l->data;
- if ((at->object == o) &&
+ if ((at->object == object) &&
(name) &&
(at->name) &&
(!strcmp(at->name, name)))
@@ -454,31 +551,39 @@ e_action_del_timer(void *o, char *name)
goto again;
}
}
+
+ D_RETURN;
}
void
-e_action_add_timer(void *o, char *name)
+e_action_add_timer(E_Object *object, char *name)
{
E_Active_Action_Timer *at;
+ D_ENTER;
+
at = NEW(E_Active_Action_Timer, 1);
- at->object = o;
+ at->object = object;
e_strdup(at->name, name);
current_timers = evas_list_append(current_timers, at);
+
+ D_RETURN;
}
void
-e_action_del_timer_object(void *o)
+e_action_del_timer_object(E_Object *object)
{
Evas_List l;
+ D_ENTER;
+
again:
for (l = current_timers; l; l = l->next)
{
E_Active_Action_Timer *at;
at = l->data;
- if (at->object == o)
+ if (at->object == object)
{
ecore_del_event_timer(at->name);
current_timers = evas_list_remove(current_timers, at);
@@ -487,33 +592,39 @@ e_action_del_timer_object(void *o)
goto again;
}
}
+
+ D_RETURN;
}
void
e_action_init(void)
{
- e_action_add_proto("Window_Move", e_act_move_start, e_act_move_cont, e_act_move_stop);
- e_action_add_proto("Window_Resize", e_act_resize_start, e_act_resize_cont, e_act_resize_stop);
- e_action_add_proto("Window_Resize_Horizontal", e_act_resize_h_start, e_act_resize_h_cont, e_act_resize_h_stop);
- e_action_add_proto("Window_Resize_Vertical", e_act_resize_v_start, e_act_resize_v_cont, e_act_resize_v_stop);
- e_action_add_proto("Window_Close", e_act_close_start, NULL, NULL);
- e_action_add_proto("Window_Kill", e_act_kill_start, NULL, NULL);
- e_action_add_proto("Window_Shade", e_act_shade_start, NULL, NULL);
- e_action_add_proto("Window_Raise", e_act_raise_start, NULL, NULL);
- e_action_add_proto("Window_Lower", e_act_lower_start, NULL, NULL);
- e_action_add_proto("Window_Raise_Lower", e_act_raise_lower_start, NULL, NULL);
- e_action_add_proto("Execute", e_act_exec_start, NULL, NULL);
- e_action_add_proto("Menu", e_act_menu_start, NULL, NULL);
- e_action_add_proto("Exit", e_act_exit_start, NULL, NULL);
- e_action_add_proto("Restart", e_act_restart_start, NULL, NULL);
- e_action_add_proto("Window_Stick", e_act_stick_start, NULL, NULL);
- e_action_add_proto("Sound", e_act_sound_start, NULL, NULL);
- e_action_add_proto("Window_Iconify", e_act_iconify_start, NULL, NULL);
- e_action_add_proto("Window_Max_Size", e_act_max_start, NULL, NULL);
- e_action_add_proto("Winodw_Snap", e_act_snap_start, NULL, NULL);
- e_action_add_proto("Window_Zoom", e_act_zoom_start, NULL, NULL);
- e_action_add_proto("Desktop", e_act_desk_start, NULL, NULL);
- e_action_add_proto("Window_Next", e_act_raise_next_start, NULL, NULL);
+ D_ENTER;
+
+ e_action_add_impl("Window_Move", e_act_move_start, e_act_move_cont, e_act_move_stop);
+ e_action_add_impl("Window_Resize", e_act_resize_start, e_act_resize_cont, e_act_resize_stop);
+ e_action_add_impl("Window_Resize_Horizontal", e_act_resize_h_start, e_act_resize_h_cont, e_act_resize_h_stop);
+ e_action_add_impl("Window_Resize_Vertical", e_act_resize_v_start, e_act_resize_v_cont, e_act_resize_v_stop);
+ e_action_add_impl("Window_Close", e_act_close_start, NULL, NULL);
+ e_action_add_impl("Window_Kill", e_act_kill_start, NULL, NULL);
+ e_action_add_impl("Window_Shade", e_act_shade_start, NULL, NULL);
+ e_action_add_impl("Window_Raise", e_act_raise_start, NULL, NULL);
+ e_action_add_impl("Window_Lower", e_act_lower_start, NULL, NULL);
+ e_action_add_impl("Window_Raise_Lower", e_act_raise_lower_start, NULL, NULL);
+ e_action_add_impl("Execute", e_act_exec_start, NULL, NULL);
+ e_action_add_impl("Menu", e_act_menu_start, NULL, NULL);
+ e_action_add_impl("Exit", e_act_exit_start, NULL, NULL);
+ e_action_add_impl("Restart", e_act_restart_start, NULL, NULL);
+ e_action_add_impl("Window_Stick", e_act_stick_start, NULL, NULL);
+ e_action_add_impl("Sound", e_act_sound_start, NULL, NULL);
+ e_action_add_impl("Window_Iconify", e_act_iconify_start, NULL, NULL);
+ e_action_add_impl("Window_Max_Size", e_act_max_start, NULL, NULL);
+ e_action_add_impl("Winodw_Snap", e_act_snap_start, NULL, NULL);
+ e_action_add_impl("Window_Zoom", e_act_zoom_start, NULL, NULL);
+ e_action_add_impl("Desktop", e_act_desk_start, NULL, NULL);
+ e_action_add_impl("Window_Next", e_act_raise_next_start, NULL, NULL);
+
+ D_RETURN;
}
@@ -533,7 +644,7 @@ e_action_init(void)
/* init func */
static void
-e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_move_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
E_Guides_Mode move_mode = E_GUIDES_BOX;
@@ -545,14 +656,16 @@ e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
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);
+ D_ENTER;
+
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;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.fixed) return;
+ if (!b) D_RETURN;
+ if (b->client.fixed) D_RETURN;
if (move_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
b->mode.move = 1;
@@ -574,7 +687,8 @@ e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
e_guides_resize(b->current.w, b->current.h);
e_guides_show();
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -584,14 +698,16 @@ e_act_move_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
}
static void
-e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_move_stop (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
-
- b = o;
+
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.fixed) return;
+ if (!b) D_RETURN;
+ if (b->client.fixed) D_RETURN;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
b->current.requested.y = b->current.y;
@@ -607,7 +723,8 @@ e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
e_border_adjust_limits(b);
e_guides_hide();
e_desktops_add_border(b->desk, b);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -617,14 +734,16 @@ e_act_move_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
}
static void
-e_act_move_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
+e_act_move_cont (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
+
+ D_ENTER;
- b = o;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.fixed) return;
+ if (!b) D_RETURN;
+ if (b->client.fixed) D_RETURN;
b->current.requested.x += dx;
b->current.requested.y += dy;
if (dx != 0) b->current.requested.dx = dx;
@@ -639,7 +758,8 @@ e_act_move_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
e_guides_resize(b->current.w, b->current.h);
e_guides_display_text(buf);
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -650,7 +770,7 @@ e_act_move_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
-e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
E_Guides_Mode resize_mode = E_GUIDES_BOX;
@@ -661,17 +781,19 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
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);
+
+ D_ENTER;
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;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -728,7 +850,8 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
e_guides_resize(b->current.w, b->current.h);
e_guides_show();
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(rx);
@@ -736,16 +859,18 @@ e_act_resize_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
}
static void
-e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_stop (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
b->current.requested.y = b->current.y;
@@ -757,7 +882,8 @@ e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int
ecore_window_gravity_set(b->win.client, NorthWestGravity);
e_border_set_gravity(b, NorthWestGravity);
e_guides_hide();
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -767,16 +893,18 @@ e_act_resize_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int
}
static void
-e_act_resize_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
+e_act_resize_cont (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
+
+ D_ENTER;
- b = o;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (b->mode.resize == 1)
{
b->current.requested.w -= dx;
@@ -811,7 +939,8 @@ e_act_resize_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int
e_guides_resize(b->current.w, b->current.h);
e_guides_display_text(buf);
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -822,7 +951,7 @@ e_act_resize_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int
static void
-e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_h_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
E_Guides_Mode resize_mode = E_GUIDES_BOX;
@@ -833,16 +962,18 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
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);
+
+ D_ENTER;
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;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -877,7 +1008,8 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_guides_resize(b->current.w, b->current.h);
e_guides_show();
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(y);
@@ -886,15 +1018,18 @@ e_act_resize_h_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
static void
-e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_h_stop (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
-
- b = o;
+
+
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
b->current.requested.y = b->current.y;
@@ -906,7 +1041,8 @@ e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
ecore_window_gravity_set(b->win.client, NorthWestGravity);
e_border_set_gravity(b, NorthWestGravity);
e_guides_hide();
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -916,15 +1052,17 @@ e_act_resize_h_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
static void
-e_act_resize_h_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
+e_act_resize_h_cont (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.w == b->client.max.w) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.w == b->client.max.w) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (b->mode.resize == 5)
{
b->current.requested.w -= dx;
@@ -944,7 +1082,7 @@ e_act_resize_h_cont (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_guides_resize(b->current.w, b->current.h);
e_guides_display_text(buf);
}
- return;
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -956,7 +1094,7 @@ e_act_resize_h_cont (void *o, E_Action *a, void *data, int x, int y, int rx, in
static void
-e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_v_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
E_Guides_Mode resize_mode = E_GUIDES_BOX;
@@ -968,15 +1106,17 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
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);
+ D_ENTER;
+
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;
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -1013,7 +1153,7 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_guides_resize(b->current.w, b->current.h);
e_guides_show();
}
- return;
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1022,15 +1162,17 @@ e_act_resize_v_start (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
static void
-e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_resize_v_stop (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
b->hold_changes = 0; /* if non opaque */
b->current.requested.x = b->current.x;
b->current.requested.y = b->current.y;
@@ -1042,7 +1184,7 @@ e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_border_set_gravity(b, NorthWestGravity);
b->changed = 1;
e_guides_hide();
- return;
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1052,15 +1194,17 @@ e_act_resize_v_stop (void *o, E_Action *a, void *data, int x, int y, int rx, in
}
static void
-e_act_resize_v_cont (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
+e_act_resize_v_cont (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.min.h == b->client.max.h) return;
- if (b->current.shaded != 0) return;
+ if (!b) D_RETURN;
+ if (b->client.min.h == b->client.max.h) D_RETURN;
+ if (b->current.shaded != 0) D_RETURN;
if (b->mode.resize == 7)
{
b->current.requested.h -= dy;
@@ -1080,7 +1224,7 @@ e_act_resize_v_cont (void *o, E_Action *a, void *data, int x, int y, int rx, in
e_guides_resize(b->current.w, b->current.h);
e_guides_display_text(buf);
}
- return;
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1092,16 +1236,20 @@ e_act_resize_v_cont (void *o, E_Action *a, void *data, int x, int y, int rx, in
static void
-e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_close_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (b->win.client) e_icccm_delete(b->win.client);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1112,16 +1260,19 @@ e_act_close_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_kill_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_kill_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (b->win.client) ecore_window_kill_client(b->win.client);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1140,17 +1291,19 @@ e_act_cb_shade(int val, void *data)
int si;
int pix_per_sec = 3200;
+ D_ENTER;
+
b = data;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (val == 0)
{
- OBJ_REF(b);
+ e_object_ref(E_OBJECT(b));
t = ecore_get_time();
ecore_window_gravity_set(b->win.client, SouthWestGravity);
- e_action_del_timer(b, "shader");
- e_action_add_timer(b, "shader");
+ e_action_del_timer(E_OBJECT(b), "shader");
+ e_action_add_timer(E_OBJECT(b), "shader");
}
dif = ecore_get_time() - t;
@@ -1165,10 +1318,12 @@ e_act_cb_shade(int val, void *data)
ecore_add_event_timer("shader", 0.01, e_act_cb_shade, 1, data);
else
{
- e_action_del_timer(b, "shader");
+ e_action_del_timer(E_OBJECT(b), "shader");
ecore_window_gravity_reset(b->win.client);
- OBJ_UNREF(b);
+ e_object_ref(E_OBJECT(b));
}
+
+ D_RETURN;
}
static void e_act_cb_unshade(int val, void *data);
@@ -1181,17 +1336,19 @@ e_act_cb_unshade(int val, void *data)
int si;
int pix_per_sec = 3200;
+ D_ENTER;
+
b = data;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (val == 0)
{
- OBJ_REF(b);
+ e_object_ref(E_OBJECT(b));
t = ecore_get_time();
ecore_window_gravity_set(b->win.client, SouthWestGravity);
- e_action_del_timer(b, "shader");
- e_action_add_timer(b, "shader");
+ e_action_del_timer(E_OBJECT(b), "shader");
+ e_action_add_timer(E_OBJECT(b), "shader");
}
dif = ecore_get_time() - t;
@@ -1207,24 +1364,29 @@ e_act_cb_unshade(int val, void *data)
ecore_add_event_timer("shader", 0.01, e_act_cb_unshade, 1, data);
else
{
- e_action_del_timer(b, "shader");
+ e_action_del_timer(E_OBJECT(b), "shader");
ecore_window_gravity_reset(b->win.client);
- OBJ_UNREF(b);
+ e_object_ref(E_OBJECT(b));
}
+
+ D_RETURN;
}
static void
-e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_shade_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (b->current.shaded == 0) e_act_cb_shade(0, b);
else e_act_cb_unshade(0, b);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1235,16 +1397,19 @@ e_act_shade_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_raise_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
e_border_raise(b);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1255,16 +1420,19 @@ e_act_raise_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_lower_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
e_border_lower(b);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1275,15 +1443,18 @@ e_act_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_raise_lower_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
- return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1294,35 +1465,41 @@ e_act_raise_lower_start (void *o, E_Action *a, void *data, int x, int y, int rx,
static void
-e_act_exec_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_exec_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
char *exe;
+ D_ENTER;
+
exe = (char *) a->params;
- if(!exe) return;
+ if(!exe) D_RETURN;
/* printf("exe: %s\n",exe); */
e_exec_run(exe);
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
UN(y);
UN(rx);
UN(ry);
- UN(o);
+ UN(object);
}
static void
-e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_menu_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
- return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1333,10 +1510,14 @@ e_act_menu_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
-e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_exit_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
+ D_ENTER;
+
exit(0);
- return;
+
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
@@ -1347,10 +1528,14 @@ e_act_exit_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
-e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_restart_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
+ D_ENTER;
+
e_exec_restart();
- return;
+
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
@@ -1361,18 +1546,21 @@ e_act_restart_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
static void
-e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_stick_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
if (b->client.sticky) b->client.sticky = 0;
else b->client.sticky = 1;
b->changed = 1;
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1383,9 +1571,12 @@ e_act_stick_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_sound_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
- return;
+ D_ENTER;
+
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
@@ -1396,15 +1587,18 @@ e_act_sound_start (void *o, E_Action *a, void *data, int x, int y, int rx, int r
static void
-e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_iconify_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
- return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
@@ -1415,16 +1609,18 @@ e_act_iconify_start (void *o, E_Action *a, void *data, int x, int y, int rx, int
static void
-e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_max_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
+ D_ENTER;
+
+ b = (E_Border*) object;
if (!b) b = e_border_current_focused();
- if (!b) return;
- if (b->client.is_desktop) return;
- if (b->current.shaded > 0) return;
- if ((b->mode.move) || (b->mode.resize)) return;
+ if (!b) D_RETURN;
+ if (b->client.is_desktop) D_RETURN;
+ if (b->current.shaded > 0) D_RETURN;
+ if ((b->mode.move) || (b->mode.resize)) D_RETURN;
b->mode.move = 0;
b->mode.resize = 0;
if (b->max.is)
@@ -1459,7 +1655,8 @@ e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
b->current.requested.w = b->current.w;
b->current.requested.h = b->current.h;
}
- return;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1470,14 +1667,20 @@ e_act_max_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
static void
-e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_snap_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
- if (!b) b = e_border_current_focused();
- if (!b) return;
- return;
+ D_ENTER;
+
+ b = (E_Border*) object;
+
+ if (!b)
+ b = e_border_current_focused();
+ if (!b)
+ D_RETURN;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1488,14 +1691,21 @@ e_act_snap_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry
static void
-e_act_zoom_start (void *o, E_Action *a, void *data, int x, int y, int rx, int ry)
+e_act_zoom_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
E_Border *b;
- b = o;
- if (!b) b = e_border_current_focused();
- if (!b) return;
- return;
+ D_ENTER;
+
+ b = (E_Border*) object;
+
+ if (!b)
+ b = e_border_current_focused();
+
+ if (!b)
+ D_RETURN;
+
+ D_RETURN;
UN(a);
UN(data);
UN(x);
@@ -1506,14 +1716,19 @@ 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)
+e_act_desk_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
int desk = 0;
- if (a->params) desk = atoi(a->params);
+ D_ENTER;
+
+ if (a->params)
+ desk = atoi(a->params);
+
e_desktops_goto_desk(desk);
- return;
- UN(o);
+
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
@@ -1524,11 +1739,14 @@ 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)
+e_act_raise_next_start (E_Object *object, E_Action *a, void *data, int x, int y, int rx, int ry)
{
+ D_ENTER;
+
e_border_raise_next();
- return;
- UN(o);
+
+ D_RETURN;
+ UN(object);
UN(a);
UN(data);
UN(x);
diff --git a/src/actions.h b/src/actions.h
index d3bf87467..f8ee9671c 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -2,25 +2,25 @@
#define E_ACTIONS_H
#include "e.h"
+#include "object.h"
typedef struct _E_Action E_Action;
typedef struct _E_Action_Impl E_Action_Impl;
typedef struct _E_Active_Action_Timer E_Active_Action_Timer;
typedef enum e_action_type
- {
- ACT_MOUSE_IN,
- ACT_MOUSE_OUT,
- ACT_MOUSE_CLICK,
- ACT_MOUSE_DOUBLE,
- ACT_MOUSE_TRIPLE,
- ACT_MOUSE_UP,
- ACT_MOUSE_CLICKED,
- ACT_MOUSE_MOVE,
- ACT_KEY_DOWN,
- ACT_KEY_UP
- }
-E_Action_Type;
+{
+ ACT_MOUSE_IN,
+ ACT_MOUSE_OUT,
+ ACT_MOUSE_CLICK,
+ ACT_MOUSE_DOUBLE,
+ ACT_MOUSE_TRIPLE,
+ ACT_MOUSE_UP,
+ ACT_MOUSE_CLICKED,
+ ACT_MOUSE_MOVE,
+ ACT_KEY_DOWN,
+ ACT_KEY_UP
+} E_Action_Type;
struct _E_Active_Action_Timer
{
@@ -30,7 +30,7 @@ struct _E_Active_Action_Timer
struct _E_Action
{
- OBJ_PROPERTIES;
+ E_Object o;
char *name;
char *action;
@@ -40,21 +40,29 @@ struct _E_Action
char *key;
int modifiers;
E_Action_Impl *action_impl;
- void *object;
+ E_Object *object;
int started;
int grabbed;
};
+typedef void (*E_Action_Start_Func)(E_Object *o, E_Action *a,
+ void *data, int x, int y, int rx, int ry);
+typedef void (*E_Action_Cont_Func) (E_Object *o, E_Action *a,
+ void *data, int x, int y, int rx, int ry, int dx, int dy);
+typedef void (*E_Action_Stop_Func) (E_Object *o, E_Action *a,
+ void *data, int x, int y, int rx, int ry);
+
struct _E_Action_Impl
{
- OBJ_PROPERTIES;
-
+ E_Object o;
+
char *action;
- void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
- void (*func_cont) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy);
- void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry);
+
+ E_Action_Start_Func func_start;
+ E_Action_Cont_Func func_cont;
+ E_Action_Stop_Func func_stop;
};
-
+
/**
* e_action_init - Actions implementation initializer
@@ -65,22 +73,20 @@ struct _E_Action_Impl
void e_action_init(void);
int e_action_start(char *action, E_Action_Type act, int button, char *key,
- Ecore_Event_Key_Modifiers mods, void *o, void *data,
+ Ecore_Event_Key_Modifiers mods, E_Object *o, void *data,
int x, int y, int rx, int ry);
void e_action_stop(char *action, E_Action_Type act, int button, char *key,
- Ecore_Event_Key_Modifiers mods, void *o, void *data,
+ Ecore_Event_Key_Modifiers mods, E_Object *o, void *data,
int x, int y, int rx, int ry);
void e_action_cont(char *action, E_Action_Type act, int button, char *key,
- Ecore_Event_Key_Modifiers mods, void *o, void *data,
+ Ecore_Event_Key_Modifiers mods, E_Object *o, void *data,
int x, int y, int rx, int ry, int dx, int dy);
-void e_action_stop_by_object(void *o, void *data, int x, int y, int rx, int ry);
+void e_action_stop_by_object(E_Object *o, void *data, int x, int y, int rx, int ry);
void e_action_stop_by_type(char *action);
-void e_action_add_proto(char *action,
- void (*func_start) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry),
- void (*func_cont) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry, int dx, int dy),
- void (*func_stop) (void *o, E_Action *a, void *data, int x, int y, int rx, int ry));
-void e_action_del_timer(void *o, char *name);
-void e_action_add_timer(void *o, char *name);
-void e_action_del_timer_object(void *o);
+void e_action_add_impl(char *action, E_Action_Start_Func func_start,
+ E_Action_Cont_Func func_cont, E_Action_Stop_Func func_stop);
+void e_action_del_timer(E_Object *object, char *name);
+void e_action_add_timer(E_Object *object, char *name);
+void e_action_del_timer_object(E_Object *object);
#endif
diff --git a/src/background.c b/src/background.c
index 05422c7f3..324212375 100644
--- a/src/background.c
+++ b/src/background.c
@@ -1,12 +1,15 @@
#include "e.h"
+#include "debug.h"
#include "background.h"
#include "util.h"
-void
-e_background_free(E_Background *bg)
+static void
+e_background_cleanup(E_Background *bg)
{
Evas_List l;
-
+
+ D_ENTER;
+
if (bg->layers)
{
for (l = bg->layers; l; l = l->next)
@@ -23,7 +26,10 @@ e_background_free(E_Background *bg)
}
if (bg->file) FREE (bg->file);
if (bg->base_obj) evas_del_object(bg->evas, bg->base_obj);
- FREE(bg);
+
+ e_object_cleanup(E_OBJECT(bg));
+
+ D_RETURN;
}
E_Background *
@@ -31,11 +37,14 @@ e_background_new(void)
{
E_Background *bg;
+ D_ENTER;
+
bg = NEW(E_Background, 1);
ZERO(bg, E_Background, 1);
- OBJ_INIT(bg, e_background_free);
+
+ e_object_init(E_OBJECT(bg), (E_Cleanup_Func) e_background_cleanup);
- return bg;
+ D_RETURN_(bg);
}
E_Background *
@@ -45,15 +54,17 @@ e_background_load(char *file)
E_DB_File *db;
int i, num;
+ D_ENTER;
+
db = e_db_open_read(file);
- if (!db) return NULL;
+ if (!db) D_RETURN_(NULL);
num = 0;
e_db_int_get(db, "/type/bg", &num);
if (num != 1)
{
e_db_close(db);
e_db_flush();
- return NULL;
+ D_RETURN_(NULL);
}
e_db_int_get(db, "/layers/count", &num);
@@ -101,7 +112,7 @@ e_background_load(char *file)
sprintf(buf, "/layers/%i/bg.b", i); e_db_int_get(db, buf, &(bl->bg.b));
sprintf(buf, "/layers/%i/bg.a", i); e_db_int_get(db, buf, &(bl->bg.a));
}
- return bg;
+ D_RETURN_(bg);
}
void
@@ -110,9 +121,11 @@ e_background_realize(E_Background *bg, Evas evas)
Evas_List l;
int ww, hh, count;
- if (bg->evas) return;
+ D_ENTER;
+
+ if (bg->evas) D_RETURN;
bg->evas = evas;
- if (!bg->evas) return;
+ if (!bg->evas) D_RETURN;
for (count = 0, l = bg->layers; l; l = l->next, count++)
{
E_Background_Layer *bl;
@@ -149,6 +162,7 @@ e_background_realize(E_Background *bg, Evas evas)
bg->geom.h = 0;
e_background_set_size(bg, ww, hh);
+ D_RETURN;
}
void
@@ -156,10 +170,12 @@ e_background_set_scroll(E_Background *bg, int sx, int sy)
{
Evas_List l;
- if ((bg->geom.sx == sx) && (bg->geom.sy == sy)) return;
+ D_ENTER;
+
+ if ((bg->geom.sx == sx) && (bg->geom.sy == sy)) D_RETURN;
bg->geom.sx = sx;
bg->geom.sy = sy;
- if (!bg->evas) return;
+ if (!bg->evas) D_RETURN;
for (l = bg->layers; l; l = l->next)
{
E_Background_Layer *bl;
@@ -173,6 +189,7 @@ e_background_set_scroll(E_Background *bg, int sx, int sy)
bl->fw, bl->fh);
}
}
+ D_RETURN;
}
void
@@ -180,7 +197,9 @@ e_background_set_size(E_Background *bg, int w, int h)
{
Evas_List l;
- if ((bg->geom.w == w) && (bg->geom.h == h)) return;
+ D_ENTER;
+
+ if ((bg->geom.w == w) && (bg->geom.h == h)) D_RETURN;
bg->geom.w = w;
bg->geom.h = h;
for (l = bg->layers; l; l = l->next)
@@ -229,6 +248,7 @@ e_background_set_size(E_Background *bg, int w, int h)
}
}
}
+ D_RETURN;
}
void
@@ -236,6 +256,8 @@ e_background_set_color_class(E_Background *bg, char *cc, int r, int g, int b, in
{
Evas_List l;
+ D_ENTER;
+
for (l = bg->layers; l; l = l->next)
{
E_Background_Layer *bl;
@@ -252,4 +274,6 @@ e_background_set_color_class(E_Background *bg, char *cc, int r, int g, int b, in
}
}
}
+
+ D_RETURN;
}
diff --git a/src/background.h b/src/background.h
index 6550b2cdb..a034c0eaf 100644
--- a/src/background.h
+++ b/src/background.h
@@ -1,6 +1,8 @@
#ifndef E_BACKGROUND_H
#define E_BACKGROUND_H
+#include "object.h"
+
typedef struct _E_Background E_Background;
typedef struct _E_Background_Layer E_Background_Layer;
@@ -14,7 +16,7 @@ E_Background_Type;
struct _E_Background
{
- OBJ_PROPERTIES;
+ E_Object o;
Evas evas;
char *file;
@@ -24,9 +26,9 @@ struct _E_Background
int w, h;
} geom;
- Evas_List layers;
+ Evas_List layers;
- Evas_Object base_obj;
+ Evas_Object base_obj;
};
@@ -59,9 +61,9 @@ struct _E_Background_Layer
};
-void e_background_free(E_Background *bg);
E_Background *e_background_new(void);
E_Background *e_background_load(char *file);
+
void e_background_realize(E_Background *bg, Evas evas);
void e_background_set_scroll(E_Background *bg, int sx, int sy);
void e_background_set_size(E_Background *bg, int w, int h);
diff --git a/src/border.c b/src/border.c
index 106c3c845..a0ff8c44a 100644
--- a/src/border.c
+++ b/src/border.c
@@ -1,6 +1,7 @@
#include "cursors.h"
#include "border.h"
#include "config.h"
+#include "debug.h"
#include "actions.h"
#include "delayed.h"
#include "desktops.h"
@@ -66,11 +67,14 @@ static void e_cb_border_move_resize(E_Border *b);
static void e_cb_border_visibility(E_Border *b);
static void e_border_poll(int val, void *data);
+static void e_border_free(E_Border *b);
static int e_border_replay_query(Ecore_Event_Mouse_Down *ev)
{
E_Border *b;
+ D_ENTER;
+
b = e_border_find_by_window(ev->win);
if (b)
{
@@ -80,9 +84,10 @@ static int e_border_replay_query(Ecore_Event_Mouse_Down *ev)
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
if ((focus_mode == 2) && (ev->mods == ECORE_EVENT_KEY_MODIFIER_NONE))
/* FIXME: also if pass click always set */
- return 1;
+ D_RETURN_(1);
}
- return 0;
+
+ D_RETURN_(0);
}
/* what to dowhen we're idle */
@@ -92,6 +97,8 @@ e_border_update_borders(void)
{
Evas_List l;
+ D_ENTER;
+
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -113,13 +120,18 @@ e_border_update_borders(void)
}
}
e_db_flush();
+
+ D_RETURN;
}
static void
e_idle(void *data)
{
+ D_ENTER;
+
e_border_update_borders();
- return;
+
+ D_RETURN;
UN(data);
}
@@ -129,6 +141,8 @@ e_map_request(Ecore_Event * ev)
{
Ecore_Event_Window_Map_Request *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -142,6 +156,8 @@ e_map_request(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -150,6 +166,8 @@ e_configure_request(Ecore_Event * ev)
{
Ecore_Event_Window_Configure_Request *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -230,6 +248,8 @@ e_configure_request(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -238,6 +258,8 @@ e_property(Ecore_Event * ev)
{
Ecore_Event_Window_Property *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -250,6 +272,8 @@ e_property(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -258,12 +282,16 @@ e_client_message(Ecore_Event * ev)
{
Ecore_Event_Message *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
e_icccm_handle_client_message(e);
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -272,6 +300,8 @@ e_unmap(Ecore_Event * ev)
{
Ecore_Event_Window_Unmap *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -285,21 +315,24 @@ e_unmap(Ecore_Event * ev)
if (b->ignore_unmap > 0) b->ignore_unmap--;
else
{
- e_action_stop_by_object(b, NULL,
+ e_action_stop_by_object(E_OBJECT(b), NULL,
mouse_win_x, mouse_win_y,
border_mouse_x, border_mouse_y);
- OBJ_UNREF(b);
- OBJ_IF_FREE(b)
+
+ if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
ecore_window_reparent(e->win, 0, 0, 0);
e_icccm_release(e->win);
- OBJ_FREE(b);
}
+
+ e_object_unref(E_OBJECT(b));
}
}
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -308,6 +341,8 @@ e_destroy(Ecore_Event * ev)
{
Ecore_Event_Window_Destroy *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -318,20 +353,23 @@ e_destroy(Ecore_Event * ev)
{
if (b->win.client == e->win)
{
- e_action_stop_by_object(b, NULL,
+ e_action_stop_by_object(E_OBJECT(b), NULL,
mouse_win_x, mouse_win_y,
border_mouse_x, border_mouse_y);
- OBJ_UNREF(b);
- OBJ_IF_FREE(b)
+
+ if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
- ecore_window_reparent(e->win, 0, 0, 0);
- e_icccm_release(e->win);
- OBJ_FREE(b);
+ ecore_window_reparent(e->win, 0, 0, 0);
+ e_icccm_release(e->win);
}
+
+ e_object_unref(E_OBJECT(b));
}
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -340,6 +378,8 @@ e_circulate_request(Ecore_Event * ev)
{
Ecore_Event_Window_Circulate_Request *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -353,6 +393,8 @@ e_circulate_request(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -361,6 +403,8 @@ e_reparent(Ecore_Event * ev)
{
Ecore_Event_Window_Reparent *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -387,6 +431,8 @@ e_reparent(Ecore_Event * ev)
#endif
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -395,6 +441,8 @@ e_shape(Ecore_Event * ev)
{
Ecore_Event_Window_Shape *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -409,6 +457,8 @@ e_shape(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -417,6 +467,8 @@ e_focus_in(Ecore_Event * ev)
{
Ecore_Event_Window_Focus_In *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
printf("focus in event\n");
@@ -430,7 +482,9 @@ e_focus_in(Ecore_Event * ev)
e_border_focus_grab_ended();
b->current.selected = 1;
b->changed = 1;
- OBS_NOTIFY(b, ECORE_EVENT_WINDOW_FOCUS_IN);
+
+ e_observee_notify_observers(E_OBSERVEE(b), ECORE_EVENT_WINDOW_FOCUS_IN);
+
{
Evas_List l;
@@ -456,6 +510,8 @@ e_focus_in(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -464,6 +520,8 @@ e_focus_out(Ecore_Event * ev)
{
Ecore_Event_Window_Focus_Out *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
printf("focus out event\n");
@@ -502,6 +560,8 @@ e_focus_out(Ecore_Event * ev)
e_delayed_action_cancel(delayed_window_raise);
}
current_ev = NULL;
+
+ D_RETURN;
}
/* */
@@ -510,6 +570,8 @@ e_colormap(Ecore_Event * ev)
{
Ecore_Event_Colormap *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -521,6 +583,8 @@ e_colormap(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* handling mouse down events */
@@ -529,6 +593,8 @@ e_mouse_down(Ecore_Event * ev)
{
Ecore_Event_Mouse_Down *e;
+ D_ENTER;
+
printf("doooown\n");
current_ev = ev;
e = ev->event;
@@ -584,6 +650,8 @@ e_mouse_down(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* handling mouse up events */
@@ -592,6 +660,8 @@ e_mouse_up(Ecore_Event * ev)
{
Ecore_Event_Mouse_Up *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -639,6 +709,8 @@ e_mouse_up(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* handling mouse move events */
@@ -647,6 +719,8 @@ e_mouse_move(Ecore_Event * ev)
{
Ecore_Event_Mouse_Move *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -693,6 +767,8 @@ e_mouse_move(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* handling mouse enter events */
@@ -701,6 +777,8 @@ e_mouse_in(Ecore_Event * ev)
{
Ecore_Event_Window_Enter *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -746,6 +824,8 @@ e_mouse_in(Ecore_Event * ev)
}
}
current_ev = NULL;
+
+ D_RETURN;
}
/* handling mouse leave events */
@@ -754,6 +834,8 @@ e_mouse_out(Ecore_Event * ev)
{
Ecore_Event_Window_Leave *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -774,6 +856,8 @@ e_mouse_out(Ecore_Event * ev)
}
current_ev = NULL;
current_ev = NULL;
+
+ D_RETURN;
}
/* handling expose events */
@@ -782,6 +866,8 @@ e_window_expose(Ecore_Event * ev)
{
Ecore_Event_Window_Expose *e;
+ D_ENTER;
+
current_ev = ev;
e = ev->event;
{
@@ -800,6 +886,8 @@ e_window_expose(Ecore_Event * ev)
if (b) b->first_expose = 1;
}
current_ev = NULL;
+
+ D_RETURN;
}
/* what to do with border events */
@@ -810,19 +898,22 @@ e_cb_mouse_in(void *data, Ebits_Object o, char *class,
{
E_Border *b;
+ D_ENTER;
+
b = data;
- if (border_mouse_buttons) return;
+ if (border_mouse_buttons) D_RETURN;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
if (class) e_cursors_display_in_window(b->win.main, class);
else e_cursors_display_in_window(b->win.main, "Default");
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
e_action_stop(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
- return;
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
+
+ D_RETURN;
UN(o);
UN(bt);
UN(ox);
@@ -837,17 +928,19 @@ e_cb_mouse_out(void *data, Ebits_Object o, char *class,
{
E_Border *b;
+ D_ENTER;
+
b = data;
- if (border_mouse_buttons) return;
+ if (border_mouse_buttons) D_RETURN;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
e_cursors_display_in_window(b->win.main, "Default");
e_action_stop(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
- return;
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
+ D_RETURN;
UN(o);
UN(bt);
UN(ox);
@@ -862,11 +955,13 @@ e_cb_mouse_down(void *data, Ebits_Object o, char *class,
{
E_Border *b;
+ D_ENTER;
+
b = data;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
border_mouse_buttons = mouse_buttons;
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
{
E_Action_Type act;
Ecore_Event_Key_Modifiers mods;
@@ -879,12 +974,12 @@ e_cb_mouse_down(void *data, Ebits_Object o, char *class,
else if (((Ecore_Event_Mouse_Down *)(current_ev->event))->triple_click)
act = ACT_MOUSE_TRIPLE;
- e_action_stop(class, act, bt, NULL, mods, b,
+ e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, b,
+ e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
}
- return;
+ D_RETURN;
UN(o);
UN(ox);
UN(oy);
@@ -898,11 +993,13 @@ e_cb_mouse_up(void *data, Ebits_Object o, char *class,
{
E_Border *b;
+ D_ENTER;
+
b = data;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
border_mouse_buttons = mouse_buttons;
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
{
E_Action_Type act;
Ecore_Event_Key_Modifiers mods;
@@ -913,12 +1010,12 @@ e_cb_mouse_up(void *data, Ebits_Object o, char *class,
if ((x >= ox) && (x < (ox + ow)) && (y >= oy) && (y < (oy + oh)))
act = ACT_MOUSE_CLICKED;
- e_action_stop(class, act, bt, NULL, mods, b,
+ e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, b,
+ e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
}
- return;
+ D_RETURN;
UN(o);
}
@@ -929,6 +1026,8 @@ e_cb_mouse_move(void *data, Ebits_Object o, char *class,
E_Border *b;
int dx, dy;
+ D_ENTER;
+
b = data;
dx = mouse_x - border_mouse_x;
dy = mouse_y - border_mouse_y;
@@ -936,12 +1035,12 @@ e_cb_mouse_move(void *data, Ebits_Object o, char *class,
border_mouse_y = mouse_y;
if (!current_ev)
- return;
+ D_RETURN;
e_action_cont(class, ACT_MOUSE_MOVE, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y, dx, dy);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y, dx, dy);
- return;
+ D_RETURN;
UN(o);
UN(bt);
UN(ox);
@@ -959,7 +1058,9 @@ e_cb_border_mouse_in(E_Border *b, Ecore_Event *e)
int focus_mode;
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-/* if (border_mouse_buttons) return;*/
+ D_ENTER;
+
+/* if (border_mouse_buttons) D_RETURN;*/
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
/* pointer focus stuff */
if (focus_mode == 0)
@@ -970,15 +1071,17 @@ e_cb_border_mouse_in(E_Border *b, Ecore_Event *e)
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
/* border_mouse_buttons = mouse_buttons;*/
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
x = ((Ecore_Event_Window_Enter *)(e->event))->x;
y = ((Ecore_Event_Window_Enter *)(e->event))->y;
e_action_stop(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_IN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
+
+ D_RETURN;
}
static void
@@ -987,22 +1090,24 @@ e_cb_border_mouse_out(E_Border *b, Ecore_Event *e)
int x, y;
char *class = "Window_Grab";
-/* if (border_mouse_buttons) return; */
+/* if (border_mouse_buttons) D_RETURN; */
/* pointer focus stuff */
/* ecore_focus_to_window(0);*/
+ D_ENTER;
+
x = mouse_x;
y = mouse_y;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
/* border_mouse_buttons = mouse_buttons; */
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
e_action_stop(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
e_action_start(class, ACT_MOUSE_OUT, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y);
- return;
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y);
+ D_RETURN;
UN(e);
}
@@ -1014,15 +1119,17 @@ e_cb_border_mouse_down(E_Border *b, Ecore_Event *e)
int focus_mode;
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
+ D_ENTER;
+
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
ecore_pointer_grab(b->win.main, CurrentTime);
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
printf("%i\n", border_mouse_buttons);
-/* if (border_mouse_buttons) return; */
+/* if (border_mouse_buttons) D_RETURN; */
/* border_mouse_buttons = mouse_buttons; */
printf("%p\n", current_ev);
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
x = ((Ecore_Event_Mouse_Down *)(e->event))->x;
y = ((Ecore_Event_Mouse_Down *)(e->event))->y;
bt = ((Ecore_Event_Mouse_Down *)(e->event))->button;
@@ -1068,9 +1175,9 @@ e_cb_border_mouse_down(E_Border *b, Ecore_Event *e)
else if (((Ecore_Event_Mouse_Down *)(current_ev->event))->triple_click)
act = ACT_MOUSE_TRIPLE;
- e_action_stop(class, act, bt, NULL, mods, b, NULL,
+ e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b), NULL,
x, y, border_mouse_x, border_mouse_y);
- if (!e_action_start(class, act, bt, NULL, mods, b, NULL,
+ if (!e_action_start(class, act, bt, NULL, mods, E_OBJECT(b), NULL,
x, y, border_mouse_x, border_mouse_y))
{
ecore_pointer_ungrab(((Ecore_Event_Mouse_Down *)(e->event))->time);
@@ -1081,6 +1188,8 @@ e_cb_border_mouse_down(E_Border *b, Ecore_Event *e)
((Ecore_Event_Mouse_Down *)(e->event))->time);
}
}
+
+ D_RETURN;
}
static void
@@ -1089,11 +1198,13 @@ e_cb_border_mouse_up(E_Border *b, Ecore_Event *e)
int x, y, bt;
char *class = "Window_Grab";
+ D_ENTER;
+
ecore_pointer_ungrab(CurrentTime);
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
/* border_mouse_buttons = mouse_buttons; */
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
x = ((Ecore_Event_Mouse_Up *)(e->event))->x;
y = ((Ecore_Event_Mouse_Up *)(e->event))->y;
bt = ((Ecore_Event_Mouse_Up *)(e->event))->button;
@@ -1103,11 +1214,13 @@ e_cb_border_mouse_up(E_Border *b, Ecore_Event *e)
mods = ((Ecore_Event_Mouse_Up *)(current_ev->event))->mods;
act = ACT_MOUSE_UP;
- e_action_stop(class, act, bt, NULL, mods, b,
+ e_action_stop(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
- e_action_start(class, act, bt, NULL, mods, b,
+ e_action_start(class, act, bt, NULL, mods, E_OBJECT(b),
NULL, x, y, border_mouse_x, border_mouse_y);
}
+
+ D_RETURN;
}
static void
@@ -1117,48 +1230,109 @@ e_cb_border_mouse_move(E_Border *b, Ecore_Event *e)
int x, y;
char *class = "Window_Grab";
+ D_ENTER;
+
dx = mouse_x - border_mouse_x;
dy = mouse_y - border_mouse_y;
border_mouse_x = mouse_x;
border_mouse_y = mouse_y;
- if (!current_ev) return;
+ if (!current_ev) D_RETURN;
x = ((Ecore_Event_Mouse_Move *)(e->event))->x;
y = ((Ecore_Event_Mouse_Move *)(e->event))->y;
e_action_cont(class, ACT_MOUSE_MOVE, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
- b, NULL, x, y, border_mouse_x, border_mouse_y, dx, dy);
+ E_OBJECT(b), NULL, x, y, border_mouse_x, border_mouse_y, dx, dy);
+
+ D_RETURN;
}
static void
e_cb_border_move_resize(E_Border *b)
{
- return;
+ D_ENTER;
+
+ D_RETURN;
UN(b);
}
static void
e_cb_border_visibility(E_Border *b)
{
- return;
+ D_ENTER;
+
+ D_RETURN;
UN(b);
}
static void
e_border_poll(int val, void *data)
{
+ D_ENTER;
+
ecore_add_event_timer("e_border_poll()", 1.00, e_border_poll, val + 1, NULL);
- return;
+ D_RETURN;
UN(data);
}
+static void
+e_border_free(E_Border *b)
+{
+ Evas_List l;
+
+ D_ENTER;
+
+ e_desktops_del_border(b->desk, b);
+ if (b->bits.l) ebits_free(b->bits.l);
+ if (b->bits.r) ebits_free(b->bits.r);
+ if (b->bits.t) ebits_free(b->bits.t);
+ if (b->bits.b) ebits_free(b->bits.b);
+ evases = evas_list_remove(evases, b->evas.l);
+ evases = evas_list_remove(evases, b->evas.r);
+ evases = evas_list_remove(evases, b->evas.t);
+ evases = evas_list_remove(evases, b->evas.b);
+ evas_free(b->evas.l);
+ evas_free(b->evas.r);
+ evas_free(b->evas.t);
+ evas_free(b->evas.b);
+ ecore_window_destroy(b->win.container);
+ ecore_window_destroy(b->win.input);
+ ecore_window_destroy(b->win.main);
+ borders = evas_list_remove(borders, b);
+
+ IF_FREE(b->client.title);
+ IF_FREE(b->client.name);
+ IF_FREE(b->client.class);
+ IF_FREE(b->client.command);
+ IF_FREE(b->client.machine);
+ IF_FREE(b->client.icon_name);
+ IF_FREE(b->border_style);
+ IF_FREE(b->border_file);
+
+ if (b->grabs)
+ {
+ for (l = b->grabs; l; l = l->next)
+ {
+ FREE(l->data);
+ }
+ evas_list_free(b->grabs);
+ }
+
+ e_object_cleanup(E_OBJECT(b));
+
+ D_RETURN;
+}
+
+
/* border creation, deletion, modification and general queries */
void
e_border_apply_border(E_Border *b)
{
int pl, pr, pt, pb;
- char *borders, buf[PATH_MAX], border[PATH_MAX], *style = NULL, *match_style;
+ char *borders, buf[PATH_MAX], border[PATH_MAX], *style = NULL;
int prop_selected = 0, prop_sticky = 0, prop_shaded = 0;
+ D_ENTER;
+
style = "default";
if ((!b->client.titlebar) && (!b->client.border)) style = "borderless";
if (b->border_style) style = b->border_style;
@@ -1173,7 +1347,7 @@ e_border_apply_border(E_Border *b)
borders = e_config_get("borders");
sprintf(buf, "%s%s/%s", borders, style, border);
/* if it's not changed - abort and dont do anything */
- if ((b->border_file) && (!strcmp(buf, b->border_file))) return;
+ if ((b->border_file) && (!strcmp(buf, b->border_file))) D_RETURN;
IF_FREE(b->border_file);
e_strdup(b->border_file, buf);
@@ -1182,6 +1356,8 @@ e_border_apply_border(E_Border *b)
pl = pr = pt = pb = 0;
if (b->bits.t) ebits_get_insets(b->bits.t, &pl, &pr, &pt, &pb);
e_icccm_set_frame_size(b->win.client, pl, pr, pt, pb);
+
+ D_RETURN;
}
void
@@ -1190,11 +1366,13 @@ e_border_reshape(E_Border *b)
static Window shape_win = 0;
int pl, pr, pt, pb;
+ D_ENTER;
+
if ((b->current.shaped_client == b->previous.shaped_client) &&
(b->current.shape_changes == b->previous.shape_changes) &&
(b->current.has_shape == b->previous.has_shape) &&
(!b->shape_changed))
- return;
+ D_RETURN;
if (!shape_win) shape_win = ecore_window_override_new(0, 0, 0, 1, 1);
pl = pr = pt = pb = 0;
@@ -1204,7 +1382,7 @@ e_border_reshape(E_Border *b)
if ((!b->current.shaped_client) && (!b->current.has_shape))
{
ecore_window_set_shape_mask(b->win.main, 0);
- return;
+ D_RETURN;
}
if ((b->current.shaped_client) && (!b->current.has_shape))
@@ -1227,7 +1405,7 @@ e_border_reshape(E_Border *b)
ecore_window_add_shape_rectangles(shape_win, rects, 4);
ecore_window_set_shape_window(b->win.main, shape_win, 0, 0);
- return;
+ D_RETURN;
}
if ((!b->current.shaped_client) && (b->current.has_shape))
@@ -1251,7 +1429,7 @@ e_border_reshape(E_Border *b)
ecore_window_add_shape_rectangles(shape_win, rects, 4);
}
ecore_window_set_shape_window(b->win.main, shape_win, 0, 0);
- return;
+ D_RETURN;
}
if ((b->current.shaped_client) && (b->current.has_shape))
{
@@ -1276,8 +1454,10 @@ e_border_reshape(E_Border *b)
}
ecore_window_set_shape_window(b->win.main, shape_win, 0, 0);
- return;
+ D_RETURN;
}
+
+ D_RETURN;
}
E_Border *
@@ -1287,6 +1467,8 @@ e_border_adopt(Window win, int use_client_pos)
int bw;
int show = 1;
+ D_ENTER;
+
/* create the struct */
b = e_border_new();
/* set the right event on the client */
@@ -1438,7 +1620,8 @@ e_border_adopt(Window win, int use_client_pos)
b->current.requested.w = b->current.w;
e_border_raise(b);
ecore_window_show(win);
- return b;
+
+ D_RETURN_(b);
}
E_Border *
@@ -1452,12 +1635,15 @@ e_border_new(void)
char *font_dir;
E_Desktop *desk;
+ D_ENTER;
+
font_dir = e_config_get("fonts");
b = NEW(E_Border, 1);
ZERO(b, E_Border, 1);
-
- OBJ_INIT(b, e_border_free);
- OBS_REGISTER(delayed_window_raise, b);
+
+ e_object_init(E_OBJECT(b), (E_Cleanup_Func) e_border_free);
+ e_observer_register_observee(E_OBSERVER(delayed_window_raise),
+ E_OBSERVEE(b));
b->current.requested.w = 1;
b->current.requested.h = 1;
@@ -1597,58 +1783,17 @@ e_border_new(void)
borders = evas_list_prepend(borders, b);
- return b;
+ D_RETURN_(b);
}
-void
-e_border_free(E_Border *b)
-{
- Evas_List l;
-
- e_desktops_del_border(b->desk, b);
- if (b->bits.l) ebits_free(b->bits.l);
- if (b->bits.r) ebits_free(b->bits.r);
- if (b->bits.t) ebits_free(b->bits.t);
- if (b->bits.b) ebits_free(b->bits.b);
- evases = evas_list_remove(evases, b->evas.l);
- evases = evas_list_remove(evases, b->evas.r);
- evases = evas_list_remove(evases, b->evas.t);
- evases = evas_list_remove(evases, b->evas.b);
- evas_free(b->evas.l);
- evas_free(b->evas.r);
- evas_free(b->evas.t);
- evas_free(b->evas.b);
- ecore_window_destroy(b->win.container);
- ecore_window_destroy(b->win.input);
- ecore_window_destroy(b->win.main);
- borders = evas_list_remove(borders, b);
-
- IF_FREE(b->client.title);
- IF_FREE(b->client.name);
- IF_FREE(b->client.class);
- IF_FREE(b->client.command);
- IF_FREE(b->client.machine);
- IF_FREE(b->client.icon_name);
- IF_FREE(b->border_style);
- IF_FREE(b->border_file);
-
- if (b->grabs)
- {
- for (l = b->grabs; l; l = l->next)
- {
- FREE(l->data);
- }
- evas_list_free(b->grabs);
- }
-
- FREE(b);
-}
void
e_border_remove_mouse_grabs(E_Border *b)
{
Evas_List l;
+ D_ENTER;
+
if (b->grabs)
{
for (l = b->grabs; l; l = l->next)
@@ -1663,11 +1808,15 @@ e_border_remove_mouse_grabs(E_Border *b)
evas_list_free(b->grabs);
b->grabs = NULL;
}
+
+ D_RETURN;
}
void
e_border_remove_click_grab(E_Border *b)
{
+ D_ENTER;
+
if (b->click_grab)
{
E_Grab *g;
@@ -1679,6 +1828,8 @@ e_border_remove_click_grab(E_Border *b)
b->click_grab = NULL;
FREE(g);
}
+
+ D_RETURN;
}
void
@@ -1690,6 +1841,8 @@ e_border_attach_mouse_grabs(E_Border *b)
char buf[PATH_MAX];
E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
+ D_ENTER;
+
E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
grabs_db = e_config_get("grabs");
@@ -1724,7 +1877,7 @@ e_border_attach_mouse_grabs(E_Border *b)
if (!e_db_int_get(db, buf, &num))
{
e_db_close(db);
- return;
+ D_RETURN;
}
for (i = 0; i < num; i++)
{
@@ -1757,6 +1910,8 @@ e_border_attach_mouse_grabs(E_Border *b)
}
e_db_close(db);
}
+
+ D_RETURN;
}
void
@@ -1764,8 +1919,12 @@ e_border_remove_all_mouse_grabs(void)
{
Evas_List l;
+ D_ENTER;
+
for (l = borders; l; l = l->next)
e_border_remove_mouse_grabs((E_Border *)l->data);
+
+ D_RETURN;
}
void
@@ -1773,8 +1932,12 @@ e_border_attach_all_mouse_grabs(void)
{
Evas_List l;
+ D_ENTER;
+
for (l = borders; l; l = l->next)
e_border_attach_mouse_grabs((E_Border *)l->data);
+
+ D_RETURN;
}
void
@@ -1788,6 +1951,8 @@ e_border_redo_grabs(void)
int changed = 0;
Evas_List l;
+ D_ENTER;
+
grabs_db = e_config_get("grabs");
settings_db = e_config_get("settings");
mod = e_file_modified_time(grabs_db);
@@ -1799,7 +1964,7 @@ e_border_redo_grabs(void)
if (mod != mod_date_settings) changed = 1;
mod_date_settings = mod;
}
- if (!changed) return;
+ if (!changed) D_RETURN;
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -1808,6 +1973,8 @@ e_border_redo_grabs(void)
e_border_remove_mouse_grabs(b);
e_border_attach_mouse_grabs(b);
}
+
+ D_RETURN;
}
E_Border *
@@ -1815,6 +1982,8 @@ e_border_find_by_window(Window win)
{
Evas_List l;
+ D_ENTER;
+
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -1829,9 +1998,10 @@ e_border_find_by_window(Window win)
(win == b->win.r) ||
(win == b->win.t) ||
(win == b->win.b))
- return b;
+ D_RETURN_(b);
}
- return NULL;
+
+ D_RETURN_(NULL);
}
void
@@ -1839,6 +2009,8 @@ e_border_set_bits(E_Border *b, char *file)
{
int pl, pr, pt, pb, ppl, ppr, ppt, ppb;
+ D_ENTER;
+
pl = pr = pt = pb = 0;
ppl = ppr = ppt = ppb = 0;
@@ -1899,15 +2071,21 @@ ebits_set_classed_bit_callback(b->bits.t, _class, CALLBACK_MOUSE_MOVE, e_cb_mous
e_border_adjust_limits(b);
}
+
+ D_RETURN;
}
void
e_border_set_color_class(E_Border *b, char *class, int rr, int gg, int bb, int aa)
{
+ D_ENTER;
+
ebits_set_color_class(b->bits.l, class, rr, gg, bb, aa);
ebits_set_color_class(b->bits.r, class, rr, gg, bb, aa);
ebits_set_color_class(b->bits.t, class, rr, gg, bb, aa);
ebits_set_color_class(b->bits.b, class, rr, gg, bb, aa);
+
+ D_RETURN;
}
void
@@ -1915,6 +2093,8 @@ e_border_adjust_limits(E_Border *b)
{
int w, h, pl, pr, pt, pb, mx, my;
+ D_ENTER;
+
if (b->mode.move)
{
e_resist_border(b);
@@ -2019,6 +2199,8 @@ e_border_adjust_limits(E_Border *b)
b->current.x += (b->current.requested.w - b->current.w);
}
}
+
+ D_RETURN;
}
void
@@ -2031,8 +2213,10 @@ e_border_update(E_Border *b)
int visibility_changed = 0;
int state_changed = 0;
- if (b->hold_changes) return;
- if (!b->changed) return;
+ D_ENTER;
+
+ if (b->hold_changes) D_RETURN;
+ if (!b->changed) D_RETURN;
b->current.visible = b->current.requested.visible;
@@ -2291,6 +2475,8 @@ e_border_update(E_Border *b)
b->bits.new = 0;
b->previous = b->current;
b->changed = 0;
+
+ D_RETURN;
}
void
@@ -2298,11 +2484,15 @@ e_border_set_layer(E_Border *b, int layer)
{
int dl;
- if (b->client.layer == layer) return;
+ D_ENTER;
+
+ if (b->client.layer == layer) D_RETURN;
dl = layer - b->client.layer;
b->client.layer = layer;
if (dl > 0) e_border_lower(b);
else e_border_raise(b);
+
+ D_RETURN;
}
static void
@@ -2311,11 +2501,13 @@ e_border_raise_delayed(int val, void *b)
int auto_raise = 0;
E_CFG_INT(cfg_auto_raise, "settings", "/window/raise/auto", 0);
+ D_ENTER;
+
E_CONFIG_INT_GET(cfg_auto_raise, auto_raise);
if (auto_raise)
e_border_raise((E_Border *)b);
- return;
+ D_RETURN;
UN(val);
}
@@ -2325,12 +2517,14 @@ e_border_raise(E_Border *b)
Evas_List l;
E_Border *rel;
+ D_ENTER;
+
if (!b->desk->windows)
{
b->desk->windows = evas_list_append(b->desk->windows, b);
b->desk->changed = 1;
ecore_window_raise(b->win.main);
- return;
+ D_RETURN;
}
for (l = b->desk->windows; l; l = l->next)
{
@@ -2341,7 +2535,7 @@ e_border_raise(E_Border *b)
b->desk->windows = evas_list_prepend_relative(b->desk->windows, b, rel);
b->desk->changed = 1;
ecore_window_stack_below(b->win.main, rel->win.main);
- return;
+ D_RETURN;
}
if ((!l->next) && (l->data != b))
{
@@ -2349,9 +2543,11 @@ e_border_raise(E_Border *b)
b->desk->windows = evas_list_append(b->desk->windows, b);
b->desk->changed = 1;
ecore_window_raise(b->win.main);
- return;
+ D_RETURN;
}
}
+
+ D_RETURN;
}
void
@@ -2360,61 +2556,73 @@ e_border_lower(E_Border *b)
Evas_List l;
E_Border *rel;
+ D_ENTER;
+
if (!b->desk->windows)
{
b->desk->windows = evas_list_append(b->desk->windows, b);
b->desk->changed = 1;
ecore_window_raise(b->win.main);
- return;
+ D_RETURN;
}
for (l = b->desk->windows; l; l = l->next)
{
rel = l->data;
if (rel->client.layer == b->client.layer)
{
- if (b == rel) return;
+ if (b == rel) D_RETURN;
b->desk->windows = evas_list_remove(b->desk->windows, b);
b->desk->windows = evas_list_prepend_relative(b->desk->windows, b, rel);
b->desk->changed = 1;
ecore_window_stack_below(b->win.main, rel->win.main);
- return;
+ D_RETURN;
}
}
+
+ D_RETURN;
}
void
e_border_raise_above(E_Border *b, E_Border *above)
{
+ D_ENTER;
+
if (!b->desk->windows)
{
b->desk->windows = evas_list_append(b->desk->windows, b);
b->desk->changed = 1;
ecore_window_raise(b->win.main);
- return;
+ D_RETURN;
}
- if (!evas_list_find(b->desk->windows, above)) return;
+ if (!evas_list_find(b->desk->windows, above)) D_RETURN;
if (b->client.layer < above->client.layer) b->client.layer = above->client.layer;
b->desk->windows = evas_list_remove(b->desk->windows, b);
b->desk->windows = evas_list_append_relative(b->desk->windows, b, above);
b->desk->changed = 1;
ecore_window_stack_above(b->win.main, above->win.main);
+
+ D_RETURN;
}
void
e_border_lower_below(E_Border *b, E_Border *below)
{
+ D_ENTER;
+
if (!b->desk->windows)
{
b->desk->windows = evas_list_append(b->desk->windows, b);
b->desk->changed = 1;
- return;
+ D_RETURN;
}
- if (!evas_list_find(b->desk->windows, below)) return;
+ if (!evas_list_find(b->desk->windows, below)) D_RETURN;
if (b->client.layer > below->client.layer) b->client.layer = below->client.layer;
b->desk->windows = evas_list_remove(b->desk->windows, b);
b->desk->windows = evas_list_prepend_relative(b->desk->windows, b, below);
b->desk->changed = 1;
ecore_window_stack_below(b->win.main, below->win.main);
+
+ D_RETURN;
}
void
@@ -2423,6 +2631,8 @@ e_border_init(void)
double raise_delay = 0.5;
E_CFG_FLOAT(cfg_raise_delay, "settings", "/window/raise/delay", 0.5);
+ D_ENTER;
+
E_CONFIG_FLOAT_GET(cfg_raise_delay, raise_delay);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
@@ -2445,10 +2655,13 @@ e_border_init(void)
ecore_event_filter_handler_add(ECORE_EVENT_COLORMAP, e_colormap);
ecore_event_filter_idle_handler_add(e_idle, NULL);
- delayed_window_raise = NEW(E_Delayed_Action, 1);
- E_DELAYED_ACT_INIT(delayed_window_raise, ECORE_EVENT_WINDOW_FOCUS_IN, raise_delay, e_border_raise_delayed);
+ delayed_window_raise =
+ e_delayed_action_new(ECORE_EVENT_WINDOW_FOCUS_IN,
+ raise_delay, e_border_raise_delayed);
ecore_add_event_timer("e_border_poll()", 1.00, e_border_poll, 0, NULL);
+
+ D_RETURN;
}
void
@@ -2457,6 +2670,8 @@ e_border_adopt_children(Window win)
Window *wins;
int i, num;
+ D_ENTER;
+
wins = ecore_window_get_children(win, &num);
if (wins)
{
@@ -2482,6 +2697,8 @@ e_border_adopt_children(Window win)
}
free(wins);
}
+
+ D_RETURN;
}
E_Border *
@@ -2489,6 +2706,8 @@ e_border_current_focused(void)
{
Evas_List l;
+ D_ENTER;
+
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -2502,22 +2721,26 @@ e_border_current_focused(void)
E_Border *b;
b = l->data;
- if (b->current.selected) return b;
+ if (b->current.selected) D_RETURN_(b);
}
for (l = borders; l; l = l->next)
{
E_Border *b;
b = l->data;
- if (b->current.select_lost_from_grab) return b;
+ if (b->current.select_lost_from_grab) D_RETURN_(b);
}
- return NULL;
+
+ D_RETURN_(NULL);
}
void
e_border_focus_grab_ended(void)
{
Evas_List l;
+
+ D_ENTER;
+
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -2527,36 +2750,44 @@ e_border_focus_grab_ended(void)
b->current.selected = 0;
b->changed = 1;
}
+
+ D_RETURN;
}
int
e_border_viewable(E_Border *b)
{
+ D_ENTER;
+
if (b->desk != e_desktops_get(0))
- return 0;
+ D_RETURN_(0);
if (b->current.x + b->current.w <= 0)
- return 0;
+ D_RETURN_(0);
if (b->current.x >= b->desk->real.w)
- return 0;
+ D_RETURN_(0);
if (b->current.y + b->current.h <= 0)
- return 0;
+ D_RETURN_(0);
if (b->current.y >= b->desk->real.h)
- return 0;
+ D_RETURN_(0);
if (!b->current.visible)
- return 0;
+ D_RETURN_(0);
- return 1;
+ D_RETURN_(1);
}
void
e_border_send_pointer(E_Border *b)
{
+ D_ENTER;
+
XWarpPointer(ecore_display_get(), None, b->win.main, 0, 0, 0, 0, b->current.w / 2, b->current.h / 2);
+
+ D_RETURN;
}
void
@@ -2565,8 +2796,10 @@ e_border_raise_next(void)
Evas_List next;
E_Border *current;
+ D_ENTER;
+
if (!borders)
- return;
+ D_RETURN;
current = e_border_current_focused();
@@ -2597,18 +2830,26 @@ e_border_raise_next(void)
e_border_raise(current);
e_border_send_pointer(current);
+
+ D_RETURN;
}
void
e_border_print_pos(char *buf, E_Border *b)
{
+ D_ENTER;
+
sprintf(buf, "%i, %i",
b->current.x, b->current.y);
+
+ D_RETURN;
}
void
e_border_print_size(char *buf, E_Border *b)
{
+ D_ENTER;
+
if ((b->client.step.w > 1) || (b->client.step.h > 1))
{
sprintf(buf, "%i x %i",
@@ -2621,20 +2862,26 @@ e_border_print_size(char *buf, E_Border *b)
b->client.w,
b->client.h);
}
+
+ D_RETURN;
}
void
e_border_set_gravity(E_Border *b, int gravity)
{
- if (!b)
- return;
+ D_ENTER;
+
+ if (!b)
+ D_RETURN;
+
+ ecore_window_gravity_set(b->win.container, gravity);
+ ecore_window_gravity_set(b->win.input, gravity);
+ ecore_window_gravity_set(b->win.l, gravity);
+ ecore_window_gravity_set(b->win.r, gravity);
+ ecore_window_gravity_set(b->win.t, gravity);
+ ecore_window_gravity_set(b->win.b, gravity);
- ecore_window_gravity_set(b->win.container, gravity);
- ecore_window_gravity_set(b->win.input, gravity);
- ecore_window_gravity_set(b->win.l, gravity);
- ecore_window_gravity_set(b->win.r, gravity);
- ecore_window_gravity_set(b->win.t, gravity);
- ecore_window_gravity_set(b->win.b, gravity);
+ D_RETURN;
}
diff --git a/src/border.h b/src/border.h
index 9e8054f1a..b09e08657 100644
--- a/src/border.h
+++ b/src/border.h
@@ -2,6 +2,7 @@
#define E_BORDER_H
#include "e.h"
+#include "observer.h"
#ifndef E_DESKTOPS_TYPEDEF
#define E_DESKTOPS_TYPEDEF
@@ -22,7 +23,7 @@ struct _E_Grab
struct _E_Border
{
- OBJ_PROPERTIES;
+ E_Observee obs;
struct {
Window main;
@@ -141,13 +142,13 @@ struct _E_Border
*/
void e_border_init(void);
+E_Border *e_border_new(void);
+
void e_border_update_borders(void);
void e_border_apply_border(E_Border *b);
void e_border_reshape(E_Border *b);
E_Border *e_border_adopt(Window win, int use_client_pos);
void e_border_adopt_children(Window win);
-E_Border *e_border_new(void);
-void e_border_free(E_Border *b);
void e_border_remove_mouse_grabs(E_Border *b);
void e_border_remove_click_grab(E_Border *b);
void e_border_attach_mouse_grabs(E_Border *b);
diff --git a/src/config.c b/src/config.c
index 6be697e7a..38b5cc6d3 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "config.h"
#include "util.h"
@@ -7,9 +8,9 @@ static char cfg_root[] = "";
{ \
if (!strcmp(type, _key)) \
{ \
- if ((_var)[0]) return (_var); \
+ if ((_var)[0]) D_RETURN_(_var); \
sprintf((_var), ## _args); \
- return (_var); \
+ D_RETURN_(_var); \
} \
}
@@ -32,6 +33,8 @@ static char cfg_fonts_dir[PATH_MAX] = "";
char *
e_config_get(char *type)
{
+ D_ENTER;
+
/* for now use the system defaults and not the user copied settings */
/* so if i chnage stuff i dont have to rm my personaly settings and */
/* have e re-install them. yes this is different from e16 - the */
@@ -75,7 +78,8 @@ e_config_get(char *type)
PACKAGE_DATA_DIR"/data/backgrounds/");
E_CONF("fonts", cfg_fonts_dir,
PACKAGE_DATA_DIR"/data/fonts/");
- return "";
+
+ D_RETURN_("");
}
void
@@ -83,6 +87,8 @@ e_config_init(void)
{
char buf[PATH_MAX];
+ D_ENTER;
+
#if 1 /* for now don't do this. i think a cp -r will be needed later anyway */
if (!e_file_is_dir(e_config_user_dir())) e_file_mkdir(e_config_user_dir());
sprintf(buf, "%sappearance", e_config_user_dir());
@@ -108,11 +114,15 @@ e_config_init(void)
#if 0
ts();
#endif
+
+ D_RETURN;
}
void
e_config_set_user_dir(char *dir)
{
+ D_ENTER;
+
strcpy(cfg_root, dir);
/* reset the cached dir paths */
cfg_grabs_db[0] = 0;
@@ -132,19 +142,24 @@ e_config_set_user_dir(char *dir)
cfg_fonts_dir[0] = 0;
/* init again - if the user hasnt got all the data */
e_config_init();
+
+ D_RETURN;
}
char *
e_config_user_dir(void)
{
- if (cfg_user_dir[0]) return cfg_user_dir;
- if (cfg_root[0]) return cfg_root;
+ D_ENTER;
+
+ if (cfg_user_dir[0]) D_RETURN_(cfg_user_dir);
+ if (cfg_root[0]) D_RETURN_(cfg_root);
#if 1 /* disabled for now - use system ones only */
sprintf(cfg_user_dir, "%s/.e/", e_file_home());
#else
sprintf(cfg_user_dir, PACKAGE_DATA_DIR"/data/config/");
#endif
- return cfg_user_dir;
+
+ D_RETURN_(cfg_user_dir);
}
void
@@ -157,6 +172,8 @@ e_config_type_add_node(E_Config_Base_Type *base, char *prefix,
{
E_Config_Node *cfg_node;
+ D_ENTER;
+
cfg_node = NEW(E_Config_Node, 1);
ZERO(cfg_node, E_Config_Node, 1);
@@ -171,6 +188,8 @@ e_config_type_add_node(E_Config_Base_Type *base, char *prefix,
e_strdup(cfg_node->def_str, def_str);
}
base->nodes = evas_list_append(base->nodes, cfg_node);
+
+ D_RETURN;
}
E_Config_Base_Type *
@@ -178,9 +197,12 @@ e_config_type_new(void)
{
E_Config_Base_Type *t;
+ D_ENTER;
+
t = NEW(E_Config_Base_Type, 1);
ZERO(t, E_Config_Base_Type, 1);
- return t;
+
+ D_RETURN_(t);
}
void *
@@ -191,9 +213,14 @@ e_config_load(char *file, char *prefix, E_Config_Base_Type *type)
Evas_List l;
char *data;
- if (!e_file_exists(file)) return NULL;
+ D_ENTER;
+
+ if (!e_file_exists(file)) D_RETURN_(NULL);
db = e_db_open_read(file);
- if (!db) return NULL;
+
+ if (!db)
+ D_RETURN_(NULL);
+
data = NEW(char, type->size);
ZERO(data, char , type->size);
for (l = type->nodes; l; l = l->next)
@@ -272,7 +299,8 @@ e_config_load(char *file, char *prefix, E_Config_Base_Type *type)
}
}
e_db_close(db);
- return data;
+
+ D_RETURN_(data);
}
@@ -299,6 +327,8 @@ void ts(void)
E_Config_Base_Type *cf_list;
E_Config_Base_Type *cf_element;
+ D_ENTER;
+
cf_element = e_config_type_new();
E_CONFIG_NODE(cf_element, "name", E_CFG_TYPE_STR, NULL, List_Element, name, 0, 0, "DEFAULT_NAME");
E_CONFIG_NODE(cf_element, "size", E_CFG_TYPE_INT, NULL, List_Element, size, 777, 0, NULL);
@@ -336,6 +366,8 @@ void ts(void)
}
exit(0);
}
+
+ D_RETURN;
}
#endif
diff --git a/src/cursors.c b/src/cursors.c
index 9b5dc8d37..e5f431c04 100644
--- a/src/cursors.c
+++ b/src/cursors.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "cursors.h"
#include "config.h"
#include "util.h"
@@ -24,8 +25,10 @@ static void
e_cursors_idle(void *data)
{
int change = 0;
+
+ D_ENTER;
- if (!cursor_change) return;
+ if (!cursor_change) D_RETURN;
if ((prev_cursor) && (cur_cursor) && (strcmp(prev_cursor, cur_cursor)))
change = 1;
if ((prev_cursor) && (!cur_cursor))
@@ -39,14 +42,18 @@ e_cursors_idle(void *data)
cur_cursor = NULL;
cursor_change = 0;
- return;
+ D_RETURN;
UN(data);
}
static void
e_cursors_set(char *type)
{
+ D_ENTER;
+
e_cursors_display_in_window(0, type);
+
+ D_RETURN;
}
static E_Cursor *
@@ -54,6 +61,8 @@ e_cursors_find(char *type)
{
Evas_List l;
+ D_ENTER;
+
for (l = cursors; l; l = l->next)
{
E_Cursor *c;
@@ -70,12 +79,12 @@ e_cursors_find(char *type)
IF_FREE(c->type);
ecore_cursor_free(c->cursor);
FREE(c);
- return NULL;
+ D_RETURN_(NULL);
}
- return c;
+ D_RETURN_(c);
}
}
- return NULL;
+ D_RETURN_(NULL);
}
void
@@ -83,6 +92,8 @@ e_cursors_display_in_window(Window win, char *type)
{
E_Cursor *c;
+ D_ENTER;
+
if (!type) type = "Default";
c = e_cursors_find(type);
if (!c)
@@ -222,23 +233,33 @@ e_cursors_display_in_window(Window win, char *type)
ecore_cursor_set(win, c->cursor);
else
{
- if (!strcmp(type, "Default")) return;
+ if (!strcmp(type, "Default")) D_RETURN;
e_cursors_display_in_window(win, "Default");
}
+
+ D_RETURN;
}
void
e_cursors_display(char *type)
{
+ D_ENTER;
+
IF_FREE(cur_cursor);
e_strdup(cur_cursor, type);
printf("%s\n", type);
cursor_change = 1;
+
+ D_RETURN;
}
void
e_cursors_init(void)
{
+ D_ENTER;
+
ecore_event_filter_idle_handler_add(e_cursors_idle, NULL);
e_cursors_set("Default");
+
+ D_RETURN;
}
diff --git a/src/debug.c b/src/debug.c
new file mode 100644
index 000000000..ecc8da545
--- /dev/null
+++ b/src/debug.c
@@ -0,0 +1,86 @@
+/*
+
+Copyright (C) 2000, 2001 Christian Kreibich <cK@whoop.org>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies of the Software and its documentation and acknowledgment shall be
+given in the documentation and software packages that this Software was
+used.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "debug.h"
+
+
+static int calldepth = 0;
+
+static void debug_whitespace(int calldepth);
+static void debug_print_info(void);
+
+static void
+debug_whitespace(int calldepth)
+{
+ int i;
+
+ for (i = 0; i < 2*calldepth; i++)
+ printf("-");
+}
+
+
+static void
+debug_print_info(void)
+{
+ printf("e17 dbg: ");
+}
+
+
+
+void
+e_debug_enter(const char *file, const char *func)
+{
+
+ calldepth++;
+
+ printf("ENTER ");
+ debug_print_info();
+ debug_whitespace(calldepth);
+ printf("%s, %s()\n", file, func);
+ fflush(stdout);
+}
+
+
+void
+e_debug_D_RETURN(const char *file, const char *func)
+{
+ printf("RETURN ");
+ debug_print_info();
+ debug_whitespace(calldepth);
+ printf("%s, %s()\n", file, func);
+ fflush(stdout);
+
+ calldepth--;
+}
+
+
diff --git a/src/debug.h b/src/debug.h
new file mode 100644
index 000000000..e0e50d9cb
--- /dev/null
+++ b/src/debug.h
@@ -0,0 +1,64 @@
+/*
+
+Copyright (C) 2000, 2001 Christian Kreibich <cK@whoop.org>.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies of the Software and its documentation and acknowledgment shall be
+given in the documentation and software packages that this Software was
+used.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+*/
+#ifndef E_DEBUG_H
+#define E_DEBUG_H
+
+#include <unistd.h>
+#include <stdio.h>
+
+#ifdef DEBUG
+
+#define D(fmt, args...) printf(fmt, ## args);
+#else
+#define D(msg)
+#endif
+
+#ifdef DEBUG_NEST
+
+void e_debug_enter(const char *file, const char *func);
+void e_debug_return(const char *file, const char *func);
+
+#define D_ENTER efsd_debug_enter(__FILE__, __FUNCTION__)
+
+#define D_RETURN \
+{ \
+ efsd_debug_return(__FILE__, __FUNCTION__); \
+ return; \
+}
+
+#define D_RETURN_(x) \
+{ \
+ efsd_debug_return(__FILE__, __FUNCTION__); \
+\
+ return x; \
+}
+#else
+#define D_ENTER
+#define D_RETURN return
+#define D_RETURN_(x) return (x)
+#endif
+
+#endif
+
diff --git a/src/delayed.c b/src/delayed.c
index afb311a92..4c1f25fe1 100644
--- a/src/delayed.c
+++ b/src/delayed.c
@@ -1,29 +1,65 @@
-
+#include <string.h>
+#include "debug.h"
#include "delayed.h"
+static void
+e_delayed_action_cleanup(E_Delayed_Action *eda)
+{
+ D_ENTER;
+
+ e_delayed_action_cancel(eda);
+ e_observer_cleanup(E_OBSERVER(eda));
+
+ D_RETURN;
+}
+
+
+E_Delayed_Action *
+e_delayed_action_new(Ecore_Event_Type event,
+ double delay, E_Delay_Func delay_func)
+{
+ E_Delayed_Action *eda = NULL;
+
+ D_ENTER;
+
+ eda = NEW(E_Delayed_Action, 1);
+ memset(eda, 0, sizeof(E_Delayed_Action));
+
+ e_observer_init(E_OBSERVER(eda), event, e_delayed_action_start,
+ (E_Cleanup_Func) e_delayed_action_cleanup);
+
+ eda->delay = delay;
+ eda->delay_func = delay_func;
+
+ D_RETURN_(eda);
+}
+
+
void
-e_delayed_action_start(void *obs, void *obj)
+e_delayed_action_start(E_Observer *obs, E_Observee *obj)
{
char event_name[1024];
- E_Delayed_Action *eda = obs;
+ E_Delayed_Action *eda = (E_Delayed_Action*) obs;
+
+ D_ENTER;
- snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", eda->e_event);
+ snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", obs->event);
ecore_add_event_timer(event_name, eda->delay, eda->delay_func, 0, obj);
+
+ D_RETURN;
}
+
void
-e_delayed_action_cancel(void *obs)
+e_delayed_action_cancel(E_Delayed_Action *eda)
{
- E_Delayed_Action *eda = obs;
char event_name[1024];
- snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", eda->e_event);
+
+ D_ENTER;
+
+ snprintf(event_name, 1024, "_e_delayed_action_notify(%d)", E_OBSERVER(eda)->event);
ecore_del_event_timer(event_name);
-}
-void
-e_delayed_action_free(void *obs)
-{
- e_delayed_action_cancel(obs);
- free(obs);
+ D_RETURN;
}
diff --git a/src/delayed.h b/src/delayed.h
index aa85c4b9d..e09a11ac2 100644
--- a/src/delayed.h
+++ b/src/delayed.h
@@ -2,26 +2,25 @@
#define E_DELAYED_H
#include "e.h"
+#include "observer.h"
-typedef struct _E_Delayed_Action E_Delayed_Action;
+typedef void (*E_Delay_Func)(int val, void *obj);
-struct _E_Delayed_Action {
- OBS_PROPERTIES;
+typedef struct _e_delayed_action
+{
+ E_Observer obs;
- double delay;
- void (*delay_func)(int val, void *obj);
-};
+ double delay;
+ E_Delay_Func delay_func;
-#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; \
-}
+} E_Delayed_Action;
-void e_delayed_action_start(void *obs, void *obj);
-void e_delayed_action_cancel(void *obs);
-void e_delayed_action_free(void *obs);
+
+E_Delayed_Action *e_delayed_action_new(Ecore_Event_Type event,
+ double delay, E_Delay_Func delay_func);
+
+void e_delayed_action_start(E_Observer *obs, E_Observee *obj);
+void e_delayed_action_cancel(E_Delayed_Action *eda);
#endif
diff --git a/src/desktops.c b/src/desktops.c
index ba6b49a10..5fa0d7b97 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "desktops.h"
#include "config.h"
#include "actions.h"
@@ -6,6 +7,7 @@
#include "view.h"
#include "icccm.h"
#include "util.h"
+#include "object.h"
static Evas_List desktops = NULL;
static Window e_base_win = 0;
@@ -16,10 +18,11 @@ static void ecore_idle(void *data);
static void
ecore_idle(void *data)
{
+ D_ENTER;
/* FIXME -- Raster, how is this related to the desktop code? */
e_db_flush();
- return;
+ D_RETURN;
UN(data);
}
@@ -27,7 +30,9 @@ void
e_desktops_init(void)
{
E_Desktop *desk;
-
+
+ D_ENTER;
+
ecore_window_get_geometry(0, NULL, NULL, &screen_w, &screen_h);
e_base_win = ecore_window_override_new(0, 0, 0, screen_w, screen_h);
ecore_window_show(e_base_win);
@@ -44,6 +49,8 @@ e_desktops_init(void)
e_icccm_set_desk_area_size(0, 1, 1);
e_icccm_set_desk_area(0, 0, 0);
e_icccm_set_desk(0, 0);
+
+ D_RETURN;
}
void
@@ -53,8 +60,10 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
int xd, yd, wd, hd;
int grav, grav_stick;
+ D_ENTER;
+
/* set grav */
- if ((dx ==0) && (dy == 0)) return;
+ if ((dx ==0) && (dy == 0)) D_RETURN;
desk->x -= dx;
desk->y -= dy;
xd = yd = wd = hd = 0;
@@ -145,29 +154,36 @@ e_desktops_scroll(E_Desktop *desk, int dx, int dy)
b->changed = 1;
}
}
+
+ D_RETURN;
}
void
-e_desktops_free(E_Desktop *desk)
+e_desktops_cleanup(E_Desktop *desk)
{
+ D_ENTER;
+
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_action_stop_by_object(E_OBJECT(b), NULL, 0, 0, 0, 0);
+
+ if (e_object_get_usecount(E_OBJECT(b)) == 1)
{
- ecore_window_reparent(b->win.client, 0, 0, 0);
- e_icccm_release(b->win.client);
- OBJ_FREE(b);
+ ecore_window_reparent(b->win.client, 0, 0, 0);
+ e_icccm_release(b->win.client);
}
}
+
ecore_window_destroy(desk->win.main);
IF_FREE(desk->name);
IF_FREE(desk->dir);
- FREE(desk);
+
+ e_object_cleanup(E_OBJECT(desk));
+
+ D_RETURN;
}
void
@@ -176,7 +192,9 @@ e_desktops_init_file_display(E_Desktop *desk)
E_View *v;
E_Border *b;
char buf[PATH_MAX];
-
+
+ D_ENTER;
+
v = e_view_new();
v->size.w = desk->real.w;
v->size.h = desk->real.h;
@@ -213,6 +231,8 @@ e_desktops_init_file_display(E_Desktop *desk)
b->client.is_desktop = 1;
if (v->options.back_pixmap) e_view_update(v);
+
+ D_RETURN;
}
E_Desktop *
@@ -220,10 +240,12 @@ e_desktops_new(void)
{
E_Desktop *desk;
+ D_ENTER;
+
desk = NEW(E_Desktop, 1);
ZERO(desk, E_Desktop, 1);
- OBJ_INIT(desk, e_desktops_free);
+ e_object_init(E_OBJECT(desk), (E_Cleanup_Func) e_desktops_cleanup);
desk->win.main = ecore_window_override_new(e_base_win, 0, 0, screen_w, screen_h);
desk->win.container = ecore_window_override_new(desk->win.main, 0, 0, screen_w, screen_h);
@@ -240,50 +262,71 @@ e_desktops_new(void)
desktops = evas_list_append(desktops, desk);
- return desk;
+ D_RETURN_(desk);
}
void
e_desktops_add_border(E_Desktop *d, E_Border *b)
{
- if ((!d) || (!b)) return;
+ D_ENTER;
+
+ if ((!d) || (!b)) D_RETURN;
b->desk = d;
b->client.desk = d->desk.desk;
b->client.area.x = d->desk.area.x;
b->client.area.y = d->desk.area.y;
e_border_raise(b);
+
+ D_RETURN;
}
void
e_desktops_del_border(E_Desktop *d, E_Border *b)
{
- if ((!d) || (!b)) return;
+ D_ENTER;
+
+ if ((!d) || (!b)) D_RETURN;
d->windows = evas_list_remove(d->windows, b);
b->desk = NULL;
+
+ D_RETURN;
}
void
e_desktops_delete(E_Desktop *d)
{
- OBJ_DO_FREE(d);
+ D_ENTER;
+
+ e_object_unref(E_OBJECT(d));
+
+ D_RETURN;
}
void
e_desktops_show(E_Desktop *d)
{
+ D_ENTER;
+
ecore_window_show(d->win.main);
+
+ D_RETURN;
}
void
e_desktops_hide(E_Desktop *d)
{
+ D_ENTER;
+
ecore_window_hide(d->win.main);
+
+ D_RETURN;
}
int
e_desktops_get_num(void)
{
- return 8;
+ D_ENTER;
+ D_RETURN_(8);
}
E_Desktop *
@@ -292,28 +335,39 @@ e_desktops_get(int d)
Evas_List l;
int i;
+ D_ENTER;
+
for (i = 0, l = desktops; l; l = l->next, i++)
{
- if (i == d) return (E_Desktop *)l->data;
+ if (i == d)
+ D_RETURN_((E_Desktop *)l->data);
}
- return NULL;
+
+ D_RETURN_(NULL);
}
int
e_desktops_get_current(void)
{
E_Desktop *desk;
-
+
+ D_ENTER;
+
desk = e_desktops_get(0);
if (desk)
- return desk->desk.desk;
- return 0;
+ D_RETURN_(desk->desk.desk);
+
+ D_RETURN_(0);
}
void
e_desktops_goto_desk(int d)
{
+ D_ENTER;
+
e_desktops_goto(d, 0, 0);
+
+ D_RETURN;
}
void
@@ -321,6 +375,8 @@ e_desktops_goto(int d, int ax, int ay)
{
E_Desktop *desk;
+ D_ENTER;
+
desk = e_desktops_get(0);
if (desk)
{
@@ -329,7 +385,7 @@ e_desktops_goto(int d, int ax, int ay)
if ((d == desk->desk.desk) &&
(ax == desk->desk.area.x) &&
- (ay == desk->desk.area.y)) return;
+ (ay == desk->desk.area.y)) D_RETURN;
dx = ax - desk->desk.area.x;
dy = ay - desk->desk.area.y;
@@ -371,4 +427,6 @@ e_desktops_goto(int d, int ax, int ay)
e_icccm_set_desk_area(0, desk->desk.area.x, desk->desk.area.y);
e_icccm_set_desk(0, desk->desk.desk);
}
+
+ D_RETURN;
}
diff --git a/src/desktops.h b/src/desktops.h
index a9caf8013..62d196086 100644
--- a/src/desktops.h
+++ b/src/desktops.h
@@ -4,6 +4,7 @@
#include "e.h"
#include "view.h"
#include "border.h"
+#include "object.h"
#ifndef E_DESKTOPS_TYPEDEF
#define E_DESKTOPS_TYPEDEF
@@ -12,7 +13,7 @@ typedef struct _E_Desktop E_Desktop;
struct _E_Desktop
{
- OBJ_PROPERTIES;
+ E_Object o;
char *name;
char *dir;
diff --git a/src/e.h b/src/e.h
index 0205ee04f..8630a9274 100644
--- a/src/e.h
+++ b/src/e.h
@@ -97,82 +97,6 @@ printf("%3.3f : %s()\n", __p->total, __p->func); \
#define E_PROF_DUMP
#endif
-/* Observer macros */
-#define OBS_PROPERTIES \
-Evas_List watched; \
-Ecore_Event_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 == ECORE_EVENT_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_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) \
- { \
- OBJ_FREE(_e_obj); \
- } \
-}
-#define OBJ_PROPERTIES \
-int references; \
-void (*e_obj_free) (void *e_obj); \
-Evas_List observers;
-#define OBJ_INIT(_e_obj, _e_obj_free_func) \
-{ \
- _e_obj->references = 1; \
- _e_obj->e_obj_free = (void *) _e_obj_free_func; \
- _e_obj->observers = NULL; \
-}
/* misc util macros */
#define INTERSECTS(x, y, w, h, xx, yy, ww, hh) \
@@ -184,19 +108,4 @@ Evas_List observers;
(!((((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
-{
- OBJ_PROPERTIES;
-};
-
-struct _E_Observer
-{
- OBS_PROPERTIES;
-};
-
#endif
diff --git a/src/e_ferite.c b/src/e_ferite.c
index 4adc9491f..0a5875b1b 100644
--- a/src/e_ferite.c
+++ b/src/e_ferite.c
@@ -1,34 +1,51 @@
+#include "debug.h"
#include "e_ferite.h"
#include "e_ferite_gen_header.h"
void e_ferite_init(void)
{
+ D_ENTER;
+
printf( "Initialising ferite....\n" );
ferite_init( 0, NULL );
+
+ D_RETURN;
}
void e_ferite_deinit(void)
{
+ D_ENTER;
+
printf( "Deinitialising ferite....\n" );
ferite_deinit();
+
+ D_RETURN;
}
int e_ferite_script_error( FeriteScript *script, char *errmsg, int val )
{
+ D_ENTER;
+
fprintf( stderr, "e17: ferite error: %s\n", errmsg );
- return 1;
+
+ D_RETURN_(1);
}
int e_ferite_script_warning( FeriteScript *script, char *warnmsg )
{
+ D_ENTER;
+
fprintf( stderr, "e17: ferite warning: %s\n", warnmsg );
- return 1;
+
+ D_RETURN_(1);
}
void e_ferite_run( char *txt )
{
FeriteScript *script = NULL;
+ D_ENTER;
+
printf( "Compiling script `%s'\n", txt );
script = __ferite_compile_string( txt );
e_ferite_register( script, script->mainns );
@@ -38,4 +55,6 @@ void e_ferite_run( char *txt )
ferite_script_execute( script );
printf( "Cleaning up.\n" );
ferite_script_delete( script );
+
+ D_RETURN;
}
diff --git a/src/embed.c b/src/embed.c
index f56fff02f..7ae6dfd64 100644
--- a/src/embed.c
+++ b/src/embed.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "embed.h"
typedef struct _Embed Embed_Private;
@@ -17,9 +18,13 @@ e_embed_text_func_show(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_show(em->evas, em->clip_obj);
e_text_show(em->text_obj);
+
+ D_RETURN;
}
static void
@@ -27,9 +32,13 @@ e_embed_text_func_hide(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_hide(em->evas, em->clip_obj);
e_text_hide(em->text_obj);
+
+ D_RETURN;
}
static void
@@ -37,9 +46,13 @@ e_embed_text_func_move(void *_data, double x, double y)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_move(em->evas, em->clip_obj, x, y);
e_text_move(em->text_obj, x, y);
+
+ D_RETURN;
}
static void
@@ -47,9 +60,13 @@ e_embed_text_func_resize(void *_data, double w, double h)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_resize(em->evas, em->clip_obj, w, h);
e_text_resize(em->text_obj, w, h);
+
+ D_RETURN;
}
static void
@@ -57,9 +74,13 @@ e_embed_text_func_raise(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_raise(em->evas, em->clip_obj);
e_text_raise(em->text_obj);
+
+ D_RETURN;
}
static void
@@ -67,9 +88,13 @@ e_embed_text_func_lower(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_lower(em->evas, em->clip_obj);
e_text_lower(em->text_obj);
+
+ D_RETURN;
}
static void
@@ -77,9 +102,13 @@ e_embed_text_func_set_layer(void *_data, int l)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj) evas_set_layer(em->evas, em->clip_obj, l);
e_text_set_layer(em->text_obj, l);
+
+ D_RETURN;
}
static void
@@ -87,6 +116,8 @@ e_embed_text_func_set_clip(void *_data, Evas_Object clip)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (em->clip_obj)
{
@@ -102,11 +133,17 @@ e_embed_text_func_set_clip(void *_data, Evas_Object clip)
else
e_text_unset_clip(em->text_obj);
}
+
+ D_RETURN;
}
static void
e_embed_text_func_set_color_class(void *_data, char *cc, int r, int g, int b, int a)
{
+ D_ENTER;
+
+ D_RETURN;
+
UN(_data);
UN(cc);
UN(r);
@@ -120,10 +157,14 @@ e_embed_text_func_get_min_size(void *_data, double *w, double *h)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
e_text_get_min_size(em->text_obj, w, h);
if (em->clip_x) *w = 0;
if (em->clip_y) *h = 0;
+
+ D_RETURN;
}
static void
@@ -131,10 +172,14 @@ e_embed_text_func_get_max_size(void *_data, double *w, double *h)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
e_text_get_max_size(em->text_obj, w, h);
if (em->clip_x) *w = 999999999;
if (em->clip_y) *h = 999999999;
+
+ D_RETURN;
}
/***/
@@ -144,6 +189,8 @@ e_embed_text(Ebits_Object o, char *bit_name, Evas evas, E_Text *text_obj, int cl
{
Embed_Private *em;
+ D_ENTER;
+
em = NEW(Embed_Private, 1);
ZERO(em, Embed_Private, 1);
em->o = o;
@@ -171,7 +218,7 @@ e_embed_text(Ebits_Object o, char *bit_name, Evas evas, E_Text *text_obj, int cl
e_embed_text_func_get_min_size,
e_embed_text_func_get_max_size,
em);
- return em;
+ D_RETURN_(em);
}
/*****************************************************************************/
@@ -181,8 +228,12 @@ e_embed_image_func_show(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_show(em->evas, em->image_obj);
+
+ D_RETURN;
}
static void
@@ -190,8 +241,12 @@ e_embed_image_func_hide(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_hide(em->evas, em->image_obj);
+
+ D_RETURN;
}
static void
@@ -199,8 +254,12 @@ e_embed_image_func_move(void *_data, double x, double y)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_move(em->evas, em->image_obj, x, y);
+
+ D_RETURN;
}
static void
@@ -208,9 +267,13 @@ e_embed_image_func_resize(void *_data, double w, double h)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_resize(em->evas, em->image_obj, w, h);
evas_set_image_fill(em->evas, em->image_obj, 0, 0, w, h);
+
+ D_RETURN;
}
static void
@@ -218,8 +281,12 @@ e_embed_image_func_raise(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_raise(em->evas, em->image_obj);
+
+ D_RETURN;
}
static void
@@ -227,8 +294,12 @@ e_embed_image_func_lower(void *_data)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_lower(em->evas, em->image_obj);
+
+ D_RETURN;
}
static void
@@ -236,8 +307,12 @@ e_embed_image_func_set_layer(void *_data, int l)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
evas_set_layer(em->evas, em->image_obj, l);
+
+ D_RETURN;
}
static void
@@ -245,11 +320,15 @@ e_embed_image_func_set_clip(void *_data, Evas_Object clip)
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if (clip)
evas_set_clip(em->evas, em->image_obj, clip);
else
evas_unset_clip(em->evas, em->image_obj);
+
+ D_RETURN;
}
static void
@@ -257,9 +336,13 @@ e_embed_image_func_set_color_class(void *_data, char *cc, int r, int g, int b, i
{
Embed_Private *em;
+ D_ENTER;
+
em = _data;
if ((cc) && (!strcmp(cc, "icon")))
evas_set_color(em->evas, em->image_obj, r, g, b, a);
+
+ D_RETURN;
}
static void
@@ -268,12 +351,16 @@ e_embed_image_func_get_min_size(void *_data, double *w, double *h)
Embed_Private *em;
int iw, ih;
+ D_ENTER;
+
em = _data;
iw = 0;
ih = 0;
evas_get_image_size(em->evas, em->image_obj, &iw, &ih);
if (w) *w = iw;
if (h) *h = ih;
+
+ D_RETURN;
}
static void
@@ -282,10 +369,14 @@ e_embed_image_func_get_max_size(void *_data, double *w, double *h)
Embed_Private *em;
int iw, ih;
+ D_ENTER;
+
em = _data;
evas_get_image_size(em->evas, em->image_obj, &iw, &ih);
if (w) *w = iw;
if (h) *h = ih;
+
+ D_RETURN;
}
/***/
@@ -295,6 +386,8 @@ e_embed_image_object(Ebits_Object o, char *bit_name, Evas evas, Evas_Object imag
{
Embed_Private *em;
+ D_ENTER;
+
em = NEW(Embed_Private, 1);
ZERO(em, Embed_Private, 1);
em->o = o;
@@ -313,7 +406,7 @@ e_embed_image_object(Ebits_Object o, char *bit_name, Evas evas, Evas_Object imag
e_embed_image_func_get_min_size,
e_embed_image_func_get_max_size,
em);
- return em;
+ D_RETURN_(em);
}
/*****/
@@ -323,7 +416,11 @@ e_embed_free(Embed emb)
{
Embed_Private *em;
+ D_ENTER;
+
em = emb;
if (em->clip_obj) evas_del_object(em->evas, em->clip_obj);
FREE(em);
+
+ D_RETURN;
}
diff --git a/src/entry.c b/src/entry.c
index 0d0371d76..208ef8985 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "entry.h"
#include "config.h"
#include "util.h"
@@ -19,6 +20,8 @@ e_clear_selection(Ecore_Event * ev)
{
Ecore_Event_Clear_Selection *e;
Evas_List l;
+
+ D_ENTER;
e = ev->event;
for (l = entries; l; l = l->next)
@@ -35,6 +38,8 @@ e_clear_selection(Ecore_Event * ev)
e_entry_configure(entry);
}
}
+
+ D_RETURN;
}
static void
@@ -43,6 +48,8 @@ e_paste_request(Ecore_Event * ev)
Ecore_Event_Paste_Request *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = entries; l; l = l->next)
{
@@ -58,6 +65,8 @@ e_paste_request(Ecore_Event * ev)
e_entry_insert_text(entry, type);
}
}
+
+ D_RETURN;
}
static void
@@ -66,6 +75,8 @@ e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
E_Entry *entry;
int pos;
+ D_ENTER;
+
entry = _data;
if ((_b == 2) && (!entry->mouse_down))
{
@@ -99,6 +110,8 @@ e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
entry->select.start = -1;
e_entry_configure(entry);
}
+
+ D_RETURN;
UN(_o);
}
@@ -108,9 +121,13 @@ e_entry_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
E_Entry *entry;
/* int pos; */
+ D_ENTER;
+
entry = _data;
if (_b == entry->mouse_down) entry->mouse_down = 0;
e_entry_configure(entry);
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_x);
@@ -122,6 +139,8 @@ e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Entry *entry;
+ D_ENTER;
+
entry = _data;
if (entry->mouse_down > 0)
{
@@ -192,6 +211,8 @@ e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
e_entry_configure(entry);
}
+
+ D_RETURN;
UN(_o);
UN(_b);
UN(_y);
@@ -203,6 +224,8 @@ e_entry_realize(E_Entry *entry)
char *entries;
char buf[PATH_MAX];
+ D_ENTER;
+
entries = e_config_get("entries");
sprintf(buf, "%s/%s", entries, "base.bits.db");
entry->obj_base = ebits_load(buf);
@@ -241,11 +264,15 @@ e_entry_realize(E_Entry *entry)
evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_DOWN, e_entry_down_cb, entry);
evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_UP, e_entry_up_cb, entry);
evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_MOVE, e_entry_move_cb, entry);
+
+ D_RETURN;
}
static void
e_entry_unrealize(E_Entry *entry)
{
+ D_ENTER;
+
if (entry->event_box) evas_del_object(entry->evas, entry->event_box);
if (entry->text) evas_del_object(entry->evas, entry->text);
if (entry->clip_box) evas_del_object(entry->evas, entry->clip_box);
@@ -258,6 +285,8 @@ e_entry_unrealize(E_Entry *entry)
entry->obj_base = NULL;
entry->obj_cursor = NULL;
entry->obj_selection = NULL;
+
+ D_RETURN;
}
static void
@@ -266,8 +295,10 @@ e_entry_configure(E_Entry *entry)
int p1l, p1r, p1t, p1b;
int p2l, p2r, p2t, p2b;
- if (!entry->evas) return;
- if (!entry->event_box) return;
+ D_ENTER;
+
+ if (!entry->evas) D_RETURN;
+ if (!entry->event_box) D_RETURN;
p1l = p1r = p1t = p1b = 0;
if (entry->obj_base) ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
p2l = p2r = p2t = p2b = 0;
@@ -354,22 +385,32 @@ e_entry_configure(E_Entry *entry)
if (entry->obj_selection)
ebits_hide(entry->obj_selection);
}
+
+ D_RETURN;
}
void
e_entry_init(void)
{
+ D_ENTER;
+
ecore_event_filter_handler_add(ECORE_EVENT_PASTE_REQUEST, e_paste_request);
ecore_event_filter_handler_add(ECORE_EVENT_CLEAR_SELECTION, e_clear_selection);
+
+ D_RETURN;
}
void
e_entry_free(E_Entry *entry)
{
+ D_ENTER;
+
entries = evas_list_remove(entries, entry);
e_entry_unrealize(entry);
IF_FREE(entry->buffer);
FREE(entry);
+
+ D_RETURN;
}
E_Entry *
@@ -377,19 +418,24 @@ e_entry_new(void)
{
E_Entry *entry;
+ D_ENTER;
+
entry = NEW(E_Entry, 1);
ZERO(entry, E_Entry, 1);
e_strdup(entry->buffer, "");
entry->select.start = -1;
entry->end_width = 4;
entries = evas_list_prepend(entries, entry);
- return entry;
+
+ D_RETURN_(entry);
}
void
e_entry_handlecore_keypress(E_Entry *entry, Ecore_Event_Key_Down *e)
{
- if (!entry->focused) return;
+ D_ENTER;
+
+ if (!entry->focused) D_RETURN;
if (!strcmp(e->key, "Up"))
{
}
@@ -497,11 +543,15 @@ e_entry_handlecore_keypress(E_Entry *entry, Ecore_Event_Key_Down *e)
}
}
e_entry_configure(entry);
+
+ D_RETURN;
}
void
e_entry_set_evas(E_Entry *entry, Evas evas)
{
+ D_ENTER;
+
if (entry->evas) e_entry_unrealize(entry);
entry->evas = evas;
e_entry_realize(entry);
@@ -511,99 +561,137 @@ e_entry_set_evas(E_Entry *entry, Evas evas)
entry->visible = 0;
e_entry_show(entry);
}
+
+ D_RETURN;
}
void
e_entry_show(E_Entry *entry)
{
- if (entry->visible) return;
+ D_ENTER;
+
+ if (entry->visible) D_RETURN;
entry->visible = 1;
- if (!entry->evas) return;
+ if (!entry->evas) D_RETURN;
if (entry->obj_base) ebits_show(entry->obj_base);
if (entry->obj_cursor) ebits_show(entry->obj_cursor);
if (entry->obj_selection) ebits_show(entry->obj_selection);
evas_show(entry->evas, entry->event_box);
evas_show(entry->evas, entry->clip_box);
evas_show(entry->evas, entry->text);
+
+ D_RETURN;
}
void
e_entry_hide(E_Entry *entry)
{
- if (!entry->visible) return;
+ D_ENTER;
+
+ if (!entry->visible) D_RETURN;
entry->visible = 0;
- if (!entry->evas) return;
+ if (!entry->evas) D_RETURN;
if (entry->obj_base) ebits_hide(entry->obj_base);
if (entry->obj_cursor) ebits_hide(entry->obj_cursor);
if (entry->obj_selection) ebits_hide(entry->obj_selection);
evas_hide(entry->evas, entry->event_box);
evas_hide(entry->evas, entry->clip_box);
evas_hide(entry->evas, entry->text);
+
+ D_RETURN;
}
void
e_entry_raise(E_Entry *entry)
{
+ D_ENTER;
+
if (entry->obj_base) ebits_raise(entry->obj_base);
evas_raise(entry->evas, entry->clip_box);
evas_raise(entry->evas, entry->text);
if (entry->obj_selection) ebits_raise(entry->obj_selection);
if (entry->obj_cursor) ebits_raise(entry->obj_cursor);
evas_raise(entry->evas, entry->event_box);
+
+ D_RETURN;
}
void
e_entry_lower(E_Entry *entry)
{
+ D_ENTER;
+
evas_lower(entry->evas, entry->event_box);
if (entry->obj_cursor) ebits_lower(entry->obj_cursor);
if (entry->obj_selection) ebits_lower(entry->obj_selection);
evas_lower(entry->evas, entry->text);
evas_lower(entry->evas, entry->clip_box);
if (entry->obj_base) ebits_lower(entry->obj_base);
+
+ D_RETURN;
}
void
e_entry_set_layer(E_Entry *entry, int l)
{
+ D_ENTER;
+
if (entry->obj_base) ebits_set_layer(entry->obj_base, l);
evas_set_layer(entry->evas, entry->clip_box, l);
evas_set_layer(entry->evas, entry->text, l);
if (entry->obj_selection) ebits_set_layer(entry->obj_selection, l);
if (entry->obj_cursor) ebits_set_layer(entry->obj_cursor, l);
evas_set_layer(entry->evas, entry->event_box, l);
+
+ D_RETURN;
}
void
e_entry_set_clip(E_Entry *entry, Evas_Object clip)
{
+ D_ENTER;
+
evas_set_clip(entry->evas, entry->clip_box, clip);
if (entry->obj_base)
ebits_set_clip(entry->obj_base, clip);
+
+ D_RETURN;
}
void
e_entry_unset_clip(E_Entry *entry)
{
+ D_ENTER;
+
evas_unset_clip(entry->evas, entry->clip_box);
if (entry->obj_base)
ebits_unset_clip(entry->obj_base);
+
+ D_RETURN;
}
void
e_entry_move(E_Entry *entry, int x, int y)
{
+ D_ENTER;
+
entry->x = x;
entry->y = y;
e_entry_configure(entry);
+
+ D_RETURN;
}
void
e_entry_resize(E_Entry *entry, int w, int h)
{
+ D_ENTER;
+
entry->w = w;
entry->h = h;
e_entry_configure(entry);
+
+ D_RETURN;
}
void
@@ -612,6 +700,8 @@ e_entry_query_max_size(E_Entry *entry, int *w, int *h)
int p1l, p1r, p1t, p1b;
int p2l, p2r, p2t, p2b;
+ D_ENTER;
+
p1l = p1r = p1t = p1b = 0;
if (entry->obj_base) ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
p2l = p2r = p2t = p2b = 0;
@@ -619,6 +709,8 @@ e_entry_query_max_size(E_Entry *entry, int *w, int *h)
if (w) *w = evas_get_text_width(entry->evas, entry->text) + p1l + p1r + p2l + p2r;
if (h) *h = evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
+
+ D_RETURN;
}
void
@@ -627,12 +719,16 @@ e_entry_max_size(E_Entry *entry, int *w, int *h)
int p1l, p1r, p1t, p1b;
int p2l, p2r, p2t, p2b;
+ D_ENTER;
+
p1l = p1r = p1t = p1b = 0;
if (entry->obj_base) ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
p2l = p2r = p2t = p2b = 0;
if (entry->obj_cursor) ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
if (w) *w = 8000;
if (h) *h = evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
+
+ D_RETURN;
}
void
@@ -641,12 +737,16 @@ e_entry_min_size(E_Entry *entry, int *w, int *h)
int p1l, p1r, p1t, p1b;
int p2l, p2r, p2t, p2b;
+ D_ENTER;
+
p1l = p1r = p1t = p1b = 0;
if (entry->obj_base) ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
p2l = p2r = p2t = p2b = 0;
if (entry->obj_cursor) ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
if (w) *w = p1l + p1r + p2l + p2r + entry->min_size;
if (h) *h = evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
+
+ D_RETURN;
}
void
@@ -655,6 +755,8 @@ e_entry_set_size(E_Entry *entry, int w, int h)
int p1l, p1r, p1t, p1b;
int p2l, p2r, p2t, p2b;
+ D_ENTER;
+
p1l = p1r = p1t = p1b = 0;
if (entry->obj_base) ebits_get_insets(entry->obj_base, &p1l, &p1r, &p1t, &p1b);
p2l = p2r = p2t = p2b = 0;
@@ -664,13 +766,17 @@ e_entry_set_size(E_Entry *entry, int w, int h)
entry->min_size = w;
e_entry_configure(entry);
}
+
+ D_RETURN;
UN(h);
}
void
e_entry_set_focus(E_Entry *entry, int focused)
{
- if (entry->focused == focused) return;
+ D_ENTER;
+
+ if (entry->focused == focused) D_RETURN;
entry->focused = focused;
e_entry_configure(entry);
if (entry->focused)
@@ -683,11 +789,15 @@ e_entry_set_focus(E_Entry *entry, int focused)
if (entry->func_focus_out)
entry->func_focus_out(entry, entry->data_focus_out);
}
+
+ D_RETURN;
}
void
e_entry_set_text(E_Entry *entry, const char *text)
{
+ D_ENTER;
+
IF_FREE(entry->buffer);
e_strdup(entry->buffer, text);
evas_set_text(entry->evas, entry->text, entry->buffer);
@@ -696,53 +806,79 @@ e_entry_set_text(E_Entry *entry, const char *text)
e_entry_configure(entry);
if (entry->func_changed)
entry->func_changed(entry, entry->data_changed);
+
+ D_RETURN;
}
const char *
e_entry_get_text(E_Entry *entry)
{
- return entry->buffer;
+ D_ENTER;
+
+ D_RETURN_(entry->buffer);
}
void
e_entry_set_cursor(E_Entry *entry, int cursor_pos)
{
+ D_ENTER;
+
entry->cursor_pos = cursor_pos;
e_entry_configure(entry);
+
+ D_RETURN;
}
int
e_entry_get_cursor(E_Entry *entry)
{
- return entry->cursor_pos;
+ D_ENTER;
+
+ D_RETURN_(entry->cursor_pos);
}
void
e_entry_set_changed_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data)
{
+ D_ENTER;
+
entry->func_changed = func;
entry->data_changed = data;
+
+ D_RETURN;
}
void
e_entry_set_enter_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data)
{
+ D_ENTER;
+
entry->func_enter = func;
entry->data_enter = data;
+
+ D_RETURN;
}
void
e_entry_set_focus_in_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data)
{
+ D_ENTER;
+
entry->func_focus_in = func;
entry->data_focus_in = data;
+
+ D_RETURN;
}
void
e_entry_set_focus_out_callback(E_Entry *entry, void (*func) (E_Entry *_entry, void *_data), void *data)
{
+ D_ENTER;
+
entry->func_focus_out = func;
entry->data_focus_out = data;
+
+ D_RETURN;
}
void
@@ -750,7 +886,9 @@ e_entry_insert_text(E_Entry *entry, char *text)
{
char *str2;
- if (!text) return;
+ D_ENTER;
+
+ if (!text) D_RETURN;
str2 = malloc(strlen(e_entry_get_text(entry)) + 1 + strlen(text));
str2[0] = 0;
strncat(str2, entry->buffer, entry->cursor_pos);
@@ -760,6 +898,8 @@ e_entry_insert_text(E_Entry *entry, char *text)
free(str2);
entry->cursor_pos+=strlen(text);
e_entry_configure(entry);
+
+ D_RETURN;
}
void
@@ -767,6 +907,8 @@ e_entry_clear_selection(E_Entry *entry)
{
char *str2;
+ D_ENTER;
+
if (entry->select.start >= 0)
{
e_strdup(str2, e_entry_get_text(entry));
@@ -779,6 +921,8 @@ e_entry_clear_selection(E_Entry *entry)
entry->select.start = -1;
}
e_entry_configure(entry);
+
+ D_RETURN;
}
void
@@ -786,11 +930,15 @@ e_entry_delete_to_left(E_Entry *entry)
{
char *str2;
+ D_ENTER;
+
e_strdup(str2, e_entry_get_text(entry));
strcpy(&(str2[entry->cursor_pos - 1]), &(entry->buffer[entry->cursor_pos]));
entry->cursor_pos--;
e_entry_set_text(entry, str2);
e_entry_configure(entry);
+
+ D_RETURN;
}
void
@@ -798,16 +946,22 @@ e_entry_delete_to_right(E_Entry *entry)
{
char *str2;
+ D_ENTER;
+
e_strdup(str2, e_entry_get_text(entry));
strcpy(&(str2[entry->cursor_pos]), &(entry->buffer[entry->cursor_pos + 1]));
e_entry_set_text(entry, str2);
free(str2);
e_entry_configure(entry);
+
+ D_RETURN;
}
char *
e_entry_get_selection(E_Entry *entry)
{
+ D_ENTER;
+
if (entry->select.start >= 0)
{
char *str2;
@@ -818,7 +972,8 @@ e_entry_get_selection(E_Entry *entry)
len = strlen(entry->buffer) - entry->select.start;
str2 = e_memdup(&(entry->buffer[entry->select.start]), len + 1);
str2[len] = 0;
- return str2;
+ D_RETURN_(str2);
}
- return NULL;
+
+ D_RETURN_(NULL);
}
diff --git a/src/exec.c b/src/exec.c
index 260989203..9afef21d0 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "exec.h"
#include "desktops.h"
#include "util.h"
@@ -8,8 +9,12 @@ static char **e_argv = NULL;
void
e_exec_set_args(int argc, char **argv)
{
+ D_ENTER;
+
e_argc = argc;
e_argv = argv;
+
+ D_RETURN;
}
void
@@ -18,6 +23,8 @@ e_exec_restart(void)
int i, num;
char exe[PATH_MAX];
+ D_ENTER;
+
printf("e_exec_restart()\n");
/* unset events on root */
ecore_window_set_events(0, XEV_NONE);
@@ -40,6 +47,8 @@ e_exec_restart(void)
strcat(exe, " ");
}
execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
+
+ D_RETURN;
}
pid_t
@@ -47,13 +56,16 @@ e_exec_run(char *exe)
{
pid_t pid;
+ D_ENTER;
+
pid = fork();
if (pid)
- return pid;
+ D_RETURN_(pid);
setsid();
execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
exit(0);
- return 0;
+
+ D_RETURN_(0);
}
pid_t
@@ -61,14 +73,17 @@ e_exec_run_in_dir(char *exe, char *dir)
{
pid_t pid;
+ D_ENTER;
+
pid = fork();
if (pid)
- return pid;
+ D_RETURN_(pid);
chdir(dir);
setsid();
execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
exit(0);
- return 0;
+
+ D_RETURN_(0);
}
pid_t
@@ -80,10 +95,12 @@ e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, cha
char *exe2;
pid_t pid;
+ D_ENTER;
+
launch_id++;
if (launch_id_ret) *launch_id_ret = launch_id;
pid = fork();
- if (pid) return pid;
+ if (pid) D_RETURN_(pid);
chdir(dir);
setsid();
if (env)
@@ -108,5 +125,6 @@ e_exec_in_dir_with_env(char *exe, char *dir, int *launch_id_ret, char **env, cha
execl("/bin/sh", "/bin/sh", "-c", exe2, NULL);
exit(0);
- return 0;
+
+ D_RETURN_(0);
}
diff --git a/src/fs.c b/src/fs.c
index 57459cbc6..152dcfe61 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "fs.h"
#include "exec.h"
@@ -15,13 +16,17 @@ static void e_fs_flush_timeout(int val, void *data);
static void
e_fs_flush_timeout(int val, void *data)
{
- if (!ec) return;
+ D_ENTER;
+
+ if (!ec) D_RETURN;
if (efsd_commands_pending(ec) > 0)
{
if (efsd_flush(ec) > 0)
ecore_add_event_timer("e_fs_flush_timeout()",
0.00, e_fs_flush_timeout, 0, NULL);
}
+
+ D_RETURN;
UN(data);
UN(val);
}
@@ -29,7 +34,11 @@ e_fs_flush_timeout(int val, void *data)
static void
e_fs_idle(void *data)
{
+ D_ENTER;
+
e_fs_flush_timeout(0, NULL);
+
+ D_RETURN;
UN(data);
}
@@ -38,6 +47,8 @@ e_fs_child_handle(Ecore_Event *ev)
{
Ecore_Event_Child *e;
+ D_ENTER;
+
e = ev->event;
printf("pid went splat! (%i)\n", e->pid);
if (e->pid == efsd_pid)
@@ -48,6 +59,8 @@ e_fs_child_handle(Ecore_Event *ev)
efsd_pid = 0;
_e_fs_restarter(1, NULL);
}
+
+ D_RETURN;
}
static void
@@ -55,6 +68,8 @@ _e_fs_fd_handle(int fd)
{
double start, current;
+ D_ENTER;
+
start = ecore_get_time();
while ((ec) && efsd_events_pending(ec))
{
@@ -92,12 +107,16 @@ _e_fs_fd_handle(int fd)
break;
}
}
+
+ D_RETURN;
}
static void
_e_fs_restarter(int val, void *data)
{
- if (ec) return;
+ D_ENTER;
+
+ if (ec) D_RETURN;
ec = efsd_open();
@@ -131,6 +150,8 @@ _e_fs_restarter(int val, void *data)
if (gap > 10.0) gap = 10.0;
ecore_add_event_timer("e_fs_restarter", gap, _e_fs_restarter, val + 1, NULL);
}
+
+ D_RETURN;
UN(data);
}
@@ -139,35 +160,47 @@ e_fs_add_restart_handler(void (*func) (void *data), void *data)
{
E_FS_Restarter *rs;
+ D_ENTER;
+
rs = NEW(E_FS_Restarter, 1);
ZERO(rs, E_FS_Restarter, 1);
rs->func = func;
rs->data = data;
fs_restart_handlers = evas_list_append(fs_restart_handlers, rs);
- return rs;
+ D_RETURN_(rs);
}
void
e_fs_del_restart_handler(E_FS_Restarter *rs)
{
+ D_ENTER;
+
if (evas_list_find(fs_restart_handlers, rs))
{
fs_restart_handlers = evas_list_remove(fs_restart_handlers, rs);
FREE(rs);
}
+
+ D_RETURN;
}
void
e_fs_add_event_handler(void (*func) (EfsdEvent *ev))
{
- if (!func) return;
+ D_ENTER;
+
+ if (!func) D_RETURN;
fs_handlers = evas_list_append(fs_handlers, func);
+
+ D_RETURN;
}
void
e_fs_init(void)
{
+ D_ENTER;
+
/* Hook in an fs handler that gets called whenever
a child of this process exits.
*/
@@ -182,10 +215,14 @@ e_fs_init(void)
*/
ecore_event_filter_idle_handler_add(e_fs_idle, NULL);
_e_fs_restarter(0, NULL);
+
+ D_RETURN;
}
EfsdConnection *
e_fs_get_connection(void)
{
- return ec;
+ D_ENTER;
+
+ D_RETURN_(ec);
}
diff --git a/src/guides.c b/src/guides.c
index d7b53396d..77ecbd5ca 100644
--- a/src/guides.c
+++ b/src/guides.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "guides.h"
#include "text.h"
#include "config.h"
@@ -48,7 +49,11 @@ static void e_guides_update(void);
static void
e_guides_idle(void *data)
{
+ D_ENTER;
+
e_guides_update();
+
+ D_RETURN;
UN(data);
}
@@ -60,7 +65,9 @@ e_guides_update(void)
char *font_dir;
int redraw;
- if (!guides.changed) return;
+ D_ENTER;
+
+ if (!guides.changed) D_RETURN;
redraw = 0;
if (guides.prev.visible != guides.current.visible)
@@ -474,96 +481,136 @@ e_guides_update(void)
}
}
guides.prev = guides.current;
+
+ D_RETURN;
}
void
e_guides_show(void)
{
- if (guides.current.visible) return;
+ D_ENTER;
+
+ if (guides.current.visible) D_RETURN;
guides.changed = 1;
guides.current.visible = 1;
+
+ D_RETURN;
}
void
e_guides_hide(void)
{
- if (!guides.current.visible) return;
+ D_ENTER;
+
+ if (!guides.current.visible) D_RETURN;
guides.changed = 1;
guides.current.visible = 0;
+
+ D_RETURN;
}
void
e_guides_move(int x, int y)
{
+ D_ENTER;
+
if ((guides.current.x == x) &&
- (guides.current.y == y)) return;
+ (guides.current.y == y)) D_RETURN;
guides.changed = 1;
guides.current.x = x;
guides.current.y = y;
+
+ D_RETURN;
}
void
e_guides_resize(int w, int h)
{
+ D_ENTER;
+
if ((guides.current.w == w) &&
- (guides.current.h == h)) return;
+ (guides.current.h == h)) D_RETURN;
guides.changed = 1;
guides.current.w = w;
guides.current.h = h;
+
+ D_RETURN;
}
void
e_guides_display_text(char *text)
{
+ D_ENTER;
+
if ((guides.current.display.text) && (text) &&
- (!strcmp(guides.current.display.text, text))) return;
+ (!strcmp(guides.current.display.text, text))) D_RETURN;
guides.changed = 1;
IF_FREE(guides.current.display.text);
guides.current.display.text = NULL;
guides.prev.display.text = (char *)1;
e_strdup(guides.current.display.text, text);
+
+ D_RETURN;
}
void
e_guides_display_icon(char *icon)
{
+ D_ENTER;
+
if ((guides.current.display.icon) && (icon) &&
- (!strcmp(guides.current.display.icon, icon))) return;
+ (!strcmp(guides.current.display.icon, icon))) D_RETURN;
guides.changed = 1;
IF_FREE(guides.current.display.icon);
guides.current.display.icon = NULL;
guides.prev.display.icon = (char *)1;
e_strdup(guides.current.display.icon, icon);
+
+ D_RETURN;
}
void
e_guides_set_display_location(E_Guides_Location loc)
{
- if (guides.current.display.loc == loc) return;
+ D_ENTER;
+
+ if (guides.current.display.loc == loc) D_RETURN;
guides.changed = 1;
guides.current.display.loc = loc;
+
+ D_RETURN;
}
void
e_guides_set_display_alignment(double x, double y)
{
+ D_ENTER;
+
if ((guides.current.display.align.x == x) &&
- (guides.current.display.align.y == y)) return;
+ (guides.current.display.align.y == y)) D_RETURN;
guides.changed = 1;
guides.current.display.align.x = x;
guides.current.display.align.y = y;
+
+ D_RETURN;
}
void
e_guides_set_mode(E_Guides_Mode mode)
{
- if (guides.current.mode == mode) return;
+ D_ENTER;
+
+ if (guides.current.mode == mode) D_RETURN;
guides.changed = 1;
guides.current.mode = mode;
+
+ D_RETURN;
}
void e_guides_init(void)
{
+ D_ENTER;
+
guides.changed = 0;
guides.current.display.loc = E_GUIDES_DISPLAY_LOCATION_SCREEN_MIDDLE;
@@ -593,4 +640,6 @@ void e_guides_init(void)
guides.disp.image = NULL;
ecore_event_filter_idle_handler_add(e_guides_idle, NULL);
+
+ D_RETURN;
}
diff --git a/src/icccm.c b/src/icccm.c
index 8da3a5d24..80f720df8 100644
--- a/src/icccm.c
+++ b/src/icccm.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "e.h"
#include "border.h"
#include "icccm.h"
@@ -48,7 +49,11 @@ MWMHints;
void
e_icccm_move_resize(Window win, int x, int y, int w, int h)
{
+ D_ENTER;
+
ecore_window_send_event_move_resize(win, x, y, w, h);
+
+ D_RETURN;
}
void
@@ -60,6 +65,8 @@ e_icccm_delete(Window win)
int size;
int del_win = 0;
+ D_ENTER;
+
ECORE_ATOM(a_wm_delete_window, "WM_DELETE_WINDOW");
ECORE_ATOM(a_wm_protocols, "WM_PROTOCOLS");
@@ -87,6 +94,8 @@ e_icccm_delete(Window win)
{
ecore_window_kill_client(win);
}
+
+ D_RETURN;
}
void
@@ -95,10 +104,14 @@ e_icccm_state_mapped(Window win)
static Atom a_wm_state = 0;
unsigned int data[2];
+ D_ENTER;
+
ECORE_ATOM(a_wm_state, "WM_STATE");
data[0] = NormalState;
data[1] = 0;
ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
+
+ D_RETURN;
}
void
@@ -107,10 +120,14 @@ e_icccm_state_iconified(Window win)
static Atom a_wm_state = 0;
unsigned int data[2];
+ D_ENTER;
+
ECORE_ATOM(a_wm_state, "WM_STATE");
data[0] = IconicState;
data[1] = 0;
ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
+
+ D_RETURN;
}
void
@@ -119,22 +136,34 @@ e_icccm_state_withdrawn(Window win)
static Atom a_wm_state = 0;
unsigned int data[2];
+ D_ENTER;
+
ECORE_ATOM(a_wm_state, "WM_STATE");
data[0] = WithdrawnState;
data[1] = 0;
ecore_window_property_set(win, a_wm_state, a_wm_state, 32, data, 2);
+
+ D_RETURN;
}
void
e_icccm_adopt(Window win)
{
+ D_ENTER;
+
ecore_window_add_to_save_set(win);
+
+ D_RETURN;
}
void
e_icccm_release(Window win)
{
+ D_ENTER;
+
ecore_window_del_from_save_set(win);
+
+ D_RETURN;
}
void
@@ -143,6 +172,8 @@ e_icccm_get_pos_info(Window win, E_Border *b)
XSizeHints hint;
int mask;
+ D_ENTER;
+
if (ecore_window_get_wm_size_hints(win, &hint, &mask))
{
if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
@@ -164,6 +195,8 @@ e_icccm_get_pos_info(Window win, E_Border *b)
b->client.pos.requested = 0;
}
}
+
+ D_RETURN;
}
void
@@ -174,6 +207,8 @@ e_icccm_get_size_info(Window win, E_Border *b)
int mask;
XSizeHints hint;
+ D_ENTER;
+
grav = NorthWestGravity;
mask = 0;
min_w = 0;
@@ -238,6 +273,8 @@ e_icccm_get_size_info(Window win, E_Border *b)
b->client.min.aspect = aspect_min;
b->client.max.aspect = aspect_max;
b->changed = 1;
+
+ D_RETURN;
}
void
@@ -247,6 +284,8 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
MWMHints *mwmhints;
int size;
+ D_ENTER;
+
ECORE_ATOM(a_motif_wm_hints, "_MOTIF_WM_HINTS");
mwmhints = ecore_window_property_get(win, a_motif_wm_hints, a_motif_wm_hints, &size);
@@ -258,7 +297,7 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
if (num < PROP_MWM_HINTS_ELEMENTS)
{
FREE(mwmhints);
- return;
+ D_RETURN;
}
if (mwmhints->flags & MWM_HINTS_DECORATIONS)
{
@@ -278,6 +317,8 @@ e_icccm_get_mwm_hints(Window win, E_Border *b)
}
FREE(mwmhints);
}
+
+ D_RETURN;
}
void
@@ -287,6 +328,8 @@ e_icccm_get_layer(Window win, E_Border *b)
int *props;
int size;
+ D_ENTER;
+
ECORE_ATOM(a_win_layer, "_WIN_LAYER");
props = ecore_window_property_get(win, a_win_layer, XA_CARDINAL, &size);
@@ -298,6 +341,8 @@ e_icccm_get_layer(Window win, E_Border *b)
if (num > 0) b->client.layer = props[0];
FREE(props);
}
+
+ D_RETURN;
}
void
@@ -305,6 +350,8 @@ e_icccm_get_title(Window win, E_Border *b)
{
char *title;
+ D_ENTER;
+
title = ecore_window_get_title(win);
if (b->client.title)
@@ -312,7 +359,7 @@ e_icccm_get_title(Window win, E_Border *b)
if ((title) && (!strcmp(title, b->client.title)))
{
FREE(title);
- return;
+ D_RETURN;
}
b->changed = 1;
FREE(b->client.title);
@@ -320,12 +367,16 @@ e_icccm_get_title(Window win, E_Border *b)
b->client.title = NULL;
if (title) b->client.title = title;
else e_strdup(b->client.title, "No Title");
+
+ D_RETURN;
}
void
e_icccm_get_class(Window win, E_Border *b)
{
+ D_ENTER;
+
IF_FREE(b->client.name);
IF_FREE(b->client.class);
b->client.name = NULL;
@@ -333,43 +384,65 @@ e_icccm_get_class(Window win, E_Border *b)
ecore_window_get_name_class(win, &(b->client.name), &(b->client.class));
if (!b->client.name) e_strdup(b->client.name, "Unknown");
if (!b->client.class) e_strdup(b->client.class, "Unknown");
+
+ D_RETURN;
}
void
e_icccm_get_hints(Window win, E_Border *b)
{
+ D_ENTER;
+
ecore_window_get_hints(win, &(b->client.takes_focus),
&(b->client.initial_state), NULL, NULL, NULL,
&(b->client.group));
+
+ D_RETURN;
}
void
e_icccm_get_machine(Window win, E_Border *b)
{
+ D_ENTER;
+
IF_FREE(b->client.machine);
b->client.machine = NULL;
b->client.machine = ecore_window_get_machine(win);
+
+ D_RETURN;
}
void
e_icccm_get_command(Window win, E_Border *b)
{
+ D_ENTER;
+
IF_FREE(b->client.command);
b->client.command = NULL;
b->client.command = ecore_window_get_command(win);
+
+ D_RETURN;
}
void
e_icccm_get_icon_name(Window win, E_Border *b)
{
+ D_ENTER;
+
IF_FREE(b->client.icon_name);
b->client.icon_name = NULL;
b->client.icon_name = ecore_window_get_icon_name(win);
+
+ D_RETURN;
}
void
e_icccm_get_state(Window win, E_Border *b)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
void
@@ -378,12 +451,16 @@ e_icccm_set_frame_size(Window win, int l, int r, int t, int b)
static Atom a_e_frame_size = 0;
int props[4];
+ D_ENTER;
+
ECORE_ATOM(a_e_frame_size, "_E_FRAME_SIZE");
props[0] = l;
props[1] = r;
props[2] = t;
props[3] = b;
ecore_window_property_set(win, a_e_frame_size, XA_CARDINAL, 32, props, 4);
+
+ D_RETURN;
}
void
@@ -392,10 +469,14 @@ e_icccm_set_desk_area(Window win, int ax, int ay)
static Atom a_win_area = 0;
int props[2];
+ D_ENTER;
+
ECORE_ATOM(a_win_area, "_WIN_AREA");
props[0] = ax;
props[1] = ay;
ecore_window_property_set(win, a_win_area, XA_CARDINAL, 32, props, 2);
+
+ D_RETURN;
}
void
@@ -404,10 +485,14 @@ e_icccm_set_desk_area_size(Window win, int ax, int ay)
static Atom a_win_area_count = 0;
int props[2];
+ D_ENTER;
+
ECORE_ATOM(a_win_area_count, "_WIN_AREA_COUNT");
props[0] = ax;
props[1] = ay;
ecore_window_property_set(win, a_win_area_count, XA_CARDINAL, 32, props, 2);
+
+ D_RETURN;
}
void
@@ -416,9 +501,13 @@ e_icccm_set_desk(Window win, int d)
static Atom a_win_workspace = 0;
int props[2];
+ D_ENTER;
+
ECORE_ATOM(a_win_workspace, "_WIN_WORKSPACE");
props[0] = d;
ecore_window_property_set(win, a_win_workspace, XA_CARDINAL, 32, props, 1);
+
+ D_RETURN;
}
int
@@ -426,17 +515,23 @@ e_icccm_is_shaped(Window win)
{
int w, h, num;
int shaped = 1;
-
XRectangle *rect;
+
+ D_ENTER;
+
ecore_window_get_geometry(win, NULL, NULL, &w, &h);
rect = ecore_window_get_shape_rectangles(win, &num);
- if (!rect) return 1;
+
+ if (!rect)
+ D_RETURN_(1);
+
if ((num == 1) &&
(rect[0].x == 0) && (rect[0].y == 0) &&
(rect[0].width == w) && (rect[0].height == h))
shaped = 0;
XFree(rect);
- return shaped;
+
+ D_RETURN_(shaped);
}
void
@@ -452,6 +547,8 @@ e_icccm_handle_property_change(Atom a, E_Border *b)
static Atom a_wm_icon_name = 0;
static Atom a_wm_state = 0;
+ D_ENTER;
+
ECORE_ATOM(a_wm_normal_hints, "WM_NORMAL_HINTS");
ECORE_ATOM(a_motif_wm_hints, "_MOTIF_WM_HINTS");
ECORE_ATOM(a_wm_name, "WM_NAME");
@@ -471,18 +568,26 @@ e_icccm_handle_property_change(Atom a, E_Border *b)
else if (a == a_wm_command) e_icccm_get_command(b->win.client, b);
else if (a == a_wm_icon_name) e_icccm_get_icon_name(b->win.client, b);
else if (a == a_wm_state) e_icccm_get_state(b->win.client, b);
+
+ D_RETURN;
}
void
e_icccm_handle_client_message(Ecore_Event_Message *e)
{
- return;
+ D_ENTER;
+
+ D_RETURN;
UN(e);
}
void
e_icccm_advertise_e_compat(void)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
void
@@ -491,10 +596,14 @@ e_icccm_advertise_mwm_compat(void)
static Atom a_motif_wm_info = 0;
int props[2];
+ D_ENTER;
+
ECORE_ATOM(a_motif_wm_info, "_MOTIF_WM_INFO");
props[0] = 2;
props[0] = ecore_window_root();
ecore_window_property_set(0, a_motif_wm_info, a_motif_wm_info, 32, props, 2);
+
+ D_RETURN;
}
void
@@ -508,6 +617,8 @@ e_icccm_advertise_gnome_compat(void)
int props[32];
Window win;
+ D_ENTER;
+
ECORE_ATOM(a_win_protocols, "_WIN_PROTOCOLS");
ECORE_ATOM(a_win_layer, "_WIN_LAYER");
props[0] = a_win_protocols;
@@ -523,14 +634,24 @@ e_icccm_advertise_gnome_compat(void)
props[0] = win;
ecore_window_property_set(win, a_win_supporting_wm_check, XA_CARDINAL, 32, props, 1);
ecore_window_property_set(0, a_win_supporting_wm_check, XA_CARDINAL, 32, props, 1);
+
+ D_RETURN;
}
void
e_icccm_advertise_kde_compat(void)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
void
e_icccm_advertise_net_compat(void)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
diff --git a/src/iconbar.c b/src/iconbar.c
index 9adaf7923..ef8b1c8e4 100644
--- a/src/iconbar.c
+++ b/src/iconbar.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "iconbar.h"
#include "util.h"
@@ -26,6 +27,8 @@ static void ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b, int _x, in
static void ib_mouse_down(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
static void ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y);
+static void e_iconbar_icon_cleanup(E_Iconbar_Icon *ic);
+
/* NB: comments here for illustration & helping people understand E's code */
/* This is a start of the comments. if you feel they are not quite good */
/* as you figure things out and if you think they could be more helpful */
@@ -33,6 +36,51 @@ static void ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int
/* helpful. */
/**
+ * e_iconbar_cleanup - Iconbar destructor.
+ * @ib: The iconbar to be cleaned up.
+ *
+ * How do we free these pesky little urchins...
+ */
+static void
+e_iconbar_cleanup(E_Iconbar *ib)
+{
+ char buf[PATH_MAX];
+
+ D_ENTER;
+
+ /* tell the view we attached to that somehting in it changed. this way */
+ /* the view will now it needs to redraw */
+ ib->view->changed = 1;
+ /* free up our ebits */
+ if (ib->bit) ebits_free(ib->bit);
+ /* if we have any icons... */
+ if (ib->icons)
+ {
+ Evas_List l;
+
+ /* go thru the list of icon and unref each one.. ie - free it */
+ for (l = ib->icons; l; l = l->next)
+ {
+ E_Iconbar_Icon *ic;
+
+ ic = l->data;
+ e_object_unref(E_OBJECT(ic));
+ }
+ /* free the list itself */
+ evas_list_free(ib->icons);
+ }
+ /* delete any timers intended to work on this iconbar */
+ sprintf(buf, "iconbar_reload:%s", ib->view->dir);
+ ecore_del_event_timer(buf);
+
+ /* call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(ib));
+
+ D_RETURN;
+}
+
+
+/**
* e_iconbar_init - Init function
*
* Initialises the iconbar system
@@ -40,6 +88,8 @@ static void ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int
void
e_iconbar_init()
{
+ D_ENTER;
+
/* we set up config structure and types so the config system can just */
/* read a db and dump it right into memory - including lists of stuff */
@@ -59,6 +109,8 @@ e_iconbar_init()
/* the list */
cf_iconbar = e_config_type_new();
E_CONFIG_NODE(cf_iconbar, "icons", E_CFG_TYPE_LIST, cf_iconbar_icon, E_Iconbar, icons, 0, 0, NULL);
+
+ D_RETURN;
}
/**
@@ -72,6 +124,8 @@ e_iconbar_new(E_View *v)
char buf[PATH_MAX];
E_Iconbar *ib;
+ D_ENTER;
+
/* first we want to load the iconbar data itself - ie the config info */
/* for what icons we have and what they execute */
sprintf(buf, "%s/.e_iconbar.db", v->dir);
@@ -89,11 +143,11 @@ e_iconbar_new(E_View *v)
/* flush edb cached handled */
e_db_flush();
/* no iconbar config loaded ? return NULL */
- if (!ib) return NULL;
+ if (!ib) D_RETURN_(NULL);
/* now that the config system has doe the loading. we need to init the */
/* object and set up ref counts and free method */
- OBJ_INIT(ib, e_iconbar_free);
+ e_object_init(E_OBJECT(ib), (E_Cleanup_Func) e_iconbar_cleanup);
/* the iconbar needs to know what view it's in */
ib->view = v;
@@ -105,7 +159,8 @@ e_iconbar_new(E_View *v)
ic = l->data;
/* and init the iocnbar icon object */
- OBJ_INIT(ic, e_iconbar_icon_free);
+ e_object_init(E_OBJECT(ic), (E_Cleanup_Func) e_iconbar_icon_cleanup);
+
/* and have the iconbar icon knwo what iconbar it belongs to */
ic->iconbar = ib;
}
@@ -118,62 +173,26 @@ e_iconbar_new(E_View *v)
if (!ib->bit)
{
/* unref the iconbar (and thus it will get freed and all icons in it */
- OBJ_DO_FREE(ib);
+ e_object_unref(E_OBJECT(ib));
/* return NULL - no iconbar worth doing here if we don't know where */
/* to put it */
- return NULL;
+ D_RETURN_(NULL);
}
/* aaah. our nicely constructed iconbar data struct with all the goodies */
/* we need. return it. she's ready for use. */
- return ib;
+ D_RETURN_(ib);
}
-/**
- * e_iconbar_free - Iconbar destructor.
- * @ib: The iconbar to be freed
- *
- * How do we free these pesky little urchins...
- */
-void
-e_iconbar_free(E_Iconbar *ib)
-{
- char buf[PATH_MAX];
-
- /* tell the view we attached to that somehting in it changed. this way */
- /* the view will now it needs to redraw */
- ib->view->changed = 1;
- /* free up our ebits */
- if (ib->bit) ebits_free(ib->bit);
- /* if we have any icons... */
- if (ib->icons)
- {
- Evas_List l;
-
- /* go thru the list of icon and unref each one.. ie - free it */
- for (l = ib->icons; l; l = l->next)
- {
- E_Iconbar_Icon *ic;
-
- ic = l->data;
- OBJ_DO_FREE(ic);
- }
- /* free the list itself */
- evas_list_free(ib->icons);
- }
- /* delete any timers intended to work on this iconbar */
- sprintf(buf, "iconbar_reload:%s", ib->view->dir);
- ecore_del_event_timer(buf);
- /* free the iconbar struct */
- FREE(ib);
-}
/**
- * e_iconbar_icon_free -- Iconbar icon destructor
+ * e_iconbar_icon_cleanup -- Iconbar icon destructor
* @ic: The icon that is to be freed
*/
-void
-e_iconbar_icon_free(E_Iconbar_Icon *ic)
+static void
+e_iconbar_icon_cleanup(E_Iconbar_Icon *ic)
{
+ D_ENTER;
+
/* if we have an imageobject. nuke it */
if (ic->image) evas_del_object(ic->iconbar->view->evas, ic->image);
/* free strings ... if they exist */
@@ -186,8 +205,11 @@ e_iconbar_icon_free(E_Iconbar_Icon *ic)
FREE(ic->hi.timer);
}
if (ic->hi.image) evas_del_object(ic->iconbar->view->evas, ic->hi.image);
- /* nuke that struct */
- FREE(ic);
+
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(ic));
+
+ D_RETURN;
}
/**
@@ -203,6 +225,8 @@ e_iconbar_realize(E_Iconbar *ib)
{
Evas_List l;
+ D_ENTER;
+
/* go thru every icon in the iconbar */
for (l = ib->icons; l; l = l->next)
{
@@ -254,6 +278,8 @@ e_iconbar_realize(E_Iconbar *ib)
/* but fixes the iconbar so its the size of the view, in the right */
/* place and arranges the icons in their right spots */
e_iconbar_fix(ib);
+
+ D_RETURN;
}
/**
@@ -269,6 +295,8 @@ e_iconbar_fix(E_Iconbar *ib)
Evas_List l;
double ix, iy, aw, ah;
+ D_ENTER;
+
/* move the ebit to 0,0 */
ebits_move(ib->bit, 0, 0);
/* resize it to fill the whole view. the internal geometry of the */
@@ -350,6 +378,8 @@ e_iconbar_fix(E_Iconbar *ib)
iy += h;
}
}
+
+ D_RETURN;
}
/**
@@ -365,6 +395,8 @@ e_iconbar_fix(E_Iconbar *ib)
void
e_iconbar_file_add(E_View *v, char *file)
{
+ D_ENTER;
+
/* is the file of interest ? */
if ((!strcmp(".e_iconbar.db", file)) ||
(!strcmp(".e_iconbar.bits.db", file)))
@@ -376,6 +408,8 @@ e_iconbar_file_add(E_View *v, char *file)
/* in 0.5 secs call our timout handler */
ecore_add_event_timer(buf, 0.5, ib_reload_timeout, 0, v);
}
+
+ D_RETURN;
}
/**
@@ -388,6 +422,8 @@ e_iconbar_file_add(E_View *v, char *file)
void
e_iconbar_file_delete(E_View *v, char *file)
{
+ D_ENTER;
+
/* is the file of interest */
if ((!strcmp(".e_iconbar.db", file)) ||
(!strcmp(".e_iconbar.bits.db", file)))
@@ -396,10 +432,12 @@ e_iconbar_file_delete(E_View *v, char *file)
/* nuked. no need to keep it around. */
if (v->iconbar)
{
- OBJ_DO_FREE(v->iconbar);
+ e_object_unref(E_OBJECT(v->iconbar));
v->iconbar = NULL;
}
}
+
+ D_RETURN;
}
/**
@@ -412,6 +450,8 @@ e_iconbar_file_delete(E_View *v, char *file)
void
e_iconbar_file_change(E_View *v, char *file)
{
+ D_ENTER;
+
/* is the file that changed of interest */
if ((!strcmp(".e_iconbar.db", file)) ||
(!strcmp(".e_iconbar.bits.db", file)))
@@ -423,6 +463,8 @@ e_iconbar_file_change(E_View *v, char *file)
/* in 0.5 secsm call the realod timeout */
ecore_add_event_timer(buf, 0.5, ib_reload_timeout, 0, v);
}
+
+ D_RETURN;
}
@@ -436,16 +478,23 @@ ib_reload_timeout(int val, void *data)
{
E_View *v;
+ D_ENTER;
+
/* get our view pointer */
v = (E_View *)data;
+
/* if we have an iconbar.. well nuke it */
- if (v->iconbar) OBJ_DO_FREE(v->iconbar);
- v->iconbar = NULL;
+ if (e_object_unref(E_OBJECT(v->iconbar)) == 0)
+ v->iconbar = NULL;
+
/* try load a new iconbar */
if (!v->iconbar) v->iconbar = e_iconbar_new(v);
+
/* if the iconbar loaded and theres an evas - we're realized */
/* so realize the iconbar */
if ((v->iconbar) && (v->evas)) e_iconbar_realize(v->iconbar);
+
+ D_RETURN;
}
/* this timeout is responsible for doing the mouse over animation */
@@ -455,6 +504,8 @@ ib_timeout(int val, void *data)
E_Iconbar_Icon *ic;
double t;
+ D_ENTER;
+
/* get the iconbar icon we are dealign with */
ic = (E_Iconbar_Icon *)data;
/* val <= 0 AND we're hilited ? first call as a timeout handler. */
@@ -564,6 +615,8 @@ ib_timeout(int val, void *data)
ecore_add_event_timer(ic->hi.timer, 0.05, ib_timeout, val, data);
/* flag the view that we changed */
ic->iconbar->view->changed = 1;
+
+ D_RETURN;
}
/* called when an ebits object bit needs to be shown */
@@ -573,6 +626,8 @@ ib_bits_show(void *data)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* show all the icons */
for (l = ib->icons; l; l = l->next)
@@ -582,6 +637,8 @@ ib_bits_show(void *data)
ic = l->data;
evas_show(ic->iconbar->view->evas, ic->image);
}
+
+ D_RETURN;
}
/* called when an ebit object bit needs to hide */
@@ -591,6 +648,8 @@ ib_bits_hide(void *data)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* hide all the icons */
for (l = ib->icons; l; l = l->next)
@@ -600,6 +659,8 @@ ib_bits_hide(void *data)
ic = l->data;
evas_hide(ic->iconbar->view->evas, ic->image);
}
+
+ D_RETURN;
}
/* called when an ebit objetc bit needs to move */
@@ -609,10 +670,14 @@ ib_bits_move(void *data, double x, double y)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* dont do anything.. just record the geometry. we'll deal with it later */
ib->icon_area.x = x;
ib->icon_area.y = y;
+
+ D_RETURN;
}
/* called when an ebit object bit needs to resize */
@@ -622,10 +687,14 @@ ib_bits_resize(void *data, double w, double h)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* dont do anything.. just record the geometry. we'll deal with it later */
ib->icon_area.w = w;
ib->icon_area.h = h;
+
+ D_RETURN;
}
/* called when the ebits object bit needs to be raised */
@@ -635,6 +704,8 @@ ib_bits_raise(void *data)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* raise all the icons */
for (l = ib->icons; l; l = l->next)
@@ -644,6 +715,8 @@ ib_bits_raise(void *data)
ic = l->data;
evas_raise(ic->iconbar->view->evas, ic->image);
}
+
+ D_RETURN;
}
/* called when the ebits object bit needs to be lowered */
@@ -653,6 +726,8 @@ ib_bits_lower(void *data)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* lower all the icons */
for (l = ib->icons; l; l = l->next)
@@ -662,6 +737,8 @@ ib_bits_lower(void *data)
ic = l->data;
evas_lower(ic->iconbar->view->evas, ic->image);
}
+
+ D_RETURN;
}
/* called when the ebits object bit needs to change layers */
@@ -671,6 +748,8 @@ ib_bits_set_layer(void *data, int lay)
E_Iconbar *ib;
Evas_List l;
+ D_ENTER;
+
ib = (E_Iconbar *)data;
/* set the layer for all the icons */
for (l = ib->icons; l; l = l->next)
@@ -680,6 +759,8 @@ ib_bits_set_layer(void *data, int lay)
ic = l->data;
evas_set_layer(ic->iconbar->view->evas, ic->image, lay);
}
+
+ D_RETURN;
}
/* not used... err.. ebits clips for us to the maximum allowed space of */
@@ -687,28 +768,44 @@ ib_bits_set_layer(void *data, int lay)
static void
ib_bits_set_clip(void *data, Evas_Object clip)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
/* we arent going to recolor our icons here according to color class */
static void
ib_bits_set_color_class(void *data, char *cc, int r, int g, int b, int a)
{
+ D_ENTER;
+
+
+ D_RETURN;
}
/* our minimum size for icon space is 0x0 */
static void
ib_bits_get_min_size(void *data, double *w, double *h)
{
+ D_ENTER;
+
*w = 0;
*h = 0;
+
+ D_RETURN;
}
/* our maximum is huge */
static void
ib_bits_get_max_size(void *data, double *w, double *h)
{
+ D_ENTER;
+
*w = 999999;
*h = 999999;
+
+ D_RETURN;
}
@@ -723,6 +820,8 @@ ib_mouse_in(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Iconbar_Icon *ic;
+ D_ENTER;
+
/* get he iconbaricon pointer from the data member */
ic = (E_Iconbar_Icon *)data;
/* set hilited flag */
@@ -744,6 +843,8 @@ ib_mouse_in(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
/* a redraw is needed */
ic->iconbar->view->changed = 1;
+
+ D_RETURN;
}
/* called when a mouse goes out of an icon object */
@@ -752,6 +853,8 @@ ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Iconbar_Icon *ic;
+ D_ENTER;
+
/* get he iconbaricon pointer from the data member */
ic = (E_Iconbar_Icon *)data;
/* unset hilited flag */
@@ -759,6 +862,8 @@ ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
/* tell the view the iconbar is in.. something changed that might mean */
/* a redraw is needed */
ic->iconbar->view->changed = 1;
+
+ D_RETURN;
}
/* called when the mouse goes down on an icon object */
@@ -767,14 +872,21 @@ ib_mouse_down(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Iconbar_Icon *ic;
+ D_ENTER;
+
/* get he iconbaricon pointer from the data member */
ic = (E_Iconbar_Icon *)data;
/* run something! */
if (ic->exec) e_exec_run(ic->exec);
+
+ D_RETURN;
}
/* called when the mouse goes up on an icon object */
static void
ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
+ D_ENTER;
+
+ D_RETURN;
}
diff --git a/src/iconbar.h b/src/iconbar.h
index 8b8d088c2..e3d3cec9b 100644
--- a/src/iconbar.h
+++ b/src/iconbar.h
@@ -5,6 +5,7 @@
#include "config.h"
#include "exec.h"
#include "view.h"
+#include "object.h"
typedef struct _E_Iconbar_Icon E_Iconbar_Icon;
#ifndef E_ICONBAR_TYPEDEF
@@ -19,7 +20,7 @@ typedef struct _E_View E_View;
struct _E_Iconbar
{
- OBJ_PROPERTIES;
+ E_Object o;
E_View *view;
Evas_List icons;
@@ -32,7 +33,7 @@ struct _E_Iconbar
struct _E_Iconbar_Icon
{
- OBJ_PROPERTIES;
+ E_Object o;
E_Iconbar *iconbar;
@@ -51,7 +52,6 @@ struct _E_Iconbar_Icon
void e_iconbar_init(void);
E_Iconbar *e_iconbar_new(E_View *v);
-void e_iconbar_free(E_Iconbar *ib);
void e_iconbar_icon_free(E_Iconbar_Icon *);
void e_iconbar_realize(E_Iconbar *ib);
void e_iconbar_fix(E_Iconbar *ib);
diff --git a/src/keys.c b/src/keys.c
index 4fafb8451..0464eb4f7 100644
--- a/src/keys.c
+++ b/src/keys.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "keys.h"
#include "actions.h"
@@ -9,6 +10,8 @@ e_key_down(Ecore_Event * ev)
{
Ecore_Event_Key_Down *e;
+ D_ENTER;
+
e = ev->event;
if (e->win == ecore_get_key_grab_win())
{
@@ -17,6 +20,8 @@ e_key_down(Ecore_Event * ev)
e_action_start("Key_Binding", ACT_KEY_DOWN, 0, e->key, e->mods,
NULL, NULL, 0, 0, 0, 0);
}
+
+ D_RETURN;
}
static void
@@ -24,6 +29,8 @@ e_key_up(Ecore_Event * ev)
{
Ecore_Event_Key_Up *e;
+ D_ENTER;
+
e = ev->event;
if (e->win == ecore_get_key_grab_win())
{
@@ -32,26 +39,40 @@ e_key_up(Ecore_Event * ev)
e_action_start("Key_Binding", ACT_KEY_UP, 0, e->key, e->mods,
NULL, NULL, 0, 0, 0, 0);
}
+
+ D_RETURN;
}
void
e_keys_init(void)
{
+ D_ENTER;
+
/* load up our actions .... once to get some grabbed keys */
e_action_start("", ACT_KEY_DOWN, 0, NULL, ECORE_EVENT_KEY_MODIFIER_NONE,
NULL, NULL, 0, 0, 0, 0);
ecore_event_filter_handler_add(ECORE_EVENT_KEY_DOWN, e_key_down);
ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
+
+ D_RETURN;
}
void
e_keys_grab(char *key, Ecore_Event_Key_Modifiers mods, int anymod)
{
+ D_ENTER;
+
ecore_key_grab(key, mods, anymod, 0);
+
+ D_RETURN;
}
void
e_keys_ungrab(char *key, Ecore_Event_Key_Modifiers mods, int anymod)
{
+ D_ENTER;
+
ecore_key_ungrab(key, mods, anymod);
+
+ D_RETURN;
}
diff --git a/src/main.c b/src/main.c
index 908b7a98a..6cbbb8509 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "actions.h"
#include "guides.h"
#include "cursors.h"
@@ -31,13 +32,19 @@ static void setup(void);
static void cb_exit(void)
{
+ D_ENTER;
+
E_PROF_DUMP;
+
+ D_RETURN;
}
static void
wm_running_error(Display * d, XErrorEvent * ev)
{
+ D_ENTER;
+
if ((ev->request_code == X_ChangeWindowAttributes) &&
(ev->error_code == BadAccess))
{
@@ -45,12 +52,16 @@ wm_running_error(Display * d, XErrorEvent * ev)
fprintf(stderr, "Exiting Enlightenment. Error.\n");
exit(-2);
}
+
+ D_RETURN;
UN(d);
}
static void
setup(void)
{
+ D_ENTER;
+
ecore_grab();
ecore_sync();
@@ -59,6 +70,8 @@ setup(void)
e_border_adopt_children(0);
ecore_ungrab();
+
+ D_RETURN;
}
int
diff --git a/src/match.c b/src/match.c
index 8a35e266a..f5e0ed788 100644
--- a/src/match.c
+++ b/src/match.c
@@ -1,8 +1,11 @@
+#include "debug.h"
#include "match.h"
void
e_match_set_props(E_Border *b)
{
+ D_ENTER;
+
#if 0
/* if we have a match that says to ignore prog coords: */
b->client.pos.requested = 0;
@@ -34,4 +37,6 @@ e_match_set_props(E_Border *b)
/* if we have a match specifying layer */
b->client.layer = match_layer;
#endif
+
+ D_RETURN;
}
diff --git a/src/menu.c b/src/menu.c
index ce0b26c3c..9151f2226 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1,8 +1,10 @@
+#include "debug.h"
#include "menu.h"
#include "config.h"
static Evas_List open_menus = NULL; /* List of all open menus */
static Evas_List menus = NULL;
+static E_Menu_Item *curr_selected_item = NULL; /* Currently selected item */
static Window menu_event_win = 0; /* Window which originated event */
static int screen_w, screen_h; /* Screen width and height */
static int mouse_x, mouse_y; /* Mouse coordinates */
@@ -18,6 +20,8 @@ static void e_mouse_move(Ecore_Event * ev);
static void e_mouse_in(Ecore_Event * ev);
static void e_mouse_out(Ecore_Event * ev);
static void e_window_expose(Ecore_Event * ev);
+static void e_menu_item_select (E_Menu_Item *mi);
+static void e_menu_item_unselect (E_Menu_Item *mi);
static void
e_scroller_timer(int val, void *data)
@@ -28,10 +32,13 @@ e_scroller_timer(int val, void *data)
int scroll_speed = 12;
static double last_time = 0.0;
double t;
+
/* these two lines... */
E_CFG_INT(cfg_resist, "settings", "/menu/scroll/resist", 5);
E_CFG_INT(cfg_scroll_speed, "settings", "/menu/scroll/speed", 12);
+ D_ENTER;
+
/* and these 2 should do exactly what tom wants - see e.h */
E_CONFIG_INT_GET(cfg_resist, resist);
E_CONFIG_INT_GET(cfg_scroll_speed, scroll_speed);
@@ -120,7 +127,8 @@ e_scroller_timer(int val, void *data)
}
if ((ok) && (open_menus))
ecore_add_event_timer("menu_scroller", 0.02, e_scroller_timer, val + 1, NULL);
- return;
+
+ D_RETURN;
UN(data);
}
@@ -129,6 +137,8 @@ e_idle(void *data)
{
Evas_List l;
+ D_ENTER;
+
for (l = menus; l; l = l->next)
{
E_Menu *m;
@@ -166,27 +176,44 @@ e_idle(void *data)
evas_render(m->evas);
}
e_db_flush();
- return;
+
+ D_RETURN;
UN(data);
}
+/**
+ * e_wheel - Handle mouse wheel events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_wheel(Ecore_Event * ev)
{
Ecore_Event_Wheel *e;
+ D_ENTER;
+
e = ev->event;
if (e->win == menu_event_win)
{
}
+
+ D_RETURN;
}
+/**
+ * e_key_down - Handle key down events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_key_down(Ecore_Event * ev)
{
Ecore_Event_Key_Down *e;
int ok;
+ D_ENTER;
+
e = ev->event;
ok = 0;
if (e->win == menu_event_win) ok = 1;
@@ -273,35 +300,60 @@ e_key_down(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
+/**
+ * e_key_up - Handle key up events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_key_up(Ecore_Event * ev)
{
Ecore_Event_Key_Up *e;
+ D_ENTER;
+
e = ev->event;
{
}
+
+ D_RETURN;
}
-/* handling mouse down events */
+/**
+ * e_mouse_down - Handle mouse down events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_mouse_down(Ecore_Event * ev)
{
Ecore_Event_Mouse_Down *e;
+ D_ENTER;
+
e = ev->event;
{
}
+
+ D_RETURN;
}
-/* handling mouse up events */
+/**
+ * e_mouse_up - Handle mouse up events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_mouse_up(Ecore_Event * ev)
{
Ecore_Event_Mouse_Up *e;
+ D_ENTER;
+
e = ev->event;
keyboard_nav = 0;
if (e->win == menu_event_win)
@@ -318,11 +370,18 @@ e_mouse_up(Ecore_Event * ev)
for (l = open_menus; l; l = l->next)
{
m = l->data;
+ /* Ensure that the item is actually selected and
+ that the mouse pointer really is over it: */
if (m->selected)
{
- e_menu_callback_item(m, m->selected);
- m->selected->selected = 0;
- m->selected = NULL;
+ if (INTERSECTS(m->selected->x + m->current.x,
+ m->selected->y + m->current.y,
+ m->selected->size.w, m->selected->size.h,
+ mouse_x, mouse_y, 0, 0))
+ {
+ e_menu_callback_item(m, m->selected);
+ }
+ e_menu_item_unselect(m->selected);
break;
}
}
@@ -336,14 +395,22 @@ e_mouse_up(Ecore_Event * ev)
}
}
}
+
+ D_RETURN;
}
-/* handling mouse move events */
+/**
+ * e_mouse_move - Handle mouse move events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_mouse_move(Ecore_Event * ev)
{
Ecore_Event_Mouse_Move *e;
+ D_ENTER;
+
e = ev->event;
keyboard_nav = 0;
if (e->win == menu_event_win)
@@ -380,27 +447,43 @@ e_mouse_move(Ecore_Event * ev)
}
}
e_scroller_timer(0, NULL);
+
+ D_RETURN;
}
-/* handling mouse enter events */
+/**
+ * e_mouse_in - Handle mouse enter events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_mouse_in(Ecore_Event * ev)
{
Ecore_Event_Window_Enter *e;
+ D_ENTER;
+
e = ev->event;
keyboard_nav = 0;
if (e->win == menu_event_win)
{
}
+
+ D_RETURN;
}
-/* handling mouse leave events */
+/**
+ * e_mouse_out - Handle mouse leave events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_mouse_out(Ecore_Event * ev)
{
Ecore_Event_Window_Leave *e;
+ D_ENTER;
+
e = ev->event;
keyboard_nav = 0;
if (e->win == menu_event_win)
@@ -421,14 +504,22 @@ e_mouse_out(Ecore_Event * ev)
}
}
}
+
+ D_RETURN;
}
-/* handling expose events */
+/**
+ * e_window_expose - Handle window expose events
+ *
+ * @ev: Pointer to event.
+ */
static void
e_window_expose(Ecore_Event * ev)
{
Ecore_Event_Window_Expose *e;
+ D_ENTER;
+
e = ev->event;
{
Evas_List l;
@@ -446,27 +537,86 @@ e_window_expose(Ecore_Event * ev)
}
}
}
+
+ D_RETURN;
+}
+
+/**
+ * e_menu_item_unselect - Unselect a menu item.
+ *
+ * @mi: Pointer to the menu item to be unselected.
+ */
+static void
+e_menu_item_unselect (E_Menu_Item *mi)
+{
+ D_ENTER;
+
+ if ((mi) && (mi->menu->selected == mi))
+ {
+ mi->menu->selected = NULL;
+ mi->selected = 0;
+ mi->menu->redo_sel = 1;
+ mi->menu->changed = 1;
+ }
+
+ D_RETURN;
}
+/**
+ * e_menu_item_select - Select a menu item.
+ * NOTE - Assumes only one item can be selected at once,
+ * and unselects any previously selected menu item.
+ *
+ * @mi: Pointer to the menu item to be selected.
+ */
+static void
+e_menu_item_select (E_Menu_Item *mi)
+{
+ D_ENTER;
+
+ e_menu_item_unselect(curr_selected_item);
+ if (mi)
+ {
+ mi->menu->selected = mi;
+ mi->selected = 1;
+ mi->menu->redo_sel = 1;
+ mi->menu->changed = 1;
+ curr_selected_item = mi;
+ }
+
+ D_RETURN;
+}
+
+/**
+ * e_menu_item_in_cb - Callback for when mouse enters a specific menu item.
+ * Attached by e_item_realize(). Selects menu item.
+ *
+ * @_data: Pointer to actual menu item structure.
+ * @_e: Evas
+ * @_o: Evas object
+ * @_b: ?????
+ * @x: ?????
+ * @y: ?????
+ */
static void
e_menu_item_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Menu_Item *mi;
+ D_ENTER;
+
mi = _data;
- mi->menu->selected = mi;
- mi->selected = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
+ e_menu_item_select(mi);
e_menu_hide_submenus(mi->menu);
- if (mi->submenu)
+ if (mi->submenu && mi->submenu->entries)
{
e_menu_move_to(mi->submenu,
mi->menu->current.x + mi->menu->current.w,
mi->menu->current.y + mi->y - mi->menu->border.t);
e_menu_show(mi->submenu);
}
- return;
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -474,17 +624,28 @@ e_menu_item_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
UN(_y);
}
+/**
+ * e_menu_item_out_cb - Callback for when mouse leaves a specific menu item.
+ * Attached by e_item_realize(). Unselects menu item.
+ *
+ * @_data: Pointer to actual menu item structure.
+ * @_e: Evas
+ * @_o: Evas object
+ * @_b: ?????
+ * @x: ?????
+ * @y: ?????
+ */
static void
e_menu_item_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Menu_Item *mi;
+ D_ENTER;
+
mi = _data;
- if (mi->menu->selected == mi) mi->menu->selected = NULL;
- mi->selected = 0;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- return;
+ e_menu_item_unselect(mi);
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -495,14 +656,22 @@ e_menu_item_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
void
e_menu_callback_item(E_Menu *m, E_Menu_Item *mi)
{
+ D_ENTER;
+
if (mi->func_select) mi->func_select(m, mi, mi->func_select_data);
+
+ D_RETURN;
}
void
e_menu_item_set_callback(E_Menu_Item *mi, void (*func) (E_Menu *m, E_Menu_Item *mi, void *data), void *data)
{
+ D_ENTER;
+
mi->func_select = func;
mi->func_select_data = data;
+
+ D_RETURN;
}
/**
@@ -517,6 +686,8 @@ e_menu_hide_submenus(E_Menu *menus_after)
{
Evas_List l;
+ D_ENTER;
+
/* Loop thru all open menus: */
for (l = open_menus; l; l = l->next)
{
@@ -534,6 +705,8 @@ e_menu_hide_submenus(E_Menu *menus_after)
break;
}
}
+
+ D_RETURN;
}
/**
@@ -549,6 +722,8 @@ e_menu_select(int dx, int dy)
Evas_List l, ll;
int done = 0;
+ D_ENTER;
+
/* Loop through all open menus, tile done or reached end */
for (l = open_menus; (l) && (!done); l = l->next)
{
@@ -601,23 +776,13 @@ e_menu_select(int dx, int dy)
if (ok)
{
- /* Unselect the old selected entry: */
- if (m->selected)
- {
- m->selected->selected = 0;
- m->redo_sel = 1;
- m->changed = 1;
- m->selected = NULL;
- }
-
- /* Select the new entry: */
- m->selected = mi;
- mi->selected = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
+ /* Unselect old and select new item: */
+ e_menu_item_unselect(m->selected);
+ e_menu_item_select(mi);
e_menu_hide_submenus(mi->menu);
+
/* If submenu, display it: */
- if (mi->submenu)
+ if (mi->submenu && mi->submenu->entries)
{
e_menu_move_to(mi->submenu,
mi->menu->current.x + mi->menu->current.w,
@@ -665,22 +830,13 @@ e_menu_select(int dx, int dy)
}
if (mi)
{
- /* Unselect old selected entry: */
- if (m->selected)
- {
- m->selected->selected = 0;
- m->redo_sel = 1;
- m->changed = 1;
- m->selected = NULL;
- }
- /* Select new entry: */
- mm->selected = mi;
- mi->selected = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
+ /* Unselect old and select new item: */
+ e_menu_item_unselect(m->selected);
+ e_menu_item_select(mi);
e_menu_hide_submenus(mi->menu);
+
/* If new entry is a submenu, display it: */
- if (mi->submenu)
+ if (mi->submenu && mi->submenu->entries)
{
e_menu_move_to(mi->submenu,
mi->menu->current.x + mi->menu->current.w,
@@ -705,11 +861,8 @@ e_menu_select(int dx, int dy)
m = open_menus->data;
mi = m->entries->data;
- m->selected = mi;
- mi->selected = 1;
- mi->menu->redo_sel = 1;
- mi->menu->changed = 1;
- if (mi->submenu)
+ e_menu_item_select(mi);
+ if (mi->submenu && mi->submenu->entries)
{
e_menu_move_to(mi->submenu,
mi->menu->current.x + mi->menu->current.w,
@@ -718,11 +871,19 @@ e_menu_select(int dx, int dy)
}
}
}
+
+ D_RETURN;
}
+/**
+ * e_menu_init - Initialise the menu, adding the required
+ * event handlers.
+ */
void
e_menu_init(void)
{
+ D_ENTER;
+
ecore_window_get_geometry(0, NULL, NULL, &screen_w, &screen_h);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
@@ -734,11 +895,15 @@ e_menu_init(void)
ecore_event_filter_handler_add(ECORE_EVENT_KEY_UP, e_key_up);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_WHEEL, e_wheel);
ecore_event_filter_idle_handler_add(e_idle, NULL);
+
+ D_RETURN;
}
void
e_menu_event_win_show(void)
{
+ D_ENTER;
+
/* create it */
if (!menu_event_win)
{
@@ -750,11 +915,15 @@ e_menu_event_win_show(void)
}
/* raise it */
if (menu_event_win) ecore_window_raise(menu_event_win);
+
+ D_RETURN;
}
void
e_menu_event_win_hide(void)
{
+ D_ENTER;
+
/* destroy it */
if (menu_event_win)
{
@@ -762,8 +931,17 @@ e_menu_event_win_hide(void)
ecore_window_destroy(menu_event_win);
menu_event_win = 0;
}
+
+ D_RETURN;
}
+/**
+ * e_menu_set_background - Sets the background of menu @m
+ * Sets background of menu using the default theme background,
+ * base.bits.db
+ *
+ * @m: Menu to set background on.
+ */
void
e_menu_set_background(E_Menu *m)
{
@@ -773,11 +951,13 @@ e_menu_set_background(E_Menu *m)
char *part;
int pl, pr, pt, pb;
+ D_ENTER;
+
menus = e_config_get("menus");
part = "base.bits.db";
sprintf(buf, "%s%s/%s", menus, style, part);
- if ((m->bg_file) && (!strcmp(m->bg_file, buf))) return;
+ if ((m->bg_file) && (!strcmp(m->bg_file, buf))) D_RETURN;
IF_FREE(m->bg_file);
m->bg_file = strdup(buf);
@@ -802,6 +982,8 @@ e_menu_set_background(E_Menu *m)
m->border.t = pt;
m->border.b = pb;
m->changed = 1;
+
+ D_RETURN;
}
void
@@ -814,6 +996,8 @@ e_menu_set_sel(E_Menu *m, E_Menu_Item *mi)
int has_sub = 0;
int selected = 0;
+ D_ENTER;
+
menus = e_config_get("menus");
if (!mi->separator)
{
@@ -821,7 +1005,7 @@ e_menu_set_sel(E_Menu *m, E_Menu_Item *mi)
if (mi->submenu) has_sub = 1;
sprintf(buf, "%s%s/selected-%i.submenu-%i.bits.db", menus, style,
selected, has_sub);
- if ((mi->bg_file) && (!strcmp(mi->bg_file, buf))) return;
+ if ((mi->bg_file) && (!strcmp(mi->bg_file, buf))) D_RETURN;
}
IF_FREE(mi->bg_file);
if (!mi->separator)
@@ -846,6 +1030,8 @@ e_menu_set_sel(E_Menu *m, E_Menu_Item *mi)
if (m->sel_border.b < pb) {m->sel_border.b = pb; m->recalc_entries = 1;}
m->redo_sel = 1;
m->changed = 1;
+
+ D_RETURN;
}
void
@@ -856,9 +1042,11 @@ e_menu_set_sep(E_Menu *m, E_Menu_Item *mi)
char *style = "default";
int pl, pr, pt, pb, minx, miny;
+ D_ENTER;
+
menus = e_config_get("menus");
sprintf(buf, "%s%s/separator.bits.db", menus, style);
- if ((mi->sep_file) && (!strcmp(mi->sep_file, buf))) return;
+ if ((mi->sep_file) && (!strcmp(mi->sep_file, buf))) D_RETURN;
IF_FREE(mi->sep_file);
mi->sep_file = strdup(buf);
@@ -881,6 +1069,8 @@ e_menu_set_sep(E_Menu *m, E_Menu_Item *mi)
if (mi->size.min.h < miny) mi->size.min.h = miny;
m->redo_sel = 1;
m->changed = 1;
+
+ D_RETURN;
}
void
@@ -892,13 +1082,15 @@ e_menu_set_state(E_Menu *m, E_Menu_Item *mi)
int on;
int pl, pr, pt, pb, minx, miny;
+ D_ENTER;
+
menus = e_config_get("menus");
on = mi->on;
if (mi->check)
sprintf(buf, "%s%s/check-%i.bits.db", menus, style, on);
else
sprintf(buf, "%s%s/radio-%i.bits.db", menus, style, on);
- if ((mi->state_file) && (!strcmp(mi->state_file, buf))) return;
+ if ((mi->state_file) && (!strcmp(mi->state_file, buf))) D_RETURN;
IF_FREE(mi->state_file);
mi->state_file = strdup(buf);
@@ -921,13 +1113,17 @@ e_menu_set_state(E_Menu *m, E_Menu_Item *mi)
if (mi->size.min.h < miny) mi->size.min.h = miny;
m->redo_sel = 1;
m->changed = 1;
+
+ D_RETURN;
}
-void
-e_menu_free(E_Menu *m)
+static void
+e_menu_cleanup(E_Menu *m)
{
Evas_List l;
+ D_ENTER;
+
for (l = m->entries; l; l = l->next)
{
E_Menu_Item *mi;
@@ -944,7 +1140,11 @@ e_menu_free(E_Menu *m)
ecore_window_destroy(m->win.main);
menus = evas_list_remove(menus, m);
open_menus = evas_list_remove(open_menus, m);
- free(m);
+
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(m));
+
+ D_RETURN;
}
E_Menu *
@@ -956,12 +1156,14 @@ e_menu_new(void)
int image_cache = 8192 * 1024;
char *font_dir;
+ D_ENTER;
+
font_dir = e_config_get("fonts");
m = NEW(E_Menu, 1);
ZERO(m, E_Menu, 1);
- OBJ_INIT(m, e_menu_free);
+ e_object_init(E_OBJECT(m), (E_Cleanup_Func) e_menu_cleanup);
m->win.main = ecore_window_override_new(0, 0, 0, 1, 1);
m->evas = evas_new_all(ecore_display_get(),
@@ -1001,53 +1203,83 @@ e_menu_new(void)
menus = evas_list_prepend(menus, m);
- return m;
+ D_RETURN_(m);
}
void
e_menu_hide(E_Menu *m)
{
+ D_ENTER;
+
+ printf("Menu hide!\n");
+
+ if (m->selected)
+ {
+ m->selected->selected = 0;
+ }
+ m->selected = NULL;
+ m->redo_sel = 1;
m->current.visible = 0;
m->changed = 1;
+
+ D_RETURN;
}
void
e_menu_show(E_Menu *m)
{
+ D_ENTER;
+
m->current.visible = 1;
m->changed = 1;
+
+ D_RETURN;
}
void
e_menu_move_to(E_Menu *m, int x, int y)
{
+ D_ENTER;
+
m->current.x = x;
m->current.y = y;
m->changed = 1;
+
+ D_RETURN;
}
void
e_menu_show_at_mouse(E_Menu *m, int x, int y, Time t)
{
+ D_ENTER;
+
m->current.x = x;
m->current.y = y;
m->time = t;
e_menu_show(m);
+
+ D_RETURN;
}
void
e_menu_add_item(E_Menu *m, E_Menu_Item *mi)
{
+ D_ENTER;
+
m->entries = evas_list_append(m->entries, mi);
m->recalc_entries = 1;
m->changed = 1;
mi->menu = m;
e_menu_item_realize(m, mi);
+
+ D_RETURN;
}
void
e_menu_del_item(E_Menu *m, E_Menu_Item *mi)
{
+ D_ENTER;
+
m->entries = evas_list_remove(m->entries, mi);
m->recalc_entries = 1;
m->changed = 1;
@@ -1057,6 +1289,8 @@ e_menu_del_item(E_Menu *m, E_Menu_Item *mi)
if (mi->menu->selected == mi) mi->menu->selected = NULL;
free(mi);
mi->menu = NULL;
+
+ D_RETURN;
}
void
@@ -1065,6 +1299,8 @@ e_menu_item_update(E_Menu *m, E_Menu_Item *mi)
int tx, ty, tw, th, ix, iy, iw, ih, rx, ry, rw, rh;
double dtw, dth;
+ D_ENTER;
+
if (mi->sep)
{
ebits_move(mi->sep, mi->x, mi->y);
@@ -1130,11 +1366,15 @@ e_menu_item_update(E_Menu *m, E_Menu_Item *mi)
ebits_show(mi->state);
}
}
+
+ D_RETURN;
}
void
e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi)
{
+ D_ENTER;
+
if (mi->bg) ebits_free(mi->bg);
mi->bg = NULL;
IF_FREE(mi->bg_file);
@@ -1151,6 +1391,8 @@ e_menu_item_unrealize(E_Menu *m, E_Menu_Item *mi)
mi->sep = NULL;
IF_FREE(mi->sep_file);
mi->sep_file = NULL;
+
+ D_RETURN;
}
void
@@ -1159,6 +1401,8 @@ e_menu_item_realize(E_Menu *m, E_Menu_Item *mi)
double tw, th;
int iw, ih, rw, rh;
+ D_ENTER;
+
if (mi->separator)
{
e_menu_set_sep(m, mi);
@@ -1198,6 +1442,8 @@ e_menu_item_realize(E_Menu *m, E_Menu_Item *mi)
e_menu_set_sel(m, mi);
if ((mi->radio) || (mi->check)) e_menu_set_state(m, mi);
}
+
+ D_RETURN;
}
E_Menu_Item *
@@ -1205,17 +1451,21 @@ e_menu_item_new(char *str)
{
E_Menu_Item *mi;
+ D_ENTER;
+
mi = NEW(E_Menu_Item, 1);
ZERO(mi, E_Menu_Item, 1);
if (str) mi->str = strdup(str);
- return mi;
+ D_RETURN_(mi);
}
void
e_menu_obscure_outside_screen(E_Menu *m)
{
+ D_ENTER;
+
/* obscure stuff outside the screen boundaries - optimizes rendering */
evas_clear_obscured_rects(m->evas);
evas_add_obscured_rect(m->evas,
@@ -1234,6 +1484,8 @@ e_menu_obscure_outside_screen(E_Menu *m)
screen_w - m->current.x,
-m->current.y - 100000,
100000, 200000 + screen_h);
+
+ D_RETURN;
}
void
@@ -1241,6 +1493,8 @@ e_menu_scroll_all_by(int dx, int dy)
{
Evas_List l;
+ D_ENTER;
+
for (l = menus; l; l = l->next)
{
E_Menu *m;
@@ -1265,6 +1519,8 @@ e_menu_scroll_all_by(int dx, int dy)
mouse_y - m->current.y);
}
}
+
+ D_RETURN;
}
void
@@ -1272,6 +1528,8 @@ e_menu_update_visibility(E_Menu *m)
{
E_Menu_Item *mi;
+ D_ENTER;
+
mi = m->selected;
if (mi)
{
@@ -1297,6 +1555,8 @@ e_menu_update_visibility(E_Menu *m)
e_menu_scroll_all_by(0, -(screen_h / 4));
}
}
+
+ D_RETURN;
}
void
@@ -1305,7 +1565,9 @@ e_menu_update_base(E_Menu *m)
int size_changed = 0;
int location_changed = 0;
- if (!m->changed) return;
+ D_ENTER;
+
+ if (!m->changed) D_RETURN;
if (m->recalc_entries)
{
@@ -1436,20 +1698,28 @@ e_menu_update_base(E_Menu *m)
evas_set_output_viewport(m->evas, 0, 0, m->current.w, m->current.h);
if (m->bg) ebits_resize(m->bg, m->current.w, m->current.h);
}
+
+ D_RETURN;
}
void
e_menu_update_finish(E_Menu *m)
{
- if (!m->changed) return;
+ D_ENTER;
+
+ if (!m->changed) D_RETURN;
m->previous = m->current;
m->changed = 0;
+
+ D_RETURN;
}
void
e_menu_update_shows(E_Menu *m)
{
- if (!m->changed) return;
+ D_ENTER;
+
+ if (!m->changed) D_RETURN;
if (m->current.visible != m->previous.visible)
{
if (m->current.visible)
@@ -1461,12 +1731,16 @@ e_menu_update_shows(E_Menu *m)
open_menus = evas_list_append(open_menus, m);
}
}
+
+ D_RETURN;
}
void
e_menu_update_hides(E_Menu *m)
{
- if (!m->changed) return;
+ D_ENTER;
+
+ if (!m->changed) D_RETURN;
if (m->current.visible != m->previous.visible)
{
if (!m->current.visible)
@@ -1498,20 +1772,28 @@ e_menu_update_hides(E_Menu *m)
if (!open_menus) e_menu_event_win_hide();
}
}
+
+ D_RETURN;
}
void
e_menu_update(E_Menu *m)
{
+ D_ENTER;
+
e_menu_update_base(m);
e_menu_update_shows(m);
e_menu_update_hides(m);
e_menu_update_finish(m);
+
+ D_RETURN;
}
void
e_menu_item_set_icon(E_Menu_Item *mi, char *icon)
{
+ D_ENTER;
+
IF_FREE(mi->icon);
mi->icon = NULL;
if (icon) mi->icon = strdup(icon);
@@ -1520,11 +1802,15 @@ e_menu_item_set_icon(E_Menu_Item *mi, char *icon)
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_text(E_Menu_Item *mi, char *text)
{
+ D_ENTER;
+
IF_FREE(mi->str);
mi->str = NULL;
if (text) mi->str = strdup(text);
@@ -1533,44 +1819,60 @@ e_menu_item_set_text(E_Menu_Item *mi, char *text)
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_separator(E_Menu_Item *mi, int sep)
{
+ D_ENTER;
+
mi->separator = sep;
if (mi->menu)
{
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_radio(E_Menu_Item *mi, int radio)
{
+ D_ENTER;
+
mi->radio = radio;
if (mi->menu)
{
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_check(E_Menu_Item *mi, int check)
{
+ D_ENTER;
+
mi->check = check;
if (mi->menu)
{
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_state(E_Menu_Item *mi, int state)
{
+ D_ENTER;
+
mi->on = state;
if (mi->menu)
{
@@ -1578,11 +1880,15 @@ e_menu_item_set_state(E_Menu_Item *mi, int state)
mi->menu->redo_sel = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu)
{
+ D_ENTER;
+
if (mi->submenu) e_menu_hide(mi->submenu);
mi->submenu = submenu;
if (mi->menu)
@@ -1591,31 +1897,45 @@ e_menu_item_set_submenu(E_Menu_Item *mi, E_Menu *submenu)
mi->menu->redo_sel = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_item_set_scale_icon(E_Menu_Item *mi, int scale)
{
+ D_ENTER;
+
mi->scale_icon = scale;
if (mi->menu)
{
mi->menu->recalc_entries = 1;
mi->menu->changed = 1;
}
+
+ D_RETURN;
}
void
e_menu_set_padding_icon(E_Menu *m, int pad)
{
+ D_ENTER;
+
m->pad.icon = pad;
m->recalc_entries = 1;
m->changed = 1;
+
+ D_RETURN;
}
void
e_menu_set_padding_state(E_Menu *m, int pad)
{
+ D_ENTER;
+
m->pad.state = pad;
m->recalc_entries = 1;
m->changed = 1;
+
+ D_RETURN;
}
diff --git a/src/menu.h b/src/menu.h
index 8ac28b59e..44d7eff98 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -2,13 +2,14 @@
#define E_MENU_H
#include "e.h"
+#include "object.h"
typedef struct _E_Menu E_Menu;
typedef struct _E_Menu_Item E_Menu_Item;
struct _E_Menu
{
- OBJ_PROPERTIES;
+ E_Object o;
struct {
int x, y, w, h;
@@ -45,8 +46,6 @@ struct _E_Menu
struct _E_Menu_Item
{
- OBJ_PROPERTIES;
-
int x, y;
struct {
struct {
@@ -106,7 +105,6 @@ void e_menu_set_background(E_Menu *m);
void e_menu_set_sel(E_Menu *m, E_Menu_Item *mi);
void e_menu_set_sep(E_Menu *m, E_Menu_Item *mi);
void e_menu_set_state(E_Menu *m, E_Menu_Item *mi);
-void e_menu_free(E_Menu *m);
E_Menu *e_menu_new(void );
void e_menu_hide(E_Menu *m);
void e_menu_show(E_Menu *m);
diff --git a/src/menubuild.c b/src/menubuild.c
index 09b9a56b4..79b1eae33 100644
--- a/src/menubuild.c
+++ b/src/menubuild.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "menu.h"
#include "menubuild.h"
#include "exec.h"
@@ -24,10 +25,13 @@ static void
e_build_menu_cb_exec(E_Menu *m, E_Menu_Item *mi, void *data)
{
char *exe;
+
+ D_ENTER;
exe = data;
e_exec_run(exe);
- return;
+
+ D_RETURN;
UN(m);
UN(mi);
}
@@ -37,6 +41,8 @@ e_build_menu_cb_script(E_Menu *m, E_Menu_Item *mi, void *data)
{
char *script;
+ D_ENTER;
+
#ifdef USE_FERITE
script = data;
e_ferite_run(script);
@@ -44,7 +50,7 @@ e_build_menu_cb_script(E_Menu *m, E_Menu_Item *mi, void *data)
printf( "No cookies for you. You will have to install ferite.\n" );
#endif
- return;
+ D_RETURN;
UN(m);
UN(mi);
UN(script);
@@ -56,6 +62,8 @@ e_build_menu_unbuild(E_Build_Menu *bm)
{
Evas_List l;
+ D_ENTER;
+
bm->menu = NULL;
if (bm->menus)
{
@@ -68,7 +76,8 @@ e_build_menu_unbuild(E_Build_Menu *bm)
e_menu_update_shows(m);
e_menu_update_hides(m);
e_menu_update_finish(m);
- OBJ_DO_FREE(m);
+
+ e_object_unref(E_OBJECT(m));
}
bm->menus = evas_list_free(bm->menus);
}
@@ -80,6 +89,8 @@ e_build_menu_unbuild(E_Build_Menu *bm)
}
bm->commands = evas_list_free(bm->commands);
}
+
+ D_RETURN;
}
@@ -92,12 +103,14 @@ e_build_menu_db_poll(int val, void *data)
time_t mod;
E_Build_Menu *bm;
+ D_ENTER;
+
bm = data;
mod = e_file_modified_time(bm->file);
if (mod <= bm->mod_time)
{
ecore_add_event_timer(bm->file, 1.0, e_build_menu_db_poll, 0, data);
- return;
+ D_RETURN;
}
bm->mod_time = mod;
@@ -106,7 +119,8 @@ e_build_menu_db_poll(int val, void *data)
if (!bm->menu) bm->mod_time = 0;
ecore_add_event_timer(bm->file, 1.0, e_build_menu_db_poll, 0, data);
- return;
+
+ D_RETURN;
UN(val);
}
@@ -116,12 +130,14 @@ e_build_menu_gnome_apps_poll(int val, void *data)
time_t mod;
E_Build_Menu *bm;
+ D_ENTER;
+
bm = data;
mod = e_file_modified_time(bm->file);
if (mod <= bm->mod_time)
{
ecore_add_event_timer(bm->file, 1.0, e_build_menu_gnome_apps_poll, 0, data);
- return;
+ D_RETURN;
}
bm->mod_time = mod;
@@ -130,7 +146,8 @@ e_build_menu_gnome_apps_poll(int val, void *data)
if (!bm->menu) bm->mod_time = 0;
ecore_add_event_timer(bm->file, 1.0, e_build_menu_gnome_apps_poll, 0, data);
- return;
+
+ D_RETURN;
UN(val);
}
@@ -141,8 +158,10 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num)
char buf[PATH_MAX];
int num2, i2;
+ D_ENTER;
+
sprintf(buf, "/menu/%i/count", num);
- if (!e_db_int_get(db, buf, &num2)) return NULL;
+ if (!e_db_int_get(db, buf, &num2)) D_RETURN_(NULL);
menu = e_menu_new();
e_menu_set_padding_icon(menu, 2);
e_menu_set_padding_state(menu, 2);
@@ -194,7 +213,8 @@ e_build_menu_db_build_number(E_Build_Menu *bm, E_DB_File *db, int num)
e_menu_add_item(menu, menuitem);
}
bm->menus = evas_list_prepend(bm->menus, menu);
- return menu;
+
+ D_RETURN_(menu);
}
static void
@@ -203,14 +223,18 @@ e_build_menu_db_build(E_Build_Menu *bm)
E_DB_File *db;
int num;
+ D_ENTER;
+
e_db_flush();
db = e_db_open_read(bm->file);
- if (!db) return;
+ if (!db) D_RETURN;
if (!e_db_int_get(db, "/menu/count", &num)) goto error;
if (num > 0) bm->menu = e_build_menu_db_build_number(bm, db, 0);
error:
e_db_close(db);
+
+ D_RETURN;
}
@@ -223,6 +247,8 @@ e_build_menu_gnome_apps_build_dir(E_Build_Menu *bm, char *dir)
E_Menu *menu = NULL;
Evas_List l, entries = NULL;
+ D_ENTER;
+
menu = e_menu_new();
e_menu_set_padding_icon(menu, 2);
e_menu_set_padding_state(menu, 2);
@@ -384,7 +410,8 @@ e_build_menu_gnome_apps_build_dir(E_Build_Menu *bm, char *dir)
}
if (entries) evas_list_free(entries);
bm->menus = evas_list_prepend(bm->menus, menu);
- return menu;
+
+ D_RETURN_(menu);
}
static void
@@ -392,18 +419,28 @@ e_build_menu_gnome_apps_build(E_Build_Menu *bm)
{
E_Menu *menu;
+ D_ENTER;
+
menu = e_build_menu_gnome_apps_build_dir(bm, bm->file);
bm->menu = menu;
+
+ D_RETURN;
}
-void
-e_build_menu_free(E_Build_Menu *bm)
+static void
+e_build_menu_cleanup(E_Build_Menu *bm)
{
+ D_ENTER;
+
ecore_del_event_timer(bm->file);
e_build_menu_unbuild(bm);
IF_FREE(bm->file);
build_menus = evas_list_remove(build_menus, bm);
- FREE(bm);
+
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(bm));
+
+ D_RETURN;
}
E_Build_Menu *
@@ -411,16 +448,20 @@ e_build_menu_new_from_db(char *file)
{
E_Build_Menu *bm;
- if (!file) return NULL;
+ D_ENTER;
+
+ if (!file) D_RETURN_(NULL);
bm = NEW(E_Build_Menu, 1);
ZERO(bm, E_Build_Menu, 1);
- OBJ_INIT(bm, e_build_menu_free);
+
+ e_object_init(E_OBJECT(bm), (E_Cleanup_Func) e_build_menu_cleanup);
bm->file = strdup(file);
build_menus = evas_list_prepend(build_menus, bm);
e_build_menu_db_poll(0, bm);
- return bm;
+
+ D_RETURN_(bm);
}
E_Build_Menu *
@@ -428,14 +469,18 @@ e_build_menu_new_from_gnome_apps(char *dir)
{
E_Build_Menu *bm;
- if (!dir) return NULL;
+ D_ENTER;
+
+ if (!dir) D_RETURN_(NULL);
bm = NEW(E_Build_Menu, 1);
ZERO(bm, E_Build_Menu, 1);
- OBJ_INIT(bm, e_build_menu_free);
-
+
+ e_object_init(E_OBJECT(bm), (E_Cleanup_Func) e_build_menu_cleanup);
+
bm->file = strdup(dir);
build_menus = evas_list_prepend(build_menus, bm);
e_build_menu_gnome_apps_poll(0, bm);
- return bm;
+
+ D_RETURN_(bm);
}
diff --git a/src/menubuild.h b/src/menubuild.h
index 47ab48e0d..e0859c829 100644
--- a/src/menubuild.h
+++ b/src/menubuild.h
@@ -2,12 +2,13 @@
#define E_MENU_BUILD_H
#include "e.h"
+#include "object.h"
typedef struct _E_Build_Menu E_Build_Menu;
struct _E_Build_Menu
{
- OBJ_PROPERTIES;
+ E_Object o;
char *file;
time_t mod_time;
@@ -18,7 +19,6 @@ struct _E_Build_Menu
Evas_List commands;
};
-void e_build_menu_free(E_Build_Menu *bm);
E_Build_Menu *e_build_menu_new_from_db(char *file);
E_Build_Menu *e_build_menu_new_from_gnome_apps(char *dir);
diff --git a/src/object.c b/src/object.c
new file mode 100644
index 000000000..dd2eaab7e
--- /dev/null
+++ b/src/object.c
@@ -0,0 +1,79 @@
+#include "debug.h"
+#include "object.h"
+
+void
+e_object_init(E_Object *obj, E_Cleanup_Func cleanup_func)
+{
+ D_ENTER;
+
+ if (!obj)
+ D_RETURN;
+
+ memset(obj, 0, sizeof(E_Object));
+ obj->references = 1;
+ obj->cleanup_func = cleanup_func;
+
+ D_RETURN;
+}
+
+void
+e_object_cleanup(E_Object *obj)
+{
+ D_ENTER;
+
+ if (!obj)
+ D_RETURN;
+
+ free(obj);
+
+ D_RETURN;
+}
+
+
+void
+e_object_ref(E_Object *obj)
+{
+ D_ENTER;
+
+ if (!obj)
+ D_RETURN;
+
+ obj->references++;
+ printf("++ refcount on %p, now %i\n", obj, obj->references);
+
+ D_RETURN;
+}
+
+int
+e_object_unref(E_Object *obj)
+{
+ D_ENTER;
+
+ if (!obj)
+ D_RETURN_(-1);
+
+ obj->references--;
+
+ printf("-- refcount on %p, now %i\n", obj, obj->references);
+
+ if (obj->references == 0 && obj->cleanup_func)
+ {
+ printf("Refcount is zero, freeing.\n");
+ obj->cleanup_func(obj);
+ D_RETURN_(0);
+ }
+
+ D_RETURN_(obj->references);
+}
+
+
+int
+e_object_get_usecount(E_Object *obj)
+{
+ D_ENTER;
+
+ if (!obj)
+ D_RETURN_(-1);
+
+ D_RETURN_(obj->references);
+}
diff --git a/src/object.h b/src/object.h
new file mode 100644
index 000000000..8651a3b74
--- /dev/null
+++ b/src/object.h
@@ -0,0 +1,78 @@
+#ifndef E_OBJECT_H
+#define E_OBJECT_H
+
+#include <Evas.h>
+#include <Ecore.h>
+
+#define E_OBJECT(x) ((E_Object*)(x))
+
+typedef void (*E_Cleanup_Func) (void *object);
+
+typedef struct _e_object
+{
+ int references;
+ E_Cleanup_Func cleanup_func;
+
+} E_Object;
+
+/**
+ * e_object_init - Initializes an E object
+ * @obj The object to initalize
+ * @cleanup_func The destructor function for this object
+ *
+ * This function initializes an E object. It registers
+ * the @cleanup_func that is to be called when the use
+ * count on this object drops to zero. This destructor
+ * then cleans up the object, from the derived classes up
+ * the hierarchy to the highest ancestor, E_Object. You
+ * MUST call the destructor of the base class at the end
+ * of a destructor, or you're creating a leak. Moreover,
+ * those destructors MUST NOT call free() on the object
+ * itself, only clean up things that are pointed to etc.
+ * The final free() call has to happen in the root class,
+ * here, it happens in e_object_cleanup().
+ */
+void e_object_init(E_Object *obj, E_Cleanup_Func cleanup_func);
+
+/**
+ * e_object_cleanup - Cleanup function for E_Objects
+ * @obj The object to clean up
+ *
+ * This is the most basic destructor function, the only
+ * one which does not call another base class destructor
+ * at the end. This is the place where the final free()
+ * call occurs.
+ */
+void e_object_cleanup(E_Object *obj);
+
+/**
+ * e_object_ref - Increment the reference count of this object
+ * @obj The object whose reference count to increase
+ */
+void e_object_ref(E_Object *obj);
+
+/**
+ * e_object_unref - Decrememnt the reference count of this object
+ * @obj The object whose reference count to decrease
+ *
+ * This function decreases an object's reference counter. If
+ * the counter drops to zero, the objects cleanup_func()
+ * that was passed with e_object_init() is called. This function
+ * is the destructor of the most derived class of this object,
+ * and works its way back to the root class's destructor,
+ * e_object_cleanup().
+ */
+int e_object_unref(E_Object *obj);
+
+/**
+ * e_object_get_usecount - Returns the current use count
+ * @obj The object whose use count to return
+ *
+ * This function returns the use count of an object. Use this
+ * function when you want to perform tasks before an object
+ * gets cleaned up by checking if the use count is one,
+ * cleaning up, and then calling e_object_unref().
+ */
+int e_object_get_usecount(E_Object *obj);
+
+#endif
diff --git a/src/observer.c b/src/observer.c
new file mode 100644
index 000000000..003ded6a1
--- /dev/null
+++ b/src/observer.c
@@ -0,0 +1,146 @@
+#include <string.h>
+
+#include "debug.h"
+#include "observer.h"
+
+void
+e_observer_init(E_Observer *obs, Ecore_Event_Type event,
+ E_Notify_Func notify_func,
+ E_Cleanup_Func cleanup_func)
+{
+ D_ENTER;
+
+ if (!obs)
+ D_RETURN;
+
+ memset(obs, 0, sizeof(E_Observer));
+
+ obs->watched = NULL;
+ obs->event = event;
+ obs->notify_func = notify_func;
+
+ e_object_init(E_OBJECT(obs), cleanup_func);
+
+ D_RETURN;
+}
+
+void
+e_observer_cleanup(E_Observer *obs)
+{
+ E_Observee *o = NULL;
+
+ D_ENTER;
+
+ if (!obs)
+ D_RETURN;
+
+ while (obs->watched)
+ {
+ o = E_OBSERVEE(obs->watched->data);
+ e_observer_unregister_observee(obs, o);
+ }
+
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(obs));
+
+ D_RETURN;
+}
+
+void
+e_observer_register_observee(E_Observer *observer, E_Observee *observee)
+{
+ D_ENTER;
+
+ if (!observer || !observee)
+ D_RETURN;
+
+ observee->observers = evas_list_append(observee->observers, observer);
+ observer->watched = evas_list_append(observer->watched, observee);
+
+ D_RETURN;
+}
+
+void
+e_observer_unregister_observee(E_Observer *observer, E_Observee *observee)
+{
+ D_ENTER;
+
+ if (!observer || !observee)
+ D_RETURN;
+
+ observee->observers = evas_list_remove(observee->observers, observer);
+ observer->watched = evas_list_remove(observer->watched, observee);
+
+ D_RETURN;
+}
+
+
+/* --------------------- Observee code below */
+
+void
+e_observee_init(E_Observee *obs, E_Cleanup_Func cleanup_func)
+{
+ D_ENTER;
+
+ if (!obs)
+ D_RETURN;
+
+ memset(obs, 0, sizeof(E_Observee));
+
+ e_object_init(E_OBJECT(obs), cleanup_func);
+
+ D_RETURN;
+}
+
+
+void
+e_observee_notify_observers(E_Observee *o, Ecore_Event_Type event)
+{
+ Evas_List obs_list = NULL;
+ E_Observer *obs = NULL;
+
+ D_ENTER;
+
+ if (!o)
+ D_RETURN;
+
+ for (obs_list = o->observers; obs_list; obs_list = obs_list->next)
+ {
+ obs = E_OBSERVER(obs_list->data);
+
+ if (obs->event == ECORE_EVENT_MAX ||
+ obs->event == event)
+ {
+ obs->notify_func(obs, o);
+ }
+ }
+
+ D_RETURN;
+}
+
+
+void
+e_observee_cleanup(E_Observee *obs)
+{
+ E_Observer *observer = NULL;
+
+ D_ENTER;
+
+ if (!obs)
+ D_RETURN;
+
+ if (e_object_get_usecount(E_OBJECT(obs)) == 1)
+ {
+ while (obs->observers)
+ {
+ observer = E_OBSERVER(obs->observers->data);
+ e_observer_unregister_observee(observer, obs);
+ }
+ }
+
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(obs));
+
+ D_RETURN;
+}
+
diff --git a/src/observer.h b/src/observer.h
new file mode 100644
index 000000000..851daf1cc
--- /dev/null
+++ b/src/observer.h
@@ -0,0 +1,107 @@
+#ifndef E_OBSERVER_H
+#define E_OBSERVER_H
+
+#include <Ecore.h>
+
+#include "e.h"
+#include "object.h"
+
+#define E_OBSERVER(x) ((E_Observer*)(x))
+#define E_OBSERVEE(x) ((E_Observee*)(x))
+
+typedef struct _e_observer E_Observer;
+typedef struct _e_observee E_Observee;
+
+typedef void(*E_Notify_Func)(E_Observer *observer, E_Observee *observee);
+
+struct _e_observer
+{
+ E_Object obj;
+
+ Evas_List watched; /* list<E_Observee> */
+ Ecore_Event_Type event;
+ E_Notify_Func notify_func;
+};
+
+struct _e_observee
+{
+ E_Object obj;
+
+ Evas_List observers; /* list<E_Observer> */
+};
+
+
+/**
+ * e_observer_init - Initializes an observer
+ * @obs The observer to initialize
+ * @event The Ecore event for which this observer will be responsible
+ * @nofify_func The function the observer calls when it gets notified
+ * @cleanup_func The destructor function to pass to the E_Object initializer
+ *
+ * This function initializes an observer. Observees can register observers,
+ * which will call the given @notify_func when an observer issues an
+ * e_observee_notify_observers() call. Observers are derived from
+ * E_Objects, therefore, this function also handles E_Object initalization.
+ */
+void e_observer_init(E_Observer *obs, Ecore_Event_Type event,
+ E_Notify_Func notify_func,
+ E_Cleanup_Func cleanup_func);
+
+/**
+ * e_observer_cleanup - Cleans up an observer.
+ * @obs The observer to clean up
+ *
+ * This function cleans up an observer by unregistering all observees.
+ */
+void e_observer_cleanup(E_Observer *obs);
+
+/**
+ * e_observer_register_observee - Registers an observee
+ * @observer The observer which registers the observee
+ * @observee The observee which registers the observer
+ *
+ * This function registers the observer in the observee and vice versa.
+ */
+void e_observer_register_observee(E_Observer *observer, E_Observee *observee);
+
+/**
+ * e_observer_unregister_observee - Unregisters an observee
+ * @observer The observer which unregisters the observee
+ * @observee The observee which unregisters the observer
+ *
+ * This function unregisters the observer in the observee and vice versa.
+ */
+void e_observer_unregister_observee(E_Observer *observer, E_Observee *observee);
+
+/**
+ * e_observee_init - Initializes an observee.
+ * @obs The observee to initialize
+ * @cleanup_func The destructor function for cleaning this observee up
+ *
+ * This function initializes an observee. Observees are derived
+ * from E_Objects, which is why this function gets the destructor
+ * function as a parameter. It is passed on to e_object_init().
+ */
+void e_observee_init(E_Observee *obs, E_Cleanup_Func cleanup_func);
+
+/**
+ * e_observee_cleanup - Cleans up an observee.
+ * @obs The observee to clean up
+ *
+ * This function cleans up an observee by unregistering it from all observers.
+ */
+void e_observee_cleanup(E_Observee *obs);
+
+/**
+ * e_observee_notify_observers - Notify observers of a given Ecore event
+ * @o The observee which notifies its observers
+ * @event The event by which to filter the observers
+ *
+ * This function scans the registered observers in the observee
+ * and calls the notify_func() of the observers that are
+ * responsible for the given @event.
+ */
+void e_observee_notify_observers(E_Observee *o, Ecore_Event_Type event);
+
+
+#endif
diff --git a/src/place.c b/src/place.c
index 681e596be..8fe44c1c9 100644
--- a/src/place.c
+++ b/src/place.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "config.h"
#include "place.h"
#include "actions.h"
@@ -15,8 +16,12 @@ e_mouse_down(Ecore_Event * ev)
{
Ecore_Event_Mouse_Down *e;
+ D_ENTER;
+
e = ev->event;
- if (!win_place) return;
+ if (!win_place) D_RETURN;
+
+ D_RETURN;
}
static void
@@ -24,13 +29,16 @@ e_mouse_up(Ecore_Event * ev)
{
Ecore_Event_Mouse_Up *e;
+ D_ENTER;
+
e = ev->event;
- if (!win_place) return;
+ if (!win_place) D_RETURN;
e_action_stop("Window_Place", ACT_MOUSE_UP, 1, NULL,
ECORE_EVENT_KEY_MODIFIER_NONE, NULL, NULL, e->x, e->y, e->rx, e->ry);
ecore_window_destroy(win_place);
win_place = 0;
- return;
+
+ D_RETURN;
}
static void
@@ -38,13 +46,17 @@ e_mouse_move(Ecore_Event * ev)
{
Ecore_Event_Mouse_Move *e;
+ D_ENTER;
+
e = ev->event;
- if (!win_place) return;
+ if (!win_place) D_RETURN;
e_action_cont("Window_Place", ACT_MOUSE_MOVE, 1, NULL,
ECORE_EVENT_KEY_MODIFIER_NONE, NULL, NULL, e->x, e->y, e->rx, e->ry,
e->rx - prx, e->ry - pry);
prx = e->rx;
pry = e->ry;
+
+ D_RETURN;
}
static int
@@ -55,6 +67,8 @@ e_place_manual(E_Border *b, E_Desktop *desk, int *x, int *y)
int move_mode = E_GUIDES_BOX;
E_CFG_INT(cfg_window_move_mode, "settings", "/window/move/mode", E_GUIDES_BOX);
+ D_ENTER;
+
E_CONFIG_INT_GET(cfg_window_move_mode, move_mode);
w = b->current.requested.w;
h = b->current.requested.h;
@@ -87,10 +101,10 @@ e_place_manual(E_Border *b, E_Desktop *desk, int *x, int *y)
/* start a move mode */
e_action_stop_by_type("Window_Place");
e_action_start("Window_Place", ACT_MOUSE_CLICK, 1, NULL,
- ECORE_EVENT_KEY_MODIFIER_NONE, b, NULL, mx, my, rx, ry);
+ ECORE_EVENT_KEY_MODIFIER_NONE, E_OBJECT(b), NULL, mx, my, rx, ry);
- if (move_mode != E_GUIDES_OPAQUE) return 0;
- return 1;
+ if (move_mode != E_GUIDES_OPAQUE) D_RETURN_(0);
+ D_RETURN_(1);
}
static int
@@ -101,6 +115,8 @@ e_place_smart(E_Border *b, E_Desktop *desk, int *x, int *y)
int *a_x = NULL, *a_y = NULL;
Evas_List l;
+ D_ENTER;
+
w = b->current.requested.w;
h = b->current.requested.h;
a_w = 2;
@@ -411,7 +427,8 @@ e_place_smart(E_Border *b, E_Desktop *desk, int *x, int *y)
done:
FREE(a_x);
FREE(a_y);
- return 1;
+
+ D_RETURN_(1);
}
static int
@@ -419,11 +436,14 @@ e_place_middle(E_Border *b, E_Desktop *desk, int *x, int *y)
{
int w, h;
+ D_ENTER;
+
w = b->current.requested.w;
h = b->current.requested.h;
*x = (desk->real.w - w) / 2;
*y = (desk->real.h - h) / 2;
- return 1;
+
+ D_RETURN_(1);
}
static int
@@ -434,6 +454,8 @@ e_place_cascade(E_Border *b, E_Desktop *desk, int *x, int *y)
static int count_y = 0;
int pl, pr, pt, pb;
+ D_ENTER;
+
pl = pr = pt = pb = 0;
if (b->bits.l) ebits_get_insets(b->bits.l, &pl, &pr, &pt, &pb);
w = b->current.requested.w;
@@ -444,7 +466,8 @@ e_place_cascade(E_Border *b, E_Desktop *desk, int *x, int *y)
*y = count_y;
count_x += pl;
count_y += pt;
- return 1;
+
+ D_RETURN_(1);
}
static int
@@ -452,6 +475,8 @@ e_place_random(E_Border *b, E_Desktop *desk, int *x, int *y)
{
int w, h;
+ D_ENTER;
+
w = b->current.requested.w;
h = b->current.requested.h;
@@ -465,28 +490,45 @@ e_place_random(E_Border *b, E_Desktop *desk, int *x, int *y)
else
*y = 0;
- return 1;
+ D_RETURN_(1);
}
int
e_place_border(E_Border *b, E_Desktop *desk, int *x, int *y, E_Placement_Mode mode)
{
+ int result = 1;
+
+ D_ENTER;
+
if (b->client.no_place)
- return 1;
+ D_RETURN_(1);
- if (mode == E_PLACE_MANUAL) return e_place_manual (b, desk, x, y);
- if (mode == E_PLACE_SMART) return e_place_smart (b, desk, x, y);
- if (mode == E_PLACE_MIDDLE) return e_place_middle (b, desk, x, y);
- if (mode == E_PLACE_CASCADE) return e_place_cascade(b, desk, x, y);
- if (mode == E_PLACE_RANDOM) return e_place_random (b, desk, x, y);
+ switch (mode)
+ {
+ case E_PLACE_MANUAL:
+ result = e_place_manual (b, desk, x, y);
+ case E_PLACE_SMART:
+ result = e_place_smart (b, desk, x, y);
+ case E_PLACE_MIDDLE:
+ result = e_place_middle (b, desk, x, y);
+ case E_PLACE_CASCADE:
+ result = e_place_cascade(b, desk, x, y);
+ case E_PLACE_RANDOM:
+ result = e_place_random (b, desk, x, y);
+ default:
+ }
- return 1;
+ D_RETURN_(result);
}
void
e_place_init(void)
{
+ D_ENTER;
+
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
+
+ D_RETURN;
}
diff --git a/src/place.h b/src/place.h
index 1b731c2b5..7ad0dffc1 100644
--- a/src/place.h
+++ b/src/place.h
@@ -15,8 +15,27 @@ typedef enum e_placement_mode
}
E_Placement_Mode;
-int e_place_border(E_Border *b, E_Desktop *desk, int *x, int *y, E_Placement_Mode mode);
+/**
+ * e_place_init - window placement initialization
+ *
+ * This function registers the event handlers necessary
+ * to be able to manage window placement strategies.
+ */
void e_place_init(void);
+
+/**
+ * e_place_border - calculates window coordinates with given strategy
+ * @b: The border if the window for which to calculate coordinates
+ * @desk: The desktop on which to perform the calculation
+ * @x: Result pointer to an integer which gets the resulting x coordinate
+ * @y: Result pointer to an integer which gets the resulting y coordinate
+ * @mode: The placement mode. Any of the values in the E_Placement_Mode enum.
+ *
+ * This function calculates coordinates for a given window border
+ * and returns them in the @x and @y pointers. It does not actually
+ * place the window.
+ */
+int e_place_border(E_Border *b, E_Desktop *desk, int *x, int *y, E_Placement_Mode mode);
#endif
diff --git a/src/resist.c b/src/resist.c
index 04fb798b4..9fe28678e 100644
--- a/src/resist.c
+++ b/src/resist.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "resist.h"
#include "config.h"
#include "desktops.h"
@@ -16,6 +17,9 @@ e_resist_border(E_Border *b)
E_CFG_INT(cfg_resist, "settings", "/move/resist", 1);
E_CFG_INT(cfg_desk_resist, "settings", "/move/resist/desk", 32);
E_CFG_INT(cfg_win_resist, "settings", "/move/resist/win", 12);
+
+
+ D_ENTER;
E_CONFIG_INT_GET(cfg_resist, resist);
E_CONFIG_INT_GET(cfg_desk_resist, desk_resist);
@@ -24,9 +28,9 @@ e_resist_border(E_Border *b)
{
b->current.x = b->current.requested.x;
b->current.y = b->current.requested.y;
- return;
+ D_RETURN;
}
- if (!b->desk) return;
+ if (!b->desk) D_RETURN;
dx = b->current.requested.x - b->previous.requested.x;
dy = b->current.requested.y - b->previous.requested.y;
/* edges of screen */
@@ -131,4 +135,6 @@ rects = evas_list_append(rects, r); \
else
b->current.y = b->current.requested.y + resist_y;
}
+
+ D_RETURN;
}
diff --git a/src/scrollbar.c b/src/scrollbar.c
index 1f764ec65..73eb89949 100644
--- a/src/scrollbar.c
+++ b/src/scrollbar.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "scrollbar.h"
#include "config.h"
@@ -13,6 +14,8 @@ static void e_sb_bar_move_cb(void *data, Ebits_Object o, char *class, int bt, in
static void
e_scrollbar_recalc(E_Scrollbar *sb)
{
+ D_ENTER;
+
if (sb->base)
{
double x, y, w, h;
@@ -51,6 +54,8 @@ e_scrollbar_recalc(E_Scrollbar *sb)
sb->bar_pos.w = sb->bar_area.w;
sb->bar_pos.h = sb->bar_area.h;
}
+
+ D_RETURN;
UN(sb);
}
@@ -59,6 +64,8 @@ e_scrollbar_setup_bits(E_Scrollbar *sb)
{
char buf[PATH_MAX];
+ D_ENTER;
+
if (sb->direction == 1)
{
sprintf(buf, "%s/scroll_base_v.bits.db", e_config_get("scrollbars"));
@@ -90,6 +97,8 @@ e_scrollbar_setup_bits(E_Scrollbar *sb)
ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar", CALLBACK_MOUSE_UP, e_sb_bar_up_cb, sb);
ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar", CALLBACK_MOUSE_MOVE, e_sb_bar_move_cb, sb);
}
+
+ D_RETURN;
}
static void
@@ -98,10 +107,12 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
E_Scrollbar *sb;
double prev;
+ D_ENTER;
+
sb = data;
- if (sb->mouse_down) return;
+ if (sb->mouse_down) D_RETURN;
sb->mouse_down = bt;
- if (!class) return;
+ if (!class) D_RETURN;
prev = sb->val;
if (!strcmp(class, "Scrollbar_Arrow1"))
{
@@ -123,6 +134,8 @@ e_sb_base_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
{
if (sb->func_change) sb->func_change(sb->func_data, sb, sb->val);
}
+
+ D_RETURN;
}
static void
@@ -130,10 +143,12 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, i
{
E_Scrollbar *sb;
+ D_ENTER;
+
sb = data;
if (bt == sb->mouse_down) sb->mouse_down = 0;
- else return;
- if (!class) return;
+ else D_RETURN;
+ if (!class) D_RETURN;
if (!strcmp(class, "Scrollbar_Arrow1"))
{
}
@@ -143,6 +158,8 @@ e_sb_base_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, i
else if (!strcmp(class, "Scrollbar_Trough"))
{
}
+
+ D_RETURN;
}
static void
@@ -150,13 +167,17 @@ e_sb_bar_down_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
{
E_Scrollbar *sb;
+ D_ENTER;
+
sb = data;
- if (sb->mouse_down) return;
+ if (sb->mouse_down) D_RETURN;
sb->mouse_down = bt;
sb->down_x = x;
sb->down_y = y;
sb->mouse_x = x;
sb->mouse_y = y;
+
+ D_RETURN;
}
static void
@@ -164,9 +185,15 @@ e_sb_bar_up_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y, in
{
E_Scrollbar *sb;
+ D_ENTER;
+
sb = data;
- if (bt == sb->mouse_down) sb->mouse_down = 0;
- else return;
+ if (bt == sb->mouse_down)
+ sb->mouse_down = 0;
+ else
+ D_RETURN;
+
+ D_RETURN;
}
static void
@@ -176,8 +203,10 @@ e_sb_bar_move_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
int dx, dy;
double prev;
+ D_ENTER;
+
sb = data;
- if (!sb->mouse_down) return;
+ if (!sb->mouse_down) D_RETURN;
dx = x - sb->mouse_x;
dy = y - sb->mouse_y;
sb->mouse_x = x;
@@ -204,6 +233,8 @@ e_sb_bar_move_cb(void *data, Ebits_Object o, char *class, int bt, int x, int y,
if (sb->bar) ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
if (sb->func_change) sb->func_change(sb->func_data, sb, sb->val);
}
+
+ D_RETURN;
}
E_Scrollbar *
@@ -211,29 +242,38 @@ e_scrollbar_new(void)
{
E_Scrollbar *sb;
+ D_ENTER;
+
sb = NEW(E_Scrollbar, 1);
ZERO(sb, E_Scrollbar, 1);
sb->range = 1.0;
sb->max = 1.0;
sb->w = 12;
sb->h = 64;
- return sb;
+
+ D_RETURN_(sb);
}
void
e_scrollbar_free(E_Scrollbar *sb)
{
+ D_ENTER;
+
if (sb->evas)
{
if (sb->base) ebits_free(sb->base);
if (sb->bar) ebits_free(sb->bar);
}
FREE(sb);
+
+ D_RETURN;
}
void
e_scrollbar_add_to_evas(E_Scrollbar *sb, Evas evas)
{
+ D_ENTER;
+
if (sb->evas)
{
if (sb->base) ebits_free(sb->base);
@@ -256,53 +296,77 @@ e_scrollbar_add_to_evas(E_Scrollbar *sb, Evas evas)
if (sb->bar) ebits_show(sb->bar);
}
}
+
+ D_RETURN;
}
void
e_scrollbar_show(E_Scrollbar *sb)
{
- if (sb->visible) return;
+ D_ENTER;
+
+ if (sb->visible) D_RETURN;
sb->visible = 1;
if (sb->base) ebits_show(sb->base);
if (sb->bar) ebits_show(sb->bar);
+
+ D_RETURN;
}
void
e_scrollbar_hide(E_Scrollbar *sb)
{
- if (!sb->visible) return;
+ D_ENTER;
+
+ if (!sb->visible) D_RETURN;
sb->visible = 0;
if (sb->base) ebits_hide(sb->base);
if (sb->bar) ebits_hide(sb->bar);
+
+ D_RETURN;
}
void
e_scrollbar_raise(E_Scrollbar *sb)
{
+ D_ENTER;
+
if (sb->base) ebits_raise(sb->base);
if (sb->bar) ebits_raise(sb->bar);
+
+ D_RETURN;
}
void
e_scrollbar_lower(E_Scrollbar *sb)
{
+ D_ENTER;
+
if (sb->bar) ebits_lower(sb->bar);
if (sb->base) ebits_lower(sb->base);
+
+ D_RETURN;
}
void
e_scrollbar_set_layer(E_Scrollbar *sb, int l)
{
- if (l == sb->layer) return;
+ D_ENTER;
+
+ if (l == sb->layer) D_RETURN;
sb->layer = l;
if (sb->base) ebits_set_layer(sb->base, sb->layer);
if (sb->bar) ebits_set_layer(sb->bar, sb->layer);
+
+ D_RETURN;
}
void
e_scrollbar_set_direction(E_Scrollbar *sb, int d)
{
- if (d == sb->direction) return;
+ D_ENTER;
+
+ if (d == sb->direction) D_RETURN;
sb->direction = d;
if (sb->evas)
{
@@ -314,29 +378,39 @@ e_scrollbar_set_direction(E_Scrollbar *sb, int d)
sb->evas = NULL;
e_scrollbar_add_to_evas(sb, evas);
}
- }
+
+ D_RETURN;
+}
void
e_scrollbar_move(E_Scrollbar *sb, double x, double y)
{
- if ((x == sb->x) && (y == sb->y)) return;
+ D_ENTER;
+
+ if ((x == sb->x) && (y == sb->y)) D_RETURN;
sb->x = x;
sb->y = y;
if (sb->base) ebits_move(sb->base, sb->x, sb->y);
e_scrollbar_recalc(sb);
if (sb->bar) ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
+
+ D_RETURN;
}
void
e_scrollbar_resize(E_Scrollbar *sb, double w, double h)
{
- if ((w == sb->w) && (h == sb->h)) return;
+ D_ENTER;
+
+ if ((w == sb->w) && (h == sb->h)) D_RETURN;
sb->w = w;
sb->h = h;
if (sb->base) ebits_resize(sb->base, sb->w, sb->h);
e_scrollbar_recalc(sb);
if (sb->bar) ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
if (sb->bar) ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
+
+ D_RETURN;
}
void
@@ -344,14 +418,20 @@ e_scrollbar_set_change_func(E_Scrollbar *sb,
void (*func_change) (void *_data, E_Scrollbar *sb, double val),
void *data)
{
+ D_ENTER;
+
sb->func_change = func_change;
sb->func_data = data;
+
+ D_RETURN;
}
void
e_scrollbar_set_value(E_Scrollbar *sb, double val)
{
- if (sb->val == val) return;
+ D_ENTER;
+
+ if (sb->val == val) D_RETURN;
if (val > sb->max - sb->range) val = sb->max - sb->range;
if (val < 0 ) val = 0;
sb->val = val;
@@ -359,51 +439,71 @@ e_scrollbar_set_value(E_Scrollbar *sb, double val)
if (sb->bar) ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
if (sb->bar) ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
if (sb->func_change) sb->func_change(sb->func_data, sb, sb->val);
+
+ D_RETURN;
}
void
e_scrollbar_set_range(E_Scrollbar *sb, double range)
{
- if (sb->range == range) return;
+ D_ENTER;
+
+ if (sb->range == range) D_RETURN;
sb->range = range;
e_scrollbar_recalc(sb);
if (sb->bar) ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
if (sb->bar) ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
+
+ D_RETURN;
}
void
e_scrollbar_set_max(E_Scrollbar *sb, double max)
{
- if (sb->max == max) return;
+ D_ENTER;
+
+ if (sb->max == max) D_RETURN;
sb->max = max;
e_scrollbar_recalc(sb);
if (sb->bar) ebits_move(sb->bar, sb->bar_pos.x, sb->bar_pos.y);
if (sb->bar) ebits_resize(sb->bar, sb->bar_pos.w, sb->bar_pos.h);
+
+ D_RETURN;
}
double
e_scrollbar_get_value(E_Scrollbar *sb)
{
- return sb->val;
+ D_ENTER;
+
+ D_RETURN_(sb->val);
}
double
e_scrollbar_get_range(E_Scrollbar *sb)
{
- return sb->range;
+ D_ENTER;
+
+ D_RETURN_(sb->range);
}
double
e_scrollbar_get_max(E_Scrollbar *sb)
{
- return sb->max;
+ D_ENTER;
+
+ D_RETURN_(sb->max);
}
void
e_scrollbar_get_geometry(E_Scrollbar *sb, double *x, double *y, double *w, double *h)
{
+ D_ENTER;
+
if (x) *x = sb->x;
if (y) *y = sb->y;
if (w) *w = sb->w;
if (h) *h = sb->h;
+
+ D_RETURN;
}
diff --git a/src/text.c b/src/text.c
index 5c849c9d8..6a25e90af 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1,3 +1,4 @@
+#include "debug.h"
#include "text.h"
E_Text *
@@ -5,6 +6,8 @@ e_text_new(Evas evas, char *text, char *class)
{
E_Text *t;
+ D_ENTER;
+
t = NEW(E_Text, 1);
ZERO(t, E_Text, 1);
t->state = strdup("normal");
@@ -38,12 +41,15 @@ e_text_new(Evas evas, char *text, char *class)
t->min.h = t->h + 2;
t->max.w = t->w + 2;
t->max.h = t->h + 2;
- return t;
+
+ D_RETURN_(t);
}
void
e_text_free(E_Text *t)
{
+ D_ENTER;
+
IF_FREE(t->state);
IF_FREE(t->class);
IF_FREE(t->text);
@@ -57,13 +63,17 @@ e_text_free(E_Text *t)
evas_del_object(t->evas, t->obj.text);
}
FREE(t);
+
+ D_RETURN;
}
void
e_text_set_text(E_Text *t, char *text)
{
+ D_ENTER;
+
if (!text) text = "";
- if (!strcmp(t->text, text)) return;
+ if (!strcmp(t->text, text)) D_RETURN;
IF_FREE(t->text);
t->text = strdup(text);
evas_set_text(t->evas, t->obj.o1, t->text);
@@ -77,102 +87,138 @@ e_text_set_text(E_Text *t, char *text)
t->min.h = t->h + 2;
t->max.w = t->w + 2;
t->max.h = t->h + 2;
+
+ D_RETURN;
}
void
e_text_set_layer(E_Text *t, int l)
{
- if (t->layer == l) return;
+ D_ENTER;
+
+ if (t->layer == l) D_RETURN;
t->layer = l;
evas_set_layer(t->evas, t->obj.o1, t->layer);
evas_set_layer(t->evas, t->obj.o2, t->layer);
evas_set_layer(t->evas, t->obj.o3, t->layer);
evas_set_layer(t->evas, t->obj.o4, t->layer);
evas_set_layer(t->evas, t->obj.text, t->layer);
+
+ D_RETURN;
}
void
e_text_set_clip(E_Text *t, Evas_Object clip)
{
+ D_ENTER;
+
evas_set_clip(t->evas, t->obj.o1, clip);
evas_set_clip(t->evas, t->obj.o2, clip);
evas_set_clip(t->evas, t->obj.o3, clip);
evas_set_clip(t->evas, t->obj.o4, clip);
evas_set_clip(t->evas, t->obj.text, clip);
+
+ D_RETURN;
}
void
e_text_unset_clip(E_Text *t)
{
+ D_ENTER;
+
evas_unset_clip(t->evas, t->obj.o1);
evas_unset_clip(t->evas, t->obj.o2);
evas_unset_clip(t->evas, t->obj.o3);
evas_unset_clip(t->evas, t->obj.o4);
evas_unset_clip(t->evas, t->obj.text);
+
+ D_RETURN;
}
void
e_text_raise(E_Text *t)
{
+ D_ENTER;
+
evas_raise(t->evas, t->obj.o1);
evas_raise(t->evas, t->obj.o2);
evas_raise(t->evas, t->obj.o3);
evas_raise(t->evas, t->obj.o4);
evas_raise(t->evas, t->obj.text);
+
+ D_RETURN;
}
void
e_text_lower(E_Text *t)
{
+ D_ENTER;
+
evas_lower(t->evas, t->obj.text);
evas_lower(t->evas, t->obj.o4);
evas_lower(t->evas, t->obj.o3);
evas_lower(t->evas, t->obj.o2);
evas_lower(t->evas, t->obj.o1);
+
+ D_RETURN;
}
void
e_text_show(E_Text *t)
{
- if (t->visible) return;
+ D_ENTER;
+
+ if (t->visible) D_RETURN;
t->visible = 1;
evas_show(t->evas, t->obj.o1);
evas_show(t->evas, t->obj.o2);
evas_show(t->evas, t->obj.o3);
evas_show(t->evas, t->obj.o4);
evas_show(t->evas, t->obj.text);
+
+ D_RETURN;
}
void
e_text_hide(E_Text *t)
{
- if (!t->visible) return;
+ D_ENTER;
+
+ if (!t->visible) D_RETURN;
t->visible = 0;
evas_hide(t->evas, t->obj.o1);
evas_hide(t->evas, t->obj.o2);
evas_hide(t->evas, t->obj.o3);
evas_hide(t->evas, t->obj.o4);
evas_hide(t->evas, t->obj.text);
+
+ D_RETURN;
}
void
e_text_set_color(E_Text *t, int r, int g, int b, int a)
{
+ D_ENTER;
+
if ((r == t->color.r) &&
(g == t->color.g) &&
(b == t->color.b) &&
- (a == t->color.a)) return;
+ (a == t->color.a)) D_RETURN;
t->color.r = r;
t->color.g = g;
t->color.b = b;
t->color.a = a;
evas_set_color(t->evas, t->obj.text, t->color.r, t->color.g, t->color.b, t->color.a);
+
+ D_RETURN;
}
void
e_text_move(E_Text *t, double x, double y)
{
- if ((t->x == x) && (t->y == y)) return;
+ D_ENTER;
+
+ if ((t->x == x) && (t->y == y)) D_RETURN;
t->x = x;
t->y = y;
evas_move(t->evas, t->obj.o1, t->x + 1, t->y);
@@ -180,11 +226,17 @@ e_text_move(E_Text *t, double x, double y)
evas_move(t->evas, t->obj.o3, t->x + 2, t->y + 1);
evas_move(t->evas, t->obj.o4, t->x + 1, t->y + 2);
evas_move(t->evas, t->obj.text, t->x + 1, t->y + 1);
+
+ D_RETURN;
}
void
e_text_resize(E_Text *t, double w, double h)
{
+ D_ENTER;
+
+
+ D_RETURN;
UN(t);
UN(w);
UN(h);
@@ -193,42 +245,66 @@ e_text_resize(E_Text *t, double w, double h)
void
e_text_get_geometry(E_Text *t, double *x, double *y, double *w, double *h)
{
+ D_ENTER;
+
if (x) *x = t->x;
if (y) *y = t->y;
if (w) *w = t->w;
if (h) *h = t->h;
+
+ D_RETURN;
}
void
e_text_get_min_size(E_Text *t, double *w, double *h)
{
+ D_ENTER;
+
if (w) *w = t->min.w;
if (h) *h = t->min.h;
+
+ D_RETURN;
}
void
e_text_get_max_size(E_Text *t, double *w, double *h)
{
+ D_ENTER;
+
if (w) *w = t->max.w;
if (h) *h = t->max.h;
+
+ D_RETURN;
}
void
e_text_set_state(E_Text *t, char *state)
{
+ D_ENTER;
+
UN(t);
UN(state);
+
+ D_RETURN;
}
void
e_text_set_class(E_Text *t, char *class)
{
+ D_ENTER;
+
UN(t);
UN(class);
+
+ D_RETURN;
}
void
e_text_update_class(E_Text *t)
{
+ D_ENTER;
+
+
+ D_RETURN;
UN(t);
}
diff --git a/src/util.c b/src/util.c
index c4bf9f634..4931c2cb2 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,12 +1,16 @@
+#include "debug.h"
#include "util.h"
time_t
e_file_modified_time(char *file)
{
struct stat st;
+
+ D_ENTER;
- if (stat(file, &st) < 0) return 0;
- return st.st_mtime;
+ if (stat(file, &st) < 0) D_RETURN_(0);
+
+ D_RETURN_(st.st_mtime);
}
void
@@ -14,8 +18,12 @@ e_set_env(char *variable, char *content)
{
char env[PATH_MAX];
+ D_ENTER;
+
sprintf(env, "%s=%s", variable, content);
putenv(env);
+
+ D_RETURN;
}
int
@@ -23,8 +31,11 @@ e_file_exists(char *file)
{
struct stat st;
- if (stat(file, &st) < 0) return 0;
- return 1;
+ D_ENTER;
+
+ if (stat(file, &st) < 0) D_RETURN_(0);
+
+ D_RETURN_(1);
}
int
@@ -32,9 +43,12 @@ e_file_is_dir(char *file)
{
struct stat st;
- if (stat(file, &st) < 0) return 0;
- if (S_ISDIR(st.st_mode)) return 1;
- return 0;
+ D_ENTER;
+
+ if (stat(file, &st) < 0) D_RETURN_(0);
+ if (S_ISDIR(st.st_mode)) D_RETURN_(1);
+
+ D_RETURN_(0);
}
char *
@@ -42,11 +56,14 @@ e_file_home(void)
{
static char *home = NULL;
- if (home) return home;
+ D_ENTER;
+
+ if (home) D_RETURN_(home);
home = getenv("HOME");
if (!home) home = getenv("TMPDIR");
if (!home) home = "/tmp";
- return home;
+
+ D_RETURN_(home);
}
static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
@@ -54,8 +71,11 @@ static mode_t default_mode = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IXG
int
e_file_mkdir(char *dir)
{
- if (mkdir(dir, default_mode) < 0) return 0;
- return 1;
+ D_ENTER;
+
+ if (mkdir(dir, default_mode) < 0) D_RETURN_(0);
+
+ D_RETURN_(1);
}
int
@@ -65,18 +85,21 @@ e_file_cp(char *src, char *dst)
char buf[16384];
size_t num;
+ D_ENTER;
+
f1 = fopen(src, "rb");
- if (!f1) return 0;
+ if (!f1) D_RETURN_(0);
f2 = fopen(dst, "wb");
if (!f2)
{
fclose(f1);
- return 0;
+ D_RETURN_(0);
}
while ((num = fread(buf, 1, 16384, f1)) > 0) fwrite(buf, 1, num, f2);
fclose(f1);
fclose(f2);
- return 1;
+
+ D_RETURN_(1);
}
char *
@@ -85,9 +108,12 @@ e_file_real(char *file)
char buf[PATH_MAX];
char *f;
- if (!realpath(file, buf)) return strdup("");
+ D_ENTER;
+
+ if (!realpath(file, buf)) D_RETURN_(strdup(""));
e_strdup(f, buf);
- return f;
+
+ D_RETURN_(f);
}
char *
@@ -96,14 +122,17 @@ e_file_get_file(char *file)
char *p;
char *f;
+ D_ENTER;
+
p = strrchr(file, '/');
if (!p)
{
e_strdup(f, file);
- return f;
+ D_RETURN_(f);
}
e_strdup(f, &(p[1]));
- return f;
+
+ D_RETURN_(f);
}
char *
@@ -113,16 +142,19 @@ e_file_get_dir(char *file)
char *f;
char buf[PATH_MAX];
+ D_ENTER;
+
strcpy(buf, file);
p = strrchr(buf, '/');
if (!p)
{
e_strdup(f, file);
- return f;
+ D_RETURN_(f);
}
*p = 0;
e_strdup(f, buf);
- return f;
+
+ D_RETURN_(f);
}
void *
@@ -130,17 +162,23 @@ e_memdup(void *data, int size)
{
void *data_dup;
+ D_ENTER;
+
data_dup = malloc(size);
- if (!data_dup) return NULL;
+ if (!data_dup) D_RETURN_(NULL);
memcpy(data_dup, data, size);
- return data_dup;
+
+ D_RETURN_(data_dup);
}
int
e_glob_matches(char *str, char *glob)
{
- if (!fnmatch(glob, str, 0)) return 1;
- return 0;
+ D_ENTER;
+
+ if (!fnmatch(glob, str, 0)) D_RETURN_(1);
+
+ D_RETURN_(0);
}
int
@@ -151,7 +189,9 @@ e_file_can_exec(struct stat *st)
static gid_t gid = -1;
int ok;
- if (!st) return 0;
+ D_ENTER;
+
+ if (!st) D_RETURN_(0);
ok = 0;
if (!have_uid) uid = getuid();
if (!have_uid) gid = getgid();
@@ -168,7 +208,8 @@ e_file_can_exec(struct stat *st)
{
if (st->st_mode & S_IXOTH) ok = 1;
}
- return ok;
+
+ D_RETURN_(ok);
}
char *
@@ -178,10 +219,13 @@ e_file_link(char *link)
char *f;
int count;
- if ((count = readlink(link, buf, sizeof(buf))) < 0) return NULL;
+ D_ENTER;
+
+ if ((count = readlink(link, buf, sizeof(buf))) < 0) D_RETURN_(NULL);
buf[count] = 0;
e_strdup(f, buf);
- return f;
+
+ D_RETURN_(f);
}
Evas_List
@@ -191,8 +235,10 @@ e_file_list_dir(char *dir)
struct dirent *dp;
Evas_List list;
+ D_ENTER;
+
dirp = opendir(dir);
- if (!dirp) return NULL;
+ if (!dirp) D_RETURN_(NULL);
list = NULL;
while ((dp = readdir(dirp)))
{
@@ -218,5 +264,6 @@ e_file_list_dir(char *dir)
}
}
closedir(dirp);
- return list;
+
+ D_RETURN_(list);
}
diff --git a/src/view.c b/src/view.c
index 5fc071055..c13dcd0c4 100644
--- a/src/view.c
+++ b/src/view.c
@@ -1,5 +1,6 @@
#include <libefsd.h>
+#include "debug.h"
#include "view.h"
#include "cursors.h"
#include "background.h"
@@ -57,6 +58,8 @@ e_view_write_icon_xy_timeout(int val, void *data)
E_View *v;
Evas_List l;
E_Icon *ic;
+
+ D_ENTER;
v = data;
for (l = v->icons; l; l = l->next)
@@ -78,11 +81,15 @@ e_view_write_icon_xy_timeout(int val, void *data)
ic->geom.y);
}
}
+
+ D_RETURN;
}
void
e_view_selection_update(E_View *v)
{
+ D_ENTER;
+
if ((v->select.on) && (!v->select.obj.middle))
{
Evas_Gradient grad;
@@ -209,9 +216,9 @@ e_view_selection_update(E_View *v)
evas_del_object(v->evas, v->select.obj.grad_b);
evas_del_object(v->evas, v->select.obj.clip);
v->select.obj.middle = NULL;
- return;
+ D_RETURN;
}
- if (!v->select.on) return;
+ if (!v->select.on) D_RETURN;
/* move & resize select objects */
{
evas_move(v->evas, v->select.obj.edge_l, v->select.x, v->select.y + 1);
@@ -246,6 +253,8 @@ e_view_selection_update(E_View *v)
evas_show(v->evas, v->select.obj.grad_t);
evas_show(v->evas, v->select.obj.grad_b);
evas_show(v->evas, v->select.obj.clip);
+
+ D_RETURN;
}
static void
@@ -253,8 +262,12 @@ e_view_scrollbar_v_change_cb(void *_data, E_Scrollbar *sb, double val)
{
E_View *v;
+ D_ENTER;
+
v = _data;
e_view_scroll_to(v, v->scroll.x, v->spacing.window.t - sb->val);
+
+ D_RETURN;
UN(val);
}
@@ -263,8 +276,12 @@ e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar *sb, double val)
{
E_View *v;
+ D_ENTER;
+
v = _data;
e_view_scroll_to(v, v->spacing.window.l - sb->val, v->scroll.y);
+
+ D_RETURN;
UN(val);
}
@@ -274,7 +291,9 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ecore_Event_Mouse_Down *ev;
E_View *v;
- if (!current_ev) return;
+ D_ENTER;
+
+ if (!current_ev) D_RETURN;
ev = current_ev->event;
v = _data;
if (!(ev->mods & (mulit_select_mod | range_select_mod)))
@@ -306,8 +325,11 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
e_view_selection_update(v);
}
+
if( _b == 2 && ev->double_click )
ecore_event_loop_quit();
+
+ D_RETURN;
UN(_e);
UN(_o);
}
@@ -319,7 +341,9 @@ 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;
+ D_ENTER;
+
+ if (!current_ev) D_RETURN;
ev = current_ev->event;
v = _data;
dx = 0;
@@ -406,6 +430,8 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
v->select.x = _x;
v->select.y = _y;
}
+
+ D_RETURN;
UN(_e);
UN(_o);
}
@@ -416,7 +442,9 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ecore_Event_Mouse_Down *ev;
E_View *v;
- if (!current_ev) return;
+ D_ENTER;
+
+ if (!current_ev) D_RETURN;
ev = current_ev->event;
v = _data;
if (v->select.on)
@@ -443,6 +471,8 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
e_view_selection_update(v);
}
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -455,10 +485,12 @@ e_view_icon_update_state(E_Icon *ic)
int iw, ih;
int gw, gh;
+ D_ENTER;
+
if (!ic->info.icon)
{
printf("EEEEEEEEEEK %s has no icon\n", ic->file);
- return;
+ D_RETURN;
}
if (ic->state.clicked)
{
@@ -527,8 +559,10 @@ e_view_icon_update_state(E_Icon *ic)
gw = ic->geom.icon.w;
gh = ic->geom.icon.h;
e_view_icon_apply_xy(ic);
- if ((iw == gw) && (ih == gh)) return;
+ if ((iw == gw) && (ih == gh)) D_RETURN;
e_view_queue_resort(ic->view);
+
+ D_RETURN;
}
void
@@ -536,6 +570,8 @@ e_view_deselect_all(void)
{
Evas_List ll;
+ D_ENTER;
+
for (ll = views; ll; ll = ll->next)
{
Evas_List l;
@@ -550,6 +586,8 @@ e_view_deselect_all(void)
e_view_icon_deselect(ic);
}
}
+
+ D_RETURN;
}
void
@@ -557,6 +595,8 @@ e_view_deselect_all_except(E_Icon *not_ic)
{
Evas_List ll;
+ D_ENTER;
+
for (ll = views; ll; ll = ll->next)
{
Evas_List l;
@@ -572,40 +612,56 @@ e_view_deselect_all_except(E_Icon *not_ic)
e_view_icon_deselect(ic);
}
}
+
+ D_RETURN;
}
void
e_view_icon_invert_selection(E_Icon *ic)
{
+ D_ENTER;
+
if (ic->state.selected) e_view_icon_deselect(ic);
else e_view_icon_select(ic);
+
+ D_RETURN;
}
void
e_view_icon_select(E_Icon *ic)
{
+ D_ENTER;
+
if (!ic->state.selected)
{
ic->state.selected = 1;
ic->view->sel_count++;
e_view_icon_update_state(ic);
}
+
+ D_RETURN;
}
void
e_view_icon_deselect(E_Icon *ic)
{
+ D_ENTER;
+
if (ic->state.selected)
{
ic->state.selected = 0;
ic->view->sel_count--;
e_view_icon_update_state(ic);
}
+
+ D_RETURN;
}
void
e_view_icon_exec(E_Icon *ic)
{
+ D_ENTER;
+
if (!strcmp(ic->info.mime.base, "dir"))
{
E_View *v;
@@ -632,6 +688,8 @@ e_view_icon_exec(E_Icon *ic)
ecore_window_set_min_size(v->win.base, 8, 8);
}
e_view_icon_deselect(ic);
+
+ D_RETURN;
}
void
@@ -640,6 +698,8 @@ e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x, int *max
Evas_List l;
int x1, x2, y1, y2;
+ D_ENTER;
+
x1 = v->extents.x1;
x2 = v->extents.x2;
y1 = v->extents.y1;
@@ -656,7 +716,7 @@ e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x, int *max
if (min_y) *min_y = 0;
if (max_x) *max_x = 1;
if (max_y) *max_y = 1;
- return;
+ D_RETURN;
}
for (l = v->icons; l; l = l->next)
{
@@ -680,6 +740,8 @@ e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x, int *max
if (min_y) *min_y = y1;
if (max_x) *max_x = x2 - 1;
if (max_y) *max_y = y2 - 1;
+
+ D_RETURN;
}
void
@@ -687,6 +749,8 @@ e_view_icons_apply_xy(E_View *v)
{
Evas_List l;
+ D_ENTER;
+
for (l = v->icons; l; l = l->next)
{
E_Icon *ic;
@@ -694,6 +758,8 @@ e_view_icons_apply_xy(E_View *v)
ic = l->data;
e_view_icon_apply_xy(ic);
}
+
+ D_RETURN;
}
void
@@ -701,6 +767,8 @@ e_view_scroll_to(E_View *v, int sx, int sy)
{
int min_x, min_y, max_x, max_y;
+ D_ENTER;
+
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
if (sx < v->size.w - v->spacing.window.r - max_x)
sx = v->size.w - v->spacing.window.r - max_x;
@@ -710,17 +778,23 @@ e_view_scroll_to(E_View *v, int sx, int sy)
sy = v->size.h - v->spacing.window.b - max_y;
if (sy > v->spacing.window.t - min_y)
sy = v->spacing.window.t - min_y;
- if ((sx == v->scroll.x) && (v->scroll.y == sy)) return;
+ if ((sx == v->scroll.x) && (v->scroll.y == sy)) D_RETURN;
v->scroll.x = sx;
v->scroll.y = sy;
e_view_icons_apply_xy(v);
if (v->bg) e_background_set_scroll(v->bg, v->scroll.x, v->scroll.y);
+
+ D_RETURN;
}
void
e_view_scroll_by(E_View *v, int sx, int sy)
{
+ D_ENTER;
+
e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy);
+
+ D_RETURN;
}
void
@@ -729,6 +803,8 @@ e_view_scroll_to_percent(E_View *v, double psx, double psy)
int min_x, min_y, max_x, max_y;
int sx, sy;
+ D_ENTER;
+
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
sx = (psx * ((double)max_x - (double)min_x)) - min_x;
sy = (psy * ((double)max_y - (double)min_y)) - min_y;
@@ -740,11 +816,13 @@ e_view_scroll_to_percent(E_View *v, double psx, double psy)
sy = v->size.h - v->spacing.window.b - max_y;
if (sy > v->spacing.window.t - min_y)
sy = v->spacing.window.t - min_y;
- if ((sx == v->scroll.x) && (v->scroll.y == sy)) return;
+ if ((sx == v->scroll.x) && (v->scroll.y == sy)) D_RETURN;
v->scroll.x = sx;
v->scroll.y = sy;
e_view_icons_apply_xy(v);
if (v->bg) e_background_set_scroll(v->bg, v->scroll.x, v->scroll.y);
+
+ D_RETURN;
}
void
@@ -753,6 +831,8 @@ e_view_get_viewable_percentage(E_View *v, double *vw, double *vh)
int min_x, min_y, max_x, max_y;
double p;
+ D_ENTER;
+
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
if (min_x == max_x)
{
@@ -774,6 +854,8 @@ e_view_get_viewable_percentage(E_View *v, double *vw, double *vh)
((double)(max_y - min_y));
if (vh) *vh = p;
}
+
+ D_RETURN;
}
void
@@ -782,6 +864,8 @@ e_view_get_position_percentage(E_View *v, double *vx, double *vy)
int min_x, min_y, max_x, max_y;
double p;
+ D_ENTER;
+
e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
if (min_x == max_x)
{
@@ -801,6 +885,8 @@ e_view_get_position_percentage(E_View *v, double *vx, double *vy)
p = ((double)(v->scroll.y - min_y)) / ((double)(max_y - min_y));
if (vy) *vy = p;
}
+
+ D_RETURN;
}
static void
@@ -810,8 +896,10 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ecore_Event *ev;
Ecore_Event_Mouse_Down *e;
+ D_ENTER;
+
ev = e_view_get_current_event();
- if (!ev) return;
+ if (!ev) D_RETURN;
e = ev->event;
ic = _data;
ic->view->select.down.x = _x;
@@ -848,6 +936,8 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
else if (_b == 3)
{
}
+
+ D_RETURN;
UN(_e);
UN(_o);
}
@@ -859,8 +949,10 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ecore_Event *ev;
Ecore_Event_Mouse_Up *e;
+ D_ENTER;
+
ev = e_view_get_current_event();
- if (!ev) return;
+ if (!ev) D_RETURN;
e = ev->event;
ic = _data;
if (ic->view->drag.started)
@@ -870,7 +962,7 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
e_view_icon_update_state(ic);
ecore_window_destroy(ic->view->drag.win);
ic->view->drag.started = 0;
- return;
+ D_RETURN;
}
if (_b == 1)
{
@@ -895,6 +987,8 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
ic->state.clicked = 0;
e_view_icon_update_state(ic);
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_x);
@@ -906,8 +1000,12 @@ e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
E_Icon *ic;
+ D_ENTER;
+
ic = _data;
e_cursors_display_in_window(ic->view->win.main, "View_Icon");
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -922,6 +1020,8 @@ e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ic = _data;
e_cursors_display_in_window(ic->view->win.main, "View");
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -936,11 +1036,13 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
Ecore_Event *ev;
Ecore_Event_Mouse_Move *e;
+ D_ENTER;
+
ev = e_view_get_current_event();
- if (!ev) return;
+ if (!ev) D_RETURN;
e = ev->event;
ic = _data;
- if (!ic->state.clicked) return;
+ if (!ic->state.clicked) D_RETURN;
if (!ic->view->drag.started)
{
int dx, dy;
@@ -1019,7 +1121,7 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ic->view->drag.offset.x = downx - ic->view->drag.x;
ic->view->drag.offset.y = downy - ic->view->drag.y;
- if ((ww < 1) || (wh < 1)) return;
+ if ((ww < 1) || (wh < 1)) D_RETURN;
ic->view->drag.win = ecore_window_override_new(0, wx, wy, ww, wh);
pmap = ecore_pixmap_new(ic->view->drag.win, ww, wh, 0);
mask = ecore_pixmap_new(ic->view->drag.win, ww, wh, 1);
@@ -1062,7 +1164,7 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
if (!ic->info.icon)
{
printf("EEEEEEEEEEK %s has no icon\n", ic->file);
- return;
+ D_RETURN;
}
if (ic->state.clicked)
{
@@ -1132,6 +1234,8 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ic->view->drag.update = 1;
ic->view->changed = 1;
}
+
+ D_RETURN;
UN(_e);
UN(_o);
UN(_b);
@@ -1142,6 +1246,8 @@ e_idle(void *data)
{
Evas_List l;
+ D_ENTER;
+
for (l = views; l; l = l->next)
{
E_View *v;
@@ -1149,13 +1255,16 @@ e_idle(void *data)
v = l->data;
e_view_update(v);
}
- return;
+
+ D_RETURN;
UN(data);
}
void
e_view_geometry_record(E_View *v)
{
+ D_ENTER;
+
if (e_fs_get_connection())
{
int left, top;
@@ -1175,6 +1284,8 @@ e_view_geometry_record(E_View *v)
"/view/h", v->dir,
v->size.h);
}
+
+ D_RETURN;
}
static void
@@ -1182,8 +1293,12 @@ e_view_geometry_record_timeout(int val, void *data)
{
E_View *v;
+ D_ENTER;
+
v = data;
e_view_geometry_record(v);
+
+ D_RETURN;
UN(val);
}
@@ -1192,8 +1307,12 @@ e_view_queue_geometry_record(E_View *v)
{
char name[PATH_MAX];
+ D_ENTER;
+
sprintf(name, "geometry_record.%s", v->dir);
ecore_add_event_timer(name, 0.10, e_view_geometry_record_timeout, 0, v);
+
+ D_RETURN;
}
void
@@ -1201,8 +1320,12 @@ e_view_queue_icon_xy_record(E_View *v)
{
char name[PATH_MAX];
+ D_ENTER;
+
sprintf(name, "icon_xy_record.%s", v->dir);
ecore_add_event_timer(name, 0.10, e_view_write_icon_xy_timeout, 0, v);
+
+ D_RETURN;
}
@@ -1212,6 +1335,8 @@ e_configure(Ecore_Event * ev)
Ecore_Event_Window_Configure *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1269,6 +1394,8 @@ e_configure(Ecore_Event * ev)
}
}
}
+
+ D_RETURN;
}
static void
@@ -1277,6 +1404,8 @@ e_property(Ecore_Event * ev)
Ecore_Event_Window_Configure *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1287,6 +1416,8 @@ e_property(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1295,6 +1426,8 @@ e_unmap(Ecore_Event * ev)
Ecore_Event_Window_Unmap *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1305,6 +1438,8 @@ e_unmap(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1313,6 +1448,8 @@ e_visibility(Ecore_Event * ev)
Ecore_Event_Window_Unmap *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1323,6 +1460,8 @@ e_visibility(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1331,6 +1470,8 @@ e_focus_in(Ecore_Event * ev)
Ecore_Event_Window_Focus_In *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1341,6 +1482,8 @@ e_focus_in(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1349,6 +1492,8 @@ e_focus_out(Ecore_Event * ev)
Ecore_Event_Window_Focus_Out *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1359,6 +1504,8 @@ e_focus_out(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1367,6 +1514,8 @@ e_delete(Ecore_Event * ev)
Ecore_Event_Window_Delete *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1375,10 +1524,12 @@ e_delete(Ecore_Event * ev)
v = l->data;
if (e->win == v->win.base)
{
- OBJ_DO_FREE(v);
- return;
+ e_object_unref(E_OBJECT(v));
+ D_RETURN;
}
}
+
+ D_RETURN;
}
static void
@@ -1387,6 +1538,8 @@ e_wheel(Ecore_Event * ev)
Ecore_Event_Wheel *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1397,6 +1550,8 @@ e_wheel(Ecore_Event * ev)
{
}
}
+
+ D_RETURN;
}
static void
@@ -1405,6 +1560,8 @@ e_key_down(Ecore_Event * ev)
Ecore_Event_Key_Down *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1442,9 +1599,11 @@ e_key_down(Ecore_Event * ev)
{
}
}
- return;
+ D_RETURN;
}
}
+
+ D_RETURN;
}
static void
@@ -1453,14 +1612,18 @@ e_key_up(Ecore_Event * ev)
Ecore_Event_Key_Up *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
- return;
+ D_RETURN;
for (l = views; l; l = l->next)
{
E_View *v;
v = l->data;
}
+
+ D_RETURN;
}
static void
@@ -1469,6 +1632,8 @@ e_mouse_down(Ecore_Event * ev)
Ecore_Event_Mouse_Down *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
@@ -1486,10 +1651,12 @@ e_mouse_down(Ecore_Event * ev)
ecore_focus_to_window(v->win.base);
evas_event_button_down(v->evas, e->x, e->y, e->button);
current_ev = NULL;
- return;
+ D_RETURN;
}
}
current_ev = NULL;
+
+ D_RETURN;
}
static void
@@ -1498,6 +1665,8 @@ e_mouse_up(Ecore_Event * ev)
Ecore_Event_Mouse_Up *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
@@ -1509,10 +1678,12 @@ e_mouse_up(Ecore_Event * ev)
{
evas_event_button_up(v->evas, e->x, e->y, e->button);
current_ev = NULL;
- return;
+ D_RETURN;
}
}
current_ev = NULL;
+
+ D_RETURN;
}
static void
@@ -1521,6 +1692,8 @@ e_mouse_move(Ecore_Event * ev)
Ecore_Event_Mouse_Move *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
@@ -1532,10 +1705,12 @@ e_mouse_move(Ecore_Event * ev)
{
evas_event_move(v->evas, e->x, e->y);
current_ev = NULL;
- return;
+ D_RETURN;
}
}
current_ev = NULL;
+
+ D_RETURN;
}
static void
@@ -1544,6 +1719,8 @@ e_mouse_in(Ecore_Event * ev)
Ecore_Event_Window_Enter *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
@@ -1558,10 +1735,12 @@ e_mouse_in(Ecore_Event * ev)
evas_event_enter(v->evas);
}
current_ev = NULL;
- return;
+ D_RETURN;
}
}
current_ev = NULL;
+
+ D_RETURN;
}
static void
@@ -1570,6 +1749,8 @@ e_mouse_out(Ecore_Event * ev)
Ecore_Event_Window_Leave *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
current_ev = ev;
for (l = views; l; l = l->next)
@@ -1581,10 +1762,12 @@ e_mouse_out(Ecore_Event * ev)
{
evas_event_leave(v->evas);
current_ev = NULL;
- return;
+ D_RETURN;
}
}
current_ev = NULL;
+
+ D_RETURN;
}
static void
@@ -1593,6 +1776,8 @@ e_window_expose(Ecore_Event * ev)
Ecore_Event_Window_Expose *e;
Evas_List l;
+ D_ENTER;
+
e = ev->event;
for (l = views; l; l = l->next)
{
@@ -1604,9 +1789,11 @@ e_window_expose(Ecore_Event * ev)
if (!(v->pmap))
evas_update_rect(v->evas, e->x, e->y, e->w, e->h);
v->changed = 1;
- return;
+ D_RETURN;
}
}
+
+ D_RETURN;
}
static void
@@ -1615,6 +1802,8 @@ e_view_handle_fs_restart(void *data)
E_View *v;
Evas_List icons = NULL, l;
+ D_ENTER;
+
v = data;
printf("e_view_handle_fs_restart\n");
@@ -1662,26 +1851,38 @@ e_view_handle_fs_restart(void *data)
}
printf("restarted monitor id (connection = %p), %i for %s\n", e_fs_get_connection(), v->monitor_id, v->dir);
v->is_listing = 1;
+
+ D_RETURN;
}
Ecore_Event *
e_view_get_current_event(void)
{
- return current_ev;
+ D_ENTER;
+
+ D_RETURN_(current_ev);
}
int
e_view_filter_file(E_View *v, char *file)
{
- if (file[0] == '.') return 0;
- return 1;
+ D_ENTER;
+
+ if (file[0] == '.')
+ D_RETURN_(0);
+
+ D_RETURN_(1);
UN(v);
}
-void
-e_view_icon_free(E_Icon *ic)
+static void
+e_view_icon_cleanup(E_Icon *ic)
{
- FREE(ic);
+ D_ENTER;
+
+ e_object_cleanup(E_OBJECT(ic));
+
+ D_RETURN;
}
E_Icon *
@@ -1689,10 +1890,14 @@ e_view_icon_new(void)
{
E_Icon *ic;
+ D_ENTER;
+
ic = NEW(E_Icon, 1);
ZERO(ic, E_Icon, 1);
- OBJ_INIT(ic, e_view_icon_free);
- return ic;
+
+ e_object_init(E_OBJECT(ic), (E_Cleanup_Func) e_view_icon_cleanup);
+
+ D_RETURN_(ic);
}
E_Icon *
@@ -1700,21 +1905,25 @@ e_view_find_icon_by_file(E_View *view, char *file)
{
Evas_List l;
+ D_ENTER;
+
for (l = view->icons; l; l = l->next)
{
E_Icon *ic;
ic = l->data;
if ((ic) && (ic->file) && (file) && (!strcmp(ic->file, file)))
- return ic;
+ D_RETURN_(ic);
}
- return NULL;
+ D_RETURN_(NULL);
}
void
e_view_icon_show(E_Icon *ic)
{
- if (ic->state.visible) return;
+ D_ENTER;
+
+ if (ic->state.visible) D_RETURN;
ic->state.visible = 1;
if (!ic->obj.event1)
{
@@ -1742,22 +1951,30 @@ e_view_icon_show(E_Icon *ic)
e_text_show(ic->obj.text);
evas_show(ic->view->evas, ic->obj.event1);
evas_show(ic->view->evas, ic->obj.event2);
+
+ D_RETURN;
}
void
e_view_icon_hide(E_Icon *ic)
{
- if (!ic->state.visible) return;
+ D_ENTER;
+
+ if (!ic->state.visible) D_RETURN;
ic->state.visible = 0;
evas_hide(ic->view->evas, ic->obj.icon);
e_text_hide(ic->obj.text);
evas_hide(ic->view->evas, ic->obj.event1);
evas_hide(ic->view->evas, ic->obj.event2);
+
+ D_RETURN;
}
void
e_view_icon_apply_xy(E_Icon *ic)
{
+ D_ENTER;
+
/* threse calc icon extents for: */
/* [I] */
/* Ig */
@@ -1846,6 +2063,8 @@ e_view_icon_apply_xy(E_Icon *ic)
ic->prev_geom.y = ic->geom.y;
ic->prev_geom.w = ic->geom.w;
ic->prev_geom.h = ic->geom.h;
+
+ D_RETURN;
}
static int
@@ -1853,9 +2072,12 @@ e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
{
E_Icon *ic, *ic2;
+ D_ENTER;
+
ic = *((E_Icon **)data1);
ic2 = *((E_Icon **)data2);
- return (strcmp(ic->file, ic2->file));
+
+ D_RETURN_(strcmp(ic->file, ic2->file));
}
void
@@ -1865,7 +2087,9 @@ e_view_resort_alphabetical(E_View *v)
E_Icon **array;
int i, count;
- if (!v->icons) return;
+ D_ENTER;
+
+ if (!v->icons) D_RETURN;
for (count = 0, l = v->icons; l; l = l->next) count++;
array = malloc(sizeof(E_Icon *) * count);
for (i = 0, l = v->icons; l; l = l->next) array[i++] = l->data;
@@ -1879,6 +2103,8 @@ e_view_resort_alphabetical(E_View *v)
v->icons = icons;
printf("done...\n");
+
+ D_RETURN;
}
void
@@ -1889,6 +2115,8 @@ e_view_arrange(E_View *v)
int x1, x2, y1, y2;
double sv, sr, sm;
+ D_ENTER;
+
x = v->spacing.window.l;
y = v->spacing.window.t;
for (l = v->icons; l; l = l->next)
@@ -1929,13 +2157,19 @@ e_view_arrange(E_View *v)
e_scrollbar_set_max(v->scrollbar.h, sm);
if (sr < sm) e_scrollbar_show(v->scrollbar.h);
else e_scrollbar_hide(v->scrollbar.h);
+
+ D_RETURN;
}
void
e_view_resort(E_View *v)
{
+ D_ENTER;
+
e_view_resort_alphabetical(v);
e_view_arrange(v);
+
+ D_RETURN;
}
static void
@@ -1943,9 +2177,13 @@ e_view_resort_timeout(int val, void *data)
{
E_View *v;
+ D_ENTER;
+
v = data;
e_view_resort(v);
v->have_resort_queued = 0;
+
+ D_RETURN;
UN(val);
}
@@ -1954,18 +2192,24 @@ e_view_queue_resort(E_View *v)
{
char name[PATH_MAX];
- if (v->have_resort_queued) return;
+ D_ENTER;
+
+ if (v->have_resort_queued) D_RETURN;
v->have_resort_queued = 1;
sprintf(name, "resort_timer.%s", v->dir);
ecore_add_event_timer(name, 1.0, e_view_resort_timeout, 0, v);
+
+ D_RETURN;
}
void
e_view_icon_initial_show(E_Icon *ic)
{
+ D_ENTER;
+
/* check if we have enuf info and we havent been shown yet */
- if (!ic->info.icon) return;
- if (ic->state.visible) return;
+ if (!ic->info.icon) D_RETURN;
+ if (ic->state.visible) D_RETURN;
/* first. lets figure out the size of the icon */
evas_get_image_size(ic->view->evas, ic->obj.icon,
@@ -1988,6 +2232,8 @@ e_view_icon_initial_show(E_Icon *ic)
/* actually show the icon */
e_view_icon_apply_xy(ic);
e_view_icon_show(ic);
+
+ D_RETURN;
}
void
@@ -1995,11 +2241,13 @@ e_view_icon_set_mime(E_Icon *ic, char *base, char *mime)
{
int diff = 0;
+ D_ENTER;
+
if (!ic->info.mime.base) diff = 1;
if (!ic->info.mime.type) diff = 1;
if ((ic->info.mime.base) && (strcmp(ic->info.mime.base, base))) diff = 1;
if ((ic->info.mime.type) && (strcmp(ic->info.mime.base, mime))) diff = 1;
- if (!diff) return;
+ if (!diff) D_RETURN;
if (ic->info.mime.base) free(ic->info.mime.base);
if (ic->info.mime.type) free(ic->info.mime.type);
ic->info.mime.base = NULL;
@@ -2017,7 +2265,7 @@ e_view_icon_set_mime(E_Icon *ic, char *base, char *mime)
ic->info.icon = strdup(ic->info.custom_icon);
evas_set_image_file(ic->view->evas, ic->obj.icon, ic->info.custom_icon);
e_view_queue_resort(ic->view);
- return;
+ D_RETURN;
}
/* find an icon */
{
@@ -2057,11 +2305,15 @@ e_view_icon_set_mime(E_Icon *ic, char *base, char *mime)
ic->info.icon = strdup(icon);
}
e_view_icon_update_state(ic);
+
+ D_RETURN;
}
void
e_view_icon_set_link(E_Icon *ic, char *link)
{
+ D_ENTER;
+
if ((!link) && (ic->info.link))
{
free(ic->info.link);
@@ -2077,6 +2329,8 @@ e_view_icon_set_link(E_Icon *ic, char *link)
/* effect changes here */
}
}
+
+ D_RETURN;
}
void
@@ -2084,15 +2338,17 @@ e_view_file_added(int id, char *file)
{
E_View *v;
+ D_ENTER;
+
/* if we get a path - ignore it - its not a file in the a dir */
- if (!file) return;
+ if (!file) D_RETURN;
/* printf("FILE ADD: %s\n", file);*/
- if (file[0] == '/') return;
+ if (file[0] == '/') D_RETURN;
v = e_view_find_by_monitor_id(id);
- if (!v) return;
+ if (!v) D_RETURN;
e_iconbar_file_add(v, file);
/* filter files here */
- if (!e_view_filter_file(v, file)) return;
+ if (!e_view_filter_file(v, file)) D_RETURN;
if (!e_view_find_icon_by_file(v, file))
{
E_Icon *ic;
@@ -2106,6 +2362,8 @@ e_view_file_added(int id, char *file)
v->icons = evas_list_append(v->icons, ic);
v->extents.valid = 0;
}
+
+ D_RETURN;
}
void
@@ -2113,11 +2371,13 @@ e_view_file_deleted(int id, char *file)
{
E_View *v;
- if (!file) return;
- if (file[0] == '/') return;
+ D_ENTER;
+
+ if (!file) D_RETURN;
+ if (file[0] == '/') D_RETURN;
v = e_view_find_by_monitor_id(id);
e_iconbar_file_delete(v, file);
- if (!v) return;
+ if (!v) D_RETURN;
{
E_Icon *ic;
@@ -2125,13 +2385,15 @@ e_view_file_deleted(int id, char *file)
if (ic)
{
e_view_icon_hide(ic);
- OBJ_DO_FREE(ic);
+ e_object_unref(E_OBJECT(ic));
v->icons = evas_list_remove(v->icons, ic);
v->changed = 1;
v->extents.valid = 0;
e_view_queue_resort(v);
}
}
+
+ D_RETURN;
}
void
@@ -2139,11 +2401,13 @@ e_view_file_changed(int id, char *file)
{
E_View *v;
- if (!file) return;
- if (file[0] == '/') return;
+ D_ENTER;
+
+ if (!file) D_RETURN;
+ if (file[0] == '/') D_RETURN;
v = e_view_find_by_monitor_id(id);
e_iconbar_file_change(v, file);
- if (!v) return;
+ if (!v) D_RETURN;
{
E_Icon *ic;
@@ -2153,6 +2417,8 @@ e_view_file_changed(int id, char *file)
{
}
}
+
+ D_RETURN;
}
void
@@ -2160,12 +2426,14 @@ e_view_file_moved(int id, char *file)
{
E_View *v;
+ D_ENTER;
+
/* never gets called ? */
- if (!file) return;
+ if (!file) D_RETURN;
printf(".!WOW!. e_view_file_moved(%i, %s);\n", id, file);
- if (file[0] == '/') return;
+ if (file[0] == '/') D_RETURN;
v = e_view_find_by_monitor_id(id);
- if (!v) return;
+ if (!v) D_RETURN;
{
E_Icon *ic;
@@ -2175,6 +2443,8 @@ e_view_file_moved(int id, char *file)
{
}
}
+
+ D_RETURN;
}
E_View *
@@ -2182,22 +2452,29 @@ e_view_find_by_monitor_id(int id)
{
Evas_List l;
+ D_ENTER;
+
for (l = views; l; l = l->next)
{
E_View *v;
v = l->data;
- if (v->monitor_id == id) return v;
+ if (v->monitor_id == id)
+ D_RETURN_(v);
}
- return NULL;
+
+ D_RETURN_(NULL);
}
-void
-e_view_free(E_View *v)
+static void
+e_view_cleanup(E_View *v)
{
char name[PATH_MAX];
- if (v->iconbar) OBJ_DO_FREE(v->iconbar);
+ D_ENTER;
+
+ if (v->iconbar)
+ e_object_unref(E_OBJECT(v->iconbar));
sprintf(name, "resort_timer.%s", v->dir);
ecore_del_event_timer(name);
@@ -2213,8 +2490,10 @@ e_view_free(E_View *v)
v->restarter = NULL;
ecore_window_destroy(v->win.base);
+ /* Call the destructor of the base class */
+ e_object_cleanup(E_OBJECT(v));
- FREE(v);
+ D_RETURN;
}
E_View *
@@ -2222,9 +2501,13 @@ e_view_new(void)
{
E_View *v;
+ D_ENTER;
+
v = NEW(E_View, 1);
ZERO(v, E_View, 1);
- OBJ_INIT(v, e_view_free);
+
+ e_object_init(E_OBJECT(v), (E_Cleanup_Func) e_view_cleanup);
+
#define SOFT_DESK
/* #define X_DESK */
/* #define GL_DESK */
@@ -2267,18 +2550,24 @@ _member.r = _r; _member.g = _g; _member.b = _b; _member.a = _a;
v->spacing.icon.b = 7;
views = evas_list_append(views, v);
- return v;
+ D_RETURN_(v);
}
void
e_view_set_background(E_View *v)
{
+ D_ENTER;
+
v->changed = 1;
+
+ D_RETURN;
}
void
e_view_set_dir(E_View *v, char *dir)
{
+ D_ENTER;
+
/* stop monitoring old dir */
if ((v->dir) && (v->monitor_id))
{
@@ -2315,6 +2604,8 @@ e_view_set_dir(E_View *v, char *dir)
v->is_listing = 1;
v->changed = 1;
}
+
+ D_RETURN;
}
void
@@ -2325,7 +2616,9 @@ e_view_realize(E_View *v)
int image_cache = 8192 * 1024;
char *font_dir;
- if (v->evas) return;
+ D_ENTER;
+
+ if (v->evas) D_RETURN;
v->win.base = ecore_window_new(0,
v->location.x, v->location.y,
v->size.w, v->size.h);
@@ -2410,6 +2703,8 @@ e_view_realize(E_View *v)
if (v->iconbar) e_iconbar_realize(v->iconbar);
v->changed = 1;
+
+ D_RETURN;
}
void
@@ -2417,6 +2712,8 @@ e_view_update(E_View *v)
{
Evas_List l;
+ D_ENTER;
+
if (v->changed)
{
for (l = v->icons; l; l = l->next)
@@ -2455,12 +2752,16 @@ e_view_update(E_View *v)
else
evas_render(v->evas);
v->changed = 0;
+
+ D_RETURN;
}
static void
e_view_handle_fs(EfsdEvent *ev)
{
+ D_ENTER;
+
switch (ev->type)
{
case EFSD_EVENT_FILECHANGE:
@@ -2747,7 +3048,7 @@ e_view_handle_fs(EfsdEvent *ev)
b->client.internal = 1;
e_border_remove_click_grab(b);
}
- return;
+ D_RETURN;
}
}
}
@@ -2773,11 +3074,15 @@ e_view_handle_fs(EfsdEvent *ev)
default:
break;
}
+
+ D_RETURN;
}
void
e_view_init(void)
{
+ D_ENTER;
+
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
@@ -2796,4 +3101,6 @@ e_view_init(void)
ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_DELETE, e_delete);
ecore_event_filter_idle_handler_add(e_idle, NULL);
e_fs_add_event_handler(e_view_handle_fs);
+
+ D_RETURN;
}
diff --git a/src/view.h b/src/view.h
index 4542e9aef..d11565078 100644
--- a/src/view.h
+++ b/src/view.h
@@ -7,6 +7,7 @@
#include "fs.h"
#include "text.h"
#include "iconbar.h"
+#include "object.h"
#ifndef E_VIEW_TYPEDEF
#define E_VIEW_TYPEDEF
@@ -24,7 +25,7 @@ typedef struct _E_Iconbar E_Iconbar;
struct _E_View
{
- OBJ_PROPERTIES;
+ E_Object o;
char *dir;
@@ -146,7 +147,7 @@ struct _E_View
struct _E_Icon
{
- OBJ_PROPERTIES;
+ E_Object o;
char *file;
@@ -230,7 +231,6 @@ void e_view_icon_invert_selection(E_Icon *ic);
void e_view_icon_select(E_Icon *ic);
void e_view_icon_deselect(E_Icon *ic);
void e_view_icon_exec(E_Icon *ic);
-void e_view_icon_free(E_Icon *ic);
void e_view_icon_initial_show(E_Icon *ic);
void e_view_icon_set_mime(E_Icon *ic, char *base, char *mime);
void e_view_icon_set_link(E_Icon *ic, char *link);
@@ -250,7 +250,6 @@ void e_view_file_deleted(int id, char *file);
void e_view_file_changed(int id, char *file);
void e_view_file_moved(int id, char *file);
E_View *e_view_find_by_monitor_id(int id);
-void e_view_free(E_View *v);
E_View *e_view_new(void);
void e_view_set_background(E_View *v);
void e_view_set_dir(E_View *v, char *dir);