aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbdpngn <rbdpngn>2003-01-15 18:29:56 +0000
committerrbdpngn <rbdpngn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2003-01-15 18:29:56 +0000
commit63e20e7f14fdca0cf3c85c38593a4a058747ae30 (patch)
tree8a1c5b1147fd56666579d35f2f8ea591ea7520a4
parentaeac895ef7a24971b19b59a876002f235b1132b1 (diff)
downloadenlightenment-63e20e7f14fdca0cf3c85c38593a4a058747ae30.tar.gz
enlightenment-63e20e7f14fdca0cf3c85c38593a4a058747ae30.tar.xz
enlightenment-63e20e7f14fdca0cf3c85c38593a4a058747ae30.zip
More SPLIT merging.
SVN revision: 6588
-rw-r--r--Makefile.am2
-rw-r--r--README12
-rwxr-xr-xautogen.sh4
-rw-r--r--configure.ac1
-rw-r--r--configure.in1
-rw-r--r--data/config/behavior/default/behavior.dbbin0 -> 155646 bytes
-rwxr-xr-xdata/scripts/build_db.sh38
-rw-r--r--po/ChangeLog27
-rwxr-xr-xsetup-gettext.sh202
-rw-r--r--src/Makefile.am13
-rw-r--r--src/actions.c205
-rw-r--r--src/actions.h7
-rw-r--r--src/background.c39
-rw-r--r--src/background.h10
-rw-r--r--src/block.c4
-rw-r--r--src/border.c876
-rw-r--r--src/border.h18
-rw-r--r--src/bordermenu.c65
-rw-r--r--src/bordermenu.h1
-rw-r--r--src/config.c507
-rw-r--r--src/config.h247
-rw-r--r--src/cursors.c4
-rw-r--r--src/data.c220
-rw-r--r--src/data.h97
-rw-r--r--src/debug.c2
-rw-r--r--src/delayed.c8
-rw-r--r--src/delayed.h6
-rw-r--r--src/desktops.c888
-rw-r--r--src/desktops.h49
-rw-r--r--src/e.h7
-rw-r--r--src/e_dir.c92
-rw-r--r--src/e_dir.h2
-rw-r--r--src/e_ferite.c76
-rw-r--r--src/e_ferite.fec170
-rw-r--r--src/e_ferite.h30
-rw-r--r--src/e_file.c9
-rw-r--r--src/e_file.h2
-rw-r--r--src/e_view_look.c15
-rw-r--r--src/e_view_machine.c12
-rw-r--r--src/e_view_machine.h6
-rw-r--r--src/embed.c64
-rw-r--r--src/embed.h4
-rw-r--r--src/entry.c167
-rw-r--r--src/entry.h12
-rw-r--r--src/epplet.c821
-rw-r--r--src/epplet.h123
-rw-r--r--src/exec.c6
-rw-r--r--src/file.c8
-rw-r--r--src/file.h2
-rw-r--r--src/focus.c2
-rw-r--r--src/fs.c8
-rw-r--r--src/guides.c103
-rw-r--r--src/iconbar.c456
-rw-r--r--src/iconbar.h15
-rw-r--r--src/icons.c173
-rw-r--r--src/icons.h6
-rw-r--r--src/main.c43
-rw-r--r--src/menu.c197
-rw-r--r--src/menu.h13
-rw-r--r--src/menubuild.c40
-rw-r--r--src/menubuild.h5
-rw-r--r--src/observer.c10
-rw-r--r--src/observer.h44
-rw-r--r--src/place.c10
-rw-r--r--src/resist.c20
-rw-r--r--src/scrollbar.c22
-rw-r--r--src/scrollbar.h4
-rw-r--r--src/text.c173
-rw-r--r--src/text.h16
-rw-r--r--src/util.c98
-rw-r--r--src/util.h17
-rw-r--r--src/view.c406
-rw-r--r--src/view.h30
-rw-r--r--src/view_layout.c63
-rw-r--r--src/view_layout.h9
-rw-r--r--tools/e_setup.c293
76 files changed, 3700 insertions, 3757 deletions
diff --git a/Makefile.am b/Makefile.am
index 71abbe967..c92690045 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
## Process this file with automake to produce Makefile.in
-SUBDIRS = intl po src lib client tools doc
+SUBDIRS = po src lib client tools doc
MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
config.h.in config.sub configure install-sh \
diff --git a/README b/README
index 218dbe159..35d56eb66 100644
--- a/README
+++ b/README
@@ -1,3 +1,15 @@
+Additional notes
+
+todo
+ entry.c - check 'todo' entries (although nobody uses entries except for
+ me in med, do they?)
+ guides.c - imlib parts that aren't converted yet.
+ text.c
+ menu.c
+ menubuild.c - e_observer_init() call.
+ border.c - use e_evas_new_all in place of the inlined code. cleanup.
+
+
+-----------------------------------------------------------------------------+
| Enlightenment 0.17.pre CVS Code.... |
+-----------------------------------------------------------------------------+
diff --git a/autogen.sh b/autogen.sh
index 4e702b73e..99abbd3fd 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -111,7 +111,7 @@ do
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
- echo "no" | gettextize --force --copy || abort "gettextize"
+ echo "no" | setup-gettext.sh
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
@@ -120,7 +120,7 @@ do
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running gettextize... Ignore non-fatal messages."
- echo "no" | gettextize --force --copy || abort "gettextize"
+ echo "no" | setup-gettext.sh
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
diff --git a/configure.ac b/configure.ac
index 39b6dc445..80f04f52c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -234,7 +234,6 @@ Makefile
src/Makefile
lib/Makefile
client/Makefile
-intl/Makefile
po/Makefile.in
tools/Makefile
doc/Makefile
diff --git a/configure.in b/configure.in
index d04879932..6f3b040c7 100644
--- a/configure.in
+++ b/configure.in
@@ -233,7 +233,6 @@ Makefile
src/Makefile
lib/Makefile
client/Makefile
-intl/Makefile
po/Makefile.in
tools/Makefile
doc/Makefile
diff --git a/data/config/behavior/default/behavior.db b/data/config/behavior/default/behavior.db
new file mode 100644
index 000000000..aeb15ca46
--- /dev/null
+++ b/data/config/behavior/default/behavior.db
Binary files differ
diff --git a/data/scripts/build_db.sh b/data/scripts/build_db.sh
index 53e464019..2005dbd2f 100755
--- a/data/scripts/build_db.sh
+++ b/data/scripts/build_db.sh
@@ -27,11 +27,26 @@ WINDOW_MODE_BORDER=1
WINDOW_MODE_BOX=2
WINDOW_MODE_TECHNICAL=3
+WINDOW_PLACE_MANUAL=0
+WINDOW_PLACE_SMART=1
+WINDOW_PLACE_MIDDLE=2
+WINDOW_PLACE_CASCADE=3
+WINDOW_PLACE_RANDOM=4
+
+DESKTOP_COUNT=8
+DESKTOP_SCROLL=0
+DESKTOP_SCROLL_STICKY=0
+DESKTOP_RESIST=3
+DESKTOP_SPEED=30
+DESKTOP_WIDTH=2
+DESKTOP_HEIGHT=2
+
GUIDES_LOC_WIN=0
GUIDES_LOC_SCR=1
+DB="./behavior.db"
+
# actions defining how to react to things
-DB="./actions.db"
NUM=0
edb_ed $DB add "/actions/"$NUM"/name" str "Title_Bar"
edb_ed $DB add "/actions/"$NUM"/action" str "Window_Raise"
@@ -337,26 +352,41 @@ edb_ed $DB add "/actions/"$NUM"/button" int 0
edb_ed $DB add "/actions/"$NUM"/key" str "Insert"
edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_CTRL_ALT
NUM=$[ $NUM + 1 ];
+edb_ed $DB add "/actions/"$NUM"/name" str "Key_Binding"
+edb_ed $DB add "/actions/"$NUM"/action" str "Window_Next"
+edb_ed $DB add "/actions/"$NUM"/params" str ""
+edb_ed $DB add "/actions/"$NUM"/event" int $ACT_KEY_DOWN
+edb_ed $DB add "/actions/"$NUM"/button" int 0
+edb_ed $DB add "/actions/"$NUM"/key" str "Tab"
+edb_ed $DB add "/actions/"$NUM"/modifiers" int $MOD_ALT
+NUM=$[ $NUM + 1 ];
edb_ed $DB add "/actions/count" int $NUM
+edb_ed $DB add "/desktops/count" int $DESKTOP_COUNT
+edb_ed $DB add "/desktops/scroll" int $DESKTOP_SCROLL
+edb_ed $DB add "/desktops/scroll_sticky" int $DESKTOP_SCROLL_STICKY
+edb_ed $DB add "/desktops/resist" int $DESKTOP_RESIST
+edb_ed $DB add "/desktops/speed" int $DESKTOP_SPEED
+edb_ed $DB add "/desktops/width" int $DESKTOP_WIDTH
+edb_ed $DB add "/desktops/height" int $DESKTOP_HEIGHT
+
# basic settings
-DB="./settings.db"
-edb_ed $DB add "/focus/mode " int $FOCUS_POINTER
edb_ed $DB add "/move/resist" int 1
edb_ed $DB add "/move/resist/desk" int 24
edb_ed $DB add "/move/resist/win" int 12
edb_ed $DB add "/menu/scroll/resist" int 5
edb_ed $DB add "/menu/scroll/speed" int 12
+edb_ed $DB add "/window/focus/mode" int $FOCUS_POINTER
edb_ed $DB add "/window/raise/auto" int 0
edb_ed $DB add "/window/raise/delay" float 0.5
edb_ed $DB add "/window/move/mode" int $WINDOW_MODE_OPAQUE
edb_ed $DB add "/window/resize/mode" int $WINDOW_MODE_BOX
+edb_ed $DB add "/window/place/mode" int $WINDOW_PLACE_SMART
edb_ed $DB add "/guides/display/x" float 0.5
edb_ed $DB add "/guides/display/y" float 0.5
edb_ed $DB add "/guides/display/location" int $GUIDES_LOC_SCR
# what events on windows are "grabbed" by the window manager
-DB="./grabs.db"
NUM=0
edb_ed $DB add "/grabs/"$NUM"/button" int 1
edb_ed $DB add "/grabs/"$NUM"/modifiers" int $MOD_ALT
diff --git a/po/ChangeLog b/po/ChangeLog
index cde271bec..f63f9e044 100644
--- a/po/ChangeLog
+++ b/po/ChangeLog
@@ -98,32 +98,6 @@
* Makefile.in.in: Upgrade to gettext-0.10.39.
-<<<<<<< ChangeLog
-2001-10-08 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-10-08 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-09-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-09-25 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-09-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-2001-09-10 gettextize <bug-gnu-utils@gnu.org>
-
- * Makefile.in.in: Upgrade to gettext-0.10.39.
-
-=======
2001-10-09 gettextize <bug-gnu-utils@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.10.40.
@@ -132,7 +106,6 @@
* Makefile.in.in: Upgrade to gettext-0.10.40.
->>>>>>> 1.6
2001-08-31 gettextize <bug-gnu-utils@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.10.39.
diff --git a/setup-gettext.sh b/setup-gettext.sh
new file mode 100755
index 000000000..fd45c037f
--- /dev/null
+++ b/setup-gettext.sh
@@ -0,0 +1,202 @@
+#!/bin/sh
+#
+# setup-gettext - Provides compatibility with versions of gettext
+# from the 0.10.x series and 0.11.x.
+#
+# Copyright (C) 2002 Christian Hammond.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+VERSION=0.1.3
+
+VERBOSE=0
+
+parse_gettext_version() {
+ GETTEXT_VERSION=`$GETTEXT_TOOL --version | sed -n 's/^.*\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1.\2.\3/p'`
+ GETTEXT_MAJOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^\([0-9]\+\).*/\1/p'`
+ GETTEXT_MINOR_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.\([0-9]\+\).*/\1/p'`
+ GETTEXT_MICRO_VERSION=`echo $GETTEXT_VERSION | sed -n 's/^[0-9]\+\.[0-9]\+\.\([0-9]\+\).*/\1/p'`
+}
+
+find_gettext() {
+ GETTEXT_TOOL=autopoint
+
+ (autopoint --version) < /dev/null > /dev/null 2>&1 || {
+ GETTEXT_TOOL=gettextize
+
+ (gettextize --version) < /dev/null > /dev/null 2>&1 || {
+ GETTEXT_TOOL=
+ }
+ }
+}
+
+install() {
+ [ -f configure.in ] && {
+ cp configure.in .tmp-configure.in
+ sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
+AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.in > configure.in
+ rm .tmp-configure.in
+ }
+
+ [ -f configure.ac ] && {
+ cp configure.ac .tmp-configure.ac
+ sed -e 's/^AM_GNU_GETTEXT\(.*\)$/AM_GNU_GETTEXT\1\
+AM_GNU_GETTEXT_VERSION(0.10.40)/' < .tmp-configure.ac > configure.ac
+ rm .tmp-configure.ac
+ }
+
+ [ -f autogen.sh ] && {
+ cp autogen.sh .tmp-autogen.sh
+ sed -e 's/\(gettextize\|autopoint\) --version/.\/setup-gettext --gettext-tool/1' -e 's/^\(echo.*|[\t ]*\)\?\(gettextize\|autopoint\) -.*$/.\/setup-gettext/1' < .tmp-autogen.sh > autogen.sh
+ rm .tmp-autogen.sh
+ }
+
+ echo 'AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])' >> acinclude.m4
+}
+
+backup_m4() {
+ [ -d m4 ] && mv m4 m4~
+}
+
+restore_m4() {
+ [ -d m4~ ] && {
+ rm -rf m4
+ mv m4~ m4
+ }
+}
+
+restore_files() {
+ [ -f configure.in~ ] && mv -f configure.in~ configure.in
+ [ -f configure.ac~ ] && mv -f configure.ac~ configure.ac
+ [ -f Makefile.am~ ] && mv -f Makefile.am~ Makefile.am
+}
+
+abort() {
+ restore_files
+ restore_m4
+
+ exit 1
+}
+
+# Main code
+
+find_gettext
+
+# See if a version of gettext and its tools are installed.
+if [ x$GETTEXT_TOOL = x ]; then
+ echo
+ echo "You do not have a version of gettext installed."
+ echo "Please download one from your local package repository or"
+ echo "from ftp://ftp.gnu.org/pub/gnu/gettext/"
+ echo
+ exit 1
+fi
+
+parse_gettext_version
+
+NUMVAR=$#
+
+if [ $NUMVAR -gt 0 ]; then
+ if [ $NUMVAR -gt 1 ]; then
+ echo "Only one option at a time!"
+ exit 1
+
+ elif [ $1 = "--gettext-tool" ]; then
+ echo $GETTEXT_TOOL
+ exit 0
+
+ elif [ $1 = "--help" ]; then
+ echo "setup-gettext v$VERSION"
+ echo "Usage:"
+ echo " --gettext-tool Returns gettextize or autopoint, depending"
+ echo " on the version of gettext installed."
+ echo " --gettext-version Returns the version of gettext installed."
+ echo " --gettext-major-version Returns the major version of gettext installed."
+ echo " --gettext-minor-version Returns the minor version of gettext installed."
+ echo " --gettext-micro-version Returns the micro version of gettext installed."
+ echo " --help Displays this help screen."
+ echo
+ exit 0
+
+ elif [ $1 = "--version" ]; then
+ echo $VERSION
+ exit 0
+
+ elif [ $1 = "--gettext-version" ]; then
+ echo $GETTEXT_VERSION
+ exit 0
+
+ elif [ $1 = "--gettext-major-version" ]; then
+ echo $GETTEXT_MAJOR_VERSION
+ exit 0
+
+ elif [ $1 = "--gettext-minor-version" ]; then
+ echo $GETTEXT_MINOR_VERSION
+ exit 0
+
+ elif [ $1 = "--gettext-micro-version" ]; then
+ echo $GETTEXT_MICRO_VERSION
+ exit 0
+
+ elif [ $1 = "--install" ]; then
+ install
+ echo "setup-gettext installed."
+ exit 0
+
+ elif [ $1 = "--happy-url" ]; then
+ echo http://gaim.sf.net/forkgettext.jpg
+ exit 0
+
+ elif [ $1 = "--verbose" ]; then
+ VERBOSE=1
+
+ else
+ echo "Invalid option '$1'"
+ exit 1
+ fi
+fi
+
+# Okay, run the main stuff
+if [ "$GETTEXT_TOOL" = "autopoint" ]; then
+ backup_m4
+ [ $VERBOSE -eq 1 ] && echo " autopoint --force"
+ echo n | autopoint --force || abort
+ restore_m4
+else
+ if [ $GETTEXT_MINOR_VERSION -eq 11 ]; then
+ backup_m4
+
+ # Gettext is pure evil. It DEMANDS that we press Return no matter
+ # what. This gets rid of their happy "feature" of doom.
+ [ $VERBOSE -eq 1 ] && \
+ echo " gettextize --copy --force --intl --no-changelog"
+
+ sed 's:read .*< /dev/tty::' `which gettextize` > .temp-gettextize
+ chmod +x .temp-gettextize
+ echo n | ./.temp-gettextize --copy --force --intl --no-changelog || abort
+ rm .temp-gettextize
+
+ restore_files
+ restore_m4
+
+ [ -f po/Makevars.template ] && mv po/Makevars.template po/Makevars
+ else
+ [ $VERBOSE -eq 1 ] && echo " gettextize --copy --force"
+ echo n | gettextize --copy --force || exit;
+ fi
+fi
+
diff --git a/src/Makefile.am b/src/Makefile.am
index c30c51330..d618606d5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,15 +9,18 @@ INCLUDES = \
-I$(top_srcdir)/intl \
@evas_cflags@ @edb_cflags@ @ebits_cflags@ @ecore_cflags@ @efsd_cflags@ @ebg_cflags@ $(DEBUGFLAGS)
-bin_PROGRAMS = enlightenment
+bin_PROGRAMS = enlightenment
enlightenment_SOURCES = \
actions.h actions.c \
block.c block.h \
border.h border.c \
bordermenu.h bordermenu.c \
+ menu.h menu.c \
+ menubuild.h menubuild.c \
config.h config.c \
cursors.c cursors.h \
+ data.c data.h \
debug.c debug.h \
delayed.h delayed.c \
desktops.h desktops.c \
@@ -30,14 +33,12 @@ enlightenment_SOURCES = \
guides.h guides.c \
globals.h globals.c \
icccm.h icccm.c \
- iconbar.h iconbar.c\
- icons.h icons.c\
+ iconbar.h iconbar.c \
+ icons.h icons.c \
ipc.h ipc.c \
keys.h keys.c \
main.c \
match.c match.h \
- menu.h menu.c \
- menubuild.h menubuild.c \
object.h object.c \
observer.h observer.c\
pack.c \
@@ -52,7 +53,7 @@ enlightenment_SOURCES = \
e_dir.h e_dir.c \
e_view_machine.h e_view_machine.c \
view_layout.h view_layout.c \
- e_view_look.h e_view_look.c \
+ e_view_look.h e_view_look.c \
e.h
enlightenment_LDADD = @evas_libs@ @edb_libs@ @ebits_libs@ @ecore_libs@ @efsd_libs@ @ebg_libs@ -lm $(INTLLIBS)
diff --git a/src/actions.c b/src/actions.c
index e390250c4..6bf51d00f 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -6,21 +6,19 @@
#include "exec.h"
#include "icccm.h"
#include "keys.h"
-#include "view.h"
#include "e_view_machine.h"
#include "util.h"
#include "guides.h"
#include "bordermenu.h"
#include "block.h"
-static Evas_List action_impls = NULL;
-static Evas_List current_actions = NULL;
-static Evas_List current_timers = NULL;
+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,
E_Object * object);
-static void e_action_cleanup(E_Action * a);
static void e_act_move_start(E_Object * object, E_Action * a,
void *data, int x, int y, int rx, int ry);
@@ -91,14 +89,14 @@ static void e_act_exec_start(E_Object * object, E_Action * a,
static void e_act_menu_start(E_Object * object, E_Action * a,
void *data, int x, int y, int rx, int ry);
-
+#if 0
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);
-
+#endif
static void e_act_stick_start(E_Object * object, E_Action * a,
void *data, int x, int y, int rx, int ry);
@@ -133,104 +131,16 @@ static void
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;
- int i, num;
- char *a_name = NULL;
- char *a_action = NULL;
- char *a_params = NULL;
- int a_event = 0;
- int a_button = 0;
- char *a_key = NULL;
- int a_modifiers = 0;
- Evas_List l;
+ Evas_List *l;
E_Action *a;
- 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_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)
- D_RETURN;
- if (!e_db_int_get(db, "/actions/count", &num))
- goto error;
- for (i = 0; i < num; i++)
- {
- char buf[PATH_MAX];
-
- snprintf(buf, PATH_MAX, "/actions/%i/name", i);
- a_name = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/actions/%i/action", i);
- a_action = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/actions/%i/params", i);
- a_params = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/actions/%i/event", i);
- e_db_int_get(db, buf, &a_event);
- snprintf(buf, PATH_MAX, "/actions/%i/button", i);
- e_db_int_get(db, buf, &a_button);
- snprintf(buf, PATH_MAX, "/actions/%i/key", i);
- a_key = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/actions/%i/modifiers", i);
- e_db_int_get(db, buf, &a_modifiers);
-
- a = NEW(E_Action, 1);
- ZERO(a, E_Action, 1);
-
- e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup);
-
- a->name = a_name;
- a->action = a_action;
- a->params = a_params;
- a->event = a_event;
- a->button = a_button;
- a->key = a_key;
- a->modifiers = a_modifiers;
- a->action_impl = NULL;
- a->object = NULL;
- a->started = 0;
- actions = evas_list_append(actions, a);
- /* it's a key? lets grab it! */
- if ((a->key) && (strlen(a->key) > 0))
- {
- if (a->modifiers == -1)
- e_keys_grab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1);
- else
- e_keys_grab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers,
- 0);
- a->grabbed = 1;
- }
- }
- error:
- e_db_close(db);
- E_CONFIG_CHECK_VALIDITY_END;
/* run thru our actions list and match event, state and stuff with an */
/* and action for it */
- for (l = actions; l; l = l->next)
+ for (l = config_data->actions; l; l = l->next)
{
- Evas_List ll;
+ Evas_List * ll;
a = l->data;
if (act != a->event)
@@ -288,7 +198,7 @@ e_action_find(char *action, E_Action_Type act, int button,
D_RETURN;
}
-static void
+void
e_action_cleanup(E_Action * a)
{
D_ENTER;
@@ -335,7 +245,7 @@ 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;
+ Evas_List * l;
int started_long_action = 0;
D_ENTER;
@@ -375,7 +285,7 @@ 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;
+ Evas_List * l;
D_ENTER;
@@ -435,7 +345,7 @@ 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;
+ Evas_List * l;
D_ENTER;
@@ -461,7 +371,7 @@ void
e_action_stop_by_object(E_Object * object, void *data, int x, int y, int rx,
int ry)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -493,7 +403,7 @@ e_action_stop_by_object(E_Object * object, void *data, int x, int y, int rx,
void
e_action_stop_by_type(char *action)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -518,6 +428,7 @@ e_action_impl_cleanup(E_Action_Impl * eai)
{
D_ENTER;
+ IF_FREE(eai->action);
e_object_cleanup(E_OBJECT(eai));
D_RETURN;
@@ -548,7 +459,7 @@ e_action_add_impl(char *action, E_Action_Start_Func func_start,
void
e_action_del_timer(E_Object * object, char *name)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -592,7 +503,7 @@ e_action_add_timer(E_Object * object, char *name)
void
e_action_del_timer_object(E_Object * object)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -677,23 +588,10 @@ e_act_move_start(E_Object * object, E_Action * a, void *data, int x, int y,
double align_y = 0.5;
E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
- E_CFG_INT(cfg_window_move_mode, "settings", "/window/move/mode",
- E_GUIDES_BOX);
- E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
- E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
- E_CFG_INT(cfg_guides_display_location, "settings",
- "/guides/display/location",
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
-
D_ENTER;
e_block_start("menus");
- 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 = (E_Border *) object;
if (!b)
@@ -705,6 +603,11 @@ e_act_move_start(E_Object * object, E_Action * a, void *data, int x, int y,
if (b->client.fixed)
D_RETURN;
+ move_mode = config_data->window->move_mode;
+ display_loc = config_data->guides->location;
+ align_x = config_data->guides->x;
+ align_y = config_data->guides->y;
+
if (move_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
b->mode.move = 1;
@@ -839,22 +742,10 @@ e_act_resize_start(E_Object * object, E_Action * a, void *data, int x, int y,
double align_y = 0.5;
E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
- E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode",
- E_GUIDES_BOX);
- E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
- E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
- E_CFG_INT(cfg_guides_display_location, "settings",
- "/guides/display/location",
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
-
D_ENTER;
e_block_start("menus");
- 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 = (E_Border *) object;
if (!b)
b = e_border_current_focused();
@@ -866,6 +757,12 @@ e_act_resize_start(E_Object * object, E_Action * a, void *data, int x, int y,
D_RETURN;
if (b->current.shaded != 0)
D_RETURN;
+
+ resize_mode = config_data->window->resize_mode;
+ display_loc = config_data->guides->location;
+ align_x = config_data->guides->x;
+ align_y = config_data->guides->y;
+
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -1043,22 +940,10 @@ e_act_resize_h_start(E_Object * object, E_Action * a, void *data, int x, int y,
double align_y = 0.5;
E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
- E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode",
- E_GUIDES_BOX);
- E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
- E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
- E_CFG_INT(cfg_guides_display_location, "settings",
- "/guides/display/location",
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
-
D_ENTER;
e_block_start("menus");
- 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 = (E_Border *) object;
if (!b)
b = e_border_current_focused();
@@ -1068,6 +953,12 @@ e_act_resize_h_start(E_Object * object, E_Action * a, void *data, int x, int y,
D_RETURN;
if (b->current.shaded != 0)
D_RETURN;
+
+ resize_mode = config_data->window->resize_mode;
+ display_loc = config_data->guides->location;
+ align_x = config_data->guides->x;
+ align_y = config_data->guides->y;
+
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -1205,22 +1096,10 @@ e_act_resize_v_start(E_Object * object, E_Action * a, void *data, int x, int y,
double align_y = 0.5;
E_Guides_Location display_loc = E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE;
- E_CFG_INT(cfg_window_resize_mode, "settings", "/window/resize/mode",
- E_GUIDES_BOX);
- E_CFG_FLOAT(cfg_guides_display_x, "settings", "/guides/display/x", 0.5);
- E_CFG_FLOAT(cfg_guides_display_y, "settings", "/guides/display/y", 0.5);
- E_CFG_INT(cfg_guides_display_location, "settings",
- "/guides/display/location",
- E_GUIDES_DISPLAY_LOCATION_WINDOW_MIDDLE);
-
D_ENTER;
e_block_start("menus");
- 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 = (E_Border *) object;
if (!b)
b = e_border_current_focused();
@@ -1230,6 +1109,12 @@ e_act_resize_v_start(E_Object * object, E_Action * a, void *data, int x, int y,
D_RETURN;
if (b->current.shaded != 0)
D_RETURN;
+
+ resize_mode = config_data->window->resize_mode;
+ display_loc = config_data->guides->location;
+ align_x = config_data->guides->x;
+ align_y = config_data->guides->y;
+
if (resize_mode >= E_GUIDES_BOX)
b->hold_changes = 1; /* if non opaque */
ecore_window_gravity_set(b->win.client, StaticGravity);
@@ -1667,7 +1552,7 @@ e_act_menu_start(E_Object * object, E_Action * a, void *data, int x, int y,
UN(ry);
}
-static void
+void
e_act_exit_start(E_Object * object, E_Action * a, void *data, int x, int y,
int rx, int ry)
{
@@ -1692,7 +1577,7 @@ e_act_exit_start(E_Object * object, E_Action * a, void *data, int x, int y,
UN(ry);
}
-static void
+void
e_act_restart_start(E_Object * object, E_Action * a, void *data, int x, int y,
int rx, int ry)
{
@@ -1967,9 +1852,13 @@ static void
e_act_raise_next_start(E_Object * object, E_Action * a, void *data, int x,
int y, int rx, int ry)
{
+ E_Border *current = NULL;
+
D_ENTER;
- e_border_raise_next();
+ current = e_desktop_raise_next_border();
+ if (current)
+ e_border_send_pointer(current);
D_RETURN;
UN(object);
diff --git a/src/actions.h b/src/actions.h
index 9ba2833e7..9f565f017 100644
--- a/src/actions.h
+++ b/src/actions.h
@@ -73,6 +73,7 @@ struct _E_Action_Impl
* i.e. the way E performs actions.
*/
void e_action_init(void);
+void e_action_cleanup(E_Action *a);
int e_action_start(char *action, E_Action_Type act, int button,
char *key, Ecore_Event_Key_Modifiers mods,
@@ -97,4 +98,10 @@ 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);
+
+void e_act_exit_start(E_Object * object, E_Action * a, void *data, int x, int y,
+ int rx, int ry);
+void e_act_restart_start(E_Object * object, E_Action * a, void *data, int x, int y,
+ int rx, int ry);
+
#endif
diff --git a/src/background.c b/src/background.c
index dca848fa0..21ced9b7b 100644
--- a/src/background.c
+++ b/src/background.c
@@ -6,7 +6,7 @@
static void
e_background_cleanup(E_Background * bg)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -22,7 +22,7 @@ e_background_cleanup(E_Background * bg)
if (bl->file)
FREE(bl->file);
if (bl->obj)
- evas_del_object(bg->evas, bl->obj);
+ evas_object_del(bl->obj);
FREE(bl);
}
evas_list_free(bg->layers);
@@ -30,7 +30,7 @@ e_background_cleanup(E_Background * bg)
if (bg->file)
FREE(bg->file);
if (bg->base_obj)
- evas_del_object(bg->evas, bg->base_obj);
+ evas_object_del(bg->base_obj);
e_object_cleanup(E_OBJECT(bg));
@@ -149,9 +149,9 @@ e_background_load(char *file)
}
void
-e_background_realize(E_Background * bg, Evas evas)
+e_background_realize(E_Background * bg, Evas * evas)
{
- Evas_List l;
+ Evas_List * l;
int ww, hh, count;
D_ENTER;
@@ -168,9 +168,10 @@ e_background_realize(E_Background * bg, Evas evas)
bl = l->data;
if (bl->type == E_BACKGROUND_TYPE_IMAGE)
{
- bl->obj = evas_add_image_from_file(bg->evas, bl->file);
- evas_set_layer(bg->evas, bl->obj, 0);
- evas_show(bg->evas, bl->obj);
+ bl->obj = evas_object_image_add(bg->evas);
+ evas_object_image_file_set(bl->obj, bl->file, NULL);
+ evas_object_layer_set(bl->obj, 0);
+ evas_object_show(bl->obj);
#if 0 /* dont need this... do we? */
if (evas_get_image_alpha(bg->evas, bl->obj))
{
@@ -203,7 +204,7 @@ e_background_realize(E_Background * bg, Evas evas)
void
e_background_set_scroll(E_Background * bg, int sx, int sy)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -220,7 +221,7 @@ e_background_set_scroll(E_Background * bg, int sx, int sy)
bl = l->data;
if (bl->type == E_BACKGROUND_TYPE_IMAGE)
{
- evas_set_image_fill(bg->evas, bl->obj,
+ evas_object_image_fill_set(bl->obj,
(double)bg->geom.sx * bl->scroll.x,
(double)bg->geom.sy * bl->scroll.y,
bl->fw, bl->fh);
@@ -232,7 +233,7 @@ e_background_set_scroll(E_Background * bg, int sx, int sy)
void
e_background_set_size(E_Background * bg, int w, int h)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -250,7 +251,7 @@ e_background_set_size(E_Background * bg, int w, int h)
iw = 0;
ih = 0;
if (bg->evas)
- evas_get_image_size(bg->evas, bl->obj, &iw, &ih);
+ evas_object_image_size_get(bl->obj, &iw, &ih);
w = bl->size.w * (double)bg->geom.w;
h = bl->size.h * (double)bg->geom.h;
if (bl->size.orig.w)
@@ -277,18 +278,18 @@ e_background_set_size(E_Background * bg, int w, int h)
bl->fh = fh;
if (bg->evas)
{
- evas_move(bg->evas, bl->obj, bl->x, bl->y);
- evas_resize(bg->evas, bl->obj, bl->w, bl->h);
+ evas_object_move(bl->obj, bl->x, bl->y);
+ evas_object_resize(bl->obj, bl->w, bl->h);
if (bl->type == E_BACKGROUND_TYPE_IMAGE)
{
- evas_set_image_fill(bg->evas, bl->obj,
+ evas_object_image_fill_set(bl->obj,
(double)bg->geom.sx * bl->scroll.x,
(double)bg->geom.sy * bl->scroll.y,
bl->fw, bl->fh);
}
else if (bl->type == E_BACKGROUND_TYPE_GRADIENT)
{
- evas_set_angle(bg->evas, bl->obj, bl->angle);
+ evas_object_angle_set(bl->obj, bl->angle);
}
else if (bl->type == E_BACKGROUND_TYPE_SOLID)
{
@@ -302,7 +303,7 @@ void
e_background_set_color_class(E_Background * bg, char *cc, int r, int g, int b,
int a)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -316,9 +317,9 @@ e_background_set_color_class(E_Background * bg, char *cc, int r, int g, int b,
if (bg->evas)
{
if ((l == bg->layers) && (bg->base_obj))
- evas_set_color(bg->evas, bl->obj, r, g, b, 255);
+ evas_object_color_set(bl->obj, r, g, b, 255);
else
- evas_set_color(bg->evas, bl->obj, r, g, b, a);
+ evas_object_color_set(bl->obj, r, g, b, a);
}
}
}
diff --git a/src/background.h b/src/background.h
index 3b38e1d3b..00ac89040 100644
--- a/src/background.h
+++ b/src/background.h
@@ -18,7 +18,7 @@ struct _E_Background
{
E_Object o;
- Evas evas;
+ Evas * evas;
char *file;
struct
@@ -28,9 +28,9 @@ struct _E_Background
}
geom;
- Evas_List layers;
+ Evas_List * layers;
- Evas_Object base_obj;
+ Evas_Object * base_obj;
};
struct _E_Background_Layer
@@ -68,13 +68,13 @@ struct _E_Background_Layer
double x, y, w, h, fw, fh;
- Evas_Object obj;
+ Evas_Object * obj;
};
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_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);
void e_background_set_color_class(E_Background * bg, char *cc,
diff --git a/src/block.c b/src/block.c
index f5aac9e48..3730c005b 100644
--- a/src/block.c
+++ b/src/block.c
@@ -10,14 +10,14 @@ struct _e_block
int refs;
};
-static Evas_List blocks = NULL;
+static Evas_List * blocks = NULL;
static E_Block *e_block_find(char *name);
static E_Block *
e_block_find(char *name)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
for (l = blocks; l; l = l->next)
diff --git a/src/border.c b/src/border.c
index dc4f7fed6..66e967117 100644
--- a/src/border.c
+++ b/src/border.c
@@ -1,5 +1,6 @@
#include "cursors.h"
#include "border.h"
+#include "bordermenu.h"
#include "config.h"
#include "debug.h"
#include "actions.h"
@@ -12,14 +13,14 @@
#include "place.h"
#include "match.h"
#include "focus.h"
-#include "menu.h"
#include "exec.h"
+#include "menu.h"
/* Window border rendering, querying, setting & modification code */
/* globals local to window borders */
-static Evas_List evases = NULL;
-static Evas_List borders = NULL;
+static Evas_List * evases = NULL;
+static Evas_List * borders = NULL;
static int mouse_x, mouse_y, mouse_win_x, mouse_win_y;
static int mouse_buttons = 0;
@@ -50,6 +51,7 @@ static void e_mouse_up(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);
+float e_border_delayed_val();
static void e_cb_mouse_in(void *data, Ebits_Object o, char *class,
int bt, int x, int y, int ox, int oy, int ow,
@@ -90,9 +92,7 @@ e_border_replay_query(Ecore_Event_Mouse_Down * ev)
{
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
if ((focus_mode == 2) && (ev->mods == ECORE_EVENT_KEY_MODIFIER_NONE))
/* FIXME: also if pass click always set */
D_RETURN_(1);
@@ -106,7 +106,7 @@ e_border_replay_query(Ecore_Event_Mouse_Down * ev)
void
e_border_update_borders(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -122,9 +122,10 @@ e_border_update_borders(void)
E_Border *b;
b = l->data;
- if (b->first_expose)
+
+ if (b->shape_changed)
{
- evas_render(b->evas);
+ e_border_reshape(b);
}
}
e_db_runtime_flush();
@@ -364,6 +365,9 @@ e_destroy(Ecore_Event * ev)
{
E_Border *b;
+ if (!(e_border_current_focused()))
+ e_icccm_send_focus_to(e_desktop_window(), 1);
+
b = e_border_find_by_window(e->win);
if (b)
{
@@ -508,9 +512,7 @@ e_focus_out(Ecore_Event * ev)
{
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
b->current.selected = 0;
if (e->key_grab)
b->current.select_lost_from_grab = 1;
@@ -585,9 +587,7 @@ e_mouse_down(Ecore_Event * ev)
{
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
if (focus_mode == 2)
{
e_focus_set_focus(b);
@@ -598,15 +598,14 @@ e_mouse_down(Ecore_Event * ev)
e_cb_border_mouse_down(b, ev);
else
{
- Evas evas;
+ Evas *evas;
int x, y;
evas = b->evas;
- ecore_window_get_root_relative_location(evas_get_window(evas),
- &x, &y);
+ ecore_window_get_root_relative_location(b->win.b, &x, &y);
x = e->rx - x;
y = e->ry - y;
- evas_event_button_down(evas, x, y, e->button);
+ evas_event_feed_mouse_down(evas, e->button);
}
}
}
@@ -640,15 +639,14 @@ e_mouse_up(Ecore_Event * ev)
e_cb_border_mouse_up(b, ev);
else
{
- Evas evas;
+ Evas *evas;
int x, y;
evas = b->evas;
- ecore_window_get_root_relative_location(evas_get_window(evas),
- &x, &y);
+ ecore_window_get_root_relative_location(b->win.b, &x, &y);
x = e->rx - x;
y = e->ry - y;
- evas_event_button_up(evas, x, y, e->button);
+ evas_event_feed_mouse_up(evas, e->button);
}
}
}
@@ -682,15 +680,14 @@ e_mouse_move(Ecore_Event * ev)
e_cb_border_mouse_move(b, ev);
else
{
- Evas evas;
+ Evas *evas;
int x, y;
evas = b->evas;
- ecore_window_get_root_relative_location(evas_get_window(evas),
- &x, &y);
+ ecore_window_get_root_relative_location(b->win.b, &x, &y);
x = e->rx - x;
y = e->ry - y;
- evas_event_move(evas, x, y);
+ evas_event_feed_mouse_move(evas, x, y);
}
}
}
@@ -716,15 +713,14 @@ e_mouse_in(Ecore_Event * ev)
else if (e->win == b->win.input)
{
int x, y;
- Evas evas;
+ Evas *evas;
evas = b->evas;
- ecore_window_get_root_relative_location(evas_get_window(evas), &x,
- &y);
+ ecore_window_get_root_relative_location(b->win.b, &x, &y);
x = e->rx - x;
y = e->ry - y;
- evas_event_move(evas, x, y);
- evas_event_enter(evas);
+ evas_event_feed_mouse_in(evas);
+ evas_event_feed_mouse_move(evas, x, y);
}
}
current_ev = NULL;
@@ -751,7 +747,7 @@ e_mouse_out(Ecore_Event * ev)
e_cb_border_mouse_out(b, ev);
if (e->win == b->win.input)
{
- evas_event_leave(b->evas);
+ evas_event_feed_mouse_out(b->evas);
}
}
}
@@ -771,20 +767,13 @@ e_window_expose(Ecore_Event * ev)
current_ev = ev;
e = ev->event;
{
- Evas_List l;
E_Border *b;
- for (l = evases; l; l = l->next)
- {
- Evas evas;
-
- evas = l->data;
- if (evas_get_window(evas) == e->win)
- evas_update_rect(evas, e->x, e->y, e->w, e->h);
- }
b = e_border_find_by_window(e->win);
if (b)
- b->first_expose = 1;
+ {
+ e_border_redraw_region(b, e->x, e->y, e->w, e->h);
+ }
}
current_ev = NULL;
@@ -967,10 +956,8 @@ e_cb_border_mouse_in(E_Border * b, Ecore_Event * e)
char *class = "Window_Grab";
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
D_ENTER;
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
/* pointer focus stuff */
if (focus_mode == 0)
e_focus_set_focus(b);
@@ -1021,11 +1008,9 @@ e_cb_border_mouse_down(E_Border * b, Ecore_Event * e)
char *class = "Window_Grab";
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
D_ENTER;
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
ecore_pointer_grab(((Ecore_Event_Mouse_Down *) (e->event))->win,
CurrentTime);
border_mouse_x = mouse_x;
@@ -1037,36 +1022,6 @@ e_cb_border_mouse_down(E_Border * b, Ecore_Event * e)
y = ((Ecore_Event_Mouse_Down *) (e->event))->y;
bt = ((Ecore_Event_Mouse_Down *) (e->event))->button;
{
- Evas_List l;
-
- again:
- for (l = b->grabs; l; l = l->next)
- {
- E_Grab *g;
-
- g = l->data;
- /* find a grab that triggered this */
- if (((((Ecore_Event_Mouse_Down *) (e->event))->button == g->button)
- || (g->button == 0)) && ((g->any_mod)
- ||
- (((Ecore_Event_Mouse_Down *) (e->
- event))->
- mods == g->mods)))
- {
- if (g->remove_after)
- {
- ecore_button_ungrab(b->win.main, g->button, g->mods,
- g->any_mod);
- ecore_window_button_grab_auto_replay_set(b->win.main,
- NULL);
- FREE(g);
- b->grabs = evas_list_remove(b->grabs, g);
- goto again;
- }
- }
- }
- }
- {
E_Action_Type act;
Ecore_Event_Key_Modifiers mods;
@@ -1181,25 +1136,29 @@ e_border_poll(int val, void *data)
}
static void
-e_border_cleanup(E_Border * b)
+e_border_cleanup_window_list(Evas_List *windows)
{
- Evas_List l;
+ Window temp;
+
+ /* Free the old set of pixmaps */
+ while (windows)
+ {
+ temp = (Window) windows->data;
+ windows = evas_list_remove(windows, (void *)temp);
+ ecore_window_destroy(temp);
+ }
+}
+static void
+e_border_cleanup(E_Border * b)
+{
D_ENTER;
e_match_save_props(b);
D("before notify\n");
e_observee_notify_observers(E_OBSERVEE(b), E_EVENT_BORDER_DELETE, NULL);
D("after notify\n");
- while (b->menus)
- {
- E_Menu *m;
-
- m = b->menus->data;
- e_menu_hide(m);
- e_object_unref(E_OBJECT(m));
- b->menus = evas_list_remove(b->menus, m);
- }
+ e_bordermenu_hide();
e_desktops_del_border(b->desk, b);
if (b->bits.b)
ebits_free(b->bits.b);
@@ -1207,8 +1166,14 @@ e_border_cleanup(E_Border * b)
if (b->obj.title)
e_text_free(b->obj.title);
+ if (b->obj.title_clip)
+ evas_object_del(b->obj.title_clip);
+
+ e_border_cleanup_window_list(b->windows);
evases = evas_list_remove(evases, b->evas);
evas_free(b->evas);
+
+ ecore_window_destroy(b->win.b);
ecore_window_destroy(b->win.container);
ecore_window_destroy(b->win.input);
ecore_window_destroy(b->win.main);
@@ -1223,17 +1188,8 @@ e_border_cleanup(E_Border * b)
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);
- }
-
/* Cleanup superclass. */
- e_object_cleanup(E_OBJECT(b));
+ e_observee_cleanup(E_OBSERVEE(b));
D_RETURN;
}
@@ -1263,7 +1219,10 @@ e_border_apply_border(E_Border * b)
if ((b->current.shaded > 0) && (b->current.shaded == b->client.h))
prop_shaded = 1;
if (b->client.sticky)
- prop_sticky = 1;
+ {
+ prop_sticky = 1;
+ e_desktops_add_sticky(b);
+ }
snprintf(border, PATH_MAX, "selected-%i.sticky-%i.shaded-%i.bits.db",
prop_selected, prop_sticky, prop_shaded);
@@ -1292,7 +1251,6 @@ void
e_border_reshape(E_Border * b)
{
static Window shape_win = 0;
- static Evas e = NULL;
int pl, pr, pt, pb;
D_ENTER;
@@ -1315,12 +1273,6 @@ e_border_reshape(E_Border * b)
D_RETURN;
}
- if (!e)
- {
- e = evas_new();
- evas_set_output_method(e, RENDER_METHOD_IMAGE);
- }
-
ecore_window_resize(shape_win, b->current.w, b->current.h);
if ((b->current.shaped_client) && (!b->current.has_shape))
@@ -1358,75 +1310,45 @@ e_border_reshape(E_Border * b)
}
else
{
+ Display *disp;
+ Evas_List *windows;
+
if ((!b->current.shaped_client) && (b->current.has_shape))
{
-
ecore_window_set_shape_rectangle(shape_win, pl,
pt - b->current.shaded,
b->current.w - pl - pr,
b->current.h - pt - pb);
-
}
else
{
-
ecore_window_set_shape_window(shape_win, b->win.client, pl,
pt - b->current.shaded);
ecore_window_clip_shape_by_rectangle(shape_win, pl, pt,
b->current.w - pl - pr,
b->current.h - pt - pb);
-
}
- if (b->bits.file)
+ D("SHAPE update for border %p bit %s\n", b, b->border_file);
+
+ e_border_update_render(b);
+
+ windows = b->windows;
+ disp = ecore_display_get();
+
+ while (windows)
{
- Imlib_Image im;
- Ebits_Object bit;
- Pixmap pmap, mask;
-
- printf("SHAPE update for border %s\n", b->bits.file);
- pmap = ecore_pixmap_new(shape_win, b->current.w, b->current.h, 0);
- mask = ecore_pixmap_new(shape_win, b->current.w, b->current.h, 1);
-
- im = imlib_create_image(b->current.w, b->current.h);
- imlib_context_set_image(im);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- evas_set_output_image(e, im);
- evas_set_output_size(e, b->current.w, b->current.h);
- evas_set_output_viewport(e, 0, 0, b->current.w, b->current.h);
-
- bit = ebits_load(b->bits.file);
- ebits_add_to_evas(bit, e);
- ebits_move(bit, 0, 0);
- ebits_resize(bit, b->current.w, b->current.h);
- ebits_show(bit);
-
- evas_update_rect(e, 0, 0, b->current.w, b->current.h);
- evas_render(e);
-
- ebits_hide(bit);
- ebits_free(bit);
-
- imlib_context_set_image(im);
- imlib_context_set_dither_mask(1);
- imlib_context_set_dither(1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_context_set_blend(0);
- imlib_context_set_color_modifier(NULL);
- imlib_render_image_on_drawable(0, 0);
- imlib_free_image();
-
- ecore_window_set_background_pixmap(shape_win, pmap);
- ecore_window_add_shape_mask(shape_win, mask);
- ecore_window_clear(shape_win);
-
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
+ int x, y, w, h;
+ Window window;
+
+ window = (Window) windows->data;
+ ecore_window_get_geometry(window, &x, &y, &w, &h);
+ ecore_window_add_shape_window(shape_win, window, x, y);
+
+ windows = windows->next;
}
+ ecore_window_clear(shape_win);
}
ecore_window_set_shape_window(b->win.main, shape_win, 0, 0);
@@ -1447,6 +1369,7 @@ e_border_release(E_Border * b)
ecore_window_reparent(b->win.client, 0, b->current.x + pl,
b->current.y + pt);
e_icccm_release(b->win.client);
+ e_desktop_raise_next_border();
D_RETURN;
}
@@ -1466,7 +1389,7 @@ e_border_adopt(Window win, int use_client_pos)
ecore_window_set_events(win,
XEV_VISIBILITY |
ResizeRedirectMask |
- XEV_CONFIGURE |
+ XEV_CONFIGURE | XEV_MOUSE_MOVE |
XEV_FOCUS | XEV_PROPERTY | XEV_COLORMAP);
ecore_window_select_shape_events(win);
/* parent of the client window listens for these */
@@ -1596,7 +1519,8 @@ e_border_adopt(Window win, int use_client_pos)
}
else
{
- show = e_place_border(b, b->desk, &x, &y, E_PLACE_SMART);
+ show = e_place_border(b, b->desk, &x, &y,
+ config_data->window->place_mode);
x += pl;
y += pt;
}
@@ -1612,6 +1536,8 @@ e_border_adopt(Window win, int use_client_pos)
b->current.requested.h = b->current.h;
b->current.requested.w = b->current.w;
e_border_raise(b);
+ e_border_update(b);
+ e_border_reshape(b);
ecore_window_show(win);
if (b->client.e.launch_id)
@@ -1625,9 +1551,6 @@ e_border_new(void)
{
/* FIXME: need to set an upper limit on the frame size */
E_Border *b;
- int max_colors = 216;
- int font_cache = 1024 * 1024;
- int image_cache = 8192 * 1024;
char *font_dir;
E_Desktop *desk;
@@ -1661,9 +1584,10 @@ e_border_new(void)
b->client.titlebar = 1;
b->client.takes_focus = 1;
- desk = e_desktops_get(0);
+ desk = e_desktops_get(e_desktops_get_current());
e_desktops_add_border(desk, b);
- b->win.main = ecore_window_override_new(desk->win.container, 0, 0, 1, 1);
+ /* b->win.main = ecore_window_override_new(desk->win.main, 0, 0, 1, 1); */
+ b->win.main = ecore_window_override_new(0, 0, 0, 1, 1);
b->win.input = ecore_window_input_new(b->win.main, 0, 0, 1, 1);
b->win.container = ecore_window_override_new(b->win.main, 0, 0, 1, 1);
e_cursors_display_in_window(b->win.container, "Application");
@@ -1674,19 +1598,17 @@ e_border_new(void)
ecore_window_show(b->win.input);
ecore_window_show(b->win.container);
- b->evas = evas_new_all(ecore_display_get(),
- b->win.main,
- 0, 0, 1, 1,
- RENDER_METHOD_ALPHA_SOFTWARE,
- max_colors, font_cache, image_cache, font_dir);
- b->win.b = evas_get_window(b->evas);
+ b->evas = e_evas_new_all(ecore_display_get(),
+ b->win.main,
+ 0, 0, 1, 1, font_dir);
+ b->win.b = e_evas_get_window(b->evas);
e_cursors_display_in_window(b->win.b, "Default");
b->obj.title = e_text_new(b->evas, "", "title");
- b->obj.title_clip = evas_add_rectangle(b->evas);
- evas_set_color(b->evas, b->obj.title_clip, 255, 255, 255, 255);
+ b->obj.title_clip = evas_object_rectangle_add(b->evas);
+ evas_object_color_set(b->obj.title_clip, 255, 255, 255, 255);
e_text_show(b->obj.title);
- evas_show(b->evas, b->obj.title_clip);
+ evas_object_show(b->obj.title_clip);
e_text_set_clip(b->obj.title, b->obj.title_clip);
ecore_window_raise(b->win.input);
@@ -1738,22 +1660,25 @@ e_border_uniconify(E_Border * b)
void
e_border_remove_mouse_grabs(E_Border * b)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
- if (b->grabs)
+ if (config_data->grabs)
{
- for (l = b->grabs; l; l = l->next)
+ for (l = config_data->grabs; l; l = l->next)
{
E_Grab *g;
g = l->data;
ecore_button_ungrab(b->win.main, g->button, g->mods, g->any_mod);
- FREE(g);
}
- evas_list_free(b->grabs);
- b->grabs = NULL;
+ }
+ if (b->click_grab)
+ {
+ ecore_button_ungrab(b->win.main, b->click_grab->button,
+ b->click_grab->mods, b->click_grab->any_mod);
+ FREE(b->click_grab);
}
b->click_grab = NULL;
@@ -1782,18 +1707,13 @@ e_border_remove_click_grab(E_Border * b)
void
e_border_attach_mouse_grabs(E_Border * b)
{
- char *grabs_db;
- E_DB_File *db;
int focus_mode;
- char buf[PATH_MAX];
-
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
+ Evas_List *l;
D_ENTER;
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
- grabs_db = e_config_get("grabs");
/* settings - click to focus would affect grabs */
if ((!b->current.selected) && (focus_mode == 2))
{
@@ -1812,52 +1732,12 @@ e_border_attach_mouse_grabs(E_Border * b)
b->click_grab = g;
}
- /* other grabs - liek alt+left to move */
- db = e_db_open_read(grabs_db);
- if (db)
+ for (l = config_data->grabs; l; l = l->next)
{
- int i, num;
+ E_Grab *g;
- snprintf(buf, PATH_MAX, "/grabs/count");
- if (!e_db_int_get(db, buf, &num))
- {
- e_db_close(db);
- D_RETURN;
- }
- for (i = 0; i < num; i++)
- {
- int button, any_mod, mod;
- Ecore_Event_Key_Modifiers mods;
-
- button = -1;
- mods = ECORE_EVENT_KEY_MODIFIER_NONE;
- any_mod = 0;
- snprintf(buf, PATH_MAX, "/grabs/%i/button", i);
- if (!e_db_int_get(db, buf, &button))
- continue;
- snprintf(buf, PATH_MAX, "/grabs/%i/modifiers", i);
- if (!e_db_int_get(db, buf, &mod))
- continue;
- if (mod == -1)
- any_mod = 1;
- mods = (Ecore_Event_Key_Modifiers) mod;
-
- if (button >= 0)
- {
- E_Grab *g;
-
- g = NEW(E_Grab, 1);
- ZERO(g, E_Grab, 1);
- g->button = button;
- g->mods = mods;
- g->any_mod = any_mod;
- g->remove_after = 0;
- b->grabs = evas_list_append(b->grabs, g);
- ecore_button_grab(b->win.main, button, XEV_BUTTON_PRESS, mods,
- 0);
- }
- }
- e_db_close(db);
+ g = l->data;
+ ecore_button_grab(b->win.main, g->button, XEV_BUTTON_PRESS, g->mods, 0);
}
D_RETURN;
@@ -1866,7 +1746,7 @@ e_border_attach_mouse_grabs(E_Border * b)
void
e_border_remove_all_mouse_grabs(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1879,7 +1759,7 @@ e_border_remove_all_mouse_grabs(void)
void
e_border_attach_all_mouse_grabs(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1898,7 +1778,7 @@ e_border_redo_grabs(void)
static time_t mod_date_settings = 0;
time_t mod;
int changed = 0;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1932,10 +1812,12 @@ e_border_redo_grabs(void)
E_Border *
e_border_find_by_window(Window win)
{
- Evas_List l;
+ Window pwin;
+ Evas_List * l;
D_ENTER;
+ pwin = ecore_window_get_parent(win);
for (l = borders; l; l = l->next)
{
E_Border *b;
@@ -1945,7 +1827,9 @@ e_border_find_by_window(Window win)
if ((win == b->win.main) ||
(win == b->win.client) ||
(win == b->win.container) ||
- (win == b->win.input) || (win == b->win.b))
+ (win == b->win.input) ||
+ (win == b->win.b) ||
+ (pwin == b->win.main))
D_RETURN_(b);
}
@@ -1967,12 +1851,8 @@ e_border_set_bits(E_Border * b, char *file)
if (b->bits.b)
ebits_free(b->bits.b);
- if (b->bits.file)
- free(b->bits.file);
b->bits.b = ebits_load(file);
- if (b->bits.b)
- b->bits.file = strdup(file);
b->bits.new = 1;
b->changed = 1;
@@ -1993,11 +1873,11 @@ e_border_set_bits(E_Border * b, char *file)
e_border_set_color_class(b, "Title BG", 100, 200, 255, 255);
#define HOOK_CB(_class) \
-ebits_set_classed_bit_callback(b->bits.b, _class, CALLBACK_MOUSE_IN, e_cb_mouse_in, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, CALLBACK_MOUSE_OUT, e_cb_mouse_out, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, CALLBACK_MOUSE_DOWN, e_cb_mouse_down, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, CALLBACK_MOUSE_UP, e_cb_mouse_up, b); \
-ebits_set_classed_bit_callback(b->bits.b, _class, CALLBACK_MOUSE_MOVE, e_cb_mouse_move, b);
+ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_IN, e_cb_mouse_in, b); \
+ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_OUT, e_cb_mouse_out, b); \
+ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_DOWN, e_cb_mouse_down, b); \
+ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_UP, e_cb_mouse_up, b); \
+ebits_set_classed_bit_callback(b->bits.b, _class, EVAS_CALLBACK_MOUSE_MOVE, e_cb_mouse_move, b);
HOOK_CB("Title_Bar");
HOOK_CB("Resize");
HOOK_CB("Resize_Horizontal");
@@ -2156,11 +2036,176 @@ e_border_adjust_limits(E_Border * b)
}
void
+e_border_redraw_region(E_Border * b, int x, int y, int w, int h)
+{
+ GC gc;
+ Evas_List *windows;
+
+ gc = ecore_gc_new(b->win.b);
+
+ windows = b->windows;
+
+ while (windows)
+ {
+ int xx, yy, ww, hh;
+ Window window;
+
+ window = (Window) windows->data;
+ ecore_window_get_geometry(window, &xx, &yy, &ww, &hh);
+
+ if (INTERSECTS(x, y, w, h, xx, yy, ww, hh))
+ {
+ int rw, rh;
+
+ rw = MIN(w, ww);
+ rh = MIN(h, hh);
+ ecore_window_clear_area(window, x, y, rw, rh);
+ }
+
+ windows = windows->next;
+ }
+
+ ecore_gc_free(gc);
+}
+
+void
+e_border_update_render(E_Border * b)
+{
+ GC gc1, gc2;
+ Evas_List *up, *hp, *owin, *nwin = NULL;
+ Window window;
+ Pixmap pmap, mask, temp;
+ int pl, pr, pt, pb;
+ Evas_Engine_Info_Software_X11 *info;
+
+ pmap = ecore_pixmap_new(b->win.b, b->current.w, b->current.h, 0);
+ mask = ecore_pixmap_new(b->win.b, b->current.w, b->current.h, 1);
+
+ gc1 = ecore_gc_new(pmap);
+ gc2 = ecore_gc_new(mask);
+
+ info = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(b->evas);
+ info->info.drawable = pmap;
+ info->info.mask = mask;
+ evas_engine_info_set(b->evas, (Evas_Engine_Info *) info);
+
+ /*
+ * Hide the bits and render to clear the old appearance from generating
+ * damage rectangles.
+ */
+ if (b->bits.b)
+ {
+ ebits_hide(b->bits.b);
+ }
+
+ if (b->obj.title)
+ {
+ evas_object_hide(b->obj.title_clip);
+ }
+
+ evas_render(b->evas);
+
+ /*
+ * Position and then show the bits so we only get damage rectangles for the
+ * area we want shown.
+ */
+ if (b->bits.b)
+ {
+ ebits_move(b->bits.b, 0, 0);
+ ebits_resize(b->bits.b, b->current.w, b->current.h);
+ ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
+ ebits_show(b->bits.b);
+ }
+
+ if (b->obj.title)
+ {
+ double tx, ty, tw, th;
+
+ ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw,
+ &th);
+ e_text_move(b->obj.title, tx, ty);
+ e_text_set_layer(b->obj.title, 1);
+
+ evas_object_move(b->obj.title_clip, tx, ty);
+ evas_object_resize(b->obj.title_clip, tw, th);
+ evas_object_show(b->obj.title_clip);
+ }
+
+ hp = up = evas_render_updates(b->evas);
+
+ owin = b->windows;
+ b->windows = NULL;
+
+ D("Rendering %d rectangles for border %p { w = %d, h = %d }\n",
+ (up ? up->count : 0), b, b->current.w, b->current.h);
+ while (up)
+ {
+ Evas_Rectangle *u;
+
+ u = up->data;
+
+ D("\tRectangle { x = %d, y = %d, w = %d, h = %d }\n",
+ u->x, u->y, u->w, u->h);
+
+ /* Copy the large pixmap to a series of small pixmaps. */
+ temp = ecore_pixmap_new(b->win.b, u->w, u->h, 0);
+ ecore_gc_set_fg(gc1, 0);
+ ecore_fill_rectangle(temp, gc1, 0, 0, u->w, u->h);
+ ecore_gc_set_fg(gc1, 1);
+ ecore_area_copy(pmap, temp, gc1, u->x, u->y, u->w, u->h, 0, 0);
+
+ /* Setup small windows for borders, with the pixmaps as backgrounds */
+ window = ecore_window_override_new(b->win.main, u->x, u->y, u->w, u->h);
+ ecore_window_set_events_propagate(window, 1);
+ ecore_window_set_events(window, XEV_IN_OUT | XEV_MOUSE_MOVE |
+ XEV_BUTTON);
+ ecore_window_set_background_pixmap(window, temp);
+ ecore_pixmap_free(temp);
+
+ /* Copy the large mask to a series of small masks. */
+ temp = ecore_pixmap_new(b->win.b, u->w, u->h, 1);
+ ecore_gc_set_fg(gc2, 0);
+ ecore_fill_rectangle(temp, gc2, 0, 0, u->w, u->h);
+ ecore_gc_set_fg(gc2, 1);
+ ecore_area_copy(mask, temp, gc2, u->x, u->y, u->w, u->h, 0, 0);
+
+ ecore_window_set_shape_mask(window, temp);
+ ecore_pixmap_free(temp);
+
+ nwin = evas_list_append(nwin, (void *)window);
+ up = up->next;
+ }
+
+ evas_render_updates_free(hp);
+
+ ecore_gc_free(gc1);
+ ecore_gc_free(gc2);
+
+ ecore_pixmap_free(pmap);
+ ecore_pixmap_free(mask);
+
+ /* Update the display all at once. */
+ b->windows = nwin;
+ while (nwin)
+ {
+ window = (Window)nwin->data;
+ ecore_window_raise(window);
+ ecore_window_show(window);
+ nwin = nwin->next;
+ }
+
+ /* Order is important here to have a smooth update */
+ e_border_redraw_region(b, 0, 0, b->current.w, b->current.h);
+ e_border_cleanup_window_list(owin);
+
+ D("Finished rendering update\n");
+}
+
+void
e_border_update(E_Border * b)
{
int location_changed = 0;
int size_changed = 0;
- int shape_changed = 0;
int border_changed = 0;
int visibility_changed = 0;
int state_changed = 0;
@@ -2179,7 +2224,7 @@ e_border_update(E_Border * b)
if ((b->current.w != b->previous.w) || (b->current.h != b->previous.h))
size_changed = 1;
if ((size_changed) && (b->current.has_shape))
- shape_changed = 1;
+ b->shape_changed = 1;
if (b->current.selected != b->previous.selected)
state_changed = 1;
if (state_changed)
@@ -2198,7 +2243,7 @@ e_border_update(E_Border * b)
border_changed = 1;
}
if ((border_changed) && (b->current.has_shape))
- shape_changed = 1;
+ b->shape_changed = 1;
if (b->current.visible != b->previous.visible)
visibility_changed = 1;
@@ -2217,7 +2262,7 @@ e_border_update(E_Border * b)
}
else if (size_changed)
{
- int pl, pr, pt, pb, x, y, w, h;
+ int pl, pr, pt, pb, w, h;
int smaller;
if ((b->current.shaped_client) || (b->previous.shaped_client) ||
@@ -2232,88 +2277,38 @@ e_border_update(E_Border * b)
ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
ecore_window_move_resize(b->win.input,
0, 0, b->current.w, b->current.h);
- if (smaller)
+ ecore_window_move_resize(b->win.main,
+ b->current.x, b->current.y,
+ b->current.w, b->current.h);
+ w = b->current.w, h = b->current.h;
+ if ((w < 1) || (h < 1))
+ ecore_window_hide(b->win.b);
+ else
{
- if (b->current.shaded == b->client.h)
- {
- ecore_window_move_resize(b->win.client,
- 0, -b->current.shaded,
- b->client.w, b->client.h);
- ecore_window_move_resize(b->win.container,
- b->current.w + 1,
- b->current.h + 1, 320, 320);
- }
- else
- {
- ecore_window_move_resize(b->win.client,
- 0, -b->current.shaded,
- b->client.w, b->client.h);
- ecore_window_move_resize(b->win.container,
- pl,
- pt,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
- }
- ecore_window_move_resize(b->win.main,
- b->current.x, b->current.y,
- b->current.w, b->current.h);
+ ecore_window_show(b->win.b);
+ ecore_window_move_resize(b->win.b, 0, 0, w, h);
+ evas_output_size_set(b->evas, w, h);
+ evas_output_viewport_set(b->evas, 0, 0, w, h);
+ }
- x = 0, y = 0, w = b->current.w, h = b->current.h;
- if ((w < 1) || (h < 1))
- ecore_window_hide(b->win.b);
- else
- {
- ecore_window_show(b->win.b);
- ecore_window_move_resize(b->win.b, x, y, w, h);
- evas_set_output_size(b->evas, w, h);
- evas_set_output_viewport(b->evas, x, y, w, h);
- }
+ if (b->current.shaded == b->client.h)
+ {
+ ecore_window_move_resize(b->win.container,
+ b->current.w + 1,
+ b->current.h + 1, 320, 320);
}
else
{
- ecore_window_move_resize(b->win.main,
- b->current.x, b->current.y,
- b->current.w, b->current.h);
- x = 0, y = 0, w = b->current.w, h = b->current.h;
- if ((w < 1) || (h < 1))
- ecore_window_hide(b->win.b);
- else
- {
- ecore_window_show(b->win.b);
- ecore_window_move_resize(b->win.b, x, y, w, h);
- evas_set_output_size(b->evas, w, h);
- evas_set_output_viewport(b->evas, x, y, w, h);
- }
-
- if (b->current.shaded == b->client.h)
- {
- ecore_window_move_resize(b->win.container,
- b->current.w + 1,
- b->current.h + 1, 320, 320);
- ecore_window_move_resize(b->win.client,
- 0, -b->current.shaded,
- b->client.w, b->client.h);
- }
- else
- {
- ecore_window_move_resize(b->win.container,
- pl,
- pt,
- b->current.w - pl - pr,
- b->current.h - pt - pb);
- ecore_window_move_resize(b->win.client,
- 0, -b->current.shaded,
- b->client.w, b->client.h);
- }
+ ecore_window_move_resize(b->win.container,
+ pl,
+ pt,
+ b->current.w - pl - pr,
+ b->current.h - pt - pb);
}
- if (b->bits.b)
- {
- ebits_resize(b->bits.b, b->current.w, b->current.h);
- evas_clear_obscured_rects(b->evas);
- evas_add_obscured_rect(b->evas, pl, pt, b->current.w - pl - pr,
- b->current.h - pt - pb);
- }
+ ecore_window_move_resize(b->win.client,
+ 0, -b->current.shaded,
+ b->client.w, b->client.h);
e_icccm_move_resize(b->win.client,
b->current.x + pl,
@@ -2323,27 +2318,19 @@ e_border_update(E_Border * b)
}
if ((b->client.title) && (b->bits.b))
{
- double tx, ty, tw, th;
-
- ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw,
- &th);
-
if (b->obj.title)
{
- e_text_set_text(b->obj.title, b->client.title);
- e_text_move(b->obj.title, tx, ty);
+ if (strcmp(b->client.title, b->obj.title->text))
+ {
+ e_text_set_text(b->obj.title, b->client.title);
+ b->shape_changed = 1;
+ }
if (b->current.selected)
e_text_set_state(b->obj.title, "selected");
else
e_text_set_state(b->obj.title, "normal");
}
- evas_move(b->evas, b->obj.title_clip, tx, ty);
- evas_resize(b->evas, b->obj.title_clip, tw, th);
-
- if (b->obj.title)
- e_text_set_layer(b->obj.title, 1);
}
- e_border_reshape(b);
if (visibility_changed)
{
if (b->current.visible)
@@ -2386,11 +2373,9 @@ 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);
+ auto_raise = config_data->window->auto_raise;
if (auto_raise)
e_border_raise((E_Border *) b);
@@ -2398,38 +2383,60 @@ e_border_raise_delayed(int val, void *b)
UN(val);
}
+float
+e_border_delayed_val()
+{
+ return config_data->window->raise_delay;
+}
+
void
e_border_raise(E_Border * b)
{
- Evas_List l;
+ Evas_List *l;
+ Evas_List **windows;
E_Border *rel;
D_ENTER;
- if (!b->desk->windows)
+ /* Sticky windows are not on a particular desktop, but we need the current
+ * desktop window list to raise the window correctly. */
+ if (b->client.sticky)
{
- b->desk->windows = evas_list_append(b->desk->windows, b);
- b->desk->changed = 1;
+ E_Desktop *desk;
+
+ desk = e_desktops_get(e_desktops_get_current());
+ windows = &desk->windows;
+ }
+ else
+ windows = &b->desk->windows;
+
+ if (!(*windows))
+ {
+ *windows = evas_list_append(*windows, b);
ecore_window_raise(b->win.main);
D_RETURN;
}
- for (l = b->desk->windows; l; l = l->next)
+ for (l = *windows; l; l = l->next)
{
rel = l->data;
if (rel->client.layer > b->client.layer)
{
- 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;
+ if (!b->client.sticky)
+ {
+ *windows = evas_list_remove(*windows, b);
+ *windows = evas_list_prepend_relative(*windows, b, rel);
+ }
+
ecore_window_stack_below(b->win.main, rel->win.main);
D_RETURN;
}
if ((!l->next) && (l->data != b))
{
- b->desk->windows = evas_list_remove(b->desk->windows, b);
- b->desk->windows = evas_list_append(b->desk->windows, b);
- b->desk->changed = 1;
+ if (!b->client.sticky)
+ {
+ *windows = evas_list_remove(*windows, b);
+ *windows = evas_list_append(*windows, b);
+ }
ecore_window_raise(b->win.main);
D_RETURN;
}
@@ -2441,29 +2448,39 @@ e_border_raise(E_Border * b)
void
e_border_lower(E_Border * b)
{
- Evas_List l;
+ Evas_List *l;
+ Evas_List **windows;
E_Border *rel;
D_ENTER;
- if (!b->desk->windows)
+ /* Sticky windows are not on a particular desktop, but we need the current
+ * desktop window list to raise the window correctly. */
+ if (b->client.sticky)
{
- b->desk->windows = evas_list_append(b->desk->windows, b);
- b->desk->changed = 1;
+ E_Desktop *desk;
+
+ desk = e_desktops_get(e_desktops_get_current());
+ windows = &desk->windows;
+ }
+ else
+ windows = &b->desk->windows;
+
+ if (!(*windows))
+ {
+ *windows = evas_list_append(*windows, b);
ecore_window_raise(b->win.main);
D_RETURN;
}
- for (l = b->desk->windows; l; l = l->next)
+ for (l = *windows; l; l = l->next)
{
rel = l->data;
if (rel->client.layer == b->client.layer)
{
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;
+ *windows = evas_list_remove(*windows, b);
+ *windows = evas_list_prepend_relative(*windows, b, rel);
ecore_window_stack_below(b->win.main, rel->win.main);
D_RETURN;
}
@@ -2475,22 +2492,34 @@ e_border_lower(E_Border * b)
void
e_border_raise_above(E_Border * b, E_Border * above)
{
+ Evas_List **windows;
+
D_ENTER;
- if (!b->desk->windows)
+ /* Sticky windows are not on a particular desktop, but we need the current
+ * desktop window list to raise the window correctly. */
+ if (b->client.sticky)
+ {
+ E_Desktop *desk;
+
+ desk = e_desktops_get(e_desktops_get_current());
+ windows = &desk->windows;
+ }
+ else
+ windows = &b->desk->windows;
+
+ if (!(*windows))
{
- b->desk->windows = evas_list_append(b->desk->windows, b);
- b->desk->changed = 1;
+ *windows = evas_list_append(*windows, b);
ecore_window_raise(b->win.main);
D_RETURN;
}
- if (!evas_list_find(b->desk->windows, above))
+ if (!evas_list_find(*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;
+ *windows = evas_list_remove(*windows, b);
+ *windows = evas_list_append_relative(*windows, b, above);
ecore_window_stack_above(b->win.main, above->win.main);
D_RETURN;
@@ -2499,21 +2528,33 @@ e_border_raise_above(E_Border * b, E_Border * above)
void
e_border_lower_below(E_Border * b, E_Border * below)
{
+ Evas_List **windows;
+
D_ENTER;
- if (!b->desk->windows)
+ /* Sticky windows are not on a particular desktop, but we need the current
+ * desktop window list to raise the window correctly. */
+ if (b->client.sticky)
{
- b->desk->windows = evas_list_append(b->desk->windows, b);
- b->desk->changed = 1;
+ E_Desktop *desk;
+
+ desk = e_desktops_get(e_desktops_get_current());
+ windows = &desk->windows;
+ }
+ else
+ windows = &b->desk->windows;
+
+ if (!(*windows))
+ {
+ *windows = evas_list_append(*windows, b);
D_RETURN;
}
- if (!evas_list_find(b->desk->windows, below))
+ if (!evas_list_find(*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;
+ *windows = evas_list_remove(*windows, b);
+ *windows = evas_list_prepend_relative(*windows, b, below);
ecore_window_stack_below(b->win.main, below->win.main);
D_RETURN;
@@ -2522,14 +2563,8 @@ e_border_lower_below(E_Border * b, E_Border * below)
void
e_border_init(void)
{
- double raise_delay = 0.5;
-
- E_CFG_FLOAT(cfg_raise_delay, "settings", "/window/raise/delay", 0.5);
-
D_ENTER;
- E_CONFIG_FLOAT_GET(cfg_raise_delay, raise_delay);
-
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);
@@ -2555,7 +2590,7 @@ e_border_init(void)
delayed_window_raise =
e_delayed_action_new(E_EVENT_BORDER_FOCUS_IN,
- raise_delay, e_border_raise_delayed);
+ e_border_delayed_val, e_border_raise_delayed);
ecore_add_event_timer("e_border_poll()", 1.00, e_border_poll, 0, NULL);
@@ -2603,7 +2638,7 @@ e_border_adopt_children(Window win)
E_Border *
e_border_current_focused(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
for (l = borders; l; l = l->next)
@@ -2629,7 +2664,7 @@ e_border_current_focused(void)
void
e_border_focus_grab_ended(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -2651,7 +2686,7 @@ e_border_viewable(E_Border * b)
{
D_ENTER;
- if (b->desk != e_desktops_get(0))
+ if (b->desk != e_desktops_get(e_desktops_get_current()))
D_RETURN_(0);
if (b->current.x + b->current.w <= 0)
@@ -2677,47 +2712,8 @@ 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
-e_border_raise_next(void)
-{
- Evas_List next;
- E_Border *current;
-
- D_ENTER;
-
- if (!borders)
- D_RETURN;
-
- current = e_border_current_focused();
-
- /* Find the current border on the list of borders */
- for (next = borders; next && next->data != current; next = next->next);
-
- /* Step to the next border, wrap around the queue if the end is reached */
- if (next && next->next)
- next = next->next;
- else
- next = borders;
-
- /* Now find the next viewable border on the same desktop */
- current = (E_Border *) next->data;
- while (next && (!e_border_viewable(current) || current->client.is_desktop))
- {
- next = next->next;
- if (!next)
- next = borders;
-
- current = (E_Border *) next->data;
- }
-
- e_border_raise(current);
- e_border_send_pointer(current);
+ ecore_pointer_warp_to(b->current.x + b->current.w / 2,
+ b->current.y + b->current.h / 2);
D_RETURN;
}
@@ -2766,9 +2762,35 @@ e_border_set_gravity(E_Border * b, int gravity)
D_RETURN;
}
-Evas_List
+Evas_List *
e_border_get_borders_list()
{
D_ENTER;
D_RETURN_(borders);
}
+
+void
+e_borders_scroll_list(Evas_List *borders, int dx, int dy)
+{
+ Evas_List *l;
+
+ for (l = borders; l; l = l->next)
+ {
+ E_Border *b;
+
+ b = l->data;
+ ecore_window_gravity_reset(b->win.main);
+ if ((!b->client.is_desktop) && (!b->mode.move))
+ {
+ b->previous.requested.x = b->current.requested.x;
+ b->previous.requested.y = b->current.requested.y;
+ b->previous.x = b->current.x;
+ b->previous.y = b->current.y;
+ b->current.requested.x += dx;
+ b->current.requested.y += dy;
+ b->current.x = b->current.requested.x;
+ b->current.y = b->current.requested.y;
+ b->changed = 1;
+ }
+ }
+}
diff --git a/src/border.h b/src/border.h
index 8c7afe951..b0a287b4d 100644
--- a/src/border.h
+++ b/src/border.h
@@ -36,18 +36,17 @@ struct _E_Border
Window client;
}
win;
- Evas evas;
+ Evas *evas;
struct
{
E_Text *title;
- Evas_Object title_clip;
+ Evas_Object *title_clip;
}
obj;
- Pixmap pixmap;
+ Evas_List *windows;
struct
{
int new;
- char *file;
Ebits_Object b;
}
bits;
@@ -198,7 +197,6 @@ struct _E_Border
int shape_changed;
int placed;
- Evas_List grabs;
E_Grab *click_grab;
E_Desktop *desk;
@@ -209,8 +207,6 @@ struct _E_Border
int hold_changes;
- Evas_List menus;
-
int changed;
};
@@ -225,6 +221,9 @@ void e_border_init(void);
E_Border *e_border_new(void);
void e_border_update_borders(void);
+void e_border_redraw_region(E_Border *b, int x, int y,
+ int w, int h);
+void e_border_update_render(E_Border * b);
void e_border_apply_border(E_Border * b);
void e_border_reshape(E_Border * b);
void e_border_release(E_Border * b);
@@ -251,11 +250,12 @@ void e_border_raise_above(E_Border * b, E_Border * above);
void e_border_lower_below(E_Border * b, E_Border * below);
E_Border *e_border_current_focused(void);
void e_border_focus_grab_ended(void);
-void e_border_raise_next(void);
void e_border_send_pointer(E_Border * b);
int e_border_viewable(E_Border * b);
void e_border_print_pos(char *buf, E_Border * b);
void e_border_print_size(char *buf, E_Border * b);
void e_border_set_gravity(E_Border * b, int gravity);
-Evas_List e_border_get_borders_list();
+Evas_List *e_border_get_borders_list();
+void e_borders_scroll_list(Evas_List *borders,
+ int dx, int dy);
#endif
diff --git a/src/bordermenu.c b/src/bordermenu.c
index 0e3923437..17bfefd23 100644
--- a/src/bordermenu.c
+++ b/src/bordermenu.c
@@ -6,6 +6,8 @@
#include "icccm.h"
#include "bordermenu.h"
+static E_Menu *bordermenu = NULL;
+
static void e_bordermenu_cb_close(E_Menu * m, E_Menu_Item * mi,
void *data);
static void e_bordermenu_cb_kill(E_Menu * m, E_Menu_Item * mi,
@@ -37,7 +39,8 @@ static void e_bordermenu_cb_remember_prog_location_ignore(E_Menu * m,
E_Menu_Item *
mi,
void *data);
-static void e_bordermenu_cb_menu_hide(E_Menu * m, void *data);
+static void e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi,
+ void *data);
static void
e_bordermenu_cb_close(E_Menu * m, E_Menu_Item * mi, void *data)
@@ -331,20 +334,32 @@ e_bordermenu_cb_remember_prog_location_ignore(E_Menu * m, E_Menu_Item * mi,
}
static void
-e_bordermenu_cb_menu_hide(E_Menu * m, void *data)
+e_bordermenu_cb_to_desktop(E_Menu * m, E_Menu_Item * mi, void *data)
{
+ int d = 0;
E_Border *b;
+ E_Desktop *desk;
D_ENTER;
b = data;
+ if (b->client.sticky)
+ D_RETURN;
- while (b->menus)
- {
- m = b->menus->data;
- m->delete_me = 1;
- b->menus = evas_list_remove(b->menus, m);
- }
+ e_desktops_del_border(b->desk, b);
+
+ sscanf(mi->str, "Desktop %d", &d);
+ desk = e_desktops_get(d);
+ if (!desk)
+ desk = e_desktops_get(e_desktops_get_current());
+ D("Sending border %p to desk %d\n", b, d);
+
+ e_desktops_add_border(desk, b);
+ b->client.desk = d;
+
+ b->current.requested.visible = 0;
+ b->changed = 1;
+ e_border_update_borders();
D_RETURN;
UN(m);
@@ -353,18 +368,19 @@ e_bordermenu_cb_menu_hide(E_Menu * m, void *data)
void
e_bordermenu_do(E_Border * b)
{
+ int i;
+ char label[PATH_MAX];
E_Menu *menu;
+ E_Menu *menu2;
E_Menu_Item *menuitem;
D_ENTER;
- if (!b->menus)
+ if (!bordermenu)
{
menu = e_menu_new();
- b->menus = evas_list_append(b->menus, menu);
e_menu_set_padding_icon(menu, 2);
e_menu_set_padding_state(menu, 2);
- e_menu_hide_callback(menu, e_bordermenu_cb_menu_hide, b);
menuitem = e_menu_item_new("Close");
/* e_menu_item_set_icon(menuitem, icon); */
@@ -451,6 +467,24 @@ e_bordermenu_do(E_Border * b)
b);
e_menu_add_item(menu, menuitem);
e_menu_set_state(menu, menuitem);
+
+ menu2 = e_menu_new();
+ e_menu_set_padding_icon(menu2, 2);
+ e_menu_set_padding_state(menu2, 2);
+
+ for (i = 0; i < e_desktops_get_num(); i++)
+ {
+ snprintf(label, PATH_MAX, "Desktop %d", i);
+ menuitem = e_menu_item_new(label);
+ e_menu_item_set_callback(menuitem, e_bordermenu_cb_to_desktop, b);
+ e_menu_add_item(menu2, menuitem);
+ }
+
+ menuitem = e_menu_item_new("Goto Desktop...");
+ e_menu_item_set_submenu(menuitem, menu2);
+ e_menu_add_item(menu, menuitem);
+
+ bordermenu = menu;
}
{
@@ -458,7 +492,7 @@ e_bordermenu_do(E_Border * b)
int crx, cry, crw, crh;
int mx, my;
- menu = b->menus->data;
+ menu = bordermenu;
pl = pr = pt = pb = 0;
if (b->bits.b)
ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
@@ -480,3 +514,10 @@ e_bordermenu_do(E_Border * b)
D_RETURN;
}
+
+void
+e_bordermenu_hide(void)
+{
+ if (bordermenu)
+ e_menu_hide(bordermenu);
+}
diff --git a/src/bordermenu.h b/src/bordermenu.h
index fb864db6c..738bcb1f8 100644
--- a/src/bordermenu.h
+++ b/src/bordermenu.h
@@ -4,5 +4,6 @@
#include "e.h"
void e_bordermenu_do(E_Border * b);
+void e_bordermenu_hide(void);
#endif
diff --git a/src/config.c b/src/config.c
index 4b48d81e1..92488ad5a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1,6 +1,12 @@
#include "debug.h"
+#include "actions.h"
+#include "border.h"
#include "config.h"
+#include "data.h"
+#include "e_dir.h"
#include "file.h"
+#include "keys.h"
+#include "observer.h"
#include "util.h"
static char cfg_root[] = "";
@@ -24,6 +30,24 @@ static char cfg_fonts_dir[PATH_MAX] = "";
static char cfg_epplets_dir[PATH_MAX] = "";
static char cfg_layout_dir[PATH_MAX] = "";
+static E_Observer *behavior_dir = NULL;
+E_Config *config_data;
+
+E_Data_Base_Type *cfg_actions = NULL;
+E_Data_Base_Type *cfg_config = NULL;
+E_Data_Base_Type *cfg_desktops = NULL;
+E_Data_Base_Type *cfg_grabs = NULL;
+E_Data_Base_Type *cfg_guides = NULL;
+E_Data_Base_Type *cfg_match = NULL;
+E_Data_Base_Type *cfg_menu = NULL;
+E_Data_Base_Type *cfg_move = NULL;
+E_Data_Base_Type *cfg_window = NULL;
+
+void e_config_behavior_changed(E_Observer * observer,
+ E_Observee * observee,
+ E_Event_Type event, void *data);
+void e_config_settings_reload(char *buf);
+
char *
e_config_get(char *type)
{
@@ -74,25 +98,159 @@ e_config_get(char *type)
E_CONF("images", cfg_images_dir, PACKAGE_DATA_DIR "/data/images/");
E_CONF("cursors", cfg_cursors_dir, PACKAGE_DATA_DIR "/data/cursors/");
E_CONF("backgrounds", cfg_backgrounds_dir,
- PACKAGE_DATA_DIR"/data/backgrounds/");
- E_CONF("fonts", cfg_fonts_dir,
- PACKAGE_DATA_DIR"/data/fonts/");
- E_CONF("epplets", cfg_epplets_dir,
- PACKAGE_DATA_DIR"/data/epplets/");
- E_CONF("layout", cfg_layout_dir,
- PACKAGE_DATA_DIR"/data/layout/");
+ PACKAGE_DATA_DIR "/data/backgrounds/");
+ E_CONF("fonts", cfg_fonts_dir, PACKAGE_DATA_DIR "/data/fonts/");
+ E_CONF("epplets", cfg_epplets_dir, PACKAGE_DATA_DIR "/data/epplets/");
+ E_CONF("layout", cfg_layout_dir, PACKAGE_DATA_DIR "/data/layout/");
D_RETURN_("");
}
void
+e_config_actions_init()
+{
+ D_ENTER;
+
+ /*
+ * Define the data type for the E_Actions struct.
+ */
+ cfg_actions = e_data_type_new();
+ E_DATA_NODE(cfg_actions, "name", E_DATA_TYPE_STR, NULL, E_Action, name,
+ (E_Data_Value) "");
+ E_DATA_NODE(cfg_actions, "action", E_DATA_TYPE_STR, NULL, E_Action, action,
+ (E_Data_Value) "");
+ E_DATA_NODE(cfg_actions, "params", E_DATA_TYPE_STR, NULL, E_Action,
+ params, (E_Data_Value) "");
+ E_DATA_NODE(cfg_actions, "event", E_DATA_TYPE_INT, NULL, E_Action, event,
+ (E_Data_Value) 0);
+ E_DATA_NODE(cfg_actions, "button", E_DATA_TYPE_INT, NULL, E_Action, button,
+ (E_Data_Value) 0);
+ E_DATA_NODE(cfg_actions, "key", E_DATA_TYPE_STR, NULL, E_Action, key,
+ (E_Data_Value) 0);
+ E_DATA_NODE(cfg_actions, "modifiers", E_DATA_TYPE_INT, NULL, E_Action,
+ modifiers, (E_Data_Value) 0);
+
+ D_RETURN;
+}
+
+void
+e_config_desktops_init()
+{
+ cfg_desktops = e_data_type_new();
+ E_DATA_NODE(cfg_desktops, "count", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ count, (E_Data_Value) 8);
+ E_DATA_NODE(cfg_desktops, "scroll", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ scroll, (E_Data_Value) 1);
+ E_DATA_NODE(cfg_desktops, "scroll_sticky", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ scroll_sticky, (E_Data_Value) 1);
+ E_DATA_NODE(cfg_desktops, "resist", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ resist, (E_Data_Value) 5);
+ E_DATA_NODE(cfg_desktops, "speed", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ speed, (E_Data_Value) 30);
+ E_DATA_NODE(cfg_desktops, "width", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ width, (E_Data_Value) 1);
+ E_DATA_NODE(cfg_desktops, "height", E_DATA_TYPE_INT, NULL, E_Config_Desktops,
+ height, (E_Data_Value) 1);
+}
+
+void
+e_config_grabs_init()
+{
+ cfg_grabs = e_data_type_new();
+ E_DATA_NODE(cfg_grabs, "button", E_DATA_TYPE_INT, NULL, E_Grab, button,
+ (E_Data_Value) 0);
+ E_DATA_NODE(cfg_grabs, "modifiers", E_DATA_TYPE_INT, NULL, E_Grab, mods,
+ (E_Data_Value) 0);
+}
+
+void
+e_config_guides_init()
+{
+ cfg_guides = e_data_type_new();
+ E_DATA_NODE(cfg_guides, "display/location", E_DATA_TYPE_INT, NULL,
+ E_Config_Guides, location, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_guides, "display/x", E_DATA_TYPE_FLOAT, NULL,
+ E_Config_Guides, x, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_guides, "display/y", E_DATA_TYPE_FLOAT, NULL,
+ E_Config_Guides, y, (E_Data_Value) 0);
+}
+
+void
+e_config_menu_init()
+{
+ cfg_menu = e_data_type_new();
+ E_DATA_NODE(cfg_menu, "scroll/resist", E_DATA_TYPE_INT, NULL,
+ E_Config_Menu, resist, (E_Data_Value) 5);
+ E_DATA_NODE(cfg_menu, "scroll/speed", E_DATA_TYPE_INT, NULL,
+ E_Config_Menu, speed, (E_Data_Value) 12);
+}
+
+void
+e_config_move_init()
+{
+ cfg_move = e_data_type_new();
+ E_DATA_NODE(cfg_move, "resist", E_DATA_TYPE_INT, NULL,
+ E_Config_Move, resist, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_move, "resist/win", E_DATA_TYPE_INT, NULL,
+ E_Config_Move, win_resist, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_move, "resist/desk", E_DATA_TYPE_INT, NULL,
+ E_Config_Move, desk_resist, (E_Data_Value) 0);
+}
+
+void
+e_config_window_init()
+{
+ cfg_window = e_data_type_new();
+ E_DATA_NODE(cfg_window, "resize/mode", E_DATA_TYPE_INT, NULL,
+ E_Config_Window, resize_mode, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_window, "move/mode", E_DATA_TYPE_INT, NULL,
+ E_Config_Window, move_mode, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_window, "focus/mode", E_DATA_TYPE_INT, NULL, E_Config_Window,
+ focus_mode, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_window, "raise/auto", E_DATA_TYPE_INT, NULL,
+ E_Config_Window, auto_raise, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_window, "raise/delay", E_DATA_TYPE_FLOAT, NULL,
+ E_Config_Window, raise_delay, (E_Data_Value) (float)0.6);
+ E_DATA_NODE(cfg_window, "place/mode", E_DATA_TYPE_INT, NULL,
+ E_Config_Window, place_mode, (E_Data_Value) 0);
+}
+
+void
e_config_init(void)
{
char buf[PATH_MAX];
+ E_Dir *dir;
D_ENTER;
-#if 1 /* for now don't do this. i think a cp -r will be needed later anyway */
+ /* Start by initializing the data loading structures */
+ e_config_actions_init();
+ e_config_desktops_init();
+ e_config_grabs_init();
+ e_config_guides_init();
+ e_config_menu_init();
+ e_config_move_init();
+ e_config_window_init();
+
+ /* Then place the data structures within the config description */
+ cfg_config = e_data_type_new();
+ E_DATA_NODE(cfg_config, "actions", E_DATA_TYPE_LIST, cfg_actions,
+ E_Config, actions, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_config, "grabs", E_DATA_TYPE_LIST, cfg_grabs,
+ E_Config, grabs, (E_Data_Value) 0);
+
+ E_DATA_NODE(cfg_config, "desktops", E_DATA_TYPE_PTR, cfg_desktops,
+ E_Config, desktops, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_config, "guides", E_DATA_TYPE_PTR, cfg_guides,
+ E_Config, guides, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_config, "menu", E_DATA_TYPE_PTR, cfg_menu,
+ E_Config, menu, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_config, "move", E_DATA_TYPE_PTR, cfg_move,
+ E_Config, move, (E_Data_Value) 0);
+ E_DATA_NODE(cfg_config, "window", E_DATA_TYPE_PTR, cfg_window,
+ E_Config, window, (E_Data_Value) 0);
+
+ /* Create directories as needed */
if (!e_file_is_dir(e_config_user_dir()))
e_file_mkdir(e_config_user_dir());
snprintf(buf, PATH_MAX, "%sappearance", e_config_user_dir());
@@ -104,6 +262,8 @@ e_config_init(void)
snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir());
if (!e_file_is_dir(buf))
e_file_mkdir(buf);
+
+ /* With the directories created, create files if needed and load config */
snprintf(buf, PATH_MAX, "%sbehavior/grabs.db", e_config_user_dir());
if (!e_file_exists(buf))
e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/grabs.db", buf);
@@ -119,22 +279,74 @@ e_config_init(void)
if (!e_file_exists(buf))
e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/apps_menu.db",
buf);
- snprintf(buf, PATH_MAX, "%sappearance/borders/border.bits.db",
- e_config_user_dir());
-#endif
-#if 0
- ts();
-#endif
+ snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir());
+ if (!e_file_exists(buf))
+ e_file_cp(PACKAGE_DATA_DIR "/data/config/behavior/default/behavior.db",
+ buf);
+
+ /* Load config data and begin monitoring it with efsd */
+ e_config_behavior_changed(NULL, NULL, 0, NULL);
+
+ snprintf(buf, PATH_MAX, "%sbehavior", e_config_user_dir());
+ dir = e_dir_new();
+ e_dir_set_dir(dir, buf);
+
+ behavior_dir = NEW(E_Observer, 1);
+ ZERO(behavior_dir, sizeof(E_Observer), 1);
+ e_observer_init(behavior_dir, E_EVENT_FILE_CHANGE,
+ e_config_behavior_changed, free);
+ e_observer_register_observee(behavior_dir, E_OBSERVEE(dir));
D_RETURN;
}
void
+e_config_behavior_changed(E_Observer * observer, E_Observee * observee,
+ E_Event_Type event, void *data)
+{
+ char buf[PATH_MAX];
+ Evas_List *l;
+
+ if (config_data)
+ {
+ e_data_free(cfg_config, (char *)config_data);
+ FREE(config_data);
+ }
+
+ snprintf(buf, PATH_MAX, "%sbehavior/behavior.db", e_config_user_dir());
+ config_data = e_data_load(buf, "", cfg_config);
+
+ /* FIXME: this should probably be a function in actions.c */
+ for (l = config_data->actions; l; l = l->next)
+ {
+ E_Action *a;
+
+ a = l->data;
+ e_object_init(E_OBJECT(a), (E_Cleanup_Func) e_action_cleanup);
+ if ((a->key) && (strlen(a->key) > 0))
+ {
+ if (a->modifiers == -1)
+ e_keys_grab(a->key, ECORE_EVENT_KEY_MODIFIER_NONE, 1);
+ else
+ e_keys_grab(a->key, (Ecore_Event_Key_Modifiers) a->modifiers,
+ 0);
+ a->grabbed = 1;
+ }
+ }
+
+ return;
+ UN(observer);
+ UN(observee);
+ UN(event);
+ UN(data);
+}
+
+void
e_config_set_user_dir(char *dir)
{
D_ENTER;
- strcpy(cfg_root, dir);
+ STRNCPY(cfg_root, dir, PATH_MAX);
/* reset the cached dir paths */
cfg_grabs_db[0] = 0;
cfg_settings_db[0] = 0;
@@ -163,272 +375,11 @@ e_config_user_dir(void)
{
D_ENTER;
+ /* We copy the config files to the user's home dir, no need to fall back */
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 */
+
snprintf(cfg_user_dir, PATH_MAX, "%s/.e/", e_util_get_user_home());
-#else
- snprintf(cfg_user_dir, PATH_MAX, PACKAGE_DATA_DIR "/data/config/");
-#endif
D_RETURN_(cfg_user_dir);
}
-
-typedef struct _e_config_file_entry E_Config_File_Entry;
-
-struct _e_config_file_entry
-{
- char *name;
- struct
- {
- char *path;
- time_t last_mod;
- }
- user , system;
- Evas_List hash[256];
-};
-
-void
-e_config_add_change_cb(char *file, void (*func) (void *_data), void *data)
-{
-}
-
-void
-e_config_del_change_cb(char *file, void (*func) (void *_data))
-{
-}
-
-int
-e_config_val_int_get(char *file, char *key, int def)
-{
-}
-
-float
-e_config_val_float_get(char *file, char *key, float def)
-{
-}
-
-char *
-e_config_val_str_get(char *file, char *key, char *def)
-{
-}
-
-char *
-e_config_val_key_get(char *file, char *key, char *def)
-{
-}
-
-void
-e_config_type_add_node(E_Config_Base_Type * base, char *prefix,
- E_Config_Datatype type, E_Config_Base_Type * list_type,
- int offset, int def_int, float def_float, char *def_str)
-{
- E_Config_Node *cfg_node;
-
- D_ENTER;
-
- cfg_node = NEW(E_Config_Node, 1);
- ZERO(cfg_node, E_Config_Node, 1);
-
- cfg_node->prefix = strdup(prefix);
- cfg_node->type = type;
- cfg_node->sub_type = list_type;
- cfg_node->offset = offset;
- cfg_node->def_int = def_int;
- cfg_node->def_float = def_float;
- if (cfg_node->def_str)
- {
- e_strdup(cfg_node->def_str, def_str);
- }
- base->nodes = evas_list_append(base->nodes, cfg_node);
-
- D_RETURN;
-}
-
-E_Config_Base_Type *
-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);
-
- D_RETURN_(t);
-}
-
-void *
-e_config_load(char *file, char *prefix, E_Config_Base_Type * type)
-{
- E_DB_File *db;
- char buf[PATH_MAX];
- Evas_List l;
- char *data;
-
- D_ENTER;
-
- if (!e_file_exists(file))
- D_RETURN_(NULL);
- db = e_db_open_read(file);
-
- if (!db)
- D_RETURN_(NULL);
-
- data = NEW(char, type->size);
- ZERO(data, char, type->size);
-
- for (l = type->nodes; l; l = l->next)
- {
- E_Config_Node *node;
-
- node = l->data;
-
- switch (node->type)
- {
- case E_CFG_TYPE_INT:
- {
- int val;
-
- val = 0;
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if (e_db_int_get(db, buf, &val))
- (*((int *)(&(data[node->offset])))) = val;
- else
- (*((int *)(&(data[node->offset])))) = node->def_int;
- }
- break;
- case E_CFG_TYPE_STR:
- {
- char *val;
-
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if ((val = e_db_str_get(db, buf)))
- (*((char **)(&(data[node->offset])))) = val;
- else
- e_strdup((*((char **)(&(data[node->offset])))),
- node->def_str);
- }
- break;
- case E_CFG_TYPE_FLOAT:
- {
- float val;
-
- val = 0;
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- if (e_db_float_get(db, buf, &val))
- (*((float *)(&(data[node->offset])))) = val;
- else
- (*((float *)(&(data[node->offset])))) = node->def_float;
- }
- break;
- case E_CFG_TYPE_LIST:
- {
- Evas_List l2;
- int i, count;
-
- l2 = NULL;
- snprintf(buf, PATH_MAX, "%s/%s/count", prefix, node->prefix);
- count = 0;
- e_db_int_get(db, buf, &count);
- for (i = 0; i < count; i++)
- {
- void *data2;
-
- snprintf(buf, PATH_MAX, "%s/%s/%i", prefix, node->prefix,
- i);
- data2 = e_config_load(file, buf, node->sub_type);
- l2 = evas_list_append(l2, data2);
- }
- (*((Evas_List *) (&(data[node->offset])))) = l2;
- }
- break;
- case E_CFG_TYPE_KEY:
- {
- snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
- (*((char **)(&(data[node->offset])))) = strdup(buf);
- }
- break;
- default:
- break;
- }
- }
- e_db_close(db);
-
- D_RETURN_(data);
-}
-
-#if 0
-typedef struct _list_base List_Base;
-typedef struct _list_element List_Element;
-
-struct _list_base
-{
- Evas_List elements;
-};
-
-struct _list_element
-{
- char *name;
- int size;
- float perc;
-};
-
-/* eg: */
-void
-ts(void)
-{
- /* define the different config types and structs to the config engine */
- 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);
- E_CONFIG_NODE(cf_element, "perc", E_CFG_TYPE_FLOAT, NULL, List_Element, perc,
- 0, 3.1415, NULL);
-
- cf_list = e_config_type_new();
- E_CONFIG_NODE(cf_list, "list", E_CFG_TYPE_LIST, cf_element, List_Base,
- elements, 0, 0, NULL);
-
- /* now test it */
- {
- List_Base *cfg_data;
-
- /* load the base data type from the base of the test db file */
- cfg_data = e_config_load("test.db", "", cf_list);
- /* no data file? */
- if (!cfg_data)
- {
- D("no load!\n");
- }
- /* got data */
- else
- {
- Evas_List l;
-
- for (l = cfg_data->elements; l; l = l->next)
- {
- List_Element *cfg_element;
-
- D("element\n");
- cfg_element = l->data;
- D("... name %s\n", cfg_element->name);
- D("... size %i\n", cfg_element->size);
- D("... perc %3.3f\n", cfg_element->perc);
- }
- }
- exit(0);
- }
-
- D_RETURN;
-}
-
-#endif
diff --git a/src/config.h b/src/config.h
index f2a166fed..519e2d56b 100644
--- a/src/config.h
+++ b/src/config.h
@@ -3,218 +3,75 @@
#include "e.h"
-typedef struct _E_Config_File E_Config_File;
-typedef struct _E_Config_Element E_Config_Element;
-
-/* something to check validity of config files where we get data from */
-/* for now its just a 5 second timout so it will only invalidate */
-/* if we havent looked for 5 seconds... BUT later when efsd is more solid */
-/* we should use that to tell us when its invalid */
-struct _E_Config_File
+/*
+ * Define small subsets of the whole config for defining data types for
+ * loading from the databases.
+ */
+typedef struct _E_Config_Desktops E_Config_Desktops;
+struct _E_Config_Desktops
{
- char *src;
- double last_fetch;
+ int count;
+ int scroll;
+ int scroll_sticky;
+ int resist;
+ int speed;
+ int width;
+ int height;
};
-struct _E_Config_Element
+typedef struct _E_Config_Guides E_Config_Guides;
+struct _E_Config_Guides
{
- char *src;
- char *key;
- double last_fetch;
- int type;
- int def_int_val;
- float def_float_val;
- char *def_str_val;
- void *def_data_val;
- int def_data_val_size;
- int cur_int_val;
- float cur_float_val;
- char *cur_str_val;
- void *cur_data_val;
- int cur_data_val_size;
+ float x;
+ float y;
+ int location;
};
-#define E_CFG_FILE(_var, _src) \
-static E_Config_File _var = {_src, 0.0}
-#define E_CONFIG_CHECK_VALIDITY(_var, _src) \
-{ \
-double __time; \
-__time = ecore_get_time(); \
-if (_var.last_fetch < (__time - 5.0)) { \
-_var.last_fetch = __time;
-#define E_CONFIG_CHECK_VALIDITY_END \
-} \
-}
-
-typedef enum e_config_type
+typedef struct _E_Config_Menu E_Config_Menu;
+struct _E_Config_Menu
{
- E_CFG_INT_T,
- E_CFG_FLOAT_T,
- E_CFG_STR_T,
- E_CFG_DATA_T,
-}
-E_Config_Type;
-
-#define E_CFG_INT(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_INT_T, \
-_default, 0.0, NULL, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-
-#define E_CFG_FLOAT(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_FLOAT_T, \
-0, _default, NULL, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-
-#define E_CFG_STR(_var, _src, _key, _default) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_STR_T, \
-0, 0.0, _default, NULL, 0, \
-0, 0.0, NULL, NULL, 0, \
-}
-
-#define E_CFG_DATA(_var, _src, _key, _default, _default_size) \
-static E_Config_Element _var = { _src, _key, 0.0, E_CFG_DATAT_T, \
-0, 0.0, NULL, _default, _default_size, \
-0, 0.0, NULL, NULL, 0, \
-}
-
-/* yes for now it only fetches them every 5 seconds - in the end i need a */
-/* validity flag for the database file to know if it changed and only then */
-/* get the value again. this is waiting for efsd to become more solid */
-#define E_CFG_VALIDITY_CHECK(_var) \
-{ \
-double __time; \
-__time = ecore_get_time(); \
-if (_var.last_fetch < (__time - 5.0)) { \
-int __cfg_ok = 0; \
-_var.last_fetch = __time;
-
-#define E_CFG_END_VALIDITY_CHECK \
-} \
-}
-
-#define E_CONFIG_INT_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-E_DB_INT_GET(e_config_get(_var.src), _var.key, _var.cur_int_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_int_val = _var.def_int_val; \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_int_val;}
-
-#define E_CONFIG_FLOAT_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-E_DB_FLOAT_GET(e_config_get(_var.src), _var.key, _var.cur_float_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_float_val = _var.def_float_val; \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_float_val;}
-
-#define E_CONFIG_STR_GET(_var, _val) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-if (_var.cur_str_val) free(_var.cur_str_val); \
-_var.cur_str_val = NULL; \
-E_DB_STR_GET(e_config_get(_var.src), _var.key, _var.cur_str_val, __cfg_ok); \
-if (!__cfg_ok) _var.cur_str_val = _var.def_str_val \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_str_val;}
-
-#define E_CONFIG_DATA_GET(_var, _val, _size) \
-{{ \
-E_CFG_VALIDITY_CHECK(_var) \
-if (_var.cur_data_val) free(_var.cur_data_val); \
-_var.cur_data_val = NULL; \
-_var.cur_data_size = 0; \
-{ E_DB_File *__db; \
-__db = e_db_open_read(e_config_get(_var.src)); \
-if (__db) { \
-_var.cur_data_val = e_db_data_get(__db, _var.key, &(_var.cur_data_size)); \
-if (_var.cur_data_val) __cfg_ok = 1; \
-e_db_close(__db); \
-} \
-} \
-if (!__cfg_ok) { \
-_var.cur_data_val = e_memdup(_var.def_data_val, _var.def_data_size); \
-_var.cur_data_size = _var.def_data_size; \
-} \
-E_CFG_END_VALIDITY_CHECK \
-} \
-_val = _var.cur_data_val; \
-_size = _var.cur_data_size;}
-
-char *e_config_get(char *type);
-void e_config_init(void);
-void e_config_set_user_dir(char *dir);
-char *e_config_user_dir(void);
-
-typedef struct _e_config_base_type E_Config_Base_Type;
-typedef struct _e_config_node E_Config_Node;
-typedef struct _e_config_value E_Config_Value;
-typedef enum _e_config_datatype E_Config_Datatype;
+ int resist;
+ int speed;
+};
-enum _e_config_datatype
+typedef struct _E_Config_Move E_Config_Move;
+struct _E_Config_Move
{
- E_CFG_TYPE_INT,
- E_CFG_TYPE_STR,
- E_CFG_TYPE_FLOAT,
- E_CFG_TYPE_LIST,
- E_CFG_TYPE_KEY
+ int resist;
+ int win_resist;
+ int desk_resist;
};
-struct _e_config_base_type
+typedef struct _E_Config_Window E_Config_Window;
+struct _E_Config_Window
{
- int size;
- Evas_List nodes;
+ int move_mode;
+ int focus_mode;
+ int auto_raise;
+ float raise_delay;
+ int resize_mode;
+ int place_mode;
};
-struct _e_config_node
+typedef struct _E_Config E_Config;
+struct _E_Config
{
- char *prefix;
- E_Config_Datatype type;
- int offset;
- E_Config_Base_Type *sub_type;
- int def_int;
- float def_float;
- char *def_str;
+ Evas_List *actions;
+ Evas_List *grabs;
+ Evas_List *match;
+
+ E_Config_Desktops *desktops;
+ E_Config_Guides *guides;
+ E_Config_Menu *menu;
+ E_Config_Move *move;
+ E_Config_Window *window;
};
-#define E_CONFIG_NODE(var, prefix, type, sub, struct_type, struct_member, def_int, def_float, def_str) \
-{ \
- struct_type _cfg_dummy; \
- char *_cfg_p1, *_cfg_p2; \
- int _cfg_offset; \
- \
- _cfg_p1 = (char *)(&(_cfg_dummy)); \
- _cfg_p2 = (char *)(&(_cfg_dummy.struct_member)); \
- _cfg_offset = (int)(_cfg_p2 - _cfg_p1); \
- \
- e_config_type_add_node(var, prefix, type, sub, _cfg_offset, def_int, def_float, def_str); \
- var->size = sizeof(struct_type); \
-}
+extern E_Config *config_data;
-E_Config_Value *e_config_value_get_int(E_Config_Value * handle, char *file,
- char *prefix, char *key,
- int *val_ret, int default_val);
-E_Config_Value *e_config_value_get_str(E_Config_Value * handle, char *file,
- char *prefix, char *key,
- char **val_ret, char *default_val);
-E_Config_Value *e_config_value_get_float(E_Config_Value * handle,
- char *file, char *prefix,
- char *key, float *val_ret,
- float default_val);
-E_Config_Base_Type *e_config_type_new(void);
-void e_config_type_add_node(E_Config_Base_Type * base,
- char *prefix,
- E_Config_Datatype type,
- E_Config_Base_Type * list_type,
- int offset,
- int def_int,
- float def_float, char *def_str);
-void *e_config_load(char *file,
- char *prefix, E_Config_Base_Type * type);
+char *e_config_get(char *type);
+void e_config_init(void);
+void e_config_set_user_dir(char *dir);
+char *e_config_user_dir(void);
#endif
diff --git a/src/cursors.c b/src/cursors.c
index af10d8f18..6266e27b0 100644
--- a/src/cursors.c
+++ b/src/cursors.c
@@ -16,7 +16,7 @@ struct _e_cursor
static int cursor_change = 0;
static char *cur_cursor = NULL;
static char *prev_cursor = NULL;
-static Evas_List cursors = NULL;
+static Evas_List * cursors = NULL;
static void e_cursors_idle(void *data);
static void e_cursors_set(char *type);
@@ -62,7 +62,7 @@ e_cursors_set(char *type)
static E_Cursor *
e_cursors_find(char *type)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
diff --git a/src/data.c b/src/data.c
new file mode 100644
index 000000000..a3a9eb927
--- /dev/null
+++ b/src/data.c
@@ -0,0 +1,220 @@
+#include "debug.h"
+#include "e.h"
+#include "data.h"
+#include "file.h"
+#include "util.h"
+
+void
+e_data_type_add_node(E_Data_Base_Type * base, char *prefix,
+ E_Data_Datatype type,
+ E_Data_Base_Type * list_type,
+ int offset, E_Data_Value def_val)
+{
+ E_Data_Node *data_node;
+
+ D_ENTER;
+
+ data_node = NEW(E_Data_Node, 1);
+ ZERO(data_node, E_Data_Node, 1);
+
+ data_node->prefix = strdup(prefix);
+ data_node->type = type;
+ data_node->sub_type = list_type;
+ data_node->offset = offset;
+ switch (type)
+ {
+ case E_DATA_TYPE_INT:
+ data_node->def_val.int_val = def_val.int_val;
+ break;
+ case E_DATA_TYPE_FLOAT:
+ data_node->def_val.float_val = def_val.float_val;
+ break;
+ case E_DATA_TYPE_STR:
+ if (data_node->def_val.str_val)
+ {
+ e_strdup(data_node->def_val.str_val, def_val.str_val);
+ }
+ break;
+ default:
+ break;
+ }
+ base->nodes = evas_list_append(base->nodes, data_node);
+
+ D_RETURN;
+}
+
+E_Data_Base_Type *
+e_data_type_new(void)
+{
+ E_Data_Base_Type *t;
+
+ D_ENTER;
+
+ t = NEW(E_Data_Base_Type, 1);
+ ZERO(t, E_Data_Base_Type, 1);
+
+ D_RETURN_(t);
+}
+
+void *
+e_data_load(char *file, char *prefix, E_Data_Base_Type * type)
+{
+ E_DB_File *db;
+ char buf[PATH_MAX];
+ Evas_List *l;
+ char *data;
+
+ D_ENTER;
+
+ if (!e_file_exists(file))
+ D_RETURN_(NULL);
+ db = e_db_open_read(file);
+
+ if (!db)
+ D_RETURN_(NULL);
+
+ data = NEW(char, type->size);
+ ZERO(data, char, type->size);
+
+ for (l = type->nodes; l; l = l->next)
+ {
+ E_Data_Node *node;
+
+ node = l->data;
+ switch (node->type)
+ {
+ case E_DATA_TYPE_INT:
+ {
+ int val;
+
+ val = 0;
+ snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
+ if (e_db_int_get(db, buf, &val))
+ (*((int *)(&(data[node->offset])))) = val;
+ else
+ (*((int *)(&(data[node->offset])))) = node->def_val.int_val;
+ }
+ break;
+ case E_DATA_TYPE_STR:
+ {
+ char *val;
+
+ snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
+ if ((val = e_db_str_get(db, buf)))
+ (*((char **)(&(data[node->offset])))) = val;
+ else
+ e_strdup((*((char **)(&(data[node->offset])))),
+ node->def_val.str_val);
+ }
+ break;
+ case E_DATA_TYPE_PTR:
+ {
+ snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
+ (*((void **)(&(data[node->offset])))) = e_data_load(file, buf,
+ node->
+ sub_type);
+ }
+ break;
+ case E_DATA_TYPE_FLOAT:
+ {
+ float val;
+
+ val = 0;
+ snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
+ if (e_db_float_get(db, buf, &val))
+ (*((float *)(&(data[node->offset])))) = val;
+ else
+ (*((float *)(&(data[node->offset])))) =
+ node->def_val.float_val;
+ }
+ break;
+ case E_DATA_TYPE_LIST:
+ {
+ Evas_List *l2;
+ int i, count;
+
+ l2 = NULL;
+ snprintf(buf, PATH_MAX, "%s/%s/count", prefix, node->prefix);
+ count = 0;
+ e_db_int_get(db, buf, &count);
+ for (i = 0; i < count; i++)
+ {
+ void *data2;
+
+ snprintf(buf, PATH_MAX, "%s/%s/%i", prefix, node->prefix,
+ i);
+ data2 = e_data_load(file, buf, node->sub_type);
+ l2 = evas_list_append(l2, data2);
+ }
+ (*((Evas_List **) (&(data[node->offset])))) = l2;
+ }
+ break;
+ case E_DATA_TYPE_KEY:
+ {
+ snprintf(buf, PATH_MAX, "%s/%s", prefix, node->prefix);
+ (*((char **)(&(data[node->offset])))) = strdup(buf);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ e_db_close(db);
+ D_RETURN_(data);
+}
+
+void
+e_data_free(E_Data_Base_Type * type, char *data)
+{
+ Evas_List *l;
+
+ D_ENTER;
+
+ for (l = type->nodes; l; l = l->next)
+ {
+ E_Data_Node *node;
+
+ node = l->data;
+ switch (node->type)
+ {
+ case E_DATA_TYPE_LIST:
+ {
+ Evas_List *l2;
+
+ l2 = (*((Evas_List **) (&(data[node->offset]))));
+ while (l2)
+ {
+ char *data2;
+
+ data2 = l2->data;
+ l2 = evas_list_remove(l2, data2);
+ e_data_free(node->sub_type, (char *)data2);
+ FREE(data2);
+ }
+ }
+ break;
+ case E_DATA_TYPE_STR:
+ case E_DATA_TYPE_KEY:
+ {
+ IF_FREE((*((char **)(&(data[node->offset])))));
+ }
+ break;
+ case E_DATA_TYPE_PTR:
+ {
+ e_data_free(node->sub_type,
+ (*((void **)(&(data[node->offset])))));
+ FREE((*((void **)(&(data[node->offset])))));
+ }
+ break;
+ case E_DATA_TYPE_INT:
+ case E_DATA_TYPE_FLOAT:
+ break;
+ default:
+ D("DATA WARNING: Data node %p corrupted!!!\n", node);
+ break;
+ }
+ }
+
+ D_RETURN;
+}
diff --git a/src/data.h b/src/data.h
new file mode 100644
index 000000000..9af9e98df
--- /dev/null
+++ b/src/data.h
@@ -0,0 +1,97 @@
+#ifndef _DB_H
+#define _DB_H
+
+/*
+ * The API described in this file is used to map data from a database into a
+ * struct. TODO: Arbitrary cleanup function for handling fields not described
+ * by the base type, ie. not read in from the database.
+ */
+
+typedef struct _e_data_base_type E_Data_Base_Type;
+typedef union _e_data_value E_Data_Value;
+typedef struct _e_data_node E_Data_Node;
+typedef enum _e_data_datatype E_Data_Datatype;
+
+enum _e_data_datatype
+{
+ E_DATA_TYPE_INT,
+ E_DATA_TYPE_STR,
+ E_DATA_TYPE_PTR,
+ E_DATA_TYPE_FLOAT,
+ E_DATA_TYPE_LIST,
+ E_DATA_TYPE_KEY
+};
+
+struct _e_data_base_type
+{
+ int size;
+ Evas_List *nodes;
+};
+
+union _e_data_value
+{
+ int int_val;
+ float float_val;
+ char *str_val;
+};
+
+struct _e_data_node
+{
+ char *prefix;
+ E_Data_Datatype type;
+ int offset;
+ E_Data_Base_Type *sub_type;
+ E_Data_Value def_val;
+};
+
+#define E_DATA_NODE(var, prefix, type, sub, struct_type, struct_member, def_val) \
+{ \
+ struct_type _cfg_dummy; \
+ char *_cfg_p1, *_cfg_p2; \
+ int _cfg_offset; \
+ \
+ _cfg_p1 = (char *)(&(_cfg_dummy)); \
+ _cfg_p2 = (char *)(&(_cfg_dummy.struct_member)); \
+ _cfg_offset = (int)(_cfg_p2 - _cfg_p1); \
+ \
+ e_data_type_add_node(var, prefix, type, sub, _cfg_offset, def_val); \
+ var->size = sizeof(struct_type); \
+}
+
+/**
+ * e_data_type_new - create the basis for a new datatype description
+ *
+ * Returns a pointer to base type for tracking the elements of a data type.
+ */
+E_Data_Base_Type *e_data_type_new(void);
+
+/**
+ * e_data_type_add_node - add a type node to the base data type
+ *
+ * Add the necessary information for setting a data field in the base struct.
+ */
+void e_data_type_add_node(E_Data_Base_Type * base,
+ char *prefix,
+ E_Data_Datatype type,
+ E_Data_Base_Type * list_type,
+ int offset, E_Data_Value def_val);
+
+/**
+ * e_data_load - allocate and assign the data of the base type
+ *
+ * Returns a newly allocated struct of the base type, with data filled from
+ * the database file with keys prefixed by prefix.
+ */
+void *e_data_load(char *file, char *prefix,
+ E_Data_Base_Type * type);
+
+/**
+ * e_data_free - free the data allocated by e_data_load
+ *
+ * The data assigned by e_data_load is freed, but the struct itself is not,
+ * since the programmer may have other fields in the struct that were not
+ * allocated by e_data_load.
+ */
+void e_data_free(E_Data_Base_Type * type, char *data);
+
+#endif
diff --git a/src/debug.c b/src/debug.c
index b486d1dfa..b1c81acd6 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "debug.h"
-static int do_print = 0;
+static int do_print = 1;
static int calldepth = 0;
static void debug_whitespace(int calldepth);
diff --git a/src/delayed.c b/src/delayed.c
index 956250033..e68a224ae 100644
--- a/src/delayed.c
+++ b/src/delayed.c
@@ -1,6 +1,7 @@
#include <string.h>
#include "debug.h"
#include "delayed.h"
+#include "util.h"
static void
e_delayed_action_cleanup(E_Delayed_Action * eda)
@@ -14,7 +15,8 @@ e_delayed_action_cleanup(E_Delayed_Action * eda)
}
E_Delayed_Action *
-e_delayed_action_new(E_Event_Type event, double delay, E_Delay_Func delay_func)
+e_delayed_action_new(E_Event_Type event, E_Delay_Val delay,
+ E_Delay_Func delay_func)
{
E_Delayed_Action *eda = NULL;
@@ -41,9 +43,11 @@ e_delayed_action_start(E_Observer * obs, E_Observee * obj, E_Event_Type event, v
D_ENTER;
snprintf(event_name, PATH_MAX, "_e_delayed_action_notify(%d)", obs->event);
- ecore_add_event_timer(event_name, eda->delay, eda->delay_func, 0, obj);
+ ecore_add_event_timer(event_name, eda->delay(), eda->delay_func, 0, obj);
D_RETURN;
+ UN(event);
+ UN(data);
}
void
diff --git a/src/delayed.h b/src/delayed.h
index 831f4cee9..809696789 100644
--- a/src/delayed.h
+++ b/src/delayed.h
@@ -5,19 +5,21 @@
#include "observer.h"
typedef void (*E_Delay_Func) (int val, void *obj);
+typedef float (*E_Delay_Val) ();
typedef struct _e_delayed_action
{
E_Observer obs;
- double delay;
+ E_Delay_Val delay;
E_Delay_Func delay_func;
}
E_Delayed_Action;
E_Delayed_Action *e_delayed_action_new(E_Event_Type event,
- double delay, E_Delay_Func delay_func);
+ E_Delay_Val delay,
+ E_Delay_Func delay_func);
void e_delayed_action_start(E_Observer * obs, E_Observee * obj,
E_Event_Type event, void *data);
diff --git a/src/desktops.c b/src/desktops.c
index 56336c388..9accc6c42 100644
--- a/src/desktops.c
+++ b/src/desktops.c
@@ -1,5 +1,4 @@
#include "debug.h"
-#include "desktops.h"
#include "config.h"
#include "actions.h"
#include "border.h"
@@ -7,153 +6,191 @@
#include "icccm.h"
#include "util.h"
#include "object.h"
+#include "e_view_look.h"
#include "e_view_machine.h"
+#include "menubuild.h"
+#include "globals.h"
+#include "desktops.h"
-static Evas_List desktops = NULL;
+static E_Desktop *current_desk = NULL;
+static Evas_List *sticky_list = NULL;
+static Evas_List *desktops = NULL;
static Window e_base_win = 0;
static int screen_w, screen_h;
+static int mouse_x, mouse_y;
-static void ecore_idle(void *data);
+static void e_idle(void *data);
+static void e_mouse_move(Ecore_Event * ev);
+static void e_mouse_down(Ecore_Event * ev);
+static void e_mouse_up(Ecore_Event * ev);
+static void e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o,
+ void *event_info);
+static void e_window_expose(Ecore_Event * ev);
+void e_desktop_layout_reload(E_Desktop * d);
static void
-ecore_idle(void *data)
+e_scroller_timer(int val, void *data)
{
+ int ok = 0;
+ int resist;
+ int scroll_speed;
+ static double last_time = 0.0;
+ double t;
+ E_Desktop *desk;
+
D_ENTER;
- /* FIXME -- Raster, how is this related to the desktop code? */
- e_db_runtime_flush();
+ resist = config_data->desktops->resist;
+ scroll_speed = config_data->desktops->speed;
+
+ t = ecore_get_time();
+ if (val != 0)
+ scroll_speed = (int)(((t - last_time) / 0.02) * (double)scroll_speed);
+ last_time = t;
+
+ ok = 0;
+ desk = current_desk;
+ if (!desk)
+ D_RETURN;
+ if (mouse_x >= (screen_w - resist))
+ {
+ int scroll = 0;
+
+ if ((desk->desk.area.x + desk->virt.w) > screen_w)
+ scroll = desk->desk.area.x + desk->virt.w - screen_w;
+ if (scroll)
+ {
+ if (scroll > scroll_speed)
+ scroll = scroll_speed;
+ e_desktops_scroll(desk, -scroll, 0);
+ ok = 1;
+ }
+ }
+ else if (mouse_x < resist)
+ {
+ int scroll = 0;
+
+ if (desk->desk.area.x < 0)
+ scroll = -desk->desk.area.x;
+ if (scroll)
+ {
+ if (scroll > scroll_speed)
+ scroll = scroll_speed;
+ e_desktops_scroll(desk, scroll, 0);
+ ok = 1;
+ }
+ }
+ if (mouse_y >= (screen_h - resist))
+ {
+ int scroll = 0;
+
+ if ((desk->desk.area.y + desk->virt.h) > screen_h)
+ scroll = desk->desk.area.y + desk->virt.h - screen_h;
+ if (scroll)
+ {
+ if (scroll > scroll_speed)
+ scroll = scroll_speed;
+ e_desktops_scroll(desk, 0, -scroll);
+ ok = 1;
+ }
+ }
+ else if (mouse_y < resist)
+ {
+ int scroll = 0;
+
+ if (desk->desk.area.y < 0)
+ scroll = -desk->desk.area.y;
+ if (scroll)
+ {
+ if (scroll > scroll_speed)
+ scroll = scroll_speed;
+ e_desktops_scroll(desk, 0, scroll);
+ ok = 1;
+ }
+ }
+ if ((ok))
+ ecore_add_event_timer("desktop_scroller", 0.02, e_scroller_timer, val + 1,
+ NULL);
+
D_RETURN;
UN(data);
}
+Window
+e_desktop_window()
+{
+ return e_base_win;
+}
+
void
e_desktops_init(void)
{
+ int i;
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);
+ e_base_win = ecore_window_input_new(0, 0, 0, screen_w, screen_h);
+ ecore_window_set_events(e_base_win, XEV_CHILD_REDIRECT | XEV_PROPERTY |
+ XEV_COLORMAP | XEV_FOCUS | XEV_KEY |
+ XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT);
+ ecore_window_set_events_propagate(e_base_win, True);
ecore_window_show(e_base_win);
- desk = e_desktops_new();
- e_desktops_show(desk);
- ecore_event_filter_idle_handler_add(ecore_idle, NULL);
+
+ D("Creating %d desktops\n", config_data->desktops->count);
+ for (i = 0; i < config_data->desktops->count; i++)
+ desk = e_desktops_new(i);
+
+ current_desk = desktops->data;
e_icccm_advertise_e_compat();
+ /* todo
e_icccm_advertise_mwm_compat();
e_icccm_advertise_gnome_compat();
e_icccm_advertise_kde_compat();
e_icccm_advertise_net_compat();
+ */
e_icccm_set_desk_area_size(0, 1, 1);
e_icccm_set_desk_area(0, 0, 0);
e_icccm_set_desk(0, 0);
+ ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_MOVE, e_mouse_move);
+ ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_UP, e_mouse_up);
+ ecore_event_filter_handler_add(ECORE_EVENT_MOUSE_DOWN, e_mouse_down);
+ ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_EXPOSE, e_window_expose);
+
+ ecore_event_filter_idle_handler_add(e_idle, NULL);
+
D_RETURN;
}
void
e_desktops_scroll(E_Desktop * desk, int dx, int dy)
{
- Evas_List l;
+ /* Evas_List * l;
int xd, yd, wd, hd;
- int grav, grav_stick;
+ int grav, grav_stick; */
+ int scroll_sticky;
D_ENTER;
- /* set grav */
+ scroll_sticky = config_data->desktops->scroll_sticky;
+
if ((dx == 0) && (dy == 0))
D_RETURN;
desk->x -= dx;
desk->y -= dy;
- xd = yd = wd = hd = 0;
- grav = NorthWestGravity;
- grav_stick = SouthEastGravity;
- if ((dx <= 0) && (dy <= 0))
- {
- grav = NorthWestGravity;
- grav_stick = SouthEastGravity;
- xd = dx;
- yd = dy;
- wd = -dx;
- hd = -dy;
- }
- else if ((dx >= 0) && (dy <= 0))
- {
- grav = NorthEastGravity;
- grav_stick = SouthWestGravity;
- xd = 0;
- yd = dy;
- wd = dx;
- hd = -dy;
- }
- else if ((dx >= 0) && (dy >= 0))
- {
- grav = SouthEastGravity;
- grav_stick = NorthWestGravity;
- xd = 0;
- yd = 0;
- wd = dx;
- hd = dy;
- }
- else if ((dx <= 0) && (dy >= 0))
- {
- grav = SouthWestGravity;
- grav_stick = NorthEastGravity;
- xd = dx;
- yd = 0;
- wd = -dx;
- hd = dy;
- }
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *b;
- b = l->data;
- /* if sticky */
- if ((b->client.sticky) && (!b->mode.move))
- ecore_window_gravity_set(b->win.main, StaticGravity);
- else
- ecore_window_gravity_set(b->win.main, grav);
- }
- grav_stick = StaticGravity;
- /* scroll */
- ecore_window_move_resize(desk->win.container,
- xd, yd, screen_w + wd, screen_h + hd);
- /* reset */
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *b;
+ e_borders_scroll_list(desk->windows, dx, dy);
+ if (scroll_sticky)
+ e_borders_scroll_list(sticky_list, dx, dy);
- b = l->data;
- /* if sticky */
- if (b->client.sticky)
- ecore_window_gravity_set(b->win.main, StaticGravity);
- else
- ecore_window_gravity_set(b->win.main, grav_stick);
-/* ecore_window_gravity_set(b->win.main, grav_stick);*/
- }
- ecore_window_move_resize(desk->win.container, 0, 0, screen_w, screen_h);
- for (l = desk->windows; l; l = l->next)
- {
- E_Border *b;
+ desk->desk.area.x += dx;
+ desk->desk.area.y += dy;
- b = l->data;
- ecore_window_gravity_reset(b->win.main);
- if ((!b->client.sticky) && (!b->mode.move))
- {
- b->current.requested.x += dx;
- b->current.requested.y += dy;
- b->current.x = b->current.requested.x;
- b->current.y = b->current.requested.y;
- b->previous.requested.x = b->current.requested.x;
- b->previous.requested.y = b->current.requested.y;
- b->previous.x = b->current.x;
- b->previous.y = b->current.y;
- b->changed = 1;
- }
- }
+ e_bg_set_scroll(desk->bg, desk->desk.area.x, desk->desk.area.y);
D_RETURN;
}
@@ -175,7 +212,21 @@ e_desktops_cleanup(E_Desktop * desk)
e_object_unref(E_OBJECT(b));
}
- ecore_window_destroy(desk->win.main);
+ if (desk->iconbar)
+ {
+ /* e_iconbar_save_out_final(desk->iconbar); */
+ e_object_unref(E_OBJECT(desk->iconbar));
+ }
+
+ if (desk->look)
+ e_object_unref(E_OBJECT(desk->look));
+
+ if (desk->bg)
+ e_bg_free(desk->bg);
+
+ if (desk->evas)
+ evas_free(desk->evas);
+
IF_FREE(desk->name);
IF_FREE(desk->dir);
@@ -184,6 +235,53 @@ e_desktops_cleanup(E_Desktop * desk)
D_RETURN;
}
+void
+e_desktop_adaptor_cleanup(void *adaptor)
+{
+ e_object_cleanup(E_OBJECT(adaptor));
+}
+
+void
+e_desktop_file_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, void *data)
+{
+ E_Desktop_Adaptor *a = (E_Desktop_Adaptor *) obs;
+
+ D_ENTER;
+
+ if(a&&a->desktop) {
+ char *mn=a->desktop->name?a->desktop->name:"";
+ if (event & E_EVENT_BG_CHANGED) {
+ D("background_reload: %s\n",mn);
+ e_desktop_bg_reload(a->desktop); }
+ else if (event & E_EVENT_ICB_CHANGED) {
+ D("iconbar_reload: %s\n",mn);
+ e_desktop_ib_reload(a->desktop); }
+ else if (event & E_EVENT_LAYOUT_CHANGED) {
+ D("layout_reload: %s\n",mn);
+ e_desktop_layout_reload(a->desktop); }}
+#ifdef DEBUG
+ else { /* add'l debug foo. technically, a, a->desktop should always be
+ set, it's only a->desktop->name that we really worry about.
+ Azundris 2003/01/11 */
+ if(a) {
+ D("e_desktop_file_event_handler: E_Desktop_Adaptor->desktop not set, "); }
+ else {
+ D("e_desktop_file_event_handler: E_Desktop_Adaptor not set, "); }
+
+ if (event & E_EVENT_BG_CHANGED) {
+ D("BG_CHANGED\n"); }
+ else if (event & E_EVENT_ICB_CHANGED) {
+ D("ICB_CHANGED\n"); }
+ else if (event & E_EVENT_LAYOUT_CHANGED) {
+ D("LAYOUT_CHANGED\n"); }
+ else { D(" (unknown event-type)\n"); }}
+#endif
+
+ D_RETURN;
+ UN(o);
+ UN(data);
+}
+
/* 2002/04/23 Azundris <hacks@azundris.com> Transparency for legacy apps
*
* Since we have new fancy ways of drawing stuff, we technically don't
@@ -196,8 +294,6 @@ e_desktops_cleanup(E_Desktop * desk)
* <gbritton@mit.edu> and Michael Jennings <mej@eterm.org>). raster
* intensely dislikes the pseudo-transparency hacks, so don't go to him
* if you need to discuss them. : )
- *
- * THIS CODE IS CONSIDERED EXPERIMENTAL (alpha).
* */
static void
@@ -220,7 +316,7 @@ e_desktops_set_fake_root(Pixmap p)
Xroot = RootWindow(Xdisplay, screen);
scr = ScreenOfDisplay(Xdisplay, screen);
- XGrabServer(Xdisplay);
+ ecore_grab();
prop_root = XInternAtom(Xdisplay, "_XROOTPMAP_ID", True);
prop_esetroot = XInternAtom(Xdisplay, "ESETROOT_PMAP_ID", True);
@@ -264,71 +360,140 @@ e_desktops_set_fake_root(Pixmap p)
XChangeProperty(Xdisplay, Xroot, prop_esetroot, XA_PIXMAP, 32,
PropModeReplace, (unsigned char *)&p, 1);
XSetCloseDownMode(Xdisplay, RetainPermanent);
- XFlush(Xdisplay);
+ ecore_flush();
- XSetWindowBackgroundPixmap(Xdisplay, Xroot, p);
- XClearWindow(Xdisplay, Xroot);
- XUngrabServer(Xdisplay);
- XFlush(Xdisplay);
+ ecore_window_set_background_pixmap(0, p);
+ ecore_window_clear(0);
+ ecore_ungrab();
+ ecore_flush();
D_RETURN;
}
void
-e_desktops_init_file_display(E_Desktop * desk)
+e_desktop_bg_reload(E_Desktop * d)
{
- E_View *v;
- E_Border *b;
- char buf[PATH_MAX];
+ E_Background bg = NULL;
+ /* This should only be called if the background did really
+ * change in the underlying dir. We dont check again
+ * here. */
D_ENTER;
- v = e_view_new();
- v->size.w = desk->real.w;
- v->size.h = desk->real.h;
- v->options.back_pixmap = 1;
-
- desk->view = v;
- /* fixme: later */
- /* uncomment this and comment out the next line for some tress testing */
- /* e_strdup(v->dir, "/dev"); */
- /* e_strdup(v->dir, e_file_home()); */
- snprintf(buf, PATH_MAX, "%s/desktop/default", e_config_user_dir());
-
- e_view_set_dir(v, buf);
- v->is_desktop = 1;
- e_view_realize(v);
- e_view_populate(v);
- e_view_set_look(v, NULL);
-
- ecore_window_hint_set_borderless(v->win.base);
- ecore_window_hint_set_sticky(v->win.base, 1);
- ecore_window_hint_set_layer(v->win.base, 1);
- ecore_window_set_title(v->win.base, "Desktop");
- ecore_window_set_name_class(v->win.base, "FileView", "Desktop");
- ecore_window_set_min_size(v->win.base, desk->real.w, desk->real.h);
- ecore_window_set_max_size(v->win.base, desk->real.w, desk->real.h);
- b = e_border_adopt(v->win.base, 1);
- b->client.internal = 1;
- e_border_remove_click_grab(b);
- b->client.sticky = 1;
- b->client.fixed = 1;
- b->client.is_desktop = 1;
-
- if (v->options.back_pixmap)
+ if (!d || !d->look)
+ D_RETURN;
+
+ /* nuke the old one */
+ if (d->bg)
{
- e_view_update(v);
- if (v->pmap)
- e_desktops_set_fake_root(v->pmap);
+ int size;
+
+ e_bg_free(d->bg);
+ d->bg = NULL;
+ /*
+ * FIXME: Do we need to do all this flushing? Doesn't evas do some
+ * time stamp comparisons?
+ */
+ if (d->evas)
+ {
+ size = evas_object_image_cache_get(d->evas);
+ evas_object_image_cache_flush(d->evas);
+ evas_object_image_cache_set(d->evas, size);
+ }
+ e_db_flush();
}
+ if (d->look->obj->bg)
+ {
+ bg = e_bg_load(d->look->obj->bg);
+ }
+ else
+ {
+ /* Our look doesnt provide a bg, falls back */
+ char buf[PATH_MAX];
+ snprintf(buf, PATH_MAX, "%s/default.bg.db", e_config_get("backgrounds"));
+ bg = e_bg_load(buf);
+ }
+
+ if (bg)
+ {
+ d->bg = bg;
+ if (d->evas)
+ {
+ e_bg_add_to_evas(d->bg, d->evas);
+ e_bg_set_scroll(d->bg, d->desk.area.x, d->desk.area.y);
+ e_bg_set_layer(d->bg, 100);
+ e_bg_resize(d->bg, d->real.w, d->real.h);
+
+ e_bg_callback_add(d->bg, EVAS_CALLBACK_MOUSE_UP, e_bg_up_cb, d);
+
+ e_bg_show(d->bg);
+ }
+ }
+
+ evas_damage_rectangle_add(d->evas, 0, 0, d->real.w, d->real.h);
+ e_desktop_update(d);
+
+ D_RETURN;
+}
+
+void
+e_desktop_layout_reload(E_Desktop * d)
+{
+ D_ENTER;
+ if (!d || !d->look)
+ D_RETURN;
+
+ if (e_object_unref(E_OBJECT(d->layout)) == 0)
+ d->layout = NULL;
+
+ /* try load a new layout */
+ d->layout = e_view_layout_new(d);
+
+ /* if the layout loaded and theres an evas - we're realized */
+ /* so realize the layout */
+ if ((d->layout) && (d->evas))
+ e_view_layout_realize(d->layout);
+
+ e_view_layout_update(d->layout);
+
+ D_RETURN;
+}
+
+void
+e_desktop_ib_reload(E_Desktop * d)
+{
+ D_ENTER;
+
+ /* if we have an iconbar.. well nuke it */
+ if (e_object_unref(E_OBJECT(d->iconbar)) == 0)
+ d->iconbar = NULL;
+
+ /* no iconbar in our look */
+ if(!d->look->obj->icb || !d->look->obj->icb_bits)
+ D_RETURN;
+
+ /* try load a new iconbar */
+ if (!d->iconbar)
+ d->iconbar = e_iconbar_new(d);
+
+ /* if the iconbar loaded and theres an evas - we're realized */
+ /* so realize the iconbar */
+ if ((d->iconbar) && (d->evas))
+ e_iconbar_realize(d->iconbar);
+
D_RETURN;
}
E_Desktop *
-e_desktops_new(void)
+e_desktops_new(int i)
{
+ char buf[PATH_MAX];
+ /* E_Border *b; */
E_Desktop *desk;
+ E_View_Look *l;
+ static Pixmap background = 0;
+ Evas_Engine_Info_Software_X11 *einfo;
D_ENTER;
@@ -337,21 +502,74 @@ e_desktops_new(void)
e_observee_init(E_OBSERVEE(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);
- ecore_window_lower(desk->win.container);
-
- ecore_window_show(desk->win.container);
-
desk->x = 0;
desk->y = 0;
desk->real.w = screen_w;
desk->real.h = screen_h;
- desk->virt.w = screen_w;
- desk->virt.h = screen_h;
+ desk->virt.w = config_data->desktops->width * screen_w;
+ desk->virt.h = config_data->desktops->height * screen_h;
+ desk->desk.desk = i;
+
+ if (!background)
+ {
+ background = ecore_pixmap_new(0, screen_w, screen_h, 0);
+ e_desktops_set_fake_root(background);
+ }
+
+ desk->evas = evas_new();
+ evas_output_method_set(desk->evas, evas_render_method_lookup("software_x11"));
+ evas_output_size_set(desk->evas, screen_w, screen_h);
+ evas_output_viewport_set(desk->evas, 0, 0, screen_w, screen_h);
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(desk->evas);
+ einfo->info.display = ecore_display_get();
+ einfo->info.visual = DefaultVisual(einfo->info.display,
+ DefaultScreen(einfo->info.display));
+ einfo->info.colormap = DefaultColormap(einfo->info.display,
+ DefaultScreen(einfo->info.display));
+
+ einfo->info.drawable = background;
+ einfo->info.depth = DefaultDepth(einfo->info.display,
+ DefaultScreen(einfo->info.display));
+ einfo->info.rotation = 0;
+ einfo->info.debug = 0;
+ evas_engine_info_set(desk->evas, (Evas_Engine_Info *) einfo);
+
+ snprintf(buf, PATH_MAX, "%sdesktop/%d/.e_layout", e_config_user_dir(), i);
+ if (!(l = e_view_machine_look_lookup(buf)))
+ desk->look = e_view_look_new();
+ else
+ {
+ desk->look = l;
+ e_object_ref(E_OBJECT(desk->look));
+ }
+ e_view_look_set_dir(desk->look, buf);
+
+ /* experimental, Azundris 2003/01/11 */
+ if(!desk->name) {
+ size_t l=0;
+ int j=10,k=1;
+ while(i>=j) {
+ j*=10;
+ k++; }
+#define DESK_DFLT_NAME "Desk "
+ if((desk->name=malloc(l=sizeof(DESK_DFLT_NAME)+k)))
+ snprintf(desk->name,l,"%s%d",DESK_DFLT_NAME,i); }
+
+ /* The adaptor allows us to watch the look for events, while keeping the
+ * desktop an observable object */
+ desk->adaptor = NEW(E_Desktop_Adaptor, 1);
+ e_observer_init(E_OBSERVER(desk->adaptor),
+ E_EVENT_BG_CHANGED | E_EVENT_ICB_CHANGED | E_EVENT_LAYOUT_CHANGED,
+ e_desktop_file_event_handler, e_desktop_adaptor_cleanup);
+ desk->adaptor->desktop = desk;
+ e_observer_register_observee(E_OBSERVER(desk->adaptor), E_OBSERVEE(desk->look->obj));
+
+ e_desktop_bg_reload(desk);
+
+ ecore_window_set_background_pixmap(0, background);
+ ecore_window_clear(0);
desktops = evas_list_append(desktops, desk);
D_RETURN_(desk);
@@ -364,16 +582,33 @@ e_desktops_add_border(E_Desktop * d, E_Border * b)
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;
+
+ if (!evas_list_find(d->windows, b))
+ {
+ 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_add_sticky(E_Border *b)
+{
+ D_ENTER;
+
+ if (b->desk)
+ e_desktops_del_border(b->desk, b);
+ if (!evas_list_find(sticky_list, b))
+ sticky_list = evas_list_append(sticky_list, b);
+
+ D_RETURN;
+}
+
+void
e_desktops_del_border(E_Desktop * d, E_Border * b)
{
D_ENTER;
@@ -386,6 +621,48 @@ e_desktops_del_border(E_Desktop * d, E_Border * b)
D_RETURN;
}
+E_Border *
+e_desktop_raise_next_border(void)
+{
+ Evas_List * next;
+ E_Border *start;
+ E_Border *current;
+
+ D_ENTER;
+
+ if (!current_desk || !current_desk->windows)
+ D_RETURN_(NULL);
+
+ start = current = e_border_current_focused();
+ if (!start)
+ start = current = current_desk->windows->data;
+
+ /* Find the current border on the list of borders */
+ for (next = current_desk->windows; next && next->data != current; next = next->next);
+
+ /* Step to the next border, wrap around the queue if the end is reached */
+ if (next && next->next)
+ next = next->next;
+ else
+ next = current_desk->windows;
+
+ /* Now find the next viewable border on the same desktop */
+ current = (E_Border *) next->data;
+ while ((current != start) && (!e_border_viewable(current)))
+ {
+ next = next->next;
+ if (!next)
+ next = current_desk->windows;
+
+ current = (E_Border *) next->data;
+ }
+
+ e_border_raise(current);
+ e_icccm_send_focus_to(current->win.client, current->client.takes_focus);
+
+ D_RETURN_(current);
+}
+
void
e_desktops_delete(E_Desktop * d)
{
@@ -401,7 +678,9 @@ e_desktops_show(E_Desktop * d)
{
D_ENTER;
- ecore_window_show(d->win.main);
+ e_bg_show(d->bg);
+ evas_damage_rectangle_add(d->evas, 0, 0, d->real.w, d->real.h);
+ e_desktop_update(d);
D_RETURN;
}
@@ -411,22 +690,23 @@ e_desktops_hide(E_Desktop * d)
{
D_ENTER;
- ecore_window_hide(d->win.main);
+ e_bg_hide(d->bg);
D_RETURN;
+ UN(d);
}
int
e_desktops_get_num(void)
{
D_ENTER;
- D_RETURN_(8);
+ D_RETURN_(config_data->desktops->count);
}
E_Desktop *
e_desktops_get(int d)
{
- Evas_List l;
+ Evas_List * l;
int i;
D_ENTER;
@@ -443,13 +723,10 @@ e_desktops_get(int d)
int
e_desktops_get_current(void)
{
- E_Desktop *desk;
-
D_ENTER;
- desk = e_desktops_get(0);
- if (desk)
- D_RETURN_(desk->desk.desk);
+ if (current_desk)
+ D_RETURN_(current_desk->desk.desk);
D_RETURN_(0);
}
@@ -471,66 +748,277 @@ e_desktops_goto(int d, int ax, int ay)
D_ENTER;
- desk = e_desktops_get(0);
+ D("Switching to desktop %d at %d, %d\n", d, ax, ay);
+ desk = e_desktops_get(d);
if (desk)
{
int dx, dy;
- Evas_List l;
+ Evas_List *l;
+ E_Border *b;
- if ((d == desk->desk.desk) &&
- (ax == desk->desk.area.x) && (ay == desk->desk.area.y))
+
+ if ((d == current_desk->desk.desk))
D_RETURN;
dx = ax - desk->desk.area.x;
dy = ay - desk->desk.area.y;
- for (l = desk->windows; l; l = l->next)
+ for (l = current_desk->windows; l; l = l->next)
{
- E_Border *b;
-
b = l->data;
- if ((!b->client.sticky) && (!b->mode.move)
- && (!b->client.iconified))
+ if ((!b->client.iconified) && (!b->mode.move))
{
- if (b->client.desk != d)
+ if (b->current.requested.visible)
{
- if (b->current.requested.visible)
- {
- b->current.requested.visible = 0;
- b->changed = 1;
- }
+ b->current.requested.visible = 0;
+ b->changed = 1;
}
- else
+ }
+ }
+
+ for (l = desk->windows; l; l = l->next)
+ {
+ b = l->data;
+ if ((!b->mode.move) && (!b->client.iconified))
+ {
+ if (!b->current.requested.visible)
{
- if (!b->current.requested.visible)
- {
- b->current.requested.visible = 1;
- b->changed = 1;
- }
+ b->current.requested.visible = 1;
+ b->changed = 1;
}
}
}
+
e_border_update_borders();
- /* if no scrolling... */
- e_desktops_scroll(desk, -(dx * desk->real.w), -(dy * desk->real.h));
- /* if scrolling.. need to setup a timeout etc. */
+ e_desktops_scroll(desk, dx, dy);
+ dx = current_desk->desk.area.x - desk->desk.area.x;
+ dy = current_desk->desk.area.y - desk->desk.area.y;
+ e_borders_scroll_list(sticky_list, dx, dy);
+
+ e_desktops_hide(current_desk);
+ e_desktops_show(desk);
+ current_desk = desk;
- desk->desk.desk = d;
- desk->desk.area.x = ax;
- desk->desk.area.y = ay;
e_icccm_set_desk_area(0, desk->desk.area.x, desk->desk.area.y);
e_icccm_set_desk(0, desk->desk.desk);
- e_observee_notify_observers(E_OBSERVEE(desk), E_EVENT_DESKTOP_SWITCH,
- NULL);
+ e_icccm_send_focus_to(e_base_win, 1);
+ e_observee_notify_observers(E_OBSERVEE(desk), E_EVENT_DESKTOP_SWITCH, NULL);
}
D_RETURN;
}
-Evas_List
+Evas_List *
e_desktops_get_desktops_list()
{
D_ENTER;
D_RETURN_(desktops);
}
+
+void
+e_desktop_update(E_Desktop *d)
+{
+ Evas_Rectangle *u;
+ Evas_List *up, *fp;
+
+ D_ENTER;
+
+ fp = up = evas_render_updates(d->evas);
+ /* special code to handle if we are double buffering to a pixmap */
+ /* and clear sections of the window if they got updated */
+ while (up)
+ {
+ u = up->data;
+ ecore_window_clear_area(0, u->x, u->y, u->w, u->h);
+ up = evas_list_next(up);
+ }
+
+ if (fp)
+ evas_render_updates_free(fp);
+
+ D_RETURN;
+}
+
+/* handling expose events */
+static void
+e_window_expose(Ecore_Event * ev)
+{
+ Ecore_Event_Window_Expose *e;
+
+ D_ENTER;
+
+ e = ev->event;
+/* if (e->win == DefaultRootWindow(ecore_display_get())) */
+ if (e->win == e_base_win)
+ e_desktop_update(current_desk);
+
+ D_RETURN;
+}
+
+/**
+ * e_mouse_down - Handle mouse down events
+ *
+ * @ev: Pointer to event.
+ */
+static void
+e_mouse_down(Ecore_Event * ev)
+{
+ Ecore_Event_Mouse_Up *e;
+
+ D_ENTER;
+
+ e = ev->event;
+/* if (e->win == DefaultRootWindow(ecore_display_get())) */
+ if (e->win == e_base_win)
+ {
+ evas_event_feed_mouse_down(current_desk->evas, e->button);
+ }
+
+ D_RETURN;
+}
+
+/**
+ * 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;
+/* if (e->win == DefaultRootWindow(ecore_display_get())) */
+ if (e->win == e_base_win)
+ {
+ evas_event_feed_mouse_up(current_desk->evas, e->button);
+ }
+
+ D_RETURN;
+}
+
+/**
+ * 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;
+ mouse_x = e->rx;
+ mouse_y = e->ry;
+ if (config_data->desktops->scroll)
+ e_scroller_timer(0, NULL);
+/* if (e->win == DefaultRootWindow(ecore_display_get())) */
+ if (e->win == e_base_win)
+ {
+ evas_event_feed_mouse_move(current_desk->evas, e->x, e->y);
+ }
+
+ D_RETURN;
+}
+
+static void
+e_idle(void *data)
+{
+ D_ENTER;
+
+ e_desktop_update(current_desk);
+
+ D_RETURN;
+ UN(data);
+}
+
+static void
+e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
+{
+ E_Desktop *d;
+ int dx, dy;
+ Evas_Event_Mouse_Up *ev_info = event_info;
+
+ D_ENTER;
+
+ d = _data;
+ dx = 0;
+ dy = 0;
+ ecore_pointer_xy_get(&dx, &dy);
+ if (ev_info->button == 1)
+ {
+ static E_Build_Menu *buildmenu = NULL;
+
+ if (!buildmenu)
+ {
+ char *apps_menu_db;
+
+ apps_menu_db = e_config_get("apps_menu");
+ if (apps_menu_db)
+ buildmenu = e_build_menu_new_from_db(apps_menu_db);
+ }
+ if (buildmenu)
+ {
+ static E_Menu *menu = NULL;
+
+ menu = buildmenu->menu;
+ if (menu)
+ {
+ e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
+ }
+ }
+ }
+ else if (ev_info->button == 2)
+ {
+ static E_Build_Menu *buildmenu = NULL;
+
+ if (!buildmenu)
+ {
+ D("building iconified windows menu\n");
+ buildmenu = e_build_menu_new_from_iconified_borders();
+ }
+ if (buildmenu && buildmenu->changed)
+ {
+ D("buildmenu changed! rebuild!\n");
+ e_build_menu_iconified_borders_rebuild(buildmenu);
+ }
+ if (buildmenu)
+ {
+ static E_Menu *menu = NULL;
+
+ menu = buildmenu->menu;
+ if (menu)
+ {
+ D("showing iconified window menu\n");
+ e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
+ }
+ }
+ }
+ else if (ev_info->button == 3)
+ {
+ static E_Build_Menu *buildmenu = NULL;
+
+ if (!buildmenu)
+ {
+ buildmenu =
+ e_build_menu_new_from_gnome_apps("/usr/share/gnome/apps");
+ }
+ if (buildmenu)
+ {
+ static E_Menu *menu = NULL;
+
+ menu = buildmenu->menu;
+ if (menu)
+ e_menu_show_at_mouse(menu, dx, dy, CurrentTime);
+ }
+ }
+
+ D_RETURN;
+ UN(_e);
+ UN(_o);
+}
diff --git a/src/desktops.h b/src/desktops.h
index 17c60c9bf..aa20d4265 100644
--- a/src/desktops.h
+++ b/src/desktops.h
@@ -2,7 +2,6 @@
#define E_DESKTOPS_H
#include "e.h"
-#include "view.h"
#include "border.h"
#include "object.h"
@@ -11,25 +10,31 @@
typedef struct _E_Desktop E_Desktop;
#endif
+#include "view_layout.h"
+
+#ifndef E_DESKTOPS_ADAPTOR_TYPEDEF
+#define E_DESKTOPS_ADAPTOR_TYPEDEF
+typedef struct _E_Desktop_Adaptor E_Desktop_Adaptor;
+#endif
+
struct _E_Desktop
{
E_Observee obs;
char *name;
char *dir;
- struct
+/* struct
{
Window main;
- Window container;
}
- win;
+ win; */
int x, y;
struct
{
int w, h;
}
real , virt;
- Evas_List windows;
+ Evas_List * windows;
struct
{
int desk;
@@ -40,8 +45,19 @@ struct _E_Desktop
area;
}
desk;
- E_View *view;
- int changed;
+ E_Desktop_Adaptor *adaptor;
+ Evas *evas;
+ E_View_Layout *layout;
+ E_View_Look *look;
+ E_Background bg;
+ E_Iconbar *iconbar;
+/* int changed; */
+};
+
+struct _E_Desktop_Adaptor
+{
+ E_Observer obsvr;
+ E_Desktop *desktop;
};
/**
@@ -57,17 +73,9 @@ void e_desktops_init(void);
void e_desktops_scroll(E_Desktop * desk, int dx, int dy);
void e_desktops_free(E_Desktop * desk);
-/**
- * e_desktops_init_file_display - Loads desktop graphics information
- * @desk: The desktop for which the graphics are loaded
- *
- * This function loads the desktop's graphics from the user's desktop
- * file definition, which lives in ~/.e/desktop/default/.e_background.bg.db.
- */
-void e_desktops_init_file_display(E_Desktop * desk);
-
-E_Desktop *e_desktops_new(void);
+E_Desktop *e_desktops_new(int i);
void e_desktops_add_border(E_Desktop * d, E_Border * b);
+void e_desktops_add_sticky(E_Border *b);
void e_desktops_del_border(E_Desktop * d, E_Border * b);
void e_desktops_delete(E_Desktop * d);
void e_desktops_show(E_Desktop * d);
@@ -91,6 +99,11 @@ E_Desktop *e_desktops_get(int d);
int e_desktops_get_current(void);
void e_desktops_goto_desk(int d);
void e_desktops_goto(int d, int ax, int ay);
-Evas_List e_desktops_get_desktops_list();
+Evas_List *e_desktops_get_desktops_list();
+void e_desktop_bg_reload(E_Desktop * d);
+void e_desktop_ib_reload(E_Desktop * d);
+void e_desktop_update(E_Desktop *d);
+E_Border *e_desktop_raise_next_border(void);
+Window e_desktop_window();
#endif
diff --git a/src/e.h b/src/e.h
index 96c606f9d..b04a4f51e 100644
--- a/src/e.h
+++ b/src/e.h
@@ -22,6 +22,7 @@
#endif
#include <Imlib2.h>
#include <Evas.h>
+#include <Evas_Engine_Software_X11.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
@@ -44,7 +45,7 @@ backtrace_symbols_fd(__BT_array, __BT_n, fileno(stdout)); \
/* macros for allowing sections of code to be runtime profiled */
#define E_PROF 1
#ifdef E_PROF
-extern Evas_List __e_profiles;
+extern Evas_List * __e_profiles;
typedef struct _e_prof
{
@@ -57,7 +58,7 @@ E_Prof;
#define E_PROF_START(_prof_func) \
{ \
E_Prof __p, *__pp; \
-Evas_List __pl; \
+Evas_List * __pl; \
__p.func = _prof_func; \
__p.total = 0.0; \
__p.t1 = ecore_get_time(); \
@@ -86,7 +87,7 @@ __e_profiles = evas_list_append(__e_profiles, __pp); \
}
#define E_PROF_DUMP \
{ \
-Evas_List __pl; \
+Evas_List * __pl; \
for (__pl = __e_profiles; __pl; __pl = __pl->next) \
{ \
E_Prof *__p; \
diff --git a/src/e_dir.c b/src/e_dir.c
index af8122396..fad3c5c9a 100644
--- a/src/e_dir.c
+++ b/src/e_dir.c
@@ -1,4 +1,5 @@
#include "file.h"
+#include "desktops.h"
#include "e_dir.h"
#include "e_view_machine.h"
#include "view.h"
@@ -65,39 +66,47 @@ e_dir_new(void)
}
static void
-e_dir_handle_fs_restart(void *data)
-{
+e_dir_handle_fs_restart(void *data) {
E_Dir *d;
D_ENTER;
- d = data;
- D("e_dir_handle_fs_restart\n");
- if (e_fs_get_connection())
- {
- EfsdOptions *ops;
-
- /* FIXME restart with metadata pending for views */
- ops = efsd_ops(3,
- efsd_op_get_stat(),
- efsd_op_get_filetype(), efsd_op_list_all());
- d->monitor_id = efsd_start_monitor(e_fs_get_connection(), d->dir,
- ops, TRUE);
-
- }
- D("restarted monitor id (connection = %p), %i for %s\n",
- e_fs_get_connection(), d->monitor_id, d->dir);
+ D("e_dir_handle_fs_restart\n");
- D_RETURN;
-}
+ if((d = data)) {
+ if(d->dir&&*(d->dir)) {
+ if (e_fs_get_connection()) {
+ EfsdOptions *ops;
+
+ /* FIXME restart with metadata pending for views */
+
+ ops = efsd_ops(3,
+ efsd_op_get_stat(),
+ efsd_op_get_filetype(), efsd_op_list_all());
+ if((d->monitor_id=efsd_start_monitor(e_fs_get_connection(), d->dir,
+ ops, TRUE))<0) {
+ D("could not restart monitor (connx %p) for \"%s\" => %i\n",
+ e_fs_get_connection(), d->dir, d->monitor_id); }
+ else {
+ D("restarted monitor (connx %p) for \"%s\" => ID %i...\n",
+ e_fs_get_connection(), d->dir, d->monitor_id); }}
+ else {
+ D("could not restart, connection refused\n"); }}
+ else {
+ D("could not restart, no dir given!?\n"); }}
+ else {
+ D("could not restart, no data\n"); }
+
+ D_RETURN; }
void
e_dir_set_dir(E_Dir * d, char *dir)
{
D_ENTER;
- if (!d)
- D_RETURN;
+ if (!d) {
+ D("e_dir_set_dir -- no E_Dir!\n");
+ D_RETURN; }
/* stop monitoring old dir */
if ((d->dir) && (d->monitor_id))
@@ -106,8 +115,29 @@ e_dir_set_dir(E_Dir * d, char *dir)
d->monitor_id = 0;
}
IF_FREE(d->dir);
+
+ if(!dir||!*dir) {
+ D("e_dir_set_dir -- no dir!\n");
+ D_RETURN; }
+
d->dir = e_file_realpath(dir);
-
+
+ if(!d->dir||!*(d->dir)) {
+ /* realpath failed. this would mean that we tried to set a monitor
+ on a non-existent (or inacessible) file. this may mean that the
+ programmer really meant "...and if it doesn't exist YET, tell me
+ if and when it is created", so rather than failing right here and
+ now, we'll forget about the realpath, stick in the path they
+ requested in the first place, and hope the backend actually supports
+ watching something it cannot determine an inode for... we'll still
+ throw a warning though, just for good measure. Azundris 2003/01/11 */
+ D("e_dir_set_dir -- e_file_realpath(\"%s\") failed...\n",dir);
+ if(d->dir)
+ free(d->dir);
+ if(!(d->dir=strdup(dir))) {
+ D("e_dir_set_dir: OOM\n");
+ D_RETURN; }}
+
/* start monitoring new dir */
d->restarter = e_fs_add_restart_handler(e_dir_handle_fs_restart, d);
if (e_fs_get_connection())
@@ -119,7 +149,7 @@ e_dir_set_dir(E_Dir * d, char *dir)
efsd_op_get_filetype(), efsd_op_list_all());
d->monitor_id = efsd_start_monitor(e_fs_get_connection(), d->dir,
ops, TRUE);
- D("monitor id for %s = %i\n", d->dir, d->monitor_id);
+ D("monitor id for \"%s\" = %i\n", d->dir, d->monitor_id);
}
D_RETURN;
}
@@ -205,14 +235,14 @@ e_dir_handle_efsd_event_reply_getfiletype(EfsdEvent * ev)
p = strchr(m, '/');
if (p)
{
- strcpy(base, m);
- strcpy(mime, p + 1);
+ STRNCPY(base, m, PATH_MAX);
+ STRNCPY(mime, p + 1, PATH_MAX);
p = strchr(base, '/');
*p = 0;
}
else
{
- strcpy(base, m);
+ STRNCPY(base, m, PATH_MAX);
strcpy(mime, "unknown");
}
e_file_set_mime(f, base, mime);
@@ -282,7 +312,7 @@ e_dir_handle_efsd_event_reply_readlink(EfsdEvent * ev)
static void
e_dir_handle_efsd_event_reply_getmeta(EfsdEvent * ev)
{
- Evas_List l;
+ Evas_List * l;
EfsdCmdId cmd;
D_ENTER;
@@ -428,7 +458,7 @@ e_dir_file_added(int id, char *file)
E_File *f;
D_ENTER;
-
+
/* if we get a path - ignore it - its not a file in the dir */
if (!file || file[0] == '/')
D_RETURN;
@@ -479,7 +509,7 @@ e_dir_file_changed(int id, char *file)
f = e_file_get_by_name(d->files, file);
if (file[0] != '.')
{
- e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_DELETE, f);
+ e_observee_notify_observers(E_OBSERVEE(d), E_EVENT_FILE_CHANGE, f);
}
D_RETURN;
}
@@ -501,7 +531,7 @@ E_Dir *
e_dir_find_by_monitor_id(int id)
{
E_Dir *d;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
diff --git a/src/e_dir.h b/src/e_dir.h
index 4cfba5b44..d2c34053f 100644
--- a/src/e_dir.h
+++ b/src/e_dir.h
@@ -28,7 +28,7 @@ struct _E_Dir
/* The realpath of the view's directory */
char *dir;
- Evas_List files;
+ Evas_List * files;
/*
* Evas_Object obj_bg;
diff --git a/src/e_ferite.c b/src/e_ferite.c
deleted file mode 100644
index e11769e5b..000000000
--- a/src/e_ferite.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*#include "debug.h"*/
-#include "e_ferite.h"
-#include "e_ferite_gen_header.h"
-#include "debug.h"
-
-#if 0
-#ifdef D /* until ferite doesn't pullte the D(ebug) macro */
-# undef D
-# define D(x,...)
-# define D_ENTER
-# define D_RETURN
-# define D_RETURN_(x)
-#endif
-#endif
-
-void
-e_ferite_init(void)
-{
- D_ENTER;
-
- D("Initialising ferite....\n");
- ferite_init(0, NULL);
-
- D_RETURN;
-}
-
-void
-e_ferite_deinit(void)
-{
- D_ENTER;
-
- D("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);
-
- D_RETURN_(1);
-}
-
-int
-e_ferite_script_warning(FeriteScript * script, char *warnmsg)
-{
- D_ENTER;
-
- fprintf(stderr, "e17: ferite warning: %s\n", warnmsg);
-
- D_RETURN_(1);
-}
-
-void
-e_ferite_run(char *txt)
-{
- FeriteScript *script = NULL;
-
- D_ENTER;
-
- D("Ferite: Compiling script `%s'\n", txt);
- script = __ferite_compile_string(txt);
- e_ferite_register(script, script->mainns);
- script->error_cb = e_ferite_script_error;
- script->warning_cb = e_ferite_script_warning;
- D("Ferite: executing script.\n");
- ferite_script_execute(script);
- D("Ferite: Cleaning up.\n");
- ferite_script_delete(script);
-
- D_RETURN;
-}
diff --git a/src/e_ferite.fec b/src/e_ferite.fec
deleted file mode 100644
index e46715b6e..000000000
--- a/src/e_ferite.fec
+++ /dev/null
@@ -1,170 +0,0 @@
-header %{
-
- #include "Ecore.h"
- #include "Ebits.h"
- #include "ferite.h"
-
- #include "desktops.h"
- #include "border.h"
- #include "debug.h"
- #include "observer.h"
- #include "file.h"
-
- #define BorderObj ((E_Border *)(self->odata))
-
-%}
-
-class Border {
-
- function Border()
- %{
- %}
-
- function get_name()
- %{
- if(BorderObj)
- FE_RETURN_STR(BorderObj->client.name, 0);
- %}
-
- function get_title()
- %{
- if(BorderObj)
- FE_RETURN_STR(BorderObj->client.title, 0);
- %}
-
- function get_class()
- %{
- if(BorderObj)
- FE_RETURN_STR(BorderObj->client.class, 0);
- %}
-
- function get_x()
- %{
- if(BorderObj)
- FE_RETURN_LONG(BorderObj->current.x);
- %}
-
- function get_y()
- %{
- if(BorderObj)
- FE_RETURN_LONG(BorderObj->current.y);
- %}
-
- function get_width()
- %{
- if(BorderObj)
- FE_RETURN_LONG(BorderObj->current.w);
- %}
-
- function get_height()
- %{
- if(BorderObj)
- FE_RETURN_LONG(BorderObj->current.h);
- %}
-
-
- function move( number x, number y );
- function resize( number width, number height );
-
- function show();
- function hide();
- function is_visible()
- %{
- if(BorderObj)
- {
- if (BorderObj->current.visible) { FE_RETURN_TRUE; }
- else { FE_RETURN_FALSE; }
- }
- %}
-
-
- function shade();
- function unshade();
- function is_shaded();
-
- function iconify()
- %{
- e_border_iconify(BorderObj);
- %}
-
- function uniconify()
- %{
- e_border_uniconify(BorderObj);
- %}
-
- function is_iconic()
- %{
- if (BorderObj->client.iconified) { FE_RETURN_TRUE }
- else { FE_RETURN_FALSE }
- %}
-
- function is_mapped();
- function is_transient();
- function is_shaped();
-
- function raise()
- %{
- %}
-
- function lower()
- %{
- %}
-
-
- function delete();
- function kill();
-
-}
-
-
-namespace e {
-
- function flip_to_desktop( number desk )
- %{
- e_desktops_goto_desk( (long)desk );
- %}
-
- function get_current_desktop()
- %{
- int retval = e_desktops_get_current();
- FE_RETURN_LONG( retval );
- %}
-
- function get_desktop_count()
- %{
- int retval = e_desktops_get_num();
- printf("desktop_count: %i\n", retval);
- FE_RETURN_LONG( retval );
- %}
-
- function get_width();
- function get_height();
-
- // shutdown enlightenment
- function shutdown()
- %{
- ecore_event_loop_quit();
- %}
-
- function restart()
- %{
- e_exec_restart();
- %}
-
- function dataCopy(object from, object to)
- %{
- to->odata = from->odata;
- %}
-
- function dataCmp(object from, object to)
- %{
- if (to->odata == from->odata) {FE_RETURN_TRUE;}
- else {FE_RETURN_FALSE;}
- %}
-
- function getTime()
- %{
- FE_RETURN_DOUBLE(ecore_get_time());
- %}
-}
-
diff --git a/src/e_ferite.h b/src/e_ferite.h
deleted file mode 100644
index 9c4d2d62f..000000000
--- a/src/e_ferite.h
+++ /dev/null
@@ -1,30 +0,0 @@
-#ifndef E_FERITE_H
-#define E_FERITE_H
-
-#include <config.h>
-#ifdef USE_FERITE
-
-#include <ferite.h>
-
-#else
-
-#define FeriteScript void
-#define FeriteNamespace void
-#define FeriteVariable void
-#define FeriteFunction void
-#define FeriteObject void
-#define FeriteNamespaceBucket void
-
-#endif
-
-void e_ferite_init(void);
-void e_ferite_deinit(void);
-void e_ferite_run(char *script);
-void e_ferite_register(FeriteScript * script,
- FeriteNamespace * ns);
-int e_ferite_script_error(FeriteScript * script, char *errmsg,
- int val);
-int e_ferite_script_warning(FeriteScript * script,
- char *warnmsg);
-
-#endif /* E_FERITE_H */
diff --git a/src/e_file.c b/src/e_file.c
index 6e5955c0b..e2154099e 100644
--- a/src/e_file.c
+++ b/src/e_file.c
@@ -11,7 +11,8 @@ e_file_cleanup(E_File * f)
D_ENTER;
IF_FREE(f->info.icon);
- IF_FREE(f->info.link) IF_FREE(f->info.custom_icon);
+ IF_FREE(f->info.link);
+ IF_FREE(f->info.custom_icon);
IF_FREE(f->info.mime.base);
IF_FREE(f->info.mime.type);
IF_FREE(f->file);
@@ -45,9 +46,9 @@ e_file_new(char *file)
}
E_File *
-e_file_get_by_name(Evas_List l, char *file)
+e_file_get_by_name(Evas_List * l, char *file)
{
- Evas_List ll;
+ Evas_List * ll;
E_File *f;
D_ENTER;
@@ -106,7 +107,7 @@ e_file_set_mime(E_File * f, char *base, char *mime)
*/
/* find an icon */
- strcpy(type, f->info.mime.type);
+ STRNCPY(type, f->info.mime.type, PATH_MAX);
p = type;
do
{
diff --git a/src/e_file.h b/src/e_file.h
index 61c2801c6..2c0af2463 100644
--- a/src/e_file.h
+++ b/src/e_file.h
@@ -27,7 +27,7 @@ struct _E_File
};
E_File *e_file_new(char *file);
-E_File *e_file_get_by_name(Evas_List l, char *file);
+E_File *e_file_get_by_name(Evas_List * l, char *file);
void e_file_set_mime(E_File * f, char *base, char *mime);
void e_file_set_link(E_File * f, char *link);
diff --git a/src/e_view_look.c b/src/e_view_look.c
index 42bfe4723..56ea6ab75 100644
--- a/src/e_view_look.c
+++ b/src/e_view_look.c
@@ -1,5 +1,6 @@
-#include "e_view_look.h"
#include "util.h"
+#include "desktops.h"
+#include "e_view_look.h"
#include "view.h"
#include "observer.h"
#include "e_file.h"
@@ -99,7 +100,7 @@ e_view_look_set_dir(E_View_Look *l, char *dir)
if (d)
{
l->dir = d;
- e_observer_register_observee(E_OBSERVER(l), E_OBSERVEE(d));
+ e_observer_register_observee(E_OBSERVER(l), E_OBSERVEE(l->dir));
}
else
{
@@ -117,25 +118,25 @@ e_view_look_file_change(E_View_Look *l, E_File *f)
char buf[PATH_MAX];
D_ENTER;
snprintf(buf, PATH_MAX, "%s/%s", l->dir->dir, f->file);
- if (!strcmp(f->file, "background.db"))
+ if (!strncmp(f->file, "background.db", PATH_MAX))
{
IF_FREE(l->obj->bg);
l->obj->bg = strdup(buf);
e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_BG_CHANGED, f);
}
- else if (!strcmp(f->file, "iconbar.db"))
+ else if (!strncmp(f->file, "iconbar.db", PATH_MAX))
{
IF_FREE(l->obj->icb);
l->obj->icb = strdup(buf);
e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
}
- else if (!strcmp(f->file, "iconbar.bits.db"))
+ else if (!strncmp(f->file, "iconbar.bits.db", PATH_MAX))
{
IF_FREE(l->obj->icb_bits);
l->obj->icb_bits = strdup(buf);
e_observee_notify_observers(E_OBSERVEE(l->obj), E_EVENT_ICB_CHANGED, f);
}
- else if (!strcmp(f->file, "layout.db"))
+ else if (!strncmp(f->file, "layout.db", PATH_MAX))
{
IF_FREE(l->obj->layout);
l->obj->layout = strdup(buf);
@@ -148,7 +149,7 @@ static void
e_view_look_file_delete(E_View_Look *l, E_File *f)
{
D_ENTER;
-
+
if (!strcmp(f->file, "background.db"))
{
IF_FREE(l->obj->bg);
diff --git a/src/e_view_machine.c b/src/e_view_machine.c
index 06ab83b45..16af98743 100644
--- a/src/e_view_machine.c
+++ b/src/e_view_machine.c
@@ -75,7 +75,7 @@ e_view_machine_unregister_look(E_View_Look * l)
void
e_view_machine_close_all_views(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
/* Copy the list of views and unregister them */
@@ -92,7 +92,7 @@ E_Dir *
e_view_machine_dir_lookup(char *path)
{
E_Dir *d;
- Evas_List l;
+ Evas_List * l;
char *realpath = NULL;
D_ENTER;
@@ -122,7 +122,7 @@ E_View_Look *
e_view_machine_look_lookup(char *path)
{
E_View_Look *vl;
- Evas_List l;
+ Evas_List * l;
char *realpath = NULL;
D_ENTER;
@@ -152,7 +152,7 @@ e_view_machine_look_lookup(char *path)
E_View *
e_view_machine_get_view_by_main_window(Window win)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
for (l = VM->views; l; l = l->next)
@@ -168,7 +168,7 @@ e_view_machine_get_view_by_main_window(Window win)
E_View *
e_view_machine_get_view_by_base_window(Window win)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
for (l = VM->views; l; l = l->next)
@@ -180,5 +180,3 @@ e_view_machine_get_view_by_base_window(Window win)
}
D_RETURN_(NULL);
}
-
-
diff --git a/src/e_view_machine.h b/src/e_view_machine.h
index cce00b9da..58a9b448d 100644
--- a/src/e_view_machine.h
+++ b/src/e_view_machine.h
@@ -4,9 +4,9 @@
#include "view.h"
struct _e_view_machine
{
- Evas_List views;
- Evas_List dirs;
- Evas_List looks;
+ Evas_List * views;
+ Evas_List * dirs;
+ Evas_List * looks;
};
typedef struct _e_view_machine E_View_Machine;
diff --git a/src/embed.c b/src/embed.c
index 12a36be95..dd37cae2c 100644
--- a/src/embed.c
+++ b/src/embed.c
@@ -7,9 +7,9 @@ typedef struct _Embed Embed_Private;
struct _Embed
{
Ebits_Object o;
- Evas evas;
- Evas_Object image_obj;
- Evas_Object clip_obj;
+ Evas * evas;
+ Evas_Object * image_obj;
+ Evas_Object * clip_obj;
int clip_x, clip_y;
E_Text *text_obj;
};
@@ -23,7 +23,7 @@ e_embed_text_func_show(void *_data)
em = _data;
if (em->clip_obj)
- evas_show(em->evas, em->clip_obj);
+ evas_object_show(em->clip_obj);
e_text_show(em->text_obj);
D_RETURN;
@@ -38,7 +38,7 @@ e_embed_text_func_hide(void *_data)
em = _data;
if (em->clip_obj)
- evas_hide(em->evas, em->clip_obj);
+ evas_object_hide(em->clip_obj);
e_text_hide(em->text_obj);
D_RETURN;
@@ -53,7 +53,7 @@ e_embed_text_func_move(void *_data, double x, double y)
em = _data;
if (em->clip_obj)
- evas_move(em->evas, em->clip_obj, x, y);
+ evas_object_move(em->clip_obj, x, y);
e_text_move(em->text_obj, x, y);
D_RETURN;
@@ -68,7 +68,7 @@ e_embed_text_func_resize(void *_data, double w, double h)
em = _data;
if (em->clip_obj)
- evas_resize(em->evas, em->clip_obj, w, h);
+ evas_object_resize(em->clip_obj, w, h);
e_text_resize(em->text_obj, w, h);
D_RETURN;
@@ -83,7 +83,7 @@ e_embed_text_func_raise(void *_data)
em = _data;
if (em->clip_obj)
- evas_raise(em->evas, em->clip_obj);
+ evas_object_raise(em->clip_obj);
e_text_raise(em->text_obj);
D_RETURN;
@@ -98,7 +98,7 @@ e_embed_text_func_lower(void *_data)
em = _data;
if (em->clip_obj)
- evas_lower(em->evas, em->clip_obj);
+ evas_object_lower(em->clip_obj);
e_text_lower(em->text_obj);
D_RETURN;
@@ -113,14 +113,14 @@ e_embed_text_func_set_layer(void *_data, int l)
em = _data;
if (em->clip_obj)
- evas_set_layer(em->evas, em->clip_obj, l);
+ evas_object_layer_set(em->clip_obj, l);
e_text_set_layer(em->text_obj, l);
D_RETURN;
}
static void
-e_embed_text_func_set_clip(void *_data, Evas_Object clip)
+e_embed_text_func_set_clip(void *_data, Evas_Object * clip)
{
Embed_Private *em;
@@ -198,7 +198,7 @@ e_embed_text_func_get_max_size(void *_data, double *w, double *h)
/***/
Embed
-e_embed_text(Ebits_Object o, char *bit_name, Evas evas, E_Text * text_obj,
+e_embed_text(Ebits_Object o, char *bit_name, Evas * evas, E_Text * text_obj,
int clip_x, int clip_y)
{
Embed_Private *em;
@@ -214,10 +214,10 @@ e_embed_text(Ebits_Object o, char *bit_name, Evas evas, E_Text * text_obj,
em->clip_y = clip_y;
if ((clip_x) || (clip_y))
{
- em->clip_obj = evas_add_rectangle(em->evas);
- evas_set_color(em->evas, em->clip_obj, 255, 255, 255, 255);
+ em->clip_obj = evas_object_rectangle_add(em->evas);
+ evas_object_color_set(em->clip_obj, 255, 255, 255, 255);
e_text_set_clip(em->text_obj, em->clip_obj);
- evas_show(em->evas, em->clip_obj);
+ evas_object_show(em->clip_obj);
}
ebits_set_named_bit_replace(o, bit_name,
e_embed_text_func_show,
@@ -244,7 +244,7 @@ e_embed_image_func_show(void *_data)
D_ENTER;
em = _data;
- evas_show(em->evas, em->image_obj);
+ evas_object_show(em->image_obj);
D_RETURN;
}
@@ -257,7 +257,7 @@ e_embed_image_func_hide(void *_data)
D_ENTER;
em = _data;
- evas_hide(em->evas, em->image_obj);
+ evas_object_hide(em->image_obj);
D_RETURN;
}
@@ -270,7 +270,7 @@ e_embed_image_func_move(void *_data, double x, double y)
D_ENTER;
em = _data;
- evas_move(em->evas, em->image_obj, x, y);
+ evas_object_move(em->image_obj, x, y);
D_RETURN;
}
@@ -283,8 +283,8 @@ e_embed_image_func_resize(void *_data, double w, double h)
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);
+ evas_object_resize(em->image_obj, w, h);
+ evas_object_image_fill_set(em->image_obj, 0, 0, w, h);
D_RETURN;
}
@@ -297,7 +297,7 @@ e_embed_image_func_raise(void *_data)
D_ENTER;
em = _data;
- evas_raise(em->evas, em->image_obj);
+ evas_object_raise(em->image_obj);
D_RETURN;
}
@@ -310,7 +310,7 @@ e_embed_image_func_lower(void *_data)
D_ENTER;
em = _data;
- evas_lower(em->evas, em->image_obj);
+ evas_object_lower(em->image_obj);
D_RETURN;
}
@@ -323,13 +323,13 @@ e_embed_image_func_set_layer(void *_data, int l)
D_ENTER;
em = _data;
- evas_set_layer(em->evas, em->image_obj, l);
+ evas_object_layer_set(em->image_obj, l);
D_RETURN;
}
static void
-e_embed_image_func_set_clip(void *_data, Evas_Object clip)
+e_embed_image_func_set_clip(void *_data, Evas_Object * clip)
{
Embed_Private *em;
@@ -337,9 +337,9 @@ e_embed_image_func_set_clip(void *_data, Evas_Object clip)
em = _data;
if (clip)
- evas_set_clip(em->evas, em->image_obj, clip);
+ evas_object_clip_set(em->image_obj, clip);
else
- evas_unset_clip(em->evas, em->image_obj);
+ evas_object_clip_unset(em->image_obj);
D_RETURN;
}
@@ -354,7 +354,7 @@ e_embed_image_func_set_color_class(void *_data, char *cc, int r, int g, int b,
em = _data;
if ((cc) && (!strcmp(cc, "icon")))
- evas_set_color(em->evas, em->image_obj, r, g, b, a);
+ evas_object_color_set(em->image_obj, r, g, b, a);
D_RETURN;
}
@@ -370,7 +370,7 @@ e_embed_image_func_get_min_size(void *_data, double *w, double *h)
em = _data;
iw = 0;
ih = 0;
- evas_get_image_size(em->evas, em->image_obj, &iw, &ih);
+ evas_object_image_size_get(em->image_obj, &iw, &ih);
if (w)
*w = iw;
if (h)
@@ -388,7 +388,7 @@ e_embed_image_func_get_max_size(void *_data, double *w, double *h)
D_ENTER;
em = _data;
- evas_get_image_size(em->evas, em->image_obj, &iw, &ih);
+ evas_object_image_size_get(em->image_obj, &iw, &ih);
if (w)
*w = iw;
if (h)
@@ -400,8 +400,8 @@ e_embed_image_func_get_max_size(void *_data, double *w, double *h)
/***/
Embed
-e_embed_image_object(Ebits_Object o, char *bit_name, Evas evas,
- Evas_Object image_obj)
+e_embed_image_object(Ebits_Object o, char *bit_name, Evas * evas,
+ Evas_Object * image_obj)
{
Embed_Private *em;
@@ -438,7 +438,7 @@ e_embed_free(Embed emb)
em = emb;
if (em->clip_obj)
- evas_del_object(em->evas, em->clip_obj);
+ evas_object_del(em->clip_obj);
FREE(em);
D_RETURN;
diff --git a/src/embed.h b/src/embed.h
index e87b22839..c812ad987 100644
--- a/src/embed.h
+++ b/src/embed.h
@@ -6,10 +6,10 @@
typedef void *Embed;
-Embed e_embed_text(Ebits_Object o, char *bit_name, Evas evas,
+Embed e_embed_text(Ebits_Object o, char *bit_name, Evas * evas,
E_Text * text_obj, int clip_x, int clip_y);
Embed e_embed_image_object(Ebits_Object o, char *bit_name,
- Evas evas, Evas_Object image_obj);
+ Evas * evas, Evas_Object * image_obj);
void e_embed_free(Embed em);
#endif
diff --git a/src/entry.c b/src/entry.c
index 6e8508fce..ebb1cd320 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -3,16 +3,16 @@
#include "config.h"
#include "util.h"
-static Evas_List entries;
+static Evas_List * entries;
static void e_clear_selection(Ecore_Event * ev);
static void e_paste_request(Ecore_Event * ev);
-static void e_entry_down_cb(void *_data, Evas _e, Evas_Object _o,
+static void e_entry_down_cb(void *_data, Evas * _e, Evas_Object * _o,
int _b, int _x, int _y);
-static void e_entry_up_cb(void *_data, Evas _e, Evas_Object _o, int _b,
+static void e_entry_up_cb(void *_data, Evas * _e, Evas_Object * _o, int _b,
int _x, int _y);
-static void e_entry_move_cb(void *_data, Evas _e, Evas_Object _o,
+static void e_entry_move_cb(void *_data, Evas * _e, Evas_Object * _o,
int _b, int _x, int _y);
static void e_entry_realize(E_Entry * entry);
static void e_entry_unrealize(E_Entry * entry);
@@ -22,7 +22,7 @@ static void
e_clear_selection(Ecore_Event * ev)
{
Ecore_Event_Clear_Selection *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -49,7 +49,7 @@ static void
e_paste_request(Ecore_Event * ev)
{
Ecore_Event_Paste_Request *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -73,7 +73,7 @@ e_paste_request(Ecore_Event * ev)
}
static void
-e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_entry_down_cb(void *_data, Evas *_e, Evas_Object * _o, int _b, int _x, int _y)
{
E_Entry *entry;
int pos;
@@ -90,13 +90,19 @@ e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
else if (!entry->mouse_down)
{
entry->focused = 1;
+ /* checkme
pos = evas_text_at_position(_e, entry->text, _x, _y,
NULL, NULL, NULL, NULL);
+ */
+ pos = evas_object_text_char_coords_get(entry->text, _x, _y,
+ NULL, NULL, NULL, NULL);
if (pos < 0)
{
int tw;
+ /* checkme todo
tw = evas_get_text_width(_e, entry->text);
+ */
if (_x > entry->x + tw)
{
entry->cursor_pos = strlen(entry->buffer);
@@ -116,11 +122,12 @@ e_entry_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
D_RETURN;
+ UN(_e);
UN(_o);
}
static void
-e_entry_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_entry_up_cb(void *_data, Evas * _e, Evas_Object * _o, int _b, int _x, int _y)
{
E_Entry *entry;
@@ -141,7 +148,7 @@ e_entry_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
static void
-e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_entry_move_cb(void *_data, Evas * _e, Evas_Object * _o, int _b, int _x, int _y)
{
E_Entry *entry;
@@ -154,14 +161,20 @@ e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
double ty;
ppos = entry->cursor_pos;
- evas_get_geometry(entry->evas, entry->text, NULL, &ty, NULL, NULL);
+ evas_object_geometry_get(entry->text, NULL, &ty, NULL, NULL);
+ /* checkme
pos = evas_text_at_position(_e, entry->text, _x, ty,
NULL, NULL, NULL, NULL);
+ */
+ pos = evas_object_text_char_coords_get(entry->text, _x, ty,
+ NULL, NULL, NULL, NULL);
if (pos < 0)
{
int tw;
+ /* checkme todo
tw = evas_get_text_width(_e, entry->text);
+ */
if (_x > entry->x + tw)
{
entry->cursor_pos = strlen(entry->buffer);
@@ -222,6 +235,7 @@ e_entry_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
D_RETURN;
+ UN(_e);
UN(_o);
UN(_b);
UN(_y);
@@ -258,24 +272,27 @@ e_entry_realize(E_Entry * entry)
/* ebits_set_color_class(entry->obj_base, "Base FG", 100, 200, 255, 255);*/
}
- entry->clip_box = evas_add_rectangle(entry->evas);
- entry->text = evas_add_text(entry->evas, "borzoib", 8, "");
+ entry->clip_box = evas_object_rectangle_add(entry->evas);
+ entry->text = evas_object_text_add(entry->evas);
+ evas_object_text_font_set(entry->text, "borzoib", 8);
if (entry->obj_cursor)
ebits_set_clip(entry->obj_cursor, entry->clip_box);
if (entry->obj_selection)
ebits_set_clip(entry->obj_selection, entry->clip_box);
- entry->event_box = evas_add_rectangle(entry->evas);
- evas_set_color(entry->evas, entry->clip_box, 255, 255, 255, 255);
- evas_set_color(entry->evas, entry->event_box, 0, 0, 0, 0);
- evas_set_color(entry->evas, entry->text, 0, 0, 0, 255);
- evas_set_clip(entry->evas, entry->text, entry->clip_box);
- evas_set_clip(entry->evas, entry->event_box, entry->clip_box);
- evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_DOWN,
+ entry->event_box = evas_object_rectangle_add(entry->evas);
+ evas_object_color_set(entry->clip_box, 255, 255, 255, 255);
+ evas_object_color_set(entry->event_box, 0, 0, 0, 0);
+ evas_object_color_set(entry->text, 0, 0, 0, 255);
+ evas_object_clip_set(entry->text, entry->clip_box);
+ evas_object_clip_set(entry->event_box, entry->clip_box);
+ /* checkme todo
+ evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_DOWN,
e_entry_down_cb, entry);
- evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_UP,
e_entry_up_cb, entry);
- evas_callback_add(entry->evas, entry->event_box, CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(entry->event_box, EVAS_CALLBACK_MOUSE_MOVE,
e_entry_move_cb, entry);
+ */
D_RETURN;
}
@@ -286,11 +303,11 @@ e_entry_unrealize(E_Entry * entry)
D_ENTER;
if (entry->event_box)
- evas_del_object(entry->evas, entry->event_box);
+ evas_object_del(entry->event_box);
if (entry->text)
- evas_del_object(entry->evas, entry->text);
+ evas_object_del(entry->text);
if (entry->clip_box)
- evas_del_object(entry->evas, entry->clip_box);
+ evas_object_del(entry->clip_box);
if (entry->obj_base)
ebits_free(entry->obj_base);
if (entry->obj_cursor)
@@ -330,12 +347,12 @@ e_entry_configure(E_Entry * entry)
ebits_move(entry->obj_base, entry->x, entry->y);
ebits_resize(entry->obj_base, entry->w, entry->h);
}
- evas_move(entry->evas, entry->clip_box, entry->x + p1l, entry->y + p1t);
- evas_resize(entry->evas, entry->clip_box, entry->w - p1l - p1r,
+ evas_object_move(entry->clip_box, entry->x + p1l, entry->y + p1t);
+ evas_object_resize(entry->clip_box, entry->w - p1l - p1r,
entry->h - p1t - p1b);
- evas_move(entry->evas, entry->event_box, entry->x + p1l + p2l,
+ evas_object_move(entry->event_box, entry->x + p1l + p2l,
entry->y + p1t + p2t);
- evas_resize(entry->evas, entry->event_box, entry->w - p1l - p1r - p2l - p2r,
+ evas_object_resize(entry->event_box, entry->w - p1l - p1r - p2l - p2r,
entry->h - p1t - p1b - p2t - p2b);
if ((entry->buffer) && (entry->buffer[0] != 0) && (entry->focused))
{
@@ -343,18 +360,30 @@ e_entry_configure(E_Entry * entry)
if (entry->cursor_pos < (int)strlen(entry->buffer))
{
+ /* checkme
evas_text_at(entry->evas, entry->text, entry->cursor_pos, &tx, &ty,
&tw, &th);
+ */
+ evas_object_text_char_pos_get(entry->text, entry->cursor_pos, &tx, &ty,
+ &tw, &th);
}
else
{
entry->cursor_pos = strlen(entry->buffer);
+ /* checkme
evas_text_at(entry->evas, entry->text, entry->cursor_pos - 1, &tx,
&ty, &tw, &th);
+ */
+ evas_object_text_char_pos_get(entry->text, entry->cursor_pos - 1, &tx,
+ &ty, &tw, &th);
tx += tw;
tw = entry->end_width;
}
+ /* check me
th = evas_get_text_height(entry->evas, entry->text);
+ */
+ th = evas_object_text_ascent_get(entry->text)+
+ evas_object_text_descent_get(entry->text);
if (tx + tw + entry->scroll_pos > entry->w - p1l - p1r)
entry->scroll_pos = entry->w - tx - tw - p1l - p1r - p1l - p2l;
else if (tx + entry->scroll_pos < p1l)
@@ -375,7 +404,11 @@ e_entry_configure(E_Entry * entry)
entry->scroll_pos = 0;
tw = 4;
tx = 0;
+ /* checkme
th = evas_get_text_height(entry->evas, entry->text);
+ */
+ th = evas_object_text_ascent_get(entry->text)+
+ evas_object_text_descent_get(entry->text);
if (entry->obj_cursor)
{
ebits_move(entry->obj_cursor,
@@ -391,27 +424,45 @@ e_entry_configure(E_Entry * entry)
if (entry->obj_cursor)
ebits_hide(entry->obj_cursor);
}
- evas_move(entry->evas, entry->text, entry->x + entry->scroll_pos + p1l + p2l,
+ evas_object_move(entry->text, entry->x + entry->scroll_pos + p1l + p2l,
entry->y + p1t + p2t);
if (entry->select.start >= 0)
{
double x1, y1, x2, tw, th;
+ /* checkme
evas_text_at(entry->evas, entry->text, entry->select.start, &x1, &y1,
NULL, NULL);
+ */
+ evas_object_text_char_pos_get(entry->text, entry->select.start, &x1, &y1,
+ NULL, NULL);
if (entry->select.start + entry->select.length <=
(int)strlen(entry->buffer))
+ {
+ /* checkme
evas_text_at(entry->evas, entry->text,
entry->select.start + entry->select.length - 1, &x2,
NULL, &tw, &th);
+ */
+ evas_object_text_char_pos_get(entry->text,
+ entry->select.start + entry->select.length - 1, &x2,
+ NULL, &tw, &th);
+ }
else
{
+ /* checkme
evas_text_at(entry->evas, entry->text,
entry->select.start + entry->select.length - 2, &x2,
NULL, &tw, &th);
+ */
+ evas_object_text_char_pos_get(entry->text,
+ entry->select.start + entry->select.length - 2, &x2,
+ NULL, &tw, &th);
tw += entry->end_width;
}
+ /* checkme todo
th = evas_get_text_height(entry->evas, entry->text);
+ */
if (entry->obj_selection)
{
ebits_move(entry->obj_selection,
@@ -598,7 +649,7 @@ e_entry_handle_keypress(E_Entry * entry, Ecore_Event_Key_Down * e)
}
void
-e_entry_set_evas(E_Entry * entry, Evas evas)
+e_entry_set_evas(E_Entry * entry, Evas * evas)
{
D_ENTER;
@@ -632,9 +683,9 @@ e_entry_show(E_Entry * entry)
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);
+ evas_object_show(entry->event_box);
+ evas_object_show(entry->clip_box);
+ evas_object_show(entry->text);
D_RETURN;
}
@@ -655,9 +706,9 @@ e_entry_hide(E_Entry * entry)
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);
+ evas_object_hide(entry->event_box);
+ evas_object_hide(entry->clip_box);
+ evas_object_hide(entry->text);
D_RETURN;
}
@@ -669,13 +720,13 @@ e_entry_raise(E_Entry * entry)
if (entry->obj_base)
ebits_raise(entry->obj_base);
- evas_raise(entry->evas, entry->clip_box);
- evas_raise(entry->evas, entry->text);
+ evas_object_raise(entry->clip_box);
+ evas_object_raise(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);
+ evas_object_raise(entry->event_box);
D_RETURN;
}
@@ -685,13 +736,13 @@ e_entry_lower(E_Entry * entry)
{
D_ENTER;
- evas_lower(entry->evas, entry->event_box);
+ evas_object_lower(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);
+ evas_object_lower(entry->text);
+ evas_object_lower(entry->clip_box);
if (entry->obj_base)
ebits_lower(entry->obj_base);
@@ -705,23 +756,23 @@ e_entry_set_layer(E_Entry * entry, int l)
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);
+ evas_object_layer_set(entry->clip_box, l);
+ evas_object_layer_set(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);
+ evas_object_layer_set(entry->event_box, l);
D_RETURN;
}
void
-e_entry_set_clip(E_Entry * entry, Evas_Object clip)
+e_entry_set_clip(E_Entry * entry, Evas_Object * clip)
{
D_ENTER;
- evas_set_clip(entry->evas, entry->clip_box, clip);
+ evas_object_clip_set(entry->clip_box, clip);
if (entry->obj_base)
ebits_set_clip(entry->obj_base, clip);
@@ -733,7 +784,7 @@ e_entry_unset_clip(E_Entry * entry)
{
D_ENTER;
- evas_unset_clip(entry->evas, entry->clip_box);
+ evas_object_clip_unset(entry->clip_box);
if (entry->obj_base)
ebits_unset_clip(entry->obj_base);
@@ -779,14 +830,18 @@ e_entry_query_max_size(E_Entry * entry, int *w, int *h)
if (entry->obj_cursor)
ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
+ /* checkme todo
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;
+ UN(w);
+ UN(h);
}
void
@@ -805,11 +860,14 @@ e_entry_max_size(E_Entry * entry, int *w, int *h)
ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
if (w)
*w = 8000;
+ /* checkme todo
if (h)
*h =
evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
+ */
D_RETURN;
+ UN(h);
}
void
@@ -828,11 +886,14 @@ e_entry_min_size(E_Entry * entry, int *w, int *h)
ebits_get_insets(entry->obj_cursor, &p2l, &p2r, &p2t, &p2b);
if (w)
*w = p1l + p1r + p2l + p2r + entry->min_size;
+ /* checkme todo
if (h)
*h =
evas_get_text_height(entry->evas, entry->text) + p1t + p1b + p2t + p2b;
+ */
D_RETURN;
+ UN(h);
}
void
@@ -889,7 +950,7 @@ e_entry_set_text(E_Entry * entry, const char *text)
IF_FREE(entry->buffer);
e_strdup(entry->buffer, text);
- evas_set_text(entry->evas, entry->text, entry->buffer);
+ evas_object_text_text_set(entry->text, entry->buffer);
if (entry->cursor_pos > (int)strlen(entry->buffer))
entry->cursor_pos = strlen(entry->buffer);
e_entry_configure(entry);
@@ -981,17 +1042,19 @@ e_entry_set_focus_out_callback(E_Entry * entry,
void
e_entry_insert_text(E_Entry * entry, char *text)
{
+ int size;
char *str2;
D_ENTER;
if (!text)
D_RETURN;
- str2 = malloc(strlen(e_entry_get_text(entry)) + 1 + strlen(text));
+ size = strlen(e_entry_get_text(entry)) + 1 + strlen(text);
+ str2 = malloc(size);
str2[0] = 0;
strncat(str2, entry->buffer, entry->cursor_pos);
- strcat(str2, text);
- strcat(str2, &(entry->buffer[entry->cursor_pos]));
+ strncat(str2, text, size);
+ strncat(str2, &(entry->buffer[entry->cursor_pos]), size);
e_entry_set_text(entry, str2);
FREE(str2);
entry->cursor_pos += strlen(text);
diff --git a/src/entry.h b/src/entry.h
index 72a324c27..0c94b3598 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -7,7 +7,7 @@ typedef struct _E_Entry E_Entry;
struct _E_Entry
{
- Evas evas;
+ Evas * evas;
char *buffer;
int cursor_pos;
struct
@@ -24,9 +24,9 @@ struct _E_Entry
Ebits_Object obj_base;
Ebits_Object obj_cursor;
Ebits_Object obj_selection;
- Evas_Object event_box;
- Evas_Object clip_box;
- Evas_Object text;
+ Evas_Object * event_box;
+ Evas_Object * clip_box;
+ Evas_Object * text;
Window paste_win;
Window selection_win;
int end_width;
@@ -52,13 +52,13 @@ void e_entry_free(E_Entry * entry);
E_Entry *e_entry_new(void);
void e_entry_handle_keypress(E_Entry * entry,
Ecore_Event_Key_Down * e);
-void e_entry_set_evas(E_Entry * entry, Evas evas);
+void e_entry_set_evas(E_Entry * entry, Evas * evas);
void e_entry_show(E_Entry * entry);
void e_entry_hide(E_Entry * entry);
void e_entry_raise(E_Entry * entry);
void e_entry_lower(E_Entry * entry);
void e_entry_set_layer(E_Entry * entry, int l);
-void e_entry_set_clip(E_Entry * entry, Evas_Object clip);
+void e_entry_set_clip(E_Entry * entry, Evas_Object * clip);
void e_entry_unset_clip(E_Entry * entry);
void e_entry_move(E_Entry * entry, int x, int y);
void e_entry_resize(E_Entry * entry, int w, int h);
diff --git a/src/epplet.c b/src/epplet.c
deleted file mode 100644
index 0ea264596..000000000
--- a/src/epplet.c
+++ /dev/null
@@ -1,821 +0,0 @@
-#include "debug.h"
-#include "epplet.h"
-#include "file.h"
-#include "observer.h"
-#include "desktops.h"
-
-#include "e_ferite.h"
-
-static void e_epplet_cleanup(E_Epplet * epp);
-static void e_epplet_mouse_down_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh);
-
-static void e_epplet_mouse_up_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh);
-
-static void e_epplet_mouse_move_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh);
-
-static void e_epplet_observer_cleanup(E_Object * o);
-
-E_Epplet *
-e_epplet_new(void *scr)
-{
-#ifdef USE_FERITE
- E_Epplet *epp;
- FeriteScript *script;
- char buf[PATH_MAX];
-
- D_ENTER;
-
- script = (FeriteScript *) scr;
-
- epp = NEW(E_Epplet, 1);
- ZERO(epp, E_Epplet, 1);
-
- e_object_init(E_OBJECT(epp), (E_Cleanup_Func) e_epplet_cleanup);
-
- epp->context = e_epplet_get_context_from_script(script);
- if (!(epp->context))
- {
- D("Error: epplet context not found\n");
- D_RETURN_(NULL);
- }
-
- epp->view = epp->context->view;
- epp->name = strdup(epp->context->name);
- epp->current.x = epp->context->geom.x;
- epp->current.y = epp->context->geom.y;
- epp->current.w = epp->context->geom.w;
- epp->current.h = epp->context->geom.h;
- epp->context->epp = epp;
-
- snprintf(buf, PATH_MAX, "%s/.e_epplets/%s/", epp->view->dir, epp->name);
- epp->dir = strdup(buf);
-
- if (!(epp->view))
- {
- D("Error: no view found for epplet: %s\n", epp->name);
- e_object_unref(E_OBJECT(epp));
- D_RETURN_(NULL);
- }
- else
- {
- D_RETURN_(epp);
- }
-#endif
-
-}
-
-static void
-e_epplet_cleanup(E_Epplet * epp)
-{
- Evas_List l;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- for (l = epp->ebits; l; l = l->next)
- {
- Ebits_Object o = l->data;
-
- ebits_free(o);
- }
-
- for (l = epp->evas_objects; l; l = l->next)
- {
- Evas_Object_Wrapper *o = l->data;
-
- evas_del_object(o->evas, o->obj);
-
- free(o);
- }
-
- if (epp->layout)
- ebits_free(epp->layout);
- if (epp->ui)
- ebits_free(epp->ui);
-#endif
- D_RETURN;
-}
-
-void
-e_epplet_load_from_layout(E_View * v)
-{
- char buf[PATH_MAX];
- Evas_List bit_names, l;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- snprintf(buf, PATH_MAX, "%s/.e_epplets.bits.db", v->dir);
- v->epplet_layout = ebits_load(buf);
- if (!v->epplet_layout)
- D_RETURN;
- ebits_add_to_evas(v->epplet_layout, v->evas);
- ebits_resize(v->epplet_layout, v->size.w, v->size.h);
- ebits_move(v->epplet_layout, 0, 0);
-
- bit_names = ebits_get_bit_names(v->epplet_layout);
-
- for (l = bit_names; l; l = l->next)
- {
- double x, y, w, h;
- E_Epplet_Context *context;
-
- context = NEW(E_Epplet_Context, 1);
- ZERO(context, E_Epplet_Context, 1);
-
- context->name = l->data;
-
- ebits_get_named_bit_geometry(v->epplet_layout, context->name, &x, &y,
- &w, &h);
-
- context->geom.x = x;
- context->geom.y = y;
- context->geom.w = w;
- context->geom.h = h;
- context->view = v;
- D("epplet has following info:\n");
- D("x: %f, y: %f, w: %f, h: %f\n", x, y, w, h);
-
- v->epplet_contexts = evas_list_append(v->epplet_contexts, context);
-
- snprintf(buf, PATH_MAX, "%s/.e_epplets/%s/%s.fe", v->dir, context->name,
- context->name);
- if (e_file_exists(buf))
- e_epplet_script_load(context, buf);
- else
- D("Error: Can't find epplet `%s'\n", buf);
- }
-#endif
-
- D_RETURN;
-}
-
-E_Epplet_Context *
-e_epplet_get_context_from_script(FeriteScript * script)
-{
- Evas_List l, ll;
-
- D_ENTER;
-
- D("script address: %p\n", script);
-
-#ifdef USE_FERITE
- for (l = views; l; l = l->next)
- {
- E_View *v;
-
- v = l->data;
- D("searching view: %s\n", v->dir);
-
- if (v->epplet_contexts == NULL)
- D("no scripts in view\n");
- for (ll = v->epplet_contexts; ll; ll = ll->next)
- {
- E_Epplet_Context *context = ll->data;
-
- D("found script: %p\n", context->script);
-
- if (context->script == script)
- D_RETURN_(context);
- }
- }
-#endif
-
- D_RETURN_(NULL);
-}
-
-void
-e_epplet_script_load(E_Epplet_Context * context, char *path)
-{
- FeriteScript *script = NULL;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- D("Ferite: Compiling epplet script `%s'\n", path);
- script = ferite_script_compile(path);
-
- if (!script)
- {
- D("Error compiling script... aborting\n");
- D_RETURN;
- }
- context->script = script;
- e_ferite_register(script, script->mainns);
- script->error_cb = e_ferite_script_error;
- script->warning_cb = e_ferite_script_warning;
- D("Ferite: executing epplet.\n");
-
- ferite_script_execute(script);
- D("Ferite: epplet executed.\n");
- /*ferite_script_delete(script); */
-#endif
-
- D_RETURN;
-}
-
-void
-e_epplet_set_common_callbacks(E_Epplet * epp)
-{
-/*
- D ("setting callbacks\n");
-
-#ifdef USE_FERITE
- if (!epp->bits)
- {
- D ("Error: no bits to set callbacks on\n");
- D_RETURN;
- }
-
- ebits_set_classed_bit_callback (epp->bits, "Title_Bar",
- CALLBACK_MOUSE_DOWN, e_epplet_mouse_down_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Title_Bar", CALLBACK_MOUSE_UP,
- e_epplet_mouse_up_cb, epp);
- ebits_set_classed_bit_callback (epp->bits, "Title_Bar", CALLBACK_MOUSE_MOVE,
- e_epplet_mouse_move_cb, epp);
-
- ebits_set_classed_bit_callback (epp->bits, "Resize",
- CALLBACK_MOUSE_DOWN, e_epplet_mouse_down_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize", CALLBACK_MOUSE_UP,
- e_epplet_mouse_up_cb, epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize", CALLBACK_MOUSE_MOVE,
- e_epplet_mouse_move_cb, epp);
-
- ebits_set_classed_bit_callback (epp->bits, "Resize_Vertical",
- CALLBACK_MOUSE_DOWN, e_epplet_mouse_down_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize_Vertical",
- CALLBACK_MOUSE_UP, e_epplet_mouse_up_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize_Vertical",
- CALLBACK_MOUSE_MOVE, e_epplet_mouse_move_cb,
- epp);
-
- ebits_set_classed_bit_callback (epp->bits, "Resize_Horizontal",
- CALLBACK_MOUSE_DOWN, e_epplet_mouse_down_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize_Horizontal",
- CALLBACK_MOUSE_UP, e_epplet_mouse_up_cb,
- epp);
- ebits_set_classed_bit_callback (epp->bits, "Resize_Horizontal",
- CALLBACK_MOUSE_MOVE, e_epplet_mouse_move_cb,
- epp);
-
-#endif
-
- D ("callbacks set\n");
-*/
-}
-
-static void
-e_epplet_mouse_down_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- E_Epplet *epp;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- epp = _data;
-
- if (!strcmp(_c, "Title_Bar"))
- {
- epp->state.moving = 1;
- epp->offset.x = _x - epp->current.x;
- epp->offset.y = _y - epp->current.y;
- }
-
- if (!strcmp(_c, "Resize"))
- {
- if (_x < epp->current.x + (epp->current.w / 2))
- {
- epp->state.resizing.left = 1;
- epp->offset.x = epp->current.x - _x;
- }
- if (_x >= epp->current.x + (epp->current.w / 2))
- {
- epp->state.resizing.right = 1;
- epp->offset.x = epp->current.x + epp->current.w - _x;
- }
- if (_y < epp->current.y + (epp->current.h / 2))
- {
- epp->state.resizing.up = 1;
- epp->offset.y = epp->current.y - _y;
- }
- if (_y >= epp->current.y + (epp->current.h / 2))
- {
- epp->state.resizing.down = 1;
- epp->offset.y = epp->current.y + epp->current.h - _y;
- }
-
- }
-
- if (!strcmp(_c, "Resize_Horizontal"))
- {
- if (_x < epp->current.x + (epp->current.w / 2))
- {
- epp->state.resizing.left = 1;
- epp->offset.x = epp->current.x - _x;
- }
- else
- {
- epp->state.resizing.right = 1;
- epp->offset.x = epp->current.x + epp->current.w - _x;
- }
- }
-
- if (!strcmp(_c, "Resize_Vertical"))
- {
- if (_y < epp->current.y + (epp->current.h / 2))
- {
- epp->state.resizing.up = 1;
- epp->offset.y = epp->current.y - _y;
- }
- else
- {
- epp->state.resizing.down = 1;
- epp->offset.y = epp->current.y + epp->current.h - _y;
- }
- }
-#endif
-
- D_RETURN;
-}
-
-static void
-e_epplet_mouse_up_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- E_Epplet *epp;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- epp = _data;
-
- if (!strcmp(_c, "Title_Bar"))
- {
- epp->state.moving = 0;
- }
-
- if (!strncmp(_c, "Resize", 6))
- {
- epp->state.resizing.up = 0;
- epp->state.resizing.down = 0;
- epp->state.resizing.left = 0;
- epp->state.resizing.right = 0;
- }
-#endif
- D_RETURN;
-}
-
-static void
-e_epplet_mouse_move_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- E_Epplet *epp;
- double x, y;
-
- D_ENTER;
-
-#ifdef USE_FERITE
-/* epp = _data;
-
- if (epp->state.moving)
- {
- x = _x - epp->offset.x;
- y = _y - epp->offset.y;
- if (x < 0)
- x = 0;
- if (y < 0)
- y = 0;
- if (x > epp->view->size.w - epp->current.w)
- x = epp->view->size.w - epp->current.w;
- if (y > epp->view->size.h - epp->current.h)
- y = epp->view->size.h - epp->current.h;
- epp->current.x = x;
- epp->current.y = y;
-
- ebits_move (epp->ui, epp->current.x, epp->current.y);
- }
-
- if (epp->state.resizing.left || epp->state.resizing.right
- || epp->state.resizing.up || epp->state.resizing.down)
- {
- int w, h, x, y;
- int mw, mh;
-
- if (epp->state.resizing.left)
- {
- w = epp->current.x + epp->current.w - _x - epp->offset.x;
- x = _x + epp->offset.x;
- }
- else if (epp->state.resizing.right)
- {
- w = _x - epp->current.x + epp->offset.x;
- x = epp->current.x;
- }
- else
- {
- w = epp->current.w;
- x = epp->current.x;
- }
-
- if (epp->state.resizing.up)
- {
- h = epp->current.h + epp->current.y - _y - epp->offset.y;
- y = _y + epp->offset.y;
- }
-
- else if (epp->state.resizing.down)
- {
- h = _y - epp->current.y + epp->offset.y;
- y = epp->current.y;
- }
- else
- {
- h = epp->current.h;
- y = epp->current.y;
- }
-
- ebits_get_max_size (epp->bits, &mw, &mh);
- if (w >= mw)
- {
- w = mw;
- x = epp->current.x;
- }
- if (h >= mh)
- {
- h = mh;
- y = epp->current.y;
- }
-
- ebits_get_min_size (epp->bits, &mw, &mh);
- if (w < mw)
- {
- w = mw;
- x = epp->current.x;
- }
- if (h < mh)
- {
- h = mh;
- y = epp->current.y;
- }
-
- epp->current.x = x;
- epp->current.y = y;
- epp->current.w = w;
- epp->current.h = h;
-
- ebits_resize (epp->bits, epp->current.w, epp->current.h);
- ebits_move (epp->bits, epp->current.x, epp->current.y);
-
- }
-*/
-#endif
-
- D_RETURN;
-}
-
-E_Epplet_CB_Info *
-e_epplet_cb_new(FeriteScript * script, char *func_name, FeriteObject * data,
- FeriteObject * data2)
-{
- E_Epplet_CB_Info *cb;
- FeriteNamespaceBucket *nsb;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- cb = NEW(E_Epplet_CB_Info, 1);
- ZERO(cb, E_Epplet_CB_Info, 1);
-
- nsb = __ferite_find_namespace(script, script->mainns, func_name, FENS_FNC);
- if (nsb != NULL)
- {
- cb->func = nsb->data;
- if (data)
- {
- cb->data = data;
- data->refcount++;
- }
- if (data2)
- {
- cb->data2 = data2;
- data2->refcount++;
- }
- cb->script = script;
- }
-#endif
-
- D_RETURN_(cb);
-}
-
-void
-e_epplet_cb_cleanup(E_Epplet_CB_Info * cb)
-{
-#ifdef USE_FERITE
- if (cb->data)
- {
- cb->data->refcount--;
- cb->data = NULL;
- }
- if (cb->data2)
- {
- cb->data2->refcount--;
- cb->data2 = NULL;
- }
- FREE(cb);
-#endif
-}
-
-void
-e_epplet_bits_cb(void *_data, Ebits_Object _o,
- char *_c, int _b, int _x, int _y,
- int _ox, int _oy, int _ow, int _oh)
-{
- E_Epplet_CB_Info *cb;
- FeriteVariable **params;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- cb = _data;
-
- if (cb->script)
- {
- D("creating params and calling func\n");
- params =
- __ferite_create_parameter_list_from_data(cb->script, "osnnnnnnn",
- cb->data, _c, _b, _x, _y,
- _ox, _oy, _ow, _oh);
- __ferite_variable_destroy(cb->script,
- __ferite_call_function(cb->script, cb->func,
- params));
- __ferite_delete_parameter_list(cb->script, params);
- D("func called, params deleted\n");
- }
- else
- {
- D("ERROR: script does not exist\n");
- }
- /* e_epplet_cb_cleanup(cb); */
-#endif
- D_RETURN;
-}
-
-void
-e_epplet_evas_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
-{
- E_Epplet_CB_Info *cb;
- FeriteVariable **params;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- cb = _data;
-
- D("d1: %s, d2: %s\n", cb->data->name, cb->data2->name);
-
- if (cb->script)
- {
- D("creating params\n");
- params = __ferite_create_parameter_list_from_data(cb->script, "oonnn",
- cb->data, cb->data2,
- (double)_b,
- (double)_x,
- (double)_y);
- D("calling func: %s\n", cb->func->name);
- __ferite_variable_destroy(cb->script,
- __ferite_call_function(cb->script, cb->func,
- params));
- __ferite_delete_parameter_list(cb->script, params);
- D("func called, params deleted\n");
- }
- else
- {
- D("ERROR: script does not exist\n");
- }
-/* e_epplet_cb_cleanup(cb); */
-#endif
- D_RETURN;
-}
-
-void
-e_epplet_timer_func(int val, void *data)
-{
- E_Epplet_CB_Info *cb;
- FeriteVariable **params;
-
- D_ENTER;
-
-#ifdef USE_FERITE
-/* D("in timer func\n"); */
- cb = data;
-
- if (cb->script)
- {
-/* D("creating params\n"); */
- params = __ferite_create_parameter_list_from_data(cb->script, "on",
- cb->data, (float)val);
-/* D("calling func\n"); */
- __ferite_variable_destroy(cb->script,
- __ferite_call_function(cb->script, cb->func,
- params));
- __ferite_delete_parameter_list(cb->script, params);
-/* D("func called, params deleted\n"); */
- }
- else
- {
- D("ERROR: script does not exist\n");
- }
-
-/* e_epplet_cb_cleanup(cb); */
-#endif
- D_RETURN;
-}
-
-E_Epplet_Observer *
-e_epplet_observer_new(FeriteScript * script, char *func_name,
- FeriteObject * data, char *event_type)
-{
- E_Epplet_Observer *obs = NULL;
- FeriteNamespaceBucket *nsb;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- obs = NEW(E_Epplet_Observer, 1);
- memset(obs, 0, sizeof(E_Epplet_Observer));
-
- if (!strcmp(event_type, "DESKTOP_SWITCH"))
- e_observer_init(E_OBSERVER(obs), E_EVENT_DESKTOP_SWITCH,
- e_epplet_desktop_observer_func,
- (E_Cleanup_Func) e_epplet_observer_cleanup);
-#if 0
- else if (!strcmp(event_type, "ICONIFY"))
- e_observer_init(E_OBSERVER(obs), E_EVENT_BORDER_ICONIFY,
- e_epplet_border_observer_func,
- (E_Cleanup_Func) e_epplet_observer_cleanup);
- else if (!strcmp(event_type, "UNICONIFY"))
- e_observer_init(E_OBSERVER(obs), E_EVENT_BORDER_UNICONIFY,
- e_epplet_border_observer_func,
- (E_Cleanup_Func) e_epplet_observer_cleanup);
- else
- e_observer_init(E_OBSERVER(obs), E_EVENT_MAX,
- e_epplet_desktop_observer_func,
- (E_Cleanup_Func) e_epplet_observer_cleanup);
-#endif
-
- nsb = __ferite_find_namespace(script, script->mainns, func_name, FENS_FNC);
- if (nsb != NULL)
- {
- obs->script = script;
- obs->func = nsb->data;
- if (data)
- {
- ((E_Epplet_Observer *) obs)->data = data;
- data->refcount++;
- }
- }
- D("returning, event: %i\n", E_OBSERVER(obs)->event);
-#endif
- D_RETURN_(obs);
-}
-
-static void
-e_epplet_observer_cleanup(E_Object * o)
-{
-#ifdef USE_FERITE
- /*FIXME: we need something here!!! Leeeeaky! */
-#endif
-}
-
-void
-e_epplet_observer_register_desktops(E_Epplet_Observer * obs)
-{
- Evas_List l;
-
- D_ENTER;
-#ifdef USE_FERITE
- D("odeskregister, bserver func: %s\n", obs->func->name);
- D("register each desktop in list\n");
- for (l = e_desktops_get_desktops_list(); l; l = l->next)
- {
- E_Desktop *d = l->data;
-
- D("registering desktop...\n")
- e_observer_register_observee(E_OBSERVER(obs), E_OBSERVEE(d));
- D("desktop registered\n")}
-#endif
- D_RETURN;
-}
-#if 0
-void
-e_epplet_observer_register_borders(E_Epplet_Observer * obs)
-{
- Evas_List l;
-
- D_ENTER;
-#ifdef USE_FERITE
- for (l = e_border_get_borders_list(); l; l = l->next)
- {
- E_Border *b = l->data;
-
- D("registering desktop...\n")
- e_observer_register_observee(E_OBSERVER(obs), E_OBSERVEE(b));
- D("desktop registered\n")}
-#endif
- D_RETURN;
-}
-#endif
-
-void
-e_epplet_desktop_observer_func(E_Observer * observer, E_Observee * observee,
- E_Event_Type event)
-{
- E_Epplet_Observer *obs;
- E_Desktop *desk;
- FeriteVariable **params;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- obs = (E_Epplet_Observer *) observer;
- desk = (E_Desktop *) observee;
-
- D("desktop: %i\n", desk->desk.desk);
- D("current: %i\n", e_desktops_get_current());
- if (obs->script)
- {
- D("creating params\n");
-
- params = __ferite_create_parameter_list_from_data(obs->script, "on",
- obs->data,
- (float)(desk->desk.
- desk));
- D("calling func: %s\n", obs->func->name);
- __ferite_variable_destroy(obs->script,
- __ferite_call_function(obs->script, obs->func,
- params));
- D("function called\n");
- __ferite_delete_parameter_list(obs->script, params);
- D("func called, params deleted\n");
- }
- else
- {
- D("ERROR: script does not exist\n");
- }
-#endif
- D_RETURN;
-}
-
-#if 0 /* don't use this, its currently broken */
-void
-e_epplet_border_observer_func(E_Observer * observer, E_Observee * observee)
-{
- E_Epplet_Observer *obs;
- E_Border *b;
- FeriteVariable **params;
-
- D_ENTER;
-
-#ifdef USE_FERITE
- obs = (E_Epplet_Observer *) observer;
- b = (E_Border *) observee;
-
- obs->data->odata = b;
-
- if (obs->script)
- {
- /*D("creating params\n"); */
-
- params = __ferite_create_parameter_list_from_data(obs->script, "o",
- obs->data);
- /*D("calling func: %s\n", obs->func->name); */
- __ferite_variable_destroy(obs->script,
- __ferite_call_function(obs->script, obs->func,
- params));
- /*D("function called\n"); */
- __ferite_delete_parameter_list(obs->script, params);
- /*D("func called, params deleted\n"); */
- }
- else
- {
- D("ERROR: script does not exist\n");
- }
-#endif
- D_RETURN;
-}
-#endif
diff --git a/src/epplet.h b/src/epplet.h
deleted file mode 100644
index 46517761b..000000000
--- a/src/epplet.h
+++ /dev/null
@@ -1,123 +0,0 @@
-#ifndef E_EPPLET_H
-#define E_EPPLET_H
-
-#include "e.h"
-#include "view.h"
-#include "observer.h"
-#include "e_ferite.h"
-
-typedef struct _E_Epplet E_Epplet;
-typedef struct _E_Epplet_Context E_Epplet_Context;
-typedef struct _E_Epplet_CB_Info E_Epplet_CB_Info;
-typedef struct _Evas_Object_Wrapper Evas_Object_Wrapper;
-typedef struct _E_Epplet_Observer E_Epplet_Observer;
-
-struct _E_Epplet_Observer
-{
- E_Observer o;
-
- FeriteScript *script;
- FeriteFunction *func;
- FeriteObject *data;
-};
-
-struct _E_Epplet_CB_Info
-{
- FeriteScript *script;
- FeriteFunction *func;
- FeriteObject *data;
- FeriteObject *data2;
-};
-
-struct _E_Epplet_Context
-{
- char *name;
- E_View *view;
- FeriteScript *script;
-
- E_Epplet *epp;
-
- struct
- {
- double x, y;
- double w, h;
- }
- geom;
-};
-
-struct _E_Epplet
-{
- E_Object o;
-
- E_Epplet_Context *context;
-
- char *name;
- E_View *view;
- char *dir;
- Ebits_Object layout;
- Ebits_Object ui;
-
- struct
- {
- double x, y;
- double w, h;
- }
- current , requested, offset;
-
- struct
- {
- int changed;
- int moving;
- struct
- {
- int up, down, left, right;
- }
- resizing;
- }
- state;
-
- Evas_List evas_objects;
- Evas_List ebits;
-};
-
-struct _Evas_Object_Wrapper
-{
- Evas evas;
- Evas_Object obj;
- E_Epplet *epp;
-};
-
-/* epplet loading / cleanup */
-E_Epplet *e_epplet_new();
-void e_epplet_load_from_layout(E_View * v);
-void e_epplet_script_load(E_Epplet_Context * v,
- char *script_path);
-E_Epplet_Context *e_epplet_get_context_from_script(FeriteScript * script);
-
-/* probably won't use this... */
-void e_epplet_set_common_callbacks(E_Epplet * epp);
-
-/* callbacks */
-E_Epplet_CB_Info *e_epplet_cb_new(FeriteScript * script, char *func_name,
- FeriteObject * data, FeriteObject * data2);
-void e_epplet_cb_cleanup(E_Epplet_CB_Info * cb);
-void e_epplet_bits_cb(void *_data, Ebits_Object _o, char *_c,
- int _b, int _x, int _y, int _ox, int _oy,
- int _ow, int _oh);
-void e_epplet_evas_cb(void *_data, Evas _e, Evas_Object _o,
- int _b, int _x, int _y);
-/* timers */
-void e_epplet_timer_func(int val, void *data);
-
-/* Observers */
-E_Epplet_Observer *e_epplet_observer_new(FeriteScript * script,
- char *func_name, FeriteObject * data,
- char *event_type);
-void e_epplet_observer_register_desktops(E_Epplet_Observer *
- obs);
-void e_epplet_desktop_observer_func(E_Observer * observer,
- E_Observee * observee,
- E_Event_Type event);
-/*void e_epplet_border_observer_func(E_Observer *observer, E_Observee *observee);*/
-
-#endif
diff --git a/src/exec.c b/src/exec.c
index 96369ab44..fe99d7fc4 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -15,7 +15,7 @@ struct _e_hack_found_cb
void *func_data;
};
-static Evas_List hack_found_cb = NULL;
+static Evas_List * hack_found_cb = NULL;
void *
e_exec_broadcast_cb_add(void (*func) (Window win, void *_data), void *data)
@@ -42,7 +42,7 @@ e_exec_broadcast_cb_del(void *cbp)
void
e_exec_broadcast_e_hack_found(Window win)
{
- Evas_List l;
+ Evas_List * l;
for (l = hack_found_cb; l; l = l->next)
{
@@ -108,7 +108,7 @@ e_exec_restart(void)
exe[0] = 0;
for (i = 0; i < e_argc; i++)
{
- strcat(exe, e_argv[i]);
+ strncat(exe, e_argv[i], PATH_MAX);
strcat(exe, " ");
}
execl("/bin/sh", "/bin/sh", "-c", exe, NULL);
diff --git a/src/file.c b/src/file.c
index e7fed30de..726feac97 100644
--- a/src/file.c
+++ b/src/file.c
@@ -126,7 +126,7 @@ e_file_get_dir(char *file)
D_ENTER;
- strcpy(buf, file);
+ STRNCPY(buf, file, PATH_MAX);
p = strrchr(buf, '/');
if (!p)
{
@@ -193,12 +193,12 @@ e_file_readlink(char *link)
D_RETURN_(f);
}
-Evas_List
+Evas_List *
e_file_ls(char *dir)
{
DIR *dirp;
struct dirent *dp;
- Evas_List list;
+ Evas_List * list;
D_ENTER;
@@ -210,7 +210,7 @@ e_file_ls(char *dir)
{
if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
{
- Evas_List l;
+ Evas_List * l;
char *f;
/* insertion sort */
diff --git a/src/file.h b/src/file.h
index c373581ed..d528d13d9 100644
--- a/src/file.h
+++ b/src/file.h
@@ -35,6 +35,6 @@ char *e_file_get_dir(char *path);
int e_file_can_exec(struct stat *st);
char *e_file_readlink(char *link);
-Evas_List e_file_ls(char *dir);
+Evas_List * e_file_ls(char *dir);
#endif
diff --git a/src/focus.c b/src/focus.c
index f0aaa9d92..8c27af223 100644
--- a/src/focus.c
+++ b/src/focus.c
@@ -4,7 +4,7 @@
#include "e.h"
#include "util.h"
-static Evas_List focus_list = NULL;
+static Evas_List * focus_list = NULL;
void
e_focus_set_focus(E_Border * b)
diff --git a/src/fs.c b/src/fs.c
index bd89a9020..da44df457 100644
--- a/src/fs.c
+++ b/src/fs.c
@@ -4,8 +4,8 @@
#include "util.h"
static EfsdConnection *ec = NULL;
-static Evas_List fs_handlers = NULL;
-static Evas_List fs_restart_handlers = NULL;
+static Evas_List * fs_handlers = NULL;
+static Evas_List * fs_restart_handlers = NULL;
static pid_t efsd_pid = 0;
static void e_fs_child_handle(Ecore_Event * ev);
@@ -80,7 +80,7 @@ e_fs_fd_handle(int fd)
if (efsd_next_event(ec, &ev) >= 0)
{
- Evas_List l;
+ Evas_List * l;
for (l = fs_handlers; l; l = l->next)
{
@@ -136,7 +136,7 @@ e_fs_restarter(int val, void *data)
}
if (ec)
{
- Evas_List l;
+ Evas_List * l;
ecore_add_event_fd(efsd_get_connection_fd(ec), e_fs_fd_handle);
for (l = fs_restart_handlers; l; l = l->next)
diff --git a/src/guides.c b/src/guides.c
index 1508203a1..3370f7dc0 100644
--- a/src/guides.c
+++ b/src/guides.c
@@ -4,6 +4,7 @@
#include "config.h"
#include "embed.h"
#include "util.h"
+#include <Imlib2.h>
static struct
{
@@ -37,10 +38,10 @@ static struct
win;
struct
{
- Evas evas;
+ Evas * evas;
Ebits_Object bg;
E_Text *text;
- Evas_Object icon;
+ Evas_Object * icon;
Imlib_Image image;
}
disp;
@@ -103,19 +104,49 @@ e_guides_update(void)
{
font_dir = e_config_get("fonts");
guides.disp.evas = evas_new();
- evas_set_output_method(guides.disp.evas, RENDER_METHOD_IMAGE);
+ evas_output_method_set(guides.disp.evas,
+ evas_render_method_lookup("software_x11"));
+ evas_object_font_path_append(guides.disp.evas, font_dir);
+ evas_output_size_set(guides.disp.evas, 1, 1);
+ evas_output_viewport_set(guides.disp.evas, 0, 0, 1, 1);
+ evas_object_font_cache_set(guides.disp.evas, font_cache);
+ evas_object_image_cache_set(guides.disp.evas, image_cache);
+
+ {
+ Evas_Engine_Info_Software_X11 *einfo;
+ XSetWindowAttributes att;
+ /*Window window;*/
+
+ Pixmap pmap, mask;
+
+ pmap = ecore_pixmap_new(guides.win.display, 100, 100, 0);
+ mask = ecore_pixmap_new(guides.win.display, 100, 100, 1);
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(guides.disp.evas);
+
+ /* the following is specific to the engine */
+ einfo->info.display = ecore_display_get();
+ einfo->info.visual = DefaultVisual(einfo->info.display, DefaultScreen(einfo->info.display));
+ einfo->info.colormap = DefaultColormap(einfo->info.display, DefaultScreen(einfo->info.display));
+
+ att.background_pixmap = None;
+ att.colormap = /*colormap*/ DefaultColormap(einfo->info.display, DefaultScreen(einfo->info.display));
+ att.border_pixel = 0;
+ att.event_mask = 0;
+ einfo->info.drawable = pmap;
+ einfo->info.mask = mask;
+
+ einfo->info.depth = DefaultDepth(einfo->info.display, DefaultScreen(einfo->info.display));
+ einfo->info.rotation = 0;
+ einfo->info.debug = 0;
+ evas_engine_info_set(guides.disp.evas, (Evas_Engine_Info *) einfo);
+
+ /* And setup for Imlib2 */
+ imlib_context_set_display(einfo->info.display);
+ imlib_context_set_visual(DefaultVisual(einfo->info.display, DefaultScreen(einfo->info.display)));
+ }
- guides.disp.image = imlib_create_image(1, 1);
- imlib_context_set_image(guides.disp.image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
- evas_set_output_image(guides.disp.evas, guides.disp.image);
- evas_font_add_path(guides.disp.evas, font_dir);
- evas_set_output_size(guides.disp.evas, 1, 1);
- evas_set_output_viewport(guides.disp.evas, 0, 0, 1, 1);
- evas_set_font_cache(guides.disp.evas, font_cache);
- evas_set_image_cache(guides.disp.evas, image_cache);
}
}
else
@@ -195,19 +226,20 @@ e_guides_update(void)
}
if ((!guides.current.display.icon) && (guides.disp.icon))
{
- evas_del_object(guides.disp.evas, guides.disp.icon);
+ evas_object_del(guides.disp.icon);
guides.disp.icon = NULL;
}
if ((guides.current.display.icon) && (!guides.disp.icon))
{
guides.disp.icon =
- evas_add_image_from_file(guides.disp.evas,
- guides.current.display.icon);
- evas_show(guides.disp.evas, guides.disp.icon);
+ evas_object_image_add(guides.disp.evas);
+ evas_object_image_file_set(guides.disp.icon,
+ guides.current.display.icon, NULL);
+ evas_object_show(guides.disp.icon);
}
if (guides.disp.icon)
- evas_set_image_file(guides.disp.evas, guides.disp.icon,
- guides.current.display.icon);
+ evas_object_image_file_set(guides.disp.icon,
+ guides.current.display.icon, NULL);
e_text_set_text(guides.disp.text, guides.current.display.text);
if (!guides.disp.bg)
{
@@ -284,37 +316,18 @@ e_guides_update(void)
guides.disp.image = NULL;
}
- guides.disp.image = imlib_create_image(dw, dh);
- imlib_context_set_image(guides.disp.image);
- imlib_image_set_has_alpha(1);
- imlib_image_clear();
-
- evas_set_output_image(guides.disp.evas, guides.disp.image);
- evas_set_output_size(guides.disp.evas, dw, dh);
- evas_set_output_viewport(guides.disp.evas, 0, 0, dw, dh);
- evas_update_rect(guides.disp.evas, 0, 0, dw, dh);
+ evas_output_size_set(guides.disp.evas, dw, dh);
+ evas_output_viewport_set(guides.disp.evas, 0, 0, dw, dh);
+ evas_damage_rectangle_add(guides.disp.evas, 0, 0, dw, dh);
evas_render(guides.disp.evas);
{
- Pixmap pmap, mask;
-
- pmap = ecore_pixmap_new(guides.win.display, dw, dh, 0);
- mask = ecore_pixmap_new(guides.win.display, dw, dh, 1);
-
- imlib_context_set_image(guides.disp.image);
+ Evas_Engine_Info_Software_X11 *einfo;
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(guides.disp.evas);
- imlib_context_set_dither_mask(1);
- imlib_context_set_dither(1);
- imlib_context_set_drawable(pmap);
- imlib_context_set_mask(mask);
- imlib_context_set_blend(0);
- imlib_context_set_color_modifier(NULL);
- imlib_render_image_on_drawable(0, 0);
- ecore_window_set_background_pixmap(guides.win.display, pmap);
- ecore_window_set_shape_mask(guides.win.display, mask);
+ ecore_window_set_background_pixmap(guides.win.display, einfo->info.drawable);
+ ecore_window_set_shape_mask(guides.win.display, einfo->info.mask);
ecore_window_clear(guides.win.display);
- ecore_pixmap_free(pmap);
- ecore_pixmap_free(mask);
}
ecore_window_move(guides.win.display, dx, dy);
ecore_window_resize(guides.win.display, dw, dh);
diff --git a/src/iconbar.c b/src/iconbar.c
index fe1880d4c..ced8eac55 100644
--- a/src/iconbar.c
+++ b/src/iconbar.c
@@ -1,16 +1,20 @@
+#include "e.h"
#include "debug.h"
+#include "data.h"
+#include "desktops.h"
#include "iconbar.h"
#include "util.h"
-#include "desktops.h"
#include "border.h"
#include "file.h"
#include "icons.h"
-#include "view_layout.h"
-static E_Config_Base_Type *cf_iconbar = NULL;
-static E_Config_Base_Type *cf_iconbar_icon = NULL;
+#include <assert.h>
+#undef NDEBUG
+
+static E_Data_Base_Type *cf_iconbar = NULL;
+static E_Data_Base_Type *cf_iconbar_icon = NULL;
-static Evas_List iconbars = NULL;
+static Evas_List * iconbars = NULL;
/* internal func (iconbar use only) prototypes */
@@ -32,26 +36,22 @@ static void ib_bits_resize(void *data, double w, double h);
static void ib_bits_raise(void *data);
static void ib_bits_lower(void *data);
static void ib_bits_set_layer(void *data, int l);
-static void ib_bits_set_clip(void *data, Evas_Object clip);
+static void ib_bits_set_clip(void *data, Evas_Object * clip);
static void ib_bits_set_color_class(void *data, char *cc, int r, int g,
int b, int a);
static void ib_bits_get_min_size(void *data, double *w, double *h);
static void ib_bits_get_max_size(void *data, double *w, double *h);
-static void ib_mouse_in(void *data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-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 ib_mouse_move(void *data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
+static void ib_mouse_in(void *data, Evas * _e, Evas_Object * _o, void *event_info);
+static void ib_mouse_out(void *data, Evas * _e, Evas_Object * _o, void *event_info);
+static void ib_mouse_down(void *data, Evas * _e, Evas_Object * _o, void *event_info);
+static void ib_mouse_up(void *data, Evas * _e, Evas_Object * _o, void *event_info);
+static void ib_mouse_move(void *data, Evas * _e, Evas_Object * _o, void *event_info);
static void e_iconbar_icon_cleanup(E_Iconbar_Icon * ic);
static void ib_child_handle(Ecore_Event * ev);
+static void ib_window_mouse_out(Ecore_Event *ev);
/* 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 */
@@ -143,7 +143,7 @@ e_iconbar_cleanup(E_Iconbar * ib)
/* save scroll position */
/* 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;
+ /* ib->desktop->changed = 1; */
/* free up our ebits */
if (ib->bit)
ebits_free(ib->bit);
@@ -151,7 +151,7 @@ e_iconbar_cleanup(E_Iconbar * ib)
/* if we have any icons... */
if (ib->icons)
{
- Evas_List l;
+ Evas_List * l;
/* go thru the list of icon and unref each one.. ie - free it */
for (l = ib->icons; l; l = l->next)
@@ -165,12 +165,12 @@ e_iconbar_cleanup(E_Iconbar * ib)
evas_list_free(ib->icons);
}
/* cleaup the clip object */
- if ((ib->view) && (ib->view->evas) && (ib->clip))
- evas_del_object(ib->view->evas, ib->clip);
+ if ((ib->desktop) && (ib->desktop->evas) && (ib->clip))
+ evas_object_del(ib->clip);
/* delete any timers intended to work on this iconbar */
- snprintf(buf, PATH_MAX, "iconbar_reload:%s", ib->view->name);
+ snprintf(buf, PATH_MAX, "iconbar_reload:%d", ib->desktop->desk.desk);
ecore_del_event_timer(buf);
- snprintf(buf, PATH_MAX, "iconbar_scroll:%s", ib->view->name);
+ snprintf(buf, PATH_MAX, "iconbar_scroll:%d", ib->desktop->desk.desk);
ecore_del_event_timer(buf);
/* call the destructor of the base class */
@@ -189,36 +189,37 @@ e_iconbar_init()
{
D_ENTER;
- /* we set up config structure and types so the config system can just */
+ /* we set up data structure and types so the data system can just */
/* read a db and dump it right into memory - including lists of stuff */
- /* a new config type - an iconbar icon */
- cf_iconbar_icon = e_config_type_new();
- /* this is a member of the iconbar icon struct we want the config system */
+ /* a new data type - an iconbar icon */
+ cf_iconbar_icon = e_data_type_new();
+ /* this is a member of the iconbar icon struct we want the data system */
/* to get from the db for us. the key is "exec". the type is a string */
- /* the struct memebr is exec. the default value is "". see the config.h */
+ /* the struct memebr is exec. the default value is "". see the data.h */
/* header for more info */
- E_CONFIG_NODE(cf_iconbar_icon, "exec", E_CFG_TYPE_STR, NULL,
- E_Iconbar_Icon, exec, 0, 0, "");
- E_CONFIG_NODE(cf_iconbar_icon, "wait", E_CFG_TYPE_INT, NULL,
- E_Iconbar_Icon, wait, 0, 0, "");
- E_CONFIG_NODE(cf_iconbar_icon, "wait_timeout", E_CFG_TYPE_FLOAT, NULL,
- E_Iconbar_Icon, wait_timeout, 0, 0, "");
+ E_DATA_NODE(cf_iconbar_icon, "exec", E_DATA_TYPE_STR, NULL,
+ E_Iconbar_Icon, exec, (E_Data_Value)"");
+ E_DATA_NODE(cf_iconbar_icon, "wait", E_DATA_TYPE_INT, NULL,
+ E_Iconbar_Icon, wait, (E_Data_Value)0);
+ E_DATA_NODE(cf_iconbar_icon, "wait_timeout", E_DATA_TYPE_FLOAT, NULL,
+ E_Iconbar_Icon, wait_timeout, (E_Data_Value)0);
/* this memebr will be replaced by the relative key path in the db as a */
/* string */
- E_CONFIG_NODE(cf_iconbar_icon, "image", E_CFG_TYPE_KEY, NULL,
- E_Iconbar_Icon, image_path, 0, 0, "");
+ E_DATA_NODE(cf_iconbar_icon, "image", E_DATA_TYPE_KEY, NULL,
+ E_Iconbar_Icon, image_path, (E_Data_Value)"");
- /* a new config type - in this case the iconbar istelf. the only thing we */
- /* want the config system to do it fill it with iconbar icon members in */
+ /* a new data type - in this case the iconbar istelf. the only thing we */
+ /* want the data system to do it fill it with iconbar icon members in */
/* 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);
- E_CONFIG_NODE(cf_iconbar, "scroll", E_CFG_TYPE_FLOAT, NULL, E_Iconbar,
- scroll, 0, 0, NULL);
+ cf_iconbar = e_data_type_new();
+ E_DATA_NODE(cf_iconbar, "icons", E_DATA_TYPE_LIST, cf_iconbar_icon,
+ E_Iconbar, icons, (E_Data_Value)"");
+ E_DATA_NODE(cf_iconbar, "scroll", E_DATA_TYPE_FLOAT, NULL, E_Iconbar,
+ scroll, (E_Data_Value)0);
ecore_event_filter_handler_add(ECORE_EVENT_CHILD, ib_child_handle);
+ ecore_event_filter_handler_add(ECORE_EVENT_WINDOW_FOCUS_OUT, ib_window_mouse_out);
D_RETURN;
}
@@ -228,51 +229,51 @@ e_iconbar_init()
* @v: The view for which an iconbar is to be constructed
*/
E_Iconbar *
-e_iconbar_new(E_View * v)
+e_iconbar_new(E_Desktop * d)
{
- Evas_List l;
+ Evas_List *l;
char buf[PATH_MAX];
E_Iconbar *ib;
D_ENTER;
- D("new iconbar for view: %s\n", v->name);
- if(!v || !v->look || !v->look->obj
- || !v->look->obj->icb || !v->look->obj->icb_bits)
+ D("new iconbar for desktop: %d\n", d->desk.desk);
+ if(!d || !d->look || !d->look->obj
+ || !d->look->obj->icb || !d->look->obj->icb_bits)
D_RETURN_(NULL);
- /* first we want to load the iconbar data itself - ie the config info */
+ /* first we want to load the iconbar data itself - ie the data info */
/* for what icons we have and what they execute */
- snprintf(buf, PATH_MAX, "%s", v->look->obj->icb);
- /* use the config system to simply load up the db and start making */
+ snprintf(buf, PATH_MAX, "%s", d->look->obj->icb);
+ /* use the data system to simply load up the db and start making */
/* structs and lists and stuff for us... we told it how to in init */
- ib = e_config_load(buf, "", cf_iconbar);
+ ib = e_data_load(buf, "", cf_iconbar);
/* flush image cache */
{
- if (v->evas)
+ if (d->evas)
{
int size;
- size = evas_get_image_cache(v->evas);
- evas_set_image_cache(v->evas, 0);
- evas_set_image_cache(v->evas, size);
+ size = evas_object_image_cache_get(d->evas);
+ evas_object_image_cache_flush(d->evas);
+ evas_object_image_cache_set(d->evas, size);
}
}
/* flush edb cached handled */
e_db_flush();
- /* no iconbar config loaded ? return NULL */
+ /* no iconbar data loaded ? return NULL */
if (!ib)
{
- D("no config loaded, return null\n");
+ D("no data loaded, return null\n");
D_RETURN_(NULL);
}
- /* now that the config system has doe the loading. we need to init the */
+ /* now that the data system has doe the loading. we need to init the */
/* object and set up ref counts and free method */
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;
+ ib->desktop = d;
/* clip object = NULL */
ib->clip = NULL;
/* reset has been scrolled flag */
@@ -284,7 +285,7 @@ e_iconbar_new(E_View * v)
E_Iconbar_Icon *ic;
ic = l->data;
- /* and init the iocnbar icon object */
+ /* and init the iconbar icon object */
e_object_init(E_OBJECT(ic), (E_Cleanup_Func) e_iconbar_icon_cleanup);
/* and have the iconbar icon know what iconbar it belongs to */
@@ -293,7 +294,7 @@ e_iconbar_new(E_View * v)
/* now we need to load up a bits file that tells us where in the view the */
/* iconbar is meant to go. same place. just a slightly different name */
- snprintf(buf, PATH_MAX, "%s", ib->view->look->obj->icb_bits);
+ snprintf(buf, PATH_MAX, "%s", ib->desktop->look->obj->icb_bits);
ib->bit = ebits_load(buf);
/* we didn't find one? */
@@ -307,13 +308,13 @@ e_iconbar_new(E_View * v)
D_RETURN_(NULL);
}
ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow1",
- CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
+ EVAS_CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow1",
- CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
+ EVAS_CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow2",
- CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
+ EVAS_CALLBACK_MOUSE_DOWN, e_ib_bit_down_cb, ib);
ebits_set_classed_bit_callback(ib->bit, "Scrollbar_Arrow2",
- CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
+ EVAS_CALLBACK_MOUSE_UP, e_ib_bit_up_cb, ib);
/* add to our list of iconbars */
iconbars = evas_list_append(iconbars, ib);
@@ -335,7 +336,7 @@ e_iconbar_icon_cleanup(E_Iconbar_Icon * ic)
D("iconbar icon cleanup\n");
/* if we have an imageobject. nuke it */
if (ic->image)
- evas_del_object(ic->iconbar->view->evas, ic->image);
+ evas_object_del(ic->image);
/* cleanup the imlib_image */
if (ic->imlib_image)
{
@@ -353,7 +354,7 @@ e_iconbar_icon_cleanup(E_Iconbar_Icon * ic)
FREE(ic->hi.timer);
}
if (ic->hi.image)
- evas_del_object(ic->iconbar->view->evas, ic->hi.image);
+ evas_object_del(ic->hi.image);
if (ic->launch_id_cb)
{
@@ -379,58 +380,64 @@ e_iconbar_icon_cleanup(E_Iconbar_Icon * ic)
* @ib: The iconbar to initalize
*
* Turns an iconbar into more than a
- * structure of config data -- actually create evas objcts
+ * structure of data -- actually create evas objcts
* we can do something visual with
*/
void
e_iconbar_realize(E_Iconbar * ib)
{
- Evas_List l;
+ Evas_List * l;
if (!ib) D_RETURN;
D_ENTER;
D("realize iconbar\n");
/* create clip object */
- ib->clip = evas_add_rectangle(ib->view->evas);
- evas_set_color(ib->view->evas, ib->clip, 255, 255, 255, 255);
+ ib->clip = evas_object_rectangle_add(ib->desktop->evas);
+ evas_object_color_set(ib->clip, 255, 255, 255, 190);
/* go thru every icon in the iconbar */
for (l = ib->icons; l; l = l->next)
{
E_Iconbar_Icon *ic;
char buf[PATH_MAX];
+ int err;
ic = l->data;
/* set the path of the image to load to be the iconbar db plus */
/* the path of the key to the image memebr - that is actually */
/* a lump of image data inlined in the iconbar db - so the icons */
/* themselves follow the iconbar wherever it goes */
- snprintf(buf, PATH_MAX, "%s:%s",
- ib->view->look->obj->icb, ic->image_path);
+ snprintf(buf, PATH_MAX, "%s:%s",
+ ib->desktop->look->obj->icb, ic->image_path);
/* add the icon image object */
- ic->image = evas_add_image_from_file(ib->view->evas, buf);
+ ic->image = evas_object_image_add(ib->desktop->evas);
+ evas_object_image_file_set(ic->image, ib->desktop->look->obj->icb,
+ ic->image_path);
+ err = evas_object_image_load_error_get(ic->image);
+ if(err)
+ D("Evas icon load error %d !!!\n", err);
/* add an imlib image so we can save it later */
ic->imlib_image = imlib_load_image(buf);
/* clip the icon */
- evas_set_clip(ib->view->evas, ic->image, ib->clip);
+ evas_object_clip_set(ic->image, ib->clip);
/* set it to be semi-transparent */
- evas_set_color(ib->view->evas, ic->image, 255, 255, 255, 128);
+ evas_object_color_set(ic->image, 255, 255, 255, 128);
/* set up callbacks on events - so the ib_* functions will be */
/* called when the corresponding event happens to the icon */
- evas_callback_add(ib->view->evas, ic->image, CALLBACK_MOUSE_IN,
+ evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_IN,
ib_mouse_in, ic);
- evas_callback_add(ib->view->evas, ic->image, CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_OUT,
ib_mouse_out, ic);
- evas_callback_add(ib->view->evas, ic->image, CALLBACK_MOUSE_DOWN,
+ evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_DOWN,
ib_mouse_down, ic);
- evas_callback_add(ib->view->evas, ic->image, CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_UP,
ib_mouse_up, ic);
- evas_callback_add(ib->view->evas, ic->image, CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ic->image, EVAS_CALLBACK_MOUSE_MOVE,
ib_mouse_move, ic);
}
/* add the ebit we loaded to the evas the iconbar exists in - now the */
/* ebit is more than just structures as well. */
- ebits_add_to_evas(ib->bit, ib->view->evas);
+ ebits_add_to_evas(ib->bit, ib->desktop->evas);
/* aaaaaaaaah. the magic of being able to replace a named bit in an ebit */
/* (in this case we expect a bit called "Icons" to exist - the user will */
/* have added a bit called this into the ebit to indicate where he/she */
@@ -471,7 +478,7 @@ e_iconbar_get_length(E_Iconbar * ib)
{
double ix, iy, aw, ah;
double len;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -491,7 +498,7 @@ e_iconbar_get_length(E_Iconbar * ib)
ic = l->data;
/* find out the original image size (of the image file) */
- evas_get_image_size(ic->iconbar->view->evas, ic->image, &iw, &ih);
+ evas_object_image_size_get(ic->image, &iw, &ih);
if (aw > ah) /* horizontal */
{
len += iw;
@@ -515,14 +522,14 @@ e_iconbar_get_length(E_Iconbar * ib)
void
e_iconbar_fix(E_Iconbar * ib)
{
- Evas_List l;
+ Evas_List * l;
double x, y, w, h;
double ix, iy, aw, ah;
D_ENTER;
x = y = w = h = 0;
/* get geometry from layout */
- if (!e_view_layout_get_element_geometry(ib->view->layout, "Iconbar",
+ if (!e_view_layout_get_element_geometry(ib->desktop->layout, "Iconbar",
&x, &y, &w, &h))
{
D_RETURN;
@@ -534,7 +541,7 @@ e_iconbar_fix(E_Iconbar * ib)
/* show it. harmless to do this all the time */
ebits_show(ib->bit);
/* tell the view we belong to something may have changed so it can draw */
- ib->view->changed = 1;
+ /* ib->desktop->changed = 1; */
/* the callbacks set up in th ebtis replace will set up what area in */
/* the canvas icons can exist in. lets extract them here */
@@ -545,13 +552,14 @@ e_iconbar_fix(E_Iconbar * ib)
/* if we have icons- show the clipper that will clip them */
if (ib->icons)
- evas_show(ib->view->evas, ib->clip);
+ evas_object_show(ib->clip);
/* no icons - hide the clipper as it will be a real object */
else
- evas_hide(ib->view->evas, ib->clip);
+ evas_object_hide(ib->clip);
+
/* move the clip object to fill the icon area */
- evas_move(ib->view->evas, ib->clip, ix, iy);
- evas_resize(ib->view->evas, ib->clip, aw, ah);
+ evas_object_move(ib->clip, ix, iy);
+ evas_object_resize(ib->clip, aw, ah);
if (aw > ah) /* horizontal */
{
@@ -606,7 +614,7 @@ e_iconbar_fix(E_Iconbar * ib)
ic = l->data;
/* find out the original image size (of the image file) */
- evas_get_image_size(ic->iconbar->view->evas, ic->image, &iw, &ih);
+ evas_object_image_size_get(ic->image, &iw, &ih);
w = iw;
h = ih;
ox = 0;
@@ -660,12 +668,18 @@ e_iconbar_fix(E_Iconbar * ib)
}
/* now move the icona nd resize it */
- evas_move(ic->iconbar->view->evas, ic->image, ic->current.x,
+ evas_object_move(ic->image, ic->current.x,
ic->current.y);
- evas_resize(ic->iconbar->view->evas, ic->image, ic->current.w,
+ evas_object_resize(ic->image, ic->current.w,
ic->current.h);
- evas_set_image_fill(ic->iconbar->view->evas, ic->image, 0, 0,
+ evas_object_image_fill_set(ic->image, 0, 0,
ic->current.w, ic->current.h);
+
+ /* kjb cep - layer ??? */
+ /*
+ printf(" icon!! %f,%f %f,%f\n", ic->current.x, ic->current.y,
+ ic->current.w, ic->current.h );
+ */
}
D_RETURN;
@@ -684,13 +698,13 @@ e_iconbar_save_out_final(E_Iconbar * ib)
D_ENTER;
- if (ib->view)
+ if (ib->desktop)
{
E_DB_File *edb;
- Evas_List l;
+ Evas_List * l;
int i;
- snprintf(buf, PATH_MAX, "%s/.e_iconbar.db", ib->view->dir->dir);
+ snprintf(buf, PATH_MAX, "%s/.e_iconbar.db", ib->desktop->dir);
D("%s\n", buf);
if (ib->changed)
@@ -721,7 +735,7 @@ e_iconbar_save_out_final(E_Iconbar * ib)
snprintf(buf2, PATH_MAX,
"%s/.e_iconbar.db:/icons/%i/image",
- ib->view->dir->dir, i);
+ ib->desktop->dir, i);
D("save image\n");
imlib_save_image(buf2);
}
@@ -777,9 +791,9 @@ e_iconbar_handle_launch_id(Window win, void *data)
e_exec_broadcast_cb_del(ic->launch_id_cb);
ic->launch_id_cb = NULL;
}
- evas_set_color(ic->iconbar->view->evas, ic->image, 255, 255, 255,
+ evas_object_color_set(ic->image, 255, 255, 255,
128);
- ic->iconbar->view->changed = 1;
+ /* ic->iconbar->desktop->changed = 1; */
}
}
}
@@ -798,7 +812,7 @@ ib_scroll_timeout(int val, void *data)
/* get our iconbar pointer */
ib = (E_Iconbar *) data;
- snprintf(buf, PATH_MAX, "iconbar_scroll:%s", ib->view->name);
+ snprintf(buf, PATH_MAX, "iconbar_scroll:%s", ib->desktop->name);
if (val == 0)
ecore_del_event_timer(buf);
else
@@ -828,8 +842,8 @@ ib_cancel_launch_timeout(int val, void *data)
e_exec_broadcast_cb_del(ic->launch_id_cb);
ic->launch_id_cb = NULL;
}
- evas_set_color(ic->iconbar->view->evas, ic->image, 255, 255, 255, 128);
- ic->iconbar->view->changed = 1;
+ evas_object_color_set(ic->image, 255, 255, 255, 128);
+ /* ic->iconbar->desktop->changed = 1; */
}
D_RETURN;
UN(val);
@@ -854,20 +868,17 @@ ib_timeout(int val, void *data)
/* no hilite (animation) image */
if (!ic->hi.image)
{
- char buf[PATH_MAX];
-
- /* figure out its path */
- snprintf(buf, PATH_MAX, "%s:%s",
- ic->iconbar->view->look->obj->icb, ic->image_path);
/* add it */
- ic->hi.image = evas_add_image_from_file(ic->iconbar->view->evas,
- buf);
+ ic->hi.image = evas_object_image_add(ic->iconbar->desktop->evas);
+ evas_object_image_file_set(ic->hi.image,
+ ic->iconbar->desktop->look->obj->icb,
+ ic->image_path);
/* put it high up */
- evas_set_layer(ic->iconbar->view->evas, ic->hi.image, 20000);
+ evas_object_layer_set(ic->hi.image, 20000);
/* dont allow it to capture any events (enter, leave etc. */
- evas_set_pass_events(ic->iconbar->view->evas, ic->hi.image, 1);
+ evas_object_pass_events_set(ic->hi.image, 1);
/* show it */
- evas_show(ic->iconbar->view->evas, ic->hi.image);
+ evas_object_show(ic->hi.image);
}
/* start at 0 */
val = 0;
@@ -876,10 +887,9 @@ ib_timeout(int val, void *data)
t = ecore_get_time();
if (ic->launch_id)
{
- evas_set_color(ic->iconbar->view->evas, ic->image, 255, 255, 255, 50);
+ evas_object_color_set(ic->image, 255, 255, 255, 50);
if (ic->hi.image)
- evas_set_color(ic->iconbar->view->evas, ic->hi.image, 255, 255, 255,
- 0);
+ evas_object_color_set(ic->hi.image, 255, 255, 255, 0);
}
/* if the icon is hilited */
else if (ic->hilited)
@@ -890,7 +900,7 @@ ib_timeout(int val, void *data)
double speed;
/* find out where the original icon image is */
- evas_get_geometry(ic->iconbar->view->evas, ic->image, &x, &y, &w, &h);
+ evas_object_geometry_get(ic->image, &x, &y, &w, &h);
/* tt is the time since we started */
tt = t - ic->hi.start;
/* the speed to run at - the less, the faster (ie a loop is 0.5 sec) */
@@ -907,15 +917,15 @@ ib_timeout(int val, void *data)
nw = w * ((tt / speed) + 1.0);
nh = h * ((tt / speed) + 1.0);
/* move the hilite icon to a good spot */
- evas_move(ic->iconbar->view->evas, ic->hi.image,
+ evas_object_move(ic->hi.image,
x + ((w - nw) / 2), y + ((h - nh) / 2));
/* resize it */
- evas_resize(ic->iconbar->view->evas, ic->hi.image, nw, nh);
+ evas_object_resize(ic->hi.image, nw, nh);
/* reset its fill so ti fills its space */
- evas_set_image_fill(ic->iconbar->view->evas, ic->hi.image, 0, 0, nw,
+ evas_object_image_fill_set(ic->hi.image, 0, 0, nw,
nh);
/* set its fade */
- evas_set_color(ic->iconbar->view->evas, ic->hi.image, 255, 255, 255, a);
+ evas_object_color_set(ic->hi.image, 255, 255, 255, a);
/* incirment our count */
val++;
}
@@ -928,7 +938,7 @@ ib_timeout(int val, void *data)
/* delete the animation object */
if (ic->hi.image)
- evas_del_object(ic->iconbar->view->evas, ic->hi.image);
+ evas_object_del(ic->hi.image);
ic->hi.image = NULL;
/* if we were pulsating.. reset start timer */
@@ -947,7 +957,7 @@ ib_timeout(int val, void *data)
/* alpha value caluclated on ramp position */
a = (int)((double)((1.0 - tt) * 127.0) + 128.0);
/* set alpha value */
- evas_set_color(ic->iconbar->view->evas, ic->image, 255, 255, 255, a);
+ evas_object_color_set(ic->image, 255, 255, 255, a);
/* time is at end of ramp.. kill timer */
if (tt == 1.0)
{
@@ -962,7 +972,7 @@ ib_timeout(int val, void *data)
if (ic->hi.timer)
ecore_add_event_timer(ic->hi.timer, 0.05, ib_timeout, val, data);
/* flag the view that we changed */
- ic->iconbar->view->changed = 1;
+ /* ic->iconbar->desktop->changed = 1; */
D_RETURN;
}
@@ -972,7 +982,7 @@ static void
ib_bits_show(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -983,7 +993,7 @@ ib_bits_show(void *data)
E_Iconbar_Icon *ic;
ic = l->data;
- evas_show(ic->iconbar->view->evas, ic->image);
+ evas_object_show(ic->image);
}
D_RETURN;
@@ -994,7 +1004,7 @@ static void
ib_bits_hide(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1005,7 +1015,7 @@ ib_bits_hide(void *data)
E_Iconbar_Icon *ic;
ic = l->data;
- evas_hide(ic->iconbar->view->evas, ic->image);
+ evas_object_hide(ic->image);
}
D_RETURN;
@@ -1016,7 +1026,7 @@ static void
ib_bits_move(void *data, double x, double y)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1034,7 +1044,7 @@ static void
ib_bits_resize(void *data, double w, double h)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1052,7 +1062,7 @@ static void
ib_bits_raise(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1063,7 +1073,7 @@ ib_bits_raise(void *data)
E_Iconbar_Icon *ic;
ic = l->data;
- evas_raise(ic->iconbar->view->evas, ic->image);
+ evas_object_raise(ic->image);
}
D_RETURN;
@@ -1074,7 +1084,7 @@ static void
ib_bits_lower(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1085,7 +1095,7 @@ ib_bits_lower(void *data)
E_Iconbar_Icon *ic;
ic = l->data;
- evas_lower(ic->iconbar->view->evas, ic->image);
+ evas_object_lower(ic->image);
}
D_RETURN;
@@ -1096,7 +1106,7 @@ static void
ib_bits_set_layer(void *data, int lay)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1107,7 +1117,7 @@ ib_bits_set_layer(void *data, int lay)
E_Iconbar_Icon *ic;
ic = l->data;
- evas_set_layer(ic->iconbar->view->evas, ic->image, lay);
+ evas_object_layer_set(ic->image, lay);
}
D_RETURN;
@@ -1116,7 +1126,7 @@ ib_bits_set_layer(void *data, int lay)
/* not used... err.. ebits clips for us to the maximum allowed space of */
/* the ebit object bit - dont know why i have this here */
static void
-ib_bits_set_clip(void *data, Evas_Object clip)
+ib_bits_set_clip(void *data, Evas_Object * clip)
{
D_ENTER;
@@ -1170,7 +1180,7 @@ ib_bits_get_max_size(void *data, double *w, double *h)
/* called when a mouse goes in on an icon object */
static void
-ib_mouse_in(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+ib_mouse_in(void *data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Iconbar_Icon *ic;
@@ -1181,14 +1191,14 @@ ib_mouse_in(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
/* set hilited flag */
ic->hilited = 1;
/* make it more opaque */
- evas_set_color(ic->iconbar->view->evas, ic->image, 255, 255, 255, 255);
+ evas_object_color_set(ic->image, 255, 255, 255, 255);
/* if we havent started an animation timer - start one */
if (!ic->hi.timer)
{
char buf[PATH_MAX];
/* come up with a unique name for it */
- snprintf(buf, PATH_MAX, "iconbar:%s/%s", ic->iconbar->view->name,
+ snprintf(buf, PATH_MAX, "iconbar:%s/%s", ic->iconbar->desktop->name,
ic->image_path);
e_strdup(ic->hi.timer, buf);
/* call the timeout */
@@ -1196,19 +1206,17 @@ ib_mouse_in(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;
+ /* ic->iconbar->desktop->changed = 1; */
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
/* called when a mouse goes out of an icon object */
static void
-ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+ib_mouse_out(void *data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Iconbar_Icon *ic;
@@ -1220,21 +1228,20 @@ ib_mouse_out(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ic->hilited = 0;
/* tell the view the iconbar is in.. something changed that might mean */
/* a redraw is needed */
- ic->iconbar->view->changed = 1;
+ /* ic->iconbar->desktop->changed = 1; */
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
/* 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)
+ib_mouse_up(void *data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Iconbar_Icon *ic;
+ Evas_Event_Mouse_Up *ev = event_info;
D_ENTER;
@@ -1247,7 +1254,7 @@ ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
ic->moving = 0;
- e_iconbar_icon_move(ic, _x, _y);
+ e_iconbar_icon_move(ic, ev->output.x, ev->output.y);
}
/* Otherwise, not moving so execute, etc */
@@ -1263,7 +1270,7 @@ ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
if (e_exec_run(ic->exec) < 0)
{
- /* FIXME: display error */
+ D("Failed to execute: %s\n", ic->exec);
}
}
else
@@ -1293,11 +1300,10 @@ ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ecore_add_event_timer(buf, 15.0,
ib_cancel_launch_timeout,
ic->launch_id, ic);
- evas_set_color(ic->iconbar->view->evas, ic->image,
+ evas_object_color_set(ic->image,
255, 255, 255, 50);
if (ic->hi.image)
- evas_set_color(ic->iconbar->view->evas,
- ic->hi.image, 255, 255, 255, 0);
+ evas_object_color_set(ic->hi.image, 255, 255, 255, 0);
}
}
}
@@ -1307,40 +1313,36 @@ ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
}
/* called when the mouse goes down on an icon object */
static void
-ib_mouse_down(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+ib_mouse_down(void *data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Iconbar_Icon *ic;
+ Evas_Event_Mouse_Down *ev = event_info;
D_ENTER;
ic = (E_Iconbar_Icon *) data;
- ic->down.x = _x;
- ic->down.y = _y;
+ ic->down.x = ev->output.x;
+ ic->down.y = ev->output.y;
- ic->mouse_down = _b;
+ ic->mouse_down = ev->button;
D_RETURN;
UN(data);
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
}
/* called when a mouse goes out of an icon object */
static void
-ib_mouse_move(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+ib_mouse_move(void *data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Iconbar_Icon *ic;
+ Evas_Event_Mouse_Move *ev = event_info;
D_ENTER;
@@ -1351,8 +1353,8 @@ ib_mouse_move(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
int dx, dy;
- ic->mouse.x = _x;
- ic->mouse.y = _y;
+ ic->mouse.x = ev->cur.output.x;
+ ic->mouse.y = ev->cur.output.y;
dx = ic->down.x - ic->mouse.x;
dy = ic->down.y - ic->mouse.y;
@@ -1361,7 +1363,7 @@ ib_mouse_move(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
ic->moving = 1;
- evas_move(ic->iconbar->view->evas, ic->image,
+ evas_object_move(ic->image,
ic->mouse.x - (ic->down.x - ic->current.x),
ic->mouse.y - (ic->down.y - ic->current.y));
}
@@ -1372,9 +1374,6 @@ ib_mouse_move(void *data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
UN(data);
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
}
void
@@ -1403,7 +1402,7 @@ e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y)
else
{
E_Iconbar_Icon *lic;
- Evas_List l;
+ Evas_List * l;
double aw = ic->iconbar->icon_area.w;
double ah = ic->iconbar->icon_area.h;
@@ -1519,7 +1518,7 @@ e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y)
ic->iconbar->changed = 1;
e_iconbar_save_out_final(ic->iconbar);
/* ic->iconbar->just_saved = 0;*/
- e_view_ib_reload(ic->iconbar->view);
+ e_desktop_ib_reload(ic->iconbar->desktop);
}
D_RETURN;
@@ -1527,11 +1526,11 @@ e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y)
/* called when a dnd drop occurs on an iconbar */
void
-e_iconbar_dnd_add_files(E_View * v, E_View * source, int num_files,
+e_iconbar_dnd_add_files(E_Desktop * d, E_View * source, int num_files,
char **dnd_files)
{
- Evas_List execs = NULL;
- Evas_List l;
+ Evas_List * execs = NULL;
+ Evas_List * l;
int i;
@@ -1549,7 +1548,7 @@ e_iconbar_dnd_add_files(E_View * v, E_View * source, int num_files,
{
/* if its an icon db, set the icon */
D("db!\n");
- for (l = v->iconbar->icons; l; l = l->next)
+ for (l = d->iconbar->icons; l; l = l->next)
{
E_Iconbar_Icon *ibic;
char buf[PATH_MAX];
@@ -1559,11 +1558,11 @@ e_iconbar_dnd_add_files(E_View * v, E_View * source, int num_files,
if (ibic)
{
- if (v->iconbar->dnd.x > ibic->current.x &&
- v->iconbar->dnd.x <
+ if (d->iconbar->dnd.x > ibic->current.x &&
+ d->iconbar->dnd.x <
ibic->current.x + ibic->current.w
- && v->iconbar->dnd.y > ibic->current.y
- && v->iconbar->dnd.y <
+ && d->iconbar->dnd.y > ibic->current.y
+ && d->iconbar->dnd.y <
ibic->current.y + ibic->current.h)
{
D("over icon: %s\n", ibic->exec);
@@ -1605,42 +1604,44 @@ e_iconbar_dnd_add_files(E_View * v, E_View * source, int num_files,
ZERO(ibic, E_Iconbar_Icon, 1);
e_object_init(E_OBJECT(ibic), (E_Cleanup_Func) e_iconbar_icon_cleanup);
- if (v->iconbar)
- ibic->iconbar = v->iconbar;
+ if (d->iconbar)
+ ibic->iconbar = d->iconbar;
else
D("EEEEEEEEEEEEK: how the hell did this happen?");
D("x: %f, v-dir: %s, ib-dir: %s\n", ibic->iconbar->icon_area.x,
- v->dir->dir, ibic->iconbar->view->dir->dir);
+ d->dir, ibic->iconbar->desktop->dir);
if (!ic->file->info.icon)
D_RETURN;
snprintf(buf, PATH_MAX, "%s:/icon/normal", ic->file->info.icon);
- ibic->image = evas_add_image_from_file(v->evas, buf);
+ ibic->image = evas_object_image_add(d->evas);
+ evas_object_image_file_set(ibic->image, ic->file->info.icon,
+ "/icon/normal");
ibic->imlib_image = imlib_load_image(buf);
ibic->image_path = strdup(ic->file->info.icon);
snprintf(buf, PATH_MAX, "%s/%s", ic->view->dir->dir, ic->file->file);
ibic->exec = strdup(buf);
- evas_set_clip(v->evas, ibic->image, v->iconbar->clip);
- evas_set_color(v->evas, ibic->image, 255, 255, 255, 128);
- evas_set_layer(v->evas, ibic->image, 11000);
- evas_show(v->evas, ibic->image);
- evas_callback_add(v->evas, ibic->image, CALLBACK_MOUSE_IN,
+ evas_object_clip_set(ibic->image, d->iconbar->clip);
+ evas_object_color_set(ibic->image, 255, 255, 255, 128);
+ evas_object_layer_set(ibic->image, 11000);
+ evas_object_show(ibic->image);
+ evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_IN,
ib_mouse_in, ibic);
- evas_callback_add(v->evas, ibic->image, CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_OUT,
ib_mouse_out, ibic);
- evas_callback_add(v->evas, ibic->image, CALLBACK_MOUSE_DOWN,
+ evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_DOWN,
ib_mouse_down, ibic);
- evas_callback_add(v->evas, ibic->image, CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_UP,
ib_mouse_up, ibic);
- evas_callback_add(v->evas, ibic->image, CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ibic->image, EVAS_CALLBACK_MOUSE_MOVE,
ib_mouse_move, ibic);
ibic->iconbar->icons = evas_list_append(ibic->iconbar->icons, ibic);
/* this adds the icon to the correct place in the list and saves */
- e_iconbar_icon_move(ibic, v->iconbar->dnd.x, v->iconbar->dnd.y);
+ e_iconbar_icon_move(ibic, d->iconbar->dnd.x, d->iconbar->dnd.y);
}
}
@@ -1649,7 +1650,7 @@ static void
ib_child_handle(Ecore_Event * ev)
{
Ecore_Event_Child *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1657,7 +1658,7 @@ ib_child_handle(Ecore_Event * ev)
for (l = iconbars; l; l = l->next)
{
E_Iconbar *ib;
- Evas_List ll;
+ Evas_List * ll;
ib = l->data;
for (ll = ib->icons; ll; ll = ll->next)
@@ -1682,9 +1683,11 @@ ib_child_handle(Ecore_Event * ev)
e_exec_broadcast_cb_del(ic->launch_id_cb);
ic->launch_id_cb = NULL;
}
- evas_set_color(ic->iconbar->view->evas, ic->image, 255,
+
+ evas_object_color_set(ic->image, 255,
255, 255, 128);
- ic->iconbar->view->changed = 1;
+
+ /* ic->iconbar->desktop->changed = 1; */
D_RETURN;
}
}
@@ -1693,6 +1696,30 @@ ib_child_handle(Ecore_Event * ev)
D_RETURN;
}
+static void
+ib_window_mouse_out(Ecore_Event * ev)
+{
+ E_Desktop *desk;
+ Ecore_Event_Window_Focus_Out *e;
+ Evas_List *l;
+
+ D_ENTER;
+
+ e = ev->event;
+ desk = e_desktops_get(e_desktops_get_current());
+ if (desk->iconbar && e->win == e_desktop_window())
+ {
+ for (l = desk->iconbar->icons; l; l = l->next)
+ {
+ E_Iconbar_Icon *ic = l->data;
+
+ ic->hilited = 0;
+ }
+ }
+ D_RETURN;
+
+}
+
E_Rect *
e_iconbar_get_resist_rect(E_Iconbar * ib)
{
@@ -1713,30 +1740,3 @@ e_iconbar_get_resist_rect(E_Iconbar * ib)
D_RETURN_(r);
}
-
-void
-e_iconbar_set_view_window_spacing(E_Iconbar * ib)
-{
- double x, y, w, h;
-
- D_ENTER;
-
- ebits_get_named_bit_geometry(ib->bit, "Resist", &x, &y, &w, &h);
-
-/* FIXME Why do the v->spacing.window.?'s need to be / 2? */
- if (h > w) /* vertical */
- {
- if (x < ib->view->size.w / 2) /* left */
- ib->view->spacing.window.l = (x + w) / 2 + 3;
- else /* right */
- ib->view->spacing.window.r = (ib->view->size.w - x) / 2 + 15;
- }
- else /* horizontal */
- {
- if (y < ib->view->size.h / 2) /* top */
- ib->view->spacing.window.t = (y + h) / 2 + 3;
- else
- ib->view->spacing.window.b = (ib->view->size.h - y) / 2 + 15;
- }
- D_RETURN;
-}
diff --git a/src/iconbar.h b/src/iconbar.h
index 9a01a6341..68aeef177 100644
--- a/src/iconbar.h
+++ b/src/iconbar.h
@@ -24,10 +24,10 @@ struct _E_Iconbar
{
E_Object o;
- E_View *view;
- Evas_List icons;
+ E_Desktop *desktop;
+ Evas_List *icons;
- Evas_Object clip;
+ Evas_Object *clip;
int has_been_scrolled;
int changed;
@@ -54,7 +54,7 @@ struct _E_Iconbar_Icon
E_Iconbar *iconbar;
- Evas_Object image;
+ Evas_Object * image;
Imlib_Image imlib_image;
char *image_path;
@@ -63,7 +63,7 @@ struct _E_Iconbar_Icon
int hilited;
struct
{
- Evas_Object image;
+ Evas_Object * image;
char *timer;
double start;
}
@@ -94,7 +94,7 @@ struct _E_Iconbar_Icon
};
void e_iconbar_init(void);
-E_Iconbar *e_iconbar_new(E_View * v);
+E_Iconbar *e_iconbar_new(E_Desktop * d);
void e_iconbar_icon_free(E_Iconbar_Icon *);
void e_iconbar_realize(E_Iconbar * ib);
void e_iconbar_fix(E_Iconbar * ib);
@@ -104,9 +104,8 @@ void e_iconbar_file_delete(E_View * v, char *file);
void e_iconbar_file_change(E_View * v, char *file);
void e_iconbar_save_out_final(E_Iconbar * ib);
E_Rect *e_iconbar_get_resist_rect(E_Iconbar * ib);
-void e_iconbar_set_view_window_spacing(E_Iconbar * ib);
void e_iconbar_icon_move(E_Iconbar_Icon * ic, int x, int y);
-void e_iconbar_dnd_add_files(E_View * v, E_View * source,
+void e_iconbar_dnd_add_files(E_Desktop * d, E_View * source,
int num_files, char **dnd_files);
#endif
diff --git a/src/icons.c b/src/icons.c
index 6b18ba4f8..700860624 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -9,23 +9,19 @@
#include "e_view_machine.h"
#include "globals.h"
-static void e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
+static void e_icon_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
+static void e_icon_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
+static void e_icon_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
+static void e_icon_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
+static void e_icon_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info);
static void
-e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_icon_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Icon *ic;
Ecore_Event *ev;
Ecore_Event_Mouse_Down *e;
+ Evas_Event_Mouse_Down *ev_info = event_info;
D_ENTER;
@@ -34,11 +30,11 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
e = ev->event;
ic = _data;
- ic->view->select.down.x = _x;
- ic->view->select.down.y = _y;
+ ic->view->select.down.x = ev_info->output.x;
+ ic->view->select.down.y = ev_info->output.y;
ic->state.clicked = 1;
e_icon_update_state(ic);
- if (_b == 1)
+ if (ev_info->button == 1)
{
if (e->double_click)
{
@@ -62,10 +58,10 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
}
}
- else if (_b == 2)
+ else if (ev_info->button == 2)
{
}
- else if (_b == 3)
+ else if (ev_info->button == 3)
{
}
@@ -75,11 +71,12 @@ e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
static void
-e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_icon_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Icon *ic;
Ecore_Event *ev;
Ecore_Event_Mouse_Up *e;
+ Evas_Event_Mouse_Up *ev_info = event_info;
D_ENTER;
@@ -112,7 +109,7 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
ecore_window_dnd_finished();
D_RETURN;
}
- if (_b == 1)
+ if (ev_info->button == 1)
{
if (ic->state.just_executed)
{
@@ -139,12 +136,10 @@ e_icon_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_x);
- UN(_y);
}
static void
-e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_icon_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Icon *ic;
@@ -156,13 +151,11 @@ e_icon_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
static void
-e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_icon_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Icon *ic;
@@ -172,16 +165,14 @@ e_icon_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
static void
_paint_selected_icons_onto_drag_window(E_View * v, Imlib_Image im, int wx,
int wy)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -201,7 +192,7 @@ _paint_selected_icons_onto_drag_window(E_View * v, Imlib_Image im, int wx,
if (!ic->state.selected)
continue;
- evas_get_geometry(ic->view->evas, ic->obj.icon, &ix, &iy, NULL, NULL);
+ evas_object_geometry_get(ic->obj.icon, &ix, &iy, NULL, NULL);
icx = ix + v->location.x - wx;
icy = iy + v->location.y - wy;
if (!ic->file->info.icon)
@@ -248,7 +239,7 @@ static void
_start_drag(E_View * v, int _x, int _y)
{
Pixmap pmap, mask;
- Evas_List l;
+ Evas_List * l;
int x, y, xx, yy, rw, rh, downx, downy, wx, wy, ww, wh;
int dx, dy;
@@ -370,11 +361,12 @@ _start_drag(E_View * v, int _x, int _y)
}
static void
-e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_icon_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
E_Icon *ic;
Ecore_Event *ev;
Ecore_Event_Mouse_Move *e;
+ Evas_Event_Mouse_Move *ev_info = event_info;
D_ENTER;
@@ -390,14 +382,14 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
if (!ic->view->drag.started)
{
- _start_drag(ic->view, _x, _y);
+ _start_drag(ic->view, ev_info->cur.output.x, ev_info->cur.output.y);
}
else if (ic->view->drag.started)
{
int x, y;
- x = _x - ic->view->drag.offset.x;
- y = _y - ic->view->drag.offset.y;
+ x = ev_info->cur.output.x - ic->view->drag.offset.x;
+ y = ev_info->cur.output.y - ic->view->drag.offset.y;
ic->view->drag.x = x;
ic->view->drag.y = y;
ic->view->drag.update = 1;
@@ -422,7 +414,6 @@ e_icon_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
}
static void
@@ -435,10 +426,16 @@ e_icon_cleanup(E_Icon * ic)
if (ic->obj.event1)
{
- evas_del_object(ic->view->evas, ic->obj.event1);
- evas_del_object(ic->view->evas, ic->obj.event2);
+ evas_object_del(ic->obj.event1);
+ evas_object_del(ic->obj.event2);
}
+ if (ic->obj.icon)
+ evas_object_del(ic->obj.icon);
+
+ if (ic->obj.text)
+ e_text_free(ic->obj.text);
+
if (ic->obj.sel.under.icon)
ebits_free(ic->obj.sel.under.icon);
if (ic->obj.sel.under.text)
@@ -471,7 +468,7 @@ e_icon_new(void)
E_Icon *
e_icon_find_by_file(E_View * view, char *file)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -495,42 +492,44 @@ e_icon_show(E_Icon * ic)
if (ic->state.visible)
D_RETURN;
ic->state.visible = 1;
+
if (!ic->obj.event1)
{
- ic->obj.event1 = evas_add_rectangle(ic->view->evas);
- ic->obj.event2 = evas_add_rectangle(ic->view->evas);
- evas_set_color(ic->view->evas, ic->obj.event1, 0, 0, 0, 0);
- evas_set_color(ic->view->evas, ic->obj.event2, 0, 0, 0, 0);
- evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_DOWN,
+ ic->obj.event1 = evas_object_rectangle_add(ic->view->evas);
+ ic->obj.event2 = evas_object_rectangle_add(ic->view->evas);
+ evas_object_color_set(ic->obj.event1, 0, 0, 0, 0);
+ evas_object_color_set(ic->obj.event2, 0, 0, 0, 0);
+ evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_DOWN,
e_icon_down_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_UP,
e_icon_up_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_IN,
+ evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_IN,
e_icon_in_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_OUT,
e_icon_out_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event1, CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ic->obj.event1, EVAS_CALLBACK_MOUSE_MOVE,
e_icon_move_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_DOWN,
+ evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_DOWN,
e_icon_down_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_UP,
+ evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_UP,
e_icon_up_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_IN,
+ evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_IN,
e_icon_in_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_OUT,
e_icon_out_cb, ic);
- evas_callback_add(ic->view->evas, ic->obj.event2, CALLBACK_MOUSE_MOVE,
+ evas_object_event_callback_add(ic->obj.event2, EVAS_CALLBACK_MOUSE_MOVE,
e_icon_move_cb, ic);
+
}
- evas_set_layer(ic->view->evas, ic->obj.icon, 200);
+ evas_object_layer_set(ic->obj.icon, 200);
e_text_set_layer(ic->obj.text, 200);
- evas_set_layer(ic->view->evas, ic->obj.event1, 210);
- evas_set_layer(ic->view->evas, ic->obj.event2, 210);
+ evas_object_layer_set(ic->obj.event1, 210);
+ evas_object_layer_set(ic->obj.event2, 210);
- evas_show(ic->view->evas, ic->obj.icon);
+ evas_object_show(ic->obj.icon);
e_text_show(ic->obj.text);
- evas_show(ic->view->evas, ic->obj.event1);
- evas_show(ic->view->evas, ic->obj.event2);
+ evas_object_show(ic->obj.event1);
+ evas_object_show(ic->obj.event2);
D_RETURN;
}
@@ -543,10 +542,10 @@ e_icon_hide(E_Icon * ic)
if (!ic->state.visible)
D_RETURN;
ic->state.visible = 0;
- evas_hide(ic->view->evas, ic->obj.icon);
+ evas_object_hide(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);
+ evas_object_hide(ic->obj.event1);
+ evas_object_hide(ic->obj.event2);
/* Hide any selection in the view */
if (ic->obj.sel.under.icon)
@@ -572,13 +571,13 @@ e_icon_hide_delete_pending(E_Icon * ic)
{
if (ic->view->drag.drop_mode == E_DND_MOVE)
{
- evas_hide(ic->view->evas, ic->obj.icon);
+ evas_object_hide(ic->obj.icon);
ic->state.drag_delete = 1;
}
else
/* copy... */
{
- evas_show(ic->view->evas, ic->obj.icon);
+ evas_object_show(ic->obj.icon);
ic->state.drag_delete = 0;
}
}
@@ -600,7 +599,7 @@ e_icon_show_delete_end(E_Icon * ic, E_dnd_enum dnd_pending_mode)
{
ic->state.drag_delete = 0;
if (dnd_pending_mode == E_DND_COPIED)
- evas_show(ic->view->evas, ic->obj.icon);
+ evas_object_show(ic->obj.icon);
}
}
@@ -623,20 +622,23 @@ e_icon_apply_xy(E_Icon * ic)
ic->geom.w = ic->geom.icon.w;
ic->geom.h = ic->geom.icon.h + ic->geom.text.h + ic->view->spacing.icon.g;
- evas_resize(ic->view->evas, ic->obj.event1,
+ if(ic->obj.event1)
+ {
+ evas_object_resize(ic->obj.event1,
ic->geom.icon.w, ic->geom.icon.h);
- evas_resize(ic->view->evas, ic->obj.event2,
+ evas_object_resize(ic->obj.event2,
ic->geom.text.w, ic->geom.text.h);
- evas_move(ic->view->evas, ic->obj.event1,
+ evas_object_move(ic->obj.event1,
ic->view->scroll.x + ic->geom.x +
((ic->geom.w - ic->geom.icon.w) / 2),
ic->view->scroll.y + ic->geom.y);
- evas_move(ic->view->evas, ic->obj.event2,
+ evas_object_move(ic->obj.event2,
ic->view->scroll.x + ic->geom.x +
((ic->geom.w - ic->geom.text.w) / 2),
ic->view->scroll.y + ic->geom.y + ic->geom.icon.h +
ic->view->spacing.icon.g);
- evas_move(ic->view->evas, ic->obj.icon,
+ }
+ evas_object_move(ic->obj.icon,
ic->view->scroll.x + ic->geom.x +
((ic->geom.w - ic->geom.icon.w) / 2),
ic->view->scroll.y + ic->geom.y);
@@ -734,9 +736,9 @@ e_icon_check_permissions(E_Icon * ic)
if (!strcmp(ic->file->info.mime.base, "dir"))
{
if (e_file_can_exec(&ic->file->stat))
- evas_set_color(ic->view->evas, ic->obj.icon, 255, 255, 255, 255);
+ evas_object_color_set(ic->obj.icon, 255, 255, 255, 255);
else
- evas_set_color(ic->view->evas, ic->obj.icon, 128, 128, 128, 128);
+ evas_object_color_set(ic->obj.icon, 128, 128, 128, 128);
}
D_RETURN;
@@ -752,7 +754,7 @@ e_icon_initial_show(E_Icon * ic)
D_RETURN;
/* first. lets figure out the size of the icon */
- evas_get_image_size(ic->view->evas, ic->obj.icon,
+ evas_object_image_size_get(ic->obj.icon,
&(ic->geom.icon.w), &(ic->geom.icon.h));
{
double tw, th;
@@ -779,7 +781,7 @@ e_icon_initial_show(E_Icon * ic)
void
e_icon_update_state(E_Icon * ic)
{
- char icon[PATH_MAX];
+ char icon[PATH_MAX], key[PATH_MAX];
int iw, ih;
D_ENTER;
@@ -791,15 +793,18 @@ e_icon_update_state(E_Icon * ic)
}
if (ic->state.clicked)
{
- snprintf(icon, PATH_MAX, "%s:/icon/clicked", ic->file->info.icon);
+ snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
+ strcpy(key, "/icon/clicked");
}
else if (ic->state.selected)
{
- snprintf(icon, PATH_MAX, "%s:/icon/selected", ic->file->info.icon);
+ snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
+ strcpy(key, "/icon/selected");
}
else
{
- snprintf(icon, PATH_MAX, "%s:/icon/normal", ic->file->info.icon);
+ snprintf(icon, PATH_MAX, "%s", ic->file->info.icon);
+ strcpy(key, "/icon/normal");
}
if ((ic->state.selected) &&
(!ic->obj.sel.under.icon) && (!ic->obj.sel.over.icon))
@@ -856,8 +861,18 @@ e_icon_update_state(E_Icon * ic)
/* This relies on the obj.icon having been allocated in view_file_add.
* Maybe it would be better to allocate here, the first
* time the icon is set? -- till */
- evas_set_image_file(ic->view->evas, ic->obj.icon, icon);
- evas_get_image_size(ic->view->evas, ic->obj.icon, &iw, &ih);
+ evas_object_image_file_set(ic->obj.icon, icon, key);
+ evas_object_image_size_get(ic->obj.icon, &iw, &ih);
+ /* kjb cep */
+ /* evas_object_image_size_set(ic->obj.icon, 30, 30);
+ */
+ /* Hmm, this shouldn't be needed, should it? */
+
+ evas_object_resize(ic->obj.icon,
+ iw, ih);
+ evas_object_image_fill_set(ic->obj.icon,
+ 0, 0, iw, ih);
+
e_icon_check_permissions(ic);
e_icon_apply_xy(ic);
ic->view->changed = 1;
diff --git a/src/icons.h b/src/icons.h
index a888d3c9e..ea917baf4 100644
--- a/src/icons.h
+++ b/src/icons.h
@@ -24,9 +24,9 @@ struct _E_Icon
struct
{
- Evas_Object icon;
- Evas_Object event1;
- Evas_Object event2;
+ Evas_Object * icon;
+ Evas_Object * event1;
+ Evas_Object * event2;
E_Text *text;
struct
{
diff --git a/src/main.c b/src/main.c
index 6e7c2eb36..d56fd788f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -17,21 +17,30 @@
#include "util.h"
#include "e_view_machine.h"
-#ifdef USE_FERITE
-# include "e_ferite.h"
-#endif
-
#include <time.h>
#include <X11/Xproto.h>
#ifdef E_PROF
-Evas_List __e_profiles = NULL;
+Evas_List * __e_profiles = NULL;
#endif
static void cb_exit(void);
static void wm_running_error(Display * d, XErrorEvent * ev);
static void setup(void);
+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_runtime_flush();
+ D_RETURN;
+ UN(data);
+}
+
static void
cb_exit(void)
{
@@ -86,8 +95,6 @@ main(int argc, char **argv)
atexit(cb_exit);
e_exec_set_args(argc, argv);
- e_config_init();
-
/* Check command line options here: */
for (i = 1; i < argc; i++)
{
@@ -133,39 +140,35 @@ main(int argc, char **argv)
ecore_grab();
ecore_sync();
ecore_set_error_handler(wm_running_error);
- ecore_window_set_events(0, XEV_CHILD_REDIRECT | XEV_PROPERTY | XEV_COLORMAP);
+ ecore_window_set_events(0, XEV_CHILD_REDIRECT | XEV_PROPERTY | XEV_COLORMAP |
+ XEV_FOCUS | XEV_KEY | XEV_MOUSE_MOVE | XEV_BUTTON |
+ XEV_IN_OUT);
ecore_sync();
ecore_reset_error_handler();
ecore_ungrab();
/* Initialization for the various modules: */
+ e_view_machine_init();
+ e_config_init();
+ e_keys_init();
e_fs_init();
- e_desktops_init();
e_border_init();
+ e_desktops_init();
e_action_init();
e_menu_init();
- e_view_machine_init();
e_entry_init();
- e_keys_init();
e_guides_init();
e_place_init();
e_cursors_init();
e_iconbar_init();
-#ifdef USE_FERITE
- e_ferite_init();
-#endif
-
- e_desktops_init_file_display(e_desktops_get(0));
+ ecore_event_filter_idle_handler_add(ecore_idle, NULL);
+ e_desktops_show(e_desktops_get(0));
setup();
ecore_event_loop();
-#ifdef USE_FERITE
- e_ferite_deinit();
-#endif
-
return 0;
}
diff --git a/src/menu.c b/src/menu.c
index 90daaf687..0df4ddf02 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -4,8 +4,8 @@
#include "util.h"
#include "math.h"
-static Evas_List open_menus = NULL; /* List of all open menus */
-static Evas_List menus = NULL;
+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 */
@@ -28,22 +28,17 @@ static void e_menu_item_unselect(E_Menu_Item * mi);
static void
e_scroller_timer(int val, void *data)
{
- Evas_List l;
+ Evas_List * l;
int ok = 0;
int resist = 5;
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);
+ resist = config_data->menu->resist;
+ scroll_speed = config_data->menu->speed;
t = ecore_get_time();
if (val != 0)
@@ -142,7 +137,7 @@ e_scroller_timer(int val, void *data)
static void
e_idle(void *data)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -240,7 +235,7 @@ e_key_down(Ecore_Event * ev)
ok = 1;
else
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
@@ -256,7 +251,7 @@ e_key_down(Ecore_Event * ev)
}
if (ok)
{
- Evas_List l;
+ Evas_List * l;
E_Menu *m = NULL;
E_Menu_Item *mi = NULL;
@@ -386,7 +381,7 @@ e_mouse_up(Ecore_Event * ev)
m = open_menus->data;
if ((e->time - m->time) > 200)
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
@@ -398,7 +393,7 @@ e_mouse_up(Ecore_Event * ev)
/* Get the dimensions of the selection for use in
* the test */
double s_x, s_y, s_w, s_h;
- evas_get_geometry(m->evas, m->selected->obj_entry,
+ evas_object_geometry_get(m->selected->obj_entry,
&s_x, &s_y, &s_w, &s_h);
if (INTERSECTS(m->current.x + rint(s_x),
m->current.y + rint(s_y),
@@ -443,7 +438,7 @@ e_mouse_move(Ecore_Event * ev)
keyboard_nav = 0;
if (e->win == menu_event_win)
{
- Evas_List l;
+ Evas_List * l;
mouse_x = e->rx;
mouse_y = e->ry;
@@ -452,13 +447,17 @@ e_mouse_move(Ecore_Event * ev)
E_Menu *m;
m = l->data;
- evas_event_move(m->evas,
+ /* checkme
+ evas_event_move(m->evas,
+ e->rx - m->current.x, e->ry - m->current.y);
+ */
+ evas_event_feed_mouse_move(m->evas,
e->rx - m->current.x, e->ry - m->current.y);
}
}
else
{
- Evas_List l;
+ Evas_List * l;
mouse_x = e->rx;
mouse_y = e->ry;
@@ -468,8 +467,12 @@ e_mouse_move(Ecore_Event * ev)
m = l->data;
+ /* checkme
evas_event_move(m->evas,
e->rx - m->current.x, e->ry - m->current.y);
+ */
+ evas_event_feed_mouse_move(m->evas,
+ e->rx - m->current.x, e->ry - m->current.y);
}
}
e_scroller_timer(0, NULL);
@@ -517,7 +520,7 @@ e_mouse_out(Ecore_Event * ev)
}
else
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
@@ -526,7 +529,7 @@ e_mouse_out(Ecore_Event * ev)
m = l->data;
if ((e->win == m->win.main) || (e->win == m->win.evas))
{
- evas_event_move(m->evas, -99999999, -99999999);
+ evas_event_feed_mouse_move(m->evas, -99999999, -99999999);
}
}
}
@@ -548,7 +551,7 @@ e_window_expose(Ecore_Event * ev)
e = ev->event;
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
@@ -558,9 +561,14 @@ e_window_expose(Ecore_Event * ev)
if (e->win == m->win.evas)
{
m->first_expose = 1;
+ /* checkme
evas_update_rect(m->evas, e->x, e->y, e->w, e->h);
+ */
+ evas_damage_rectangle_add(m->evas, e->x, e->y, e->w, e->h);
break;
}
+
+ e_menu_update_shape(m);
}
}
@@ -625,9 +633,10 @@ e_menu_item_select(E_Menu_Item * mi)
* @y: ?????
*/
static void
-e_menu_item_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_menu_item_in_cb(void *_data, Evas * _e, Evas_Object * _o, void *ev_info)
{
E_Menu_Item *mi;
+ Evas_Event_Mouse_In *event_info = ev_info;
D_ENTER;
@@ -645,9 +654,7 @@ e_menu_item_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
/**
@@ -662,9 +669,10 @@ e_menu_item_in_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
* @y: ?????
*/
static void
-e_menu_item_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_menu_item_out_cb(void *_data, Evas * _e, Evas_Object * _o, void *ev_info)
{
E_Menu_Item *mi;
+ Evas_Event_Mouse_Out *event_info = ev_info;
D_ENTER;
@@ -674,9 +682,7 @@ e_menu_item_out_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
void
@@ -721,7 +727,7 @@ e_menu_item_set_callback(E_Menu_Item * mi,
void
e_menu_hide_submenus(E_Menu * menus_after)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -756,7 +762,7 @@ e_menu_hide_submenus(E_Menu * menus_after)
void
e_menu_select(int dx, int dy)
{
- Evas_List l, ll;
+ Evas_List *l, *ll;
int done = 0;
D_ENTER;
@@ -852,7 +858,7 @@ e_menu_select(int dx, int dy)
/* Moving out of a submenu: */
if (dx < 0)
{
- Evas_List ll;
+ Evas_List * ll;
mm = l->prev->data;
for (ll = mm->entries; (ll) && (!mi); ll = ll->next)
@@ -962,7 +968,7 @@ e_menu_event_win_show(void)
ecore_window_raise(menu_event_win);
if ((!ecore_grab_window_get()) || (!ecore_keyboard_grab_window_get()))
{
- Evas_List l;
+ Evas_List * l;
for (l = menus; l; l = l->next)
{
@@ -1209,7 +1215,7 @@ e_menu_set_state(E_Menu * m, E_Menu_Item * mi)
static void
e_menu_cleanup(E_Menu * m)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1242,9 +1248,6 @@ E_Menu *
e_menu_new(void)
{
E_Menu *m;
- int max_colors = 216;
- int font_cache = 1024 * 1024;
- int image_cache = 8192 * 1024;
char *font_dir;
D_ENTER;
@@ -1257,11 +1260,9 @@ e_menu_new(void)
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(),
+ m->evas = e_evas_new_all(ecore_display_get(),
m->win.main,
- 0, 0, 1, 1,
- RENDER_METHOD_ALPHA_SOFTWARE,
- max_colors, font_cache, image_cache, font_dir);
+ 0, 0, 1, 1, font_dir);
/* aaaaaaaaah. this makes building the menu fast - moves the mouse far */
/* far far far far away so callbacks and events arent triggerd as we */
/* create objects that ofter hang around 0,0 - the default place for */
@@ -1276,9 +1277,9 @@ e_menu_new(void)
/* screen - an then re-render it all - but well.. it's an extreme and */
/* for now i think people will just have to live with a maximum menu size */
/* of 32768x32768... didums! */
- evas_event_move(m->evas, -999999999, -99999999);
+ evas_event_feed_mouse_move(m->evas, -999999999, -99999999);
- m->win.evas = evas_get_window(m->evas);
+ m->win.evas = e_evas_get_window(m->evas);
ecore_window_set_events(m->win.evas,
XEV_EXPOSE | XEV_MOUSE_MOVE | XEV_BUTTON | XEV_IN_OUT
| XEV_KEY);
@@ -1420,7 +1421,7 @@ e_menu_item_update(E_Menu * m, E_Menu_Item * mi)
th = 0;
if (mi->obj_text)
{
- evas_get_geometry(m->evas, mi->obj_text, NULL, NULL, &dtw, &dth);
+ evas_object_geometry_get(mi->obj_text, NULL, NULL, &dtw, &dth);
tw = (int)dtw;
th = (int)dth;
}
@@ -1433,7 +1434,7 @@ e_menu_item_update(E_Menu * m, E_Menu_Item * mi)
{
int sh;
- evas_get_image_size(m->evas, mi->obj_icon, &iw, &ih);
+ evas_object_image_size_get(mi->obj_icon, &iw, &ih);
sh = th;
if (rh > th)
sh = rh;
@@ -1446,10 +1447,10 @@ e_menu_item_update(E_Menu * m, E_Menu_Item * mi)
ix = rx + m->size.state + m->pad.state;
ix += ((m->size.icon - iw) / 2);
iy = ((mi->size.h - ih) / 2);
- evas_move(m->evas, mi->obj_icon, m->sel_border.l + mi->x + ix,
+ evas_object_move(mi->obj_icon, m->sel_border.l + mi->x + ix,
m->sel_border.t + mi->y + iy);
- evas_resize(m->evas, mi->obj_icon, iw, ih);
- evas_set_image_fill(m->evas, mi->obj_icon, 0, 0, iw, ih);
+ evas_object_resize(mi->obj_icon, iw, ih);
+ evas_object_image_fill_set(mi->obj_icon, 0, 0, iw, ih);
}
if (mi->obj_text)
@@ -1459,14 +1460,14 @@ e_menu_item_update(E_Menu * m, E_Menu_Item * mi)
if (m->size.icon)
tx += m->size.icon + m->pad.icon;
ty = ((mi->size.h - th) / 2);
- evas_move(m->evas, mi->obj_text, m->sel_border.l + mi->x + tx,
+ evas_object_move(mi->obj_text, m->sel_border.l + mi->x + tx,
m->sel_border.t + mi->y + ty);
}
if (mi->obj_entry)
{
- evas_move(m->evas, mi->obj_entry, mi->x, mi->y);
- evas_resize(m->evas, mi->obj_entry,
+ evas_object_move(mi->obj_entry, mi->x, mi->y);
+ evas_object_resize(mi->obj_entry,
mi->size.w + m->sel_border.l + m->sel_border.r,
mi->size.h + m->sel_border.t + m->sel_border.b);
}
@@ -1490,13 +1491,13 @@ e_menu_item_unrealize(E_Menu * m, E_Menu_Item * mi)
IF_FREE(mi->bg_file);
mi->bg_file = NULL;
if (mi->obj_entry)
- evas_del_object(m->evas, mi->obj_entry);
+ evas_object_del(mi->obj_entry);
mi->obj_entry = NULL;
if (mi->obj_text)
- evas_del_object(m->evas, mi->obj_text);
+ evas_object_del(mi->obj_text);
mi->obj_text = NULL;
if (mi->obj_icon)
- evas_del_object(m->evas, mi->obj_icon);
+ evas_object_del(mi->obj_icon);
mi->obj_icon = NULL;
if (mi->state)
ebits_free(mi->state);
@@ -1510,6 +1511,7 @@ e_menu_item_unrealize(E_Menu * m, E_Menu_Item * mi)
mi->sep_file = NULL;
D_RETURN;
+ UN(m);
}
void
@@ -1528,29 +1530,32 @@ e_menu_item_realize(E_Menu * m, E_Menu_Item * mi)
{
if (mi->str)
{
- mi->obj_text = evas_add_text(m->evas, "borzoib", 8, mi->str);
- evas_set_color(m->evas, mi->obj_text, 0, 0, 0, 255);
- evas_show(m->evas, mi->obj_text);
- evas_set_layer(m->evas, mi->obj_text, 10);
+ mi->obj_text = evas_object_text_add(m->evas);
+ evas_object_text_font_set(mi->obj_text, "borzoib", 8);
+ evas_object_text_text_set(mi->obj_text, mi->str);
+ evas_object_color_set(mi->obj_text, 0, 0, 0, 255);
+ evas_object_show(mi->obj_text);
+ evas_object_layer_set(mi->obj_text, 10);
}
if (mi->icon)
{
- mi->obj_icon = evas_add_image_from_file(m->evas, mi->icon);
- evas_show(m->evas, mi->obj_icon);
- evas_set_layer(m->evas, mi->obj_icon, 10);
+ mi->obj_icon = evas_object_image_add(m->evas);
+ evas_object_image_file_set(mi->obj_icon, mi->icon, NULL);
+ evas_object_show(mi->obj_icon);
+ evas_object_layer_set(mi->obj_icon, 10);
}
- mi->obj_entry = evas_add_rectangle(m->evas);
- evas_set_layer(m->evas, mi->obj_entry, 11);
- evas_set_color(m->evas, mi->obj_entry, 0, 0, 0, 0);
- evas_show(m->evas, mi->obj_entry);
+ mi->obj_entry = evas_object_rectangle_add(m->evas);
+ evas_object_layer_set(mi->obj_entry, 11);
+ evas_object_color_set(mi->obj_entry, 0, 0, 0, 0);
+ evas_object_show(mi->obj_entry);
tw = 0;
th = 0;
if (mi->obj_text)
- evas_get_geometry(m->evas, mi->obj_text, NULL, NULL, &tw, &th);
+ evas_object_geometry_get(mi->obj_text, NULL, NULL, &tw, &th);
iw = 0;
ih = 0;
if (mi->obj_icon)
- evas_get_image_size(m->evas, mi->obj_icon, &iw, &ih);
+ evas_object_image_size_get(mi->obj_icon, &iw, &ih);
rw = 0;
rh = 0;
if (mi->state)
@@ -1561,9 +1566,10 @@ e_menu_item_realize(E_Menu * m, E_Menu_Item * mi)
if (((!mi->scale_icon) && (ih > th)) || ((!mi->str) && (ih > th)))
th = (double)ih;
mi->size.min.h = (int)th;
- evas_callback_add(m->evas, mi->obj_entry, CALLBACK_MOUSE_IN,
+ /* checkme todo */
+ evas_object_event_callback_add(mi->obj_entry, EVAS_CALLBACK_MOUSE_IN,
e_menu_item_in_cb, mi);
- evas_callback_add(m->evas, mi->obj_entry, CALLBACK_MOUSE_OUT,
+ evas_object_event_callback_add(mi->obj_entry, EVAS_CALLBACK_MOUSE_OUT,
e_menu_item_out_cb, mi);
e_menu_set_sel(m, mi);
if ((mi->radio) || (mi->check))
@@ -1595,17 +1601,17 @@ 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,
+ evas_obscured_clear(m->evas);
+ evas_obscured_rectangle_add(m->evas,
-m->current.x - 100000,
-m->current.y - 100000, 200000 + screen_w, 100000);
- evas_add_obscured_rect(m->evas,
+ evas_obscured_rectangle_add(m->evas,
-m->current.x - 100000,
-m->current.y - 100000, 100000, 200000 + screen_h);
- evas_add_obscured_rect(m->evas,
+ evas_obscured_rectangle_add(m->evas,
-m->current.x - 100000,
screen_h - m->current.y, 200000 + screen_w, 100000);
- evas_add_obscured_rect(m->evas,
+ evas_obscured_rectangle_add(m->evas,
screen_w - m->current.x,
-m->current.y - 100000, 100000, 200000 + screen_h);
@@ -1615,7 +1621,7 @@ e_menu_obscure_outside_screen(E_Menu * m)
void
e_menu_scroll_all_by(int dx, int dy)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1638,7 +1644,7 @@ e_menu_scroll_all_by(int dx, int dy)
E_Menu *m;
m = l->data;
- evas_event_move(m->evas,
+ evas_event_feed_mouse_move(m->evas,
mouse_x - m->current.x, mouse_y - m->current.y);
}
}
@@ -1696,7 +1702,7 @@ e_menu_update_base(E_Menu * m)
if (m->recalc_entries)
{
- Evas_List l;
+ Evas_List * l;
int max_w, max_h;
int i;
@@ -1725,12 +1731,12 @@ e_menu_update_base(E_Menu * m)
tw = 0;
th = 0;
if (mi->obj_text)
- evas_get_geometry(m->evas, mi->obj_text, NULL, NULL, &tw,
+ evas_object_geometry_get(mi->obj_text, NULL, NULL, &tw,
&th);
iw = 0;
ih = 0;
if (mi->obj_icon)
- evas_get_image_size(m->evas, mi->obj_icon, &iw, &ih);
+ evas_object_image_size_get(mi->obj_icon, &iw, &ih);
rw = 0;
rh = 0;
if (mi->state)
@@ -1791,7 +1797,7 @@ e_menu_update_base(E_Menu * m)
}
if (m->redo_sel)
{
- Evas_List l;
+ Evas_List * l;
for (l = m->entries; l; l = l->next)
{
@@ -1839,12 +1845,14 @@ e_menu_update_base(E_Menu * m)
if (size_changed)
{
ecore_window_resize(m->win.evas, m->current.w, m->current.h);
- evas_set_output_size(m->evas, m->current.w, m->current.h);
- evas_set_output_viewport(m->evas, 0, 0, m->current.w, m->current.h);
+ evas_output_size_set(m->evas, m->current.w, m->current.h);
+ evas_output_viewport_set(m->evas, 0, 0, m->current.w, m->current.h);
if (m->bg)
ebits_resize(m->bg, m->current.w, m->current.h);
}
+ e_menu_update_shape(m);
+
D_RETURN;
}
@@ -1881,6 +1889,8 @@ e_menu_update_shows(E_Menu * m)
}
}
+ e_menu_update_shape(m);
+
D_RETURN;
}
@@ -1928,10 +1938,33 @@ e_menu_update_hides(E_Menu * m)
}
}
+ e_menu_update_shape(m);
+
D_RETURN;
}
void
+e_menu_update_shape(E_Menu *m)
+{
+ Pixmap pmap, mask;
+
+ D_ENTER;
+
+ pmap = ecore_pixmap_new(m->win.main, m->current.w, m->current.h, 0);
+ mask = ecore_pixmap_new(m->win.main, m->current.w, m->current.h, 1);
+
+ e_evas_get_mask(m->evas, pmap, mask);
+ ecore_window_set_background_pixmap(m->win.main, pmap);
+ ecore_window_set_shape_mask(m->win.main, mask);
+ ecore_window_clear(m->win.main);
+
+ ecore_pixmap_free(pmap);
+ ecore_pixmap_free(mask);
+
+ D_RETURN;
+}
+
+void
e_menu_update(E_Menu * m)
{
D_ENTER;
diff --git a/src/menu.h b/src/menu.h
index b30899759..76c5c90c2 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -27,9 +27,9 @@ struct _E_Menu
Window main, evas;
}
win;
- Evas evas;
- Ebits_Object bg;
- Evas_List entries;
+ Evas * evas;
+ Ebits_Object * bg;
+ Evas_List * entries;
char *bg_file;
int first_expose;
@@ -77,13 +77,13 @@ struct _E_Menu_Item
char *bg_file;
int selected;
- Evas_Object obj_entry;
+ Evas_Object * obj_entry;
char *str;
- Evas_Object obj_text;
+ Evas_Object * obj_text;
char *icon;
- Evas_Object obj_icon;
+ Evas_Object * obj_icon;
int scale_icon;
Ebits_Object state;
@@ -149,6 +149,7 @@ void e_menu_update_base(E_Menu * m);
void e_menu_update_finish(E_Menu * m);
void e_menu_update_shows(E_Menu * m);
void e_menu_update_hides(E_Menu * m);
+void e_menu_update_shape(E_Menu *m);
void e_menu_update(E_Menu * m);
void e_menu_item_set_icon(E_Menu_Item * mi, char *icon);
void e_menu_item_set_text(E_Menu_Item * mi, char *text);
diff --git a/src/menubuild.c b/src/menubuild.c
index 650bc4585..6128132cb 100644
--- a/src/menubuild.c
+++ b/src/menubuild.c
@@ -6,12 +6,9 @@
#include "file.h"
#include "border.h"
#include "observer.h"
+#include "actions.h"
-#ifdef USE_FERITE
-# include "e_ferite.h"
-#endif
-
-Evas_List build_menus = NULL;
+Evas_List * build_menus = NULL;
static void e_build_menu_cb_exec(E_Menu * m, E_Menu_Item * mi,
void *data);
@@ -33,7 +30,8 @@ static void e_build_menu_iconified_borders_changed(E_Observer *
observer,
E_Observee *
observee,
- E_Event_Type event);
+ E_Event_Type event,
+ void *data);
/* ------------ various callbacks ---------------------- */
static void
@@ -73,12 +71,13 @@ e_build_menu_cb_script(E_Menu * m, E_Menu_Item * mi, void *data)
D_ENTER;
-#ifdef USE_FERITE
script = data;
- e_ferite_run(script);
-#else
- D("No cookies for you. You will have to install ferite.\n");
-#endif
+
+ if(strstr(script, "e.shutdown"))
+ e_act_exit_start(NULL,NULL,NULL,0,0,0,0);
+
+ if(strstr(script, "e.restart"))
+ e_act_restart_start(NULL,NULL,NULL,0,0,0,0);
D_RETURN;
UN(m);
@@ -92,7 +91,7 @@ e_build_menu_cb_script(E_Menu * m, E_Menu_Item * mi, void *data)
static void
e_build_menu_unbuild(E_Build_Menu * bm)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -282,7 +281,7 @@ static E_Menu *
e_build_menu_gnome_apps_build_dir(E_Build_Menu * bm, char *dir)
{
E_Menu *menu = NULL;
- Evas_List l, entries = NULL;
+ Evas_List *l, *entries = NULL;
D_ENTER;
@@ -293,7 +292,7 @@ e_build_menu_gnome_apps_build_dir(E_Build_Menu * bm, char *dir)
{
FILE *f;
char buf[PATH_MAX];
- Evas_List dirlist = NULL;
+ Evas_List * dirlist = NULL;
/* read .order file */
snprintf(buf, PATH_MAX, "%s/.order", dir);
@@ -324,7 +323,7 @@ e_build_menu_gnome_apps_build_dir(E_Build_Menu * bm, char *dir)
/* if it isnt a "dot" file or dir */
if (s[0] != '.')
{
- Evas_List ll;
+ Evas_List * ll;
int have_it;
have_it = 0;
@@ -538,7 +537,7 @@ E_Build_Menu *
e_build_menu_new_from_iconified_borders()
{
E_Build_Menu *bm;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -546,10 +545,12 @@ e_build_menu_new_from_iconified_borders()
ZERO(bm, E_Build_Menu, 1);
/* e_observer_init(E_OBSERVER(bm), E_EVENT_BORDER_ICONIFY | E_EVENT_BORDER_UNICONIFY | E_EVENT_BORDER_NEW, e_build_menu_iconified_borders_changed, (E_Cleanup_Func) e_build_menu_cleanup);*/
+
e_observer_init(E_OBSERVER(bm), E_EVENT_BORDER_ALL,
- e_build_menu_iconified_borders_changed,
+ (E_Notify_Func) e_build_menu_iconified_borders_changed,
(E_Cleanup_Func) e_build_menu_cleanup);
+
for (l = e_border_get_borders_list(); l; l = l->next)
{
E_Border *b = l->data;
@@ -578,7 +579,7 @@ e_build_menu_iconified_borders_rebuild(E_Build_Menu * bm)
static void
e_build_menu_iconified_borders_changed(E_Observer * observer,
E_Observee * observee,
- E_Event_Type event)
+ E_Event_Type event, void *data)
{
E_Build_Menu *bm;
@@ -604,13 +605,14 @@ e_build_menu_iconified_borders_changed(E_Observer * observer,
bm->changed = 1;
}
D_RETURN;
+ UN(data);
}
static E_Menu *
e_build_menu_iconified_borders_build(E_Build_Menu * bm)
{
E_Menu *menu = NULL;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
diff --git a/src/menubuild.h b/src/menubuild.h
index 7b065cfbd..0b2d91ee4 100644
--- a/src/menubuild.h
+++ b/src/menubuild.h
@@ -4,6 +4,7 @@
#include "e.h"
#include "object.h"
#include "observer.h"
+#include "menu.h"
typedef struct _E_Build_Menu E_Build_Menu;
@@ -16,8 +17,8 @@ struct _E_Build_Menu
E_Menu *menu;
- Evas_List menus;
- Evas_List commands;
+ Evas_List * menus;
+ Evas_List * commands;
int changed;
};
diff --git a/src/observer.c b/src/observer.c
index 3762249b7..ea91c085a 100644
--- a/src/observer.c
+++ b/src/observer.c
@@ -3,7 +3,7 @@
#include "debug.h"
#include "observer.h"
-static Evas_List observers;
+static Evas_List * observers;
void
e_observer_init(E_Observer * obs, E_Event_Type event,
@@ -97,18 +97,18 @@ e_observee_init(E_Observee * obs, E_Cleanup_Func cleanup_func)
void
e_observee_notify_observers(E_Observee * o, E_Event_Type event, void *data)
{
- Evas_List obs_list = NULL;
+ 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);
-
+
/* check bit mask */
if (obs->event & event)
{
@@ -122,7 +122,7 @@ e_observee_notify_observers(E_Observee * o, E_Event_Type event, void *data)
void
e_observee_notify_all_observers(E_Observee * o, E_Event_Type event, void *data)
{
- Evas_List obs_list = NULL;
+ Evas_List * obs_list = NULL;
E_Observer *obs = NULL;
D_ENTER;
diff --git a/src/observer.h b/src/observer.h
index c864723eb..00e7c95b0 100644
--- a/src/observer.h
+++ b/src/observer.h
@@ -18,25 +18,29 @@ typedef enum _e_event_type
E_EVENT_BORDER_NEW = 1 << 0,
E_EVENT_BORDER_DELETE = 1 << 1,
E_EVENT_BORDER_FOCUS_IN = 1 << 2,
- E_EVENT_BORDER_ICONIFY = 1 << 3,
- E_EVENT_BORDER_UNICONIFY = 1 << 4,
- E_EVENT_BORDER_MAXIMIZE = 1 << 5,
- E_EVENT_BORDER_UNMAXIMIZE = 1 << 6,
- E_EVENT_BORDER_MOVE = 1 << 7,
- E_EVENT_BORDER_RESIZE = 1 << 8,
-
- E_EVENT_DESKTOP_NEW = 1 << 10,
- E_EVENT_DESKTOP_DELETE = 1 << 11,
- E_EVENT_DESKTOP_SWITCH = 1 << 12,
-
- E_EVENT_FILE_ADD = 1 << 13,
- E_EVENT_FILE_CHANGE = 1 << 14,
- E_EVENT_FILE_DELETE = 1 << 15,
- E_EVENT_FILE_INFO = 1 << 16,
+ E_EVENT_BORDER_FOCUS_OUT = 1 << 3,
+ E_EVENT_BORDER_ICONIFY = 1 << 4,
+ E_EVENT_BORDER_UNICONIFY = 1 << 5,
+ E_EVENT_BORDER_MAXIMIZE = 1 << 6,
+ E_EVENT_BORDER_UNMAXIMIZE = 1 << 7,
+ E_EVENT_BORDER_MOVE = 1 << 8,
+ E_EVENT_BORDER_RESIZE = 1 << 9,
+ E_EVENT_BORDER_RAISE = 1 << 10,
+ E_EVENT_BORDER_LOWER = 1 << 11,
+
+ E_EVENT_DESKTOP_NEW = 1 << 12,
+ E_EVENT_DESKTOP_DELETE = 1 << 13,
+ E_EVENT_DESKTOP_SWITCH = 1 << 14,
+ E_EVENT_DESKTOP_SCROLL = 1 << 15,
+
+ E_EVENT_FILE_ADD = 1 << 16,
+ E_EVENT_FILE_CHANGE = 1 << 17,
+ E_EVENT_FILE_DELETE = 1 << 18,
+ E_EVENT_FILE_INFO = 1 << 19,
- E_EVENT_BG_CHANGED = 1 << 17,
- E_EVENT_ICB_CHANGED = 1 << 18,
- E_EVENT_LAYOUT_CHANGED = 1 << 19,
+ E_EVENT_BG_CHANGED = 1 << 20,
+ E_EVENT_ICB_CHANGED = 1 << 21,
+ E_EVENT_LAYOUT_CHANGED = 1 << 22,
/* meta event types */
E_EVENT_BORDER_ALL = E_EVENT_BORDER_NEW |
@@ -60,7 +64,7 @@ struct _e_observer
{
E_Object obj;
- Evas_List watched; /* list<E_Observee> */
+ Evas_List * watched; /* list<E_Observee> */
E_Event_Type event;
E_Notify_Func notify_func;
};
@@ -69,7 +73,7 @@ struct _e_observee
{
E_Object obj;
- Evas_List observers; /* list<E_Observer> */
+ Evas_List * observers; /* list<E_Observer> */
};
/**
diff --git a/src/place.c b/src/place.c
index e004824fb..42a82213d 100644
--- a/src/place.c
+++ b/src/place.c
@@ -71,12 +71,9 @@ e_place_manual(E_Border * b, E_Desktop * desk, int *x, int *y)
int mx, my, rx, ry;
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);
+ move_mode = config_data->window->move_mode;
w = b->current.requested.w;
h = b->current.requested.h;
@@ -93,7 +90,8 @@ e_place_manual(E_Border * b, E_Desktop * desk, int *x, int *y)
}
/* get mouse coords */
- ecore_pointer_xy(desk->win.main, &mx, &my);
+ /* ecore_pointer_xy(desk->win.main, &mx, &my); */
+ ecore_pointer_xy(0, &mx, &my);
rx = mx;
ry = my;
prx = rx;
@@ -122,7 +120,7 @@ e_place_smart(E_Border * b, E_Desktop * desk, int *x, int *y)
int w, h;
int a_w = 0, a_h = 0;
int *a_x = NULL, *a_y = NULL;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
diff --git a/src/resist.c b/src/resist.c
index 3c919e3c6..c041c35a8 100644
--- a/src/resist.c
+++ b/src/resist.c
@@ -14,18 +14,14 @@ e_resist_border(E_Border * b)
/* int ok = 0; */
int dx, dy, d;
int resist_x = 0, resist_y = 0;
- Evas_List l, rects = NULL;
+ Evas_List *l, *rects = NULL;
E_Rect *r;
- 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);
- E_CONFIG_INT_GET(cfg_win_resist, win_resist);
+ resist = config_data->move->resist;
+ desk_resist = config_data->move->desk_resist;
+ win_resist = config_data->move->win_resist;
if (!resist)
{
b->current.x = b->current.requested.x;
@@ -55,11 +51,11 @@ rects = evas_list_append(rects, r); \
/* here if need be - ie xinerama middle between screens and panels etc. */
{
- if (b->desk->view->iconbar)
- evas_list_append(rects,
- e_iconbar_get_resist_rect(b->desk->view->iconbar));
+ if (b->desk->iconbar)
+ evas_list_append(rects,
+ e_iconbar_get_resist_rect(b->desk->iconbar));
}
-
+
for (l = b->desk->windows; l; l = l->next)
{
E_Border *bd;
diff --git a/src/scrollbar.c b/src/scrollbar.c
index 1d7887d27..f72b64c83 100644
--- a/src/scrollbar.c
+++ b/src/scrollbar.c
@@ -144,31 +144,31 @@ e_scrollbar_setup_bits(E_Scrollbar * sb)
sb->h = h;
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Trough",
- CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
+ EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
sb);
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Trough",
- CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
+ EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow1",
- CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
+ EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
sb);
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow1",
- CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
+ EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow2",
- CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
+ EVAS_CALLBACK_MOUSE_DOWN, e_sb_base_down_cb,
sb);
ebits_set_classed_bit_callback(sb->base, "Scrollbar_Arrow2",
- CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
+ EVAS_CALLBACK_MOUSE_UP, e_sb_base_up_cb, sb);
}
if (sb->bar)
{
ebits_add_to_evas(sb->bar, sb->evas);
ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar",
- CALLBACK_MOUSE_DOWN, e_sb_bar_down_cb,
+ EVAS_CALLBACK_MOUSE_DOWN, e_sb_bar_down_cb,
sb);
ebits_set_classed_bit_callback(sb->bar, "Scrollbar_Bar",
- CALLBACK_MOUSE_UP, e_sb_bar_up_cb, sb);
+ EVAS_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,
+ EVAS_CALLBACK_MOUSE_MOVE, e_sb_bar_move_cb,
sb);
}
@@ -568,7 +568,7 @@ e_scrollbar_cleanup(E_Scrollbar * sb)
}
void
-e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas evas)
+e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas * evas)
{
D_ENTER;
@@ -692,7 +692,7 @@ e_scrollbar_set_direction(E_Scrollbar * sb, int d)
sb->direction = d;
if (sb->evas)
{
- Evas evas;
+ Evas * evas;
if (sb->base)
ebits_free(sb->base);
diff --git a/src/scrollbar.h b/src/scrollbar.h
index 5a0472c40..d309cf5a7 100644
--- a/src/scrollbar.h
+++ b/src/scrollbar.h
@@ -25,7 +25,7 @@ struct _E_Scrollbar
double range;
E_View *view;
- Evas evas;
+ Evas * evas;
Ebits_Object bar;
Ebits_Object base;
@@ -59,7 +59,7 @@ struct _E_Scrollbar
};
E_Scrollbar *e_scrollbar_new(E_View * v);
-void e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas evas);
+void e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas * evas);
void e_scrollbar_show(E_Scrollbar * sb);
void e_scrollbar_hide(E_Scrollbar * sb);
void e_scrollbar_raise(E_Scrollbar * sb);
diff --git a/src/text.c b/src/text.c
index 21df68725..df737cb8c 100644
--- a/src/text.c
+++ b/src/text.c
@@ -3,7 +3,7 @@
#include "util.h"
E_Text *
-e_text_new(Evas evas, char *text, char *class)
+e_text_new(Evas * evas, char *text, char *class)
{
E_Text *t;
@@ -21,32 +21,49 @@ e_text_new(Evas evas, char *text, char *class)
else
t->text = strdup("");
t->evas = evas;
- t->obj.o1 = evas_add_text(t->evas, "borzoib", 8, t->text);
- t->obj.o2 = evas_add_text(t->evas, "borzoib", 8, t->text);
- t->obj.o3 = evas_add_text(t->evas, "borzoib", 8, t->text);
- t->obj.o4 = evas_add_text(t->evas, "borzoib", 8, t->text);
- t->obj.text = evas_add_text(t->evas, "borzoib", 8, t->text);
- evas_set_pass_events(t->evas, t->obj.o1, 1);
- evas_set_pass_events(t->evas, t->obj.o2, 1);
- evas_set_pass_events(t->evas, t->obj.o3, 1);
- evas_set_pass_events(t->evas, t->obj.o4, 1);
- evas_set_pass_events(t->evas, t->obj.text, 1);
- evas_set_color(t->evas, t->obj.o1, 0, 0, 0, 255);
- evas_set_color(t->evas, t->obj.o2, 0, 0, 0, 255);
- evas_set_color(t->evas, t->obj.o3, 0, 0, 0, 255);
- evas_set_color(t->evas, t->obj.o4, 0, 0, 0, 255);
- evas_set_color(t->evas, t->obj.text, 255, 255, 255, 255);
- evas_move(t->evas, t->obj.o1, t->x + 1, t->y);
- evas_move(t->evas, t->obj.o2, t->x, t->y + 1);
- 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);
+ t->obj.o1 = evas_object_text_add(t->evas);
+ evas_object_text_font_set(t->obj.o1, "borzoib", 8);
+ evas_object_text_text_set(t->obj.o1, t->text);
+
+ t->obj.o2 = evas_object_text_add(t->evas);
+ evas_object_text_font_set(t->obj.o2, "borzoib", 8);
+ evas_object_text_text_set(t->obj.o2, t->text);
+
+ t->obj.o3 = evas_object_text_add(t->evas);
+ evas_object_text_font_set(t->obj.o3, "borzoib", 8);
+ evas_object_text_text_set(t->obj.o3, t->text);
+
+ t->obj.o4 = evas_object_text_add(t->evas);
+ evas_object_text_font_set(t->obj.o4, "borzoib", 8);
+ evas_object_text_text_set(t->obj.o4, t->text);
+
+ t->obj.text = evas_object_text_add(t->evas);
+ evas_object_text_font_set(t->obj.text, "borzoib", 8);
+ evas_object_text_text_set(t->obj.text, t->text);
+
+ evas_object_pass_events_set(t->obj.o1, 1);
+ evas_object_pass_events_set(t->obj.o2, 1);
+ evas_object_pass_events_set(t->obj.o3, 1);
+ evas_object_pass_events_set(t->obj.o4, 1);
+ evas_object_pass_events_set(t->obj.text, 1);
+ evas_object_color_set(t->obj.o1, 0, 0, 0, 255);
+ evas_object_color_set(t->obj.o2, 0, 0, 0, 255);
+ evas_object_color_set(t->obj.o3, 0, 0, 0, 255);
+ evas_object_color_set(t->obj.o4, 0, 0, 0, 255);
+ evas_object_color_set(t->obj.text, 255, 255, 255, 255);
+ evas_object_move(t->obj.o1, t->x + 1, t->y);
+ evas_object_move(t->obj.o2, t->x, t->y + 1);
+ evas_object_move(t->obj.o3, t->x + 2, t->y + 1);
+ evas_object_move(t->obj.o4, t->x + 1, t->y + 2);
+ evas_object_move(t->obj.text, t->x + 1, t->y + 1);
t->color.r = 255;
t->color.g = 255;
t->color.b = 255;
t->color.a = 255;
- t->w = evas_get_text_width(t->evas, t->obj.text) + 2;
- t->h = evas_get_text_height(t->evas, t->obj.text) + 2;
+ evas_object_geometry_get(t->obj.text, NULL, NULL, &t->w, &t->h);
+ t->w += 2;
+ t->h += 2;
+
t->min.w = t->w + 2;
t->min.h = t->h + 2;
t->max.w = t->w + 2;
@@ -66,11 +83,11 @@ e_text_free(E_Text * t)
if ((t->evas) && (t->obj.text))
{
- evas_del_object(t->evas, t->obj.o1);
- evas_del_object(t->evas, t->obj.o2);
- evas_del_object(t->evas, t->obj.o3);
- evas_del_object(t->evas, t->obj.o4);
- evas_del_object(t->evas, t->obj.text);
+ evas_object_del(t->obj.o1);
+ evas_object_del(t->obj.o2);
+ evas_object_del(t->obj.o3);
+ evas_object_del(t->obj.o4);
+ evas_object_del(t->obj.text);
}
FREE(t);
@@ -88,13 +105,15 @@ e_text_set_text(E_Text * t, char *text)
D_RETURN;
FREE(t->text);
t->text = strdup(text);
- evas_set_text(t->evas, t->obj.o1, t->text);
- evas_set_text(t->evas, t->obj.o2, t->text);
- evas_set_text(t->evas, t->obj.o3, t->text);
- evas_set_text(t->evas, t->obj.o4, t->text);
- evas_set_text(t->evas, t->obj.text, t->text);
- t->w = evas_get_text_width(t->evas, t->obj.text) + 2;
- t->h = evas_get_text_height(t->evas, t->obj.text) + 2;
+ evas_object_text_text_set(t->obj.o1, t->text);
+ evas_object_text_text_set(t->obj.o2, t->text);
+ evas_object_text_text_set(t->obj.o3, t->text);
+ evas_object_text_text_set(t->obj.o4, t->text);
+ evas_object_text_text_set(t->obj.text, t->text);
+ evas_object_geometry_get(t->obj.text, NULL, NULL, &t->w, &t->h);
+ t->w += 2;
+ t->h += 2;
+
t->min.w = t->w + 2;
t->min.h = t->h + 2;
t->max.w = t->w + 2;
@@ -111,25 +130,25 @@ e_text_set_layer(E_Text * t, int l)
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);
+ evas_object_layer_set(t->obj.o1, t->layer);
+ evas_object_layer_set(t->obj.o2, t->layer);
+ evas_object_layer_set(t->obj.o3, t->layer);
+ evas_object_layer_set(t->obj.o4, t->layer);
+ evas_object_layer_set(t->obj.text, t->layer);
D_RETURN;
}
void
-e_text_set_clip(E_Text * t, Evas_Object clip)
+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);
+ evas_object_clip_set(t->obj.o1, clip);
+ evas_object_clip_set(t->obj.o2, clip);
+ evas_object_clip_set(t->obj.o3, clip);
+ evas_object_clip_set(t->obj.o4, clip);
+ evas_object_clip_set(t->obj.text, clip);
D_RETURN;
}
@@ -139,11 +158,11 @@ 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);
+ evas_object_clip_unset(t->obj.o1);
+ evas_object_clip_unset(t->obj.o2);
+ evas_object_clip_unset(t->obj.o3);
+ evas_object_clip_unset(t->obj.o4);
+ evas_object_clip_unset(t->obj.text);
D_RETURN;
}
@@ -153,11 +172,11 @@ 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);
+ evas_object_raise(t->obj.o1);
+ evas_object_raise(t->obj.o2);
+ evas_object_raise(t->obj.o3);
+ evas_object_raise(t->obj.o4);
+ evas_object_raise(t->obj.text);
D_RETURN;
}
@@ -167,11 +186,11 @@ 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);
+ evas_object_lower(t->obj.text);
+ evas_object_lower(t->obj.o4);
+ evas_object_lower(t->obj.o3);
+ evas_object_lower(t->obj.o2);
+ evas_object_lower(t->obj.o1);
D_RETURN;
}
@@ -184,11 +203,11 @@ e_text_show(E_Text * t)
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);
+ evas_object_show(t->obj.o1);
+ evas_object_show(t->obj.o2);
+ evas_object_show(t->obj.o3);
+ evas_object_show(t->obj.o4);
+ evas_object_show(t->obj.text);
D_RETURN;
}
@@ -201,11 +220,11 @@ e_text_hide(E_Text * t)
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);
+ evas_object_hide(t->obj.o1);
+ evas_object_hide(t->obj.o2);
+ evas_object_hide(t->obj.o3);
+ evas_object_hide(t->obj.o4);
+ evas_object_hide(t->obj.text);
D_RETURN;
}
@@ -222,7 +241,7 @@ e_text_set_color(E_Text * t, int r, int g, int b, int a)
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,
+ evas_object_color_set(t->obj.text, t->color.r, t->color.g, t->color.b,
t->color.a);
D_RETURN;
@@ -237,11 +256,11 @@ e_text_move(E_Text * t, double x, double y)
D_RETURN;
t->x = x;
t->y = y;
- evas_move(t->evas, t->obj.o1, t->x + 1, t->y);
- evas_move(t->evas, t->obj.o2, t->x, t->y + 1);
- 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);
+ evas_object_move(t->obj.o1, t->x + 1, t->y);
+ evas_object_move(t->obj.o2, t->x, t->y + 1);
+ evas_object_move(t->obj.o3, t->x + 2, t->y + 1);
+ evas_object_move(t->obj.o4, t->x + 1, t->y + 2);
+ evas_object_move(t->obj.text, t->x + 1, t->y + 1);
D_RETURN;
}
diff --git a/src/text.h b/src/text.h
index b4de9f5c2..41d5fad40 100644
--- a/src/text.h
+++ b/src/text.h
@@ -25,23 +25,23 @@ struct _E_Text
color;
int layer;
- Evas evas;
+ Evas * evas;
struct
{
- Evas_Object text;
- Evas_Object o1;
- Evas_Object o2;
- Evas_Object o3;
- Evas_Object o4;
+ Evas_Object * text;
+ Evas_Object * o1;
+ Evas_Object * o2;
+ Evas_Object * o3;
+ Evas_Object * o4;
}
obj;
};
-E_Text *e_text_new(Evas evas, char *text, char *class);
+E_Text *e_text_new(Evas * evas, char *text, char *class);
void e_text_free(E_Text * t);
void e_text_set_text(E_Text * t, char *text);
void e_text_set_layer(E_Text * t, int l);
-void e_text_set_clip(E_Text * t, Evas_Object clip);
+void e_text_set_clip(E_Text * t, Evas_Object * clip);
void e_text_unset_clip(E_Text * t);
void e_text_raise(E_Text * t);
void e_text_lower(E_Text * t);
diff --git a/src/util.c b/src/util.c
index 8fa95a288..468f59c1e 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,5 +1,7 @@
#include "debug.h"
#include "util.h"
+#include "Evas.h"
+#include "Evas_Engine_Software_X11.h"
void
e_util_set_env(char *variable, char *content)
@@ -102,3 +104,99 @@ e_util_de_url_and_verify(const char *fi)
D_RETURN_(wk);
}
+
+
+Evas *
+e_evas_new_all(Display *disp, Window parent_window,
+ int x, int y, int win_w, int win_h,
+ char *font_dir)
+{
+ Evas *e;
+
+ e = evas_new();
+ evas_output_method_set(e, evas_render_method_lookup("software_x11"));
+ evas_output_size_set(e, win_w, win_h);
+ evas_output_viewport_set(e, 0, 0, win_w, win_h);
+ {
+ Evas_Engine_Info_Software_X11 *einfo;
+ XSetWindowAttributes att;
+ Window window;
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(e);
+
+ /* the following is specific to the engine */
+ einfo->info.display = disp;
+ einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
+ einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
+
+ att.background_pixmap = None;
+ att.colormap = /*colormap*/ DefaultColormap(disp, DefaultScreen(disp));
+ att.border_pixel = 0;
+ att.event_mask = 0;
+ window = XCreateWindow(disp,
+ parent_window,
+ x, y, win_w, win_h, 0,
+ DefaultDepth(disp, DefaultScreen(disp)),
+ /*imlib_get_visual_depth(display, visual),*/
+ InputOutput,
+ einfo->info.visual,
+ CWColormap | CWBorderPixel | CWEventMask | CWBackPixmap,
+ &att);
+
+ einfo->info.drawable = window /*win*/;
+ einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
+ einfo->info.rotation = 0;
+ einfo->info.debug = 0;
+ evas_engine_info_set(e, (Evas_Engine_Info *) einfo);
+ }
+
+ evas_object_image_cache_set(e, 0);
+ evas_object_font_cache_set(e, 0);
+ evas_object_font_path_append(e, font_dir);
+
+ return e;
+}
+
+Evas_List *
+e_evas_get_mask(Evas *evas, Pixmap pmap, Pixmap mask)
+{
+ int w, h;
+ Pixmap old_pmap, old_mask;
+ Evas_List *updates;
+ Evas_Engine_Info_Software_X11 *info;
+
+ info = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
+
+ old_pmap = info->info.drawable;
+ old_mask = info->info.mask;
+
+ info->info.drawable = pmap;
+ info->info.mask = mask;
+
+ evas_engine_info_set(evas, (Evas_Engine_Info *) info);
+ evas_output_size_get(evas, &w, &h);
+ evas_damage_rectangle_add(evas, 0, 0, w, h);
+ evas_render(evas);
+ evas_damage_rectangle_add(evas, 0, 0, w, h);
+
+ info->info.drawable = old_pmap;
+ info->info.mask = old_mask;
+ evas_engine_info_set(evas, (Evas_Engine_Info *) info);
+
+ return updates;
+}
+
+
+Window
+e_evas_get_window(Evas *evas)
+{
+ Window win;
+ Evas_Engine_Info_Software_X11 *einfo;
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
+
+ /* the following is specific to the engine */
+ win = einfo->info.drawable;
+
+ return win;
+}
diff --git a/src/util.h b/src/util.h
index 311331256..f813d7618 100644
--- a/src/util.h
+++ b/src/util.h
@@ -8,6 +8,13 @@ char *e_util_get_user_home(void);
void *e_util_memdup(void *data, int size);
int e_util_glob_matches(char *str, char *glob);
char *e_util_de_url_and_verify(const char *fi);
+Window e_evas_get_window(Evas *evas);
+Evas_List *e_evas_get_mask(Evas *evas, Pixmap pmap, Pixmap mask);
+Evas *e_evas_new_all(Display *disp, Window win,
+ int x, int y, int win_w, int win_h,
+ char *font_dir);
+
+#define RENDER_METHOD_ALPHA_SOFTWARE 0
#define e_strdup(__dest, __var) \
{ \
@@ -26,5 +33,15 @@ if (__dest) strcpy(__dest, __var); \
#define SPANS_COMMON(x1, w1, x2, w2) \
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
#define UN(_blah) _blah = 0
+#define MIN(v1, v2) (v1 < v2 ? v1 : v2)
+
+#define STRNCPY(d, s, l) \
+do \
+{ \
+ int __c; \
+ for (__c = 0; (__c < (l)) && ((d)[__c] = (s)[__c]); __c++); \
+ (d)[(l) - 1] = 0; \
+} \
+while (0)
#endif
diff --git a/src/view.c b/src/view.c
index 56676e83b..e4917ba02 100644
--- a/src/view.c
+++ b/src/view.c
@@ -15,6 +15,7 @@
#include "e_view_machine.h"
#include "e_file.h"
#include "globals.h"
+#include <Ebg.h>
static Ecore_Event *current_ev = NULL;
@@ -23,12 +24,12 @@ static int dnd_num_files = 0;
static E_dnd_enum dnd_pending_mode;
static E_View *v_dnd_source;
-static void e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
-static void e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b,
- int _x, int _y);
+static void e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o,
+ void *event_info);
+static void e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o,
+ void *event_info);
+static void e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o,
+ void *event_info);
static void e_idle(void *data);
static void e_wheel(Ecore_Event * ev);
static void e_key_down(Ecore_Event * ev);
@@ -68,7 +69,7 @@ static void
e_view_write_icon_xy_timeout(int val, void *data)
{
E_View *v;
- Evas_List l;
+ Evas_List * l;
E_Icon *ic;
double t_in;
@@ -117,120 +118,106 @@ e_view_selection_update(E_View * v)
if ((v->select.on) && (!v->select.obj.middle))
{
- Evas_Gradient grad;
-
/* create select objects */
- v->select.obj.middle = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.middle,
+ v->select.obj.middle = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.middle,
v->select.config.middle.r,
v->select.config.middle.g,
v->select.config.middle.b, v->select.config.middle.a);
- evas_set_layer(v->evas, v->select.obj.middle, 300);
- v->select.obj.edge_l = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.edge_l,
+ evas_object_layer_set(v->select.obj.middle, 300);
+ v->select.obj.edge_l = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.edge_l,
v->select.config.edge_l.r,
v->select.config.edge_l.g,
v->select.config.edge_l.b, v->select.config.edge_l.a);
- evas_set_layer(v->evas, v->select.obj.edge_l, 300);
- v->select.obj.edge_r = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.edge_r,
+ evas_object_layer_set(v->select.obj.edge_l, 300);
+ v->select.obj.edge_r = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.edge_r,
v->select.config.edge_r.r,
v->select.config.edge_r.g,
v->select.config.edge_r.b, v->select.config.edge_r.a);
- evas_set_layer(v->evas, v->select.obj.edge_r, 300);
- v->select.obj.edge_t = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.edge_t,
+ evas_object_layer_set(v->select.obj.edge_r, 300);
+ v->select.obj.edge_t = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.edge_t,
v->select.config.edge_t.r,
v->select.config.edge_t.g,
v->select.config.edge_t.b, v->select.config.edge_t.a);
- evas_set_layer(v->evas, v->select.obj.edge_t, 300);
- v->select.obj.edge_b = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.edge_b,
+ evas_object_layer_set(v->select.obj.edge_t, 300);
+ v->select.obj.edge_b = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.edge_b,
v->select.config.edge_b.r,
v->select.config.edge_b.g,
v->select.config.edge_b.b, v->select.config.edge_b.a);
- evas_set_layer(v->evas, v->select.obj.edge_b, 300);
+ evas_object_layer_set(v->select.obj.edge_b, 300);
- v->select.obj.grad_l = evas_add_gradient_box(v->evas);
- evas_set_angle(v->evas, v->select.obj.grad_l, 270);
- grad = evas_gradient_new();
- evas_gradient_add_color(grad,
+ v->select.obj.grad_l = evas_object_gradient_add(v->evas);
+ evas_object_gradient_angle_set(v->select.obj.grad_l, 270);
+ evas_object_gradient_color_add(v->select.obj.grad_l,
v->select.config.grad_l.r,
v->select.config.grad_l.g,
v->select.config.grad_l.b,
v->select.config.grad_l.a, 8);
- evas_gradient_add_color(grad,
+ evas_object_gradient_color_add(v->select.obj.grad_l,
v->select.config.grad_l.r,
v->select.config.grad_l.g,
v->select.config.grad_l.b, 0, 8);
- evas_set_gradient(v->evas, v->select.obj.grad_l, grad);
- evas_gradient_free(grad);
- evas_set_layer(v->evas, v->select.obj.grad_l, 300);
- v->select.obj.grad_r = evas_add_gradient_box(v->evas);
- evas_set_angle(v->evas, v->select.obj.grad_r, 90);
- grad = evas_gradient_new();
- evas_gradient_add_color(grad,
+ evas_object_layer_set(v->select.obj.grad_l, 300);
+ v->select.obj.grad_r = evas_object_gradient_add(v->evas);
+ evas_object_gradient_angle_set(v->select.obj.grad_r, 90);
+ evas_object_gradient_color_add(v->select.obj.grad_r,
v->select.config.grad_r.r,
v->select.config.grad_r.g,
v->select.config.grad_r.b,
v->select.config.grad_r.a, 8);
- evas_gradient_add_color(grad,
+ evas_object_gradient_color_add(v->select.obj.grad_r,
v->select.config.grad_r.r,
v->select.config.grad_r.g,
v->select.config.grad_r.b, 0, 8);
- evas_set_gradient(v->evas, v->select.obj.grad_r, grad);
- evas_gradient_free(grad);
- evas_set_layer(v->evas, v->select.obj.grad_r, 300);
- v->select.obj.grad_t = evas_add_gradient_box(v->evas);
- evas_set_angle(v->evas, v->select.obj.grad_t, 0);
- grad = evas_gradient_new();
- evas_gradient_add_color(grad,
+ evas_object_layer_set(v->select.obj.grad_r, 300);
+ v->select.obj.grad_t = evas_object_gradient_add(v->evas);
+ evas_object_gradient_angle_set(v->select.obj.grad_t, 0);
+ evas_object_gradient_color_add(v->select.obj.grad_t,
v->select.config.grad_t.r,
v->select.config.grad_t.g,
v->select.config.grad_t.b,
v->select.config.grad_t.a, 8);
- evas_gradient_add_color(grad,
+ evas_object_gradient_color_add(v->select.obj.grad_t,
v->select.config.grad_t.r,
v->select.config.grad_t.g,
v->select.config.grad_t.b, 0, 8);
- evas_set_gradient(v->evas, v->select.obj.grad_t, grad);
- evas_gradient_free(grad);
- evas_set_layer(v->evas, v->select.obj.grad_t, 300);
- v->select.obj.grad_b = evas_add_gradient_box(v->evas);
- evas_set_angle(v->evas, v->select.obj.grad_b, 180);
- grad = evas_gradient_new();
- evas_gradient_add_color(grad,
+ evas_object_layer_set(v->select.obj.grad_t, 300);
+ v->select.obj.grad_b = evas_object_gradient_add(v->evas);
+ evas_object_gradient_angle_set(v->select.obj.grad_b, 180);
+ evas_object_gradient_color_add(v->select.obj.grad_b,
v->select.config.grad_b.r,
v->select.config.grad_b.g,
v->select.config.grad_b.b,
v->select.config.grad_b.a, 8);
- evas_gradient_add_color(grad,
+ evas_object_gradient_color_add(v->select.obj.grad_b,
v->select.config.grad_b.r,
v->select.config.grad_b.g,
v->select.config.grad_b.b, 0, 8);
- evas_set_gradient(v->evas, v->select.obj.grad_b, grad);
- evas_gradient_free(grad);
- evas_set_layer(v->evas, v->select.obj.grad_b, 300);
- v->select.obj.clip = evas_add_rectangle(v->evas);
- evas_set_color(v->evas, v->select.obj.clip, 255, 255, 255, 255);
- evas_set_clip(v->evas, v->select.obj.grad_l, v->select.obj.clip);
- evas_set_clip(v->evas, v->select.obj.grad_r, v->select.obj.clip);
- evas_set_clip(v->evas, v->select.obj.grad_t, v->select.obj.clip);
- evas_set_clip(v->evas, v->select.obj.grad_b, v->select.obj.clip);
+ evas_object_layer_set(v->select.obj.grad_b, 300);
+ v->select.obj.clip = evas_object_rectangle_add(v->evas);
+ evas_object_color_set(v->select.obj.clip, 255, 255, 255, 255);
+ evas_object_clip_set(v->select.obj.grad_l, v->select.obj.clip);
+ evas_object_clip_set(v->select.obj.grad_r, v->select.obj.clip);
+ evas_object_clip_set(v->select.obj.grad_t, v->select.obj.clip);
+ evas_object_clip_set(v->select.obj.grad_b, v->select.obj.clip);
}
if ((!v->select.on) && (v->select.obj.middle))
{
/* destroy select objects */
- evas_del_object(v->evas, v->select.obj.middle);
- evas_del_object(v->evas, v->select.obj.edge_l);
- evas_del_object(v->evas, v->select.obj.edge_r);
- evas_del_object(v->evas, v->select.obj.edge_t);
- evas_del_object(v->evas, v->select.obj.edge_b);
- evas_del_object(v->evas, v->select.obj.grad_l);
- evas_del_object(v->evas, v->select.obj.grad_r);
- evas_del_object(v->evas, v->select.obj.grad_t);
- evas_del_object(v->evas, v->select.obj.grad_b);
- evas_del_object(v->evas, v->select.obj.clip);
+ evas_object_del(v->select.obj.middle);
+ evas_object_del(v->select.obj.edge_l);
+ evas_object_del(v->select.obj.edge_r);
+ evas_object_del(v->select.obj.edge_t);
+ evas_object_del(v->select.obj.edge_b);
+ evas_object_del(v->select.obj.grad_l);
+ evas_object_del(v->select.obj.grad_r);
+ evas_object_del(v->select.obj.grad_t);
+ evas_object_del(v->select.obj.grad_b);
+ evas_object_del(v->select.obj.clip);
v->select.obj.middle = NULL;
v->changed = 1;
D_RETURN;
@@ -239,52 +226,52 @@ e_view_selection_update(E_View * v)
D_RETURN;
/* move & resize select objects */
{
- evas_move(v->evas, v->select.obj.edge_l, v->select.x, v->select.y + 1);
- evas_resize(v->evas, v->select.obj.edge_l, 1, v->select.h - 1);
- evas_move(v->evas, v->select.obj.edge_r, v->select.x + v->select.w - 1,
+ evas_object_move(v->select.obj.edge_l, v->select.x, v->select.y + 1);
+ evas_object_resize(v->select.obj.edge_l, 1, v->select.h - 1);
+ evas_object_move(v->select.obj.edge_r, v->select.x + v->select.w - 1,
v->select.y);
- evas_resize(v->evas, v->select.obj.edge_r, 1, v->select.h - 1);
- evas_move(v->evas, v->select.obj.edge_t, v->select.x, v->select.y);
- evas_resize(v->evas, v->select.obj.edge_t, v->select.w - 1, 1);
- evas_move(v->evas, v->select.obj.edge_b, v->select.x + 1,
+ evas_object_resize(v->select.obj.edge_r, 1, v->select.h - 1);
+ evas_object_move(v->select.obj.edge_t, v->select.x, v->select.y);
+ evas_object_resize(v->select.obj.edge_t, v->select.w - 1, 1);
+ evas_object_move(v->select.obj.edge_b, v->select.x + 1,
v->select.y + v->select.h - 1);
- evas_resize(v->evas, v->select.obj.edge_b, v->select.w - 1, 1);
- evas_move(v->evas, v->select.obj.middle, v->select.x + 1,
+ evas_object_resize(v->select.obj.edge_b, v->select.w - 1, 1);
+ evas_object_move(v->select.obj.middle, v->select.x + 1,
v->select.y + 1);
- evas_resize(v->evas, v->select.obj.middle, v->select.w - 1 - 1,
+ evas_object_resize(v->select.obj.middle, v->select.w - 1 - 1,
v->select.h - 1 - 1);
- evas_move(v->evas, v->select.obj.grad_l, v->select.x + 1,
+ evas_object_move(v->select.obj.grad_l, v->select.x + 1,
v->select.y + 1);
- evas_resize(v->evas, v->select.obj.grad_l, v->select.config.grad_size.l,
+ evas_object_resize(v->select.obj.grad_l, v->select.config.grad_size.l,
v->select.h - 1 - 1);
- evas_move(v->evas, v->select.obj.grad_r,
+ evas_object_move(v->select.obj.grad_r,
v->select.x + v->select.w - 1 - v->select.config.grad_size.r,
v->select.y + 1);
- evas_resize(v->evas, v->select.obj.grad_r, v->select.config.grad_size.r,
+ evas_object_resize(v->select.obj.grad_r, v->select.config.grad_size.r,
v->select.h - 1 - 1);
- evas_move(v->evas, v->select.obj.grad_t, v->select.x + 1,
+ evas_object_move(v->select.obj.grad_t, v->select.x + 1,
v->select.y + 1);
- evas_resize(v->evas, v->select.obj.grad_t, v->select.w - 1 - 1,
+ evas_object_resize(v->select.obj.grad_t, v->select.w - 1 - 1,
v->select.config.grad_size.t);
- evas_move(v->evas, v->select.obj.grad_b, v->select.x + 1,
+ evas_object_move(v->select.obj.grad_b, v->select.x + 1,
v->select.y + v->select.h - 1 - v->select.config.grad_size.b);
- evas_resize(v->evas, v->select.obj.grad_b, v->select.w - 1 - 1,
+ evas_object_resize(v->select.obj.grad_b, v->select.w - 1 - 1,
v->select.config.grad_size.b);
- evas_move(v->evas, v->select.obj.clip, v->select.x + 1, v->select.y + 1);
- evas_resize(v->evas, v->select.obj.clip, v->select.w - 1 - 1,
+ evas_object_move(v->select.obj.clip, v->select.x + 1, v->select.y + 1);
+ evas_object_resize(v->select.obj.clip, v->select.w - 1 - 1,
v->select.h - 1 - 1);
}
- evas_show(v->evas, v->select.obj.middle);
- evas_show(v->evas, v->select.obj.edge_l);
- evas_show(v->evas, v->select.obj.edge_r);
- evas_show(v->evas, v->select.obj.edge_t);
- evas_show(v->evas, v->select.obj.edge_b);
- evas_show(v->evas, v->select.obj.grad_l);
- evas_show(v->evas, v->select.obj.grad_r);
- 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);
+ evas_object_show(v->select.obj.middle);
+ evas_object_show(v->select.obj.edge_l);
+ evas_object_show(v->select.obj.edge_r);
+ evas_object_show(v->select.obj.edge_t);
+ evas_object_show(v->select.obj.edge_b);
+ evas_object_show(v->select.obj.grad_l);
+ evas_object_show(v->select.obj.grad_r);
+ evas_object_show(v->select.obj.grad_t);
+ evas_object_show(v->select.obj.grad_b);
+ evas_object_show(v->select.obj.clip);
v->changed = 1;
D_RETURN;
}
@@ -318,10 +305,11 @@ e_view_scrollbar_h_change_cb(void *_data, E_Scrollbar * sb, double val)
}
static void
-e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_bg_down_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
Ecore_Event_Mouse_Down *ev;
E_View *v;
+ Evas_Event_Mouse_Down *ev_info = event_info;
D_ENTER;
@@ -336,35 +324,35 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
e_view_deselect_all(v);
}
- if (_b == 1)
+ if (ev_info->button == 1)
{
- v->select.down.x = _x;
- v->select.down.y = _y;
+ v->select.down.x = ev_info->output.x;
+ v->select.down.y = ev_info->output.y;
v->select.on = 1;
- if (_x < v->select.down.x)
+ if (ev_info->output.x < v->select.down.x)
{
- v->select.x = _x;
+ v->select.x = ev_info->output.x;
v->select.w = v->select.down.x - v->select.x + 1;
}
else
{
v->select.x = v->select.down.x;
- v->select.w = _x - v->select.down.x + 1;
+ v->select.w = ev_info->output.x - v->select.down.x + 1;
}
- if (_y < v->select.down.y)
+ if (ev_info->output.y < v->select.down.y)
{
- v->select.y = _y;
+ v->select.y = ev_info->output.y;
v->select.h = v->select.down.y - v->select.y + 1;
}
else
{
v->select.y = v->select.down.y;
- v->select.h = _y - v->select.down.y + 1;
+ v->select.h = ev_info->output.y - v->select.down.y + 1;
}
e_view_selection_update(v);
}
- if (_b == 2 && ev->double_click)
+ if (ev_info->button == 2 && ev->double_click)
ecore_event_loop_quit();
D_RETURN;
@@ -373,11 +361,12 @@ e_bg_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
static void
-e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_bg_up_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
Ecore_Event_Mouse_Up *ev;
E_View *v;
int dx, dy;
+ Evas_Event_Mouse_Up *ev_info = event_info;
D_ENTER;
@@ -390,20 +379,20 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
if (v->select.on)
{
- dx = v->select.down.x - _x;
- dy = v->select.down.y - _y;
+ dx = v->select.down.x - ev_info->output.x;
+ dy = v->select.down.y - ev_info->output.y;
if (dx < 0)
dx = -dx;
if (dy < 0)
dy = -dy;
- if (_b == 1)
+ if (ev_info->button == 1)
v->select.on = 0;
e_view_selection_update(v);
}
- if ((_b == 1) && ((dx > 3) || (dy > 3)))
+ if ((ev_info->button == 1) && ((dx > 3) || (dy > 3)))
{
- Evas_List l;
+ Evas_List * l;
for (l = v->icons; l; l = l->next)
{
@@ -423,7 +412,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
else if (v->select.last_count == 0)
{
- if (_b == 1)
+ if (ev_info->button == 1)
{
if (!(ev->mods & (multi_select_mod | range_select_mod)))
{
@@ -450,7 +439,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
}
}
- else if (_b == 2)
+ else if (ev_info->button == 2)
{
#if 1
static E_Build_Menu *buildmenu = NULL;
@@ -479,7 +468,7 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
#endif
}
- else if (_b == 3)
+ else if (ev_info->button == 3)
{
static E_Build_Menu *buildmenu = NULL;
@@ -498,10 +487,10 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
}
}
- if (_b == 1)
+ if (ev_info->button == 1)
{
- v->select.x = _x;
- v->select.y = _y;
+ v->select.x = ev_info->output.x;
+ v->select.y = ev_info->output.y;
}
D_RETURN;
@@ -510,10 +499,11 @@ e_bg_up_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
}
static void
-e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
+e_bg_move_cb(void *_data, Evas * _e, Evas_Object * _o, void *event_info)
{
Ecore_Event_Mouse_Down *ev;
E_View *v;
+ Evas_Event_Mouse_Move *ev_info = event_info;
D_ENTER;
@@ -523,25 +513,25 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
v = _data;
if (v->select.on)
{
- if (_x < v->select.down.x)
+ if (ev_info->cur.output.x < v->select.down.x)
{
- v->select.x = _x;
+ v->select.x = ev_info->cur.output.x;
v->select.w = v->select.down.x - v->select.x + 1;
}
else
{
v->select.x = v->select.down.x;
- v->select.w = _x - v->select.down.x + 1;
+ v->select.w = ev_info->cur.output.x - v->select.down.x + 1;
}
- if (_y < v->select.down.y)
+ if (ev_info->cur.output.y < v->select.down.y)
{
- v->select.y = _y;
+ v->select.y = ev_info->cur.output.y;
v->select.h = v->select.down.y - v->select.y + 1;
}
else
{
v->select.y = v->select.down.y;
- v->select.h = _y - v->select.down.y + 1;
+ v->select.h = ev_info->cur.output.y - v->select.down.y + 1;
}
e_view_selection_update(v);
@@ -550,13 +540,12 @@ e_bg_move_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
}
void
e_view_deselect_all(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -574,7 +563,7 @@ e_view_deselect_all(E_View * v)
void
e_view_deselect_all_except(E_Icon * not_ic)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -594,7 +583,7 @@ void
e_view_icons_get_extents(E_View * v, int *min_x, int *min_y, int *max_x,
int *max_y)
{
- Evas_List l;
+ Evas_List * l;
int x1, x2, y1, y2;
D_ENTER;
@@ -660,7 +649,7 @@ e_view_icons_get_extents(E_View * v, int *min_x, int *min_y, int *max_x,
void
e_view_icons_apply_xy(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -824,7 +813,7 @@ e_view_get_position_percentage(E_View * v, double *vx, double *vy)
static void
e_idle(void *data)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -943,20 +932,22 @@ e_configure(Ecore_Event * ev)
ecore_window_resize(v->win.main, v->size.w, v->size.h);
if (v->options.back_pixmap)
{
+ Evas_Engine_Info_Software_X11 *info;
+
v->pmap =
ecore_pixmap_new(v->win.main, v->size.w, v->size.h,
0);
- evas_set_output(v->evas, ecore_display_get(), v->pmap,
- evas_get_visual(v->evas),
- evas_get_colormap(v->evas));
+ info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
+ info->info.drawable = v->pmap;
+ evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
ecore_window_set_background_pixmap(v->win.main, v->pmap);
ecore_window_clear(v->win.main);
}
if (v->bg)
e_bg_resize(v->bg, v->size.w, v->size.h);
D("evas_set_output_viewpor(%p)\n", v->evas);
- evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h);
- evas_set_output_size(v->evas, v->size.w, v->size.h);
+ evas_output_viewport_set(v->evas, 0, 0, v->size.w, v->size.h);
+ evas_output_size_set(v->evas, v->size.w, v->size.h);
e_view_scroll_to(v, v->scroll.x, v->scroll.y);
e_view_arrange(v);
e_view_layout_update(v->layout);
@@ -1238,12 +1229,10 @@ e_mouse_down(Ecore_Event * ev)
{
int focus_mode;
- E_CFG_INT(cfg_focus_mode, "settings", "/focus/mode", 0);
-
- E_CONFIG_INT_GET(cfg_focus_mode, focus_mode);
+ focus_mode = config_data->window->focus_mode;
if (focus_mode == 2)
ecore_focus_to_window(v->win.base);
- evas_event_button_down(v->evas, e->x, e->y, e->button);
+ evas_event_feed_mouse_down(v->evas, e->button);
current_ev = NULL;
D_RETURN;
}
@@ -1267,7 +1256,7 @@ e_mouse_up(Ecore_Event * ev)
{
if ((v = e_view_machine_get_view_by_main_window(e->win)))
{
- evas_event_button_up(v->evas, e->x, e->y, e->button);
+ evas_event_feed_mouse_up(v->evas, e->button);
current_ev = NULL;
D_RETURN;
}
@@ -1291,7 +1280,7 @@ e_mouse_move(Ecore_Event * ev)
{
if ((v = e_view_machine_get_view_by_main_window(e->win)))
{
- evas_event_move(v->evas, e->x, e->y);
+ evas_event_feed_mouse_move(v->evas, e->x, e->y);
current_ev = NULL;
D_RETURN;
}
@@ -1317,7 +1306,7 @@ e_mouse_in(Ecore_Event * ev)
{
if (v->is_desktop)
{
- evas_event_enter(v->evas);
+ evas_event_feed_mouse_in(v->evas);
}
current_ev = NULL;
D_RETURN;
@@ -1342,7 +1331,7 @@ e_mouse_out(Ecore_Event * ev)
{
if ((v = e_view_machine_get_view_by_main_window(e->win)))
{
- evas_event_leave(v->evas);
+ evas_event_feed_mouse_out(v->evas);
current_ev = NULL;
D_RETURN;
}
@@ -1367,7 +1356,7 @@ e_window_expose(Ecore_Event * ev)
if ((v = e_view_machine_get_view_by_main_window(e->win)))
{
if (!(v->pmap))
- evas_update_rect(v->evas, e->x, e->y, e->w, e->h);
+ evas_damage_rectangle_add(v->evas, e->x, e->y, e->w, e->h);
v->changed = 1;
D_RETURN;
}
@@ -1412,7 +1401,7 @@ e_view_restart_alphabetical_qsort_cb(const void *data1, const void *data2)
void
e_view_resort_alphabetical(E_View * v)
{
- Evas_List icons = NULL, l;
+ Evas_List *icons = NULL, *l;
E_Icon **array;
int i, count;
@@ -1442,7 +1431,7 @@ e_view_resort_alphabetical(E_View * v)
void
e_view_arrange(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
int x, y;
int x1, x2, y1, y2;
double sv, sr, sm;
@@ -1586,11 +1575,6 @@ e_view_cleanup(E_View * v)
* not via a timeout, because we will destroy the object after this.*/
e_view_geometry_record(v);
- if (v->iconbar)
- {
- /*e_iconbar_save_out_final(v->iconbar); */
- e_object_unref(E_OBJECT(v->iconbar));
- }
if (v->bg)
e_bg_free(v->bg);
if (v->scrollbar.h)
@@ -1637,7 +1621,8 @@ e_view_file_event_handler(E_Observer *obs, E_Observee *o, E_Event_Type event, vo
else if (event & E_EVENT_BG_CHANGED)
{
snprintf(buf, PATH_MAX, "background_reload:%s", v->name);
- ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
+ e_view_bg_reload(v);
+ //ecore_add_event_timer(buf, 0.5, e_view_bg_reload_timeout, 0, v);
}
else if (event & E_EVENT_ICB_CHANGED)
{
@@ -1678,14 +1663,14 @@ e_view_new(void)
#ifdef SOFT_DESK
/* ONLY alpha software can be "backing stored" */
- v->options.render_method = RENDER_METHOD_ALPHA_SOFTWARE;
- v->options.back_pixmap = 1;
+ /*v->options.render_method = RENDER_METHOD_ALPHA_SOFTWARE;*/
+ v->options.back_pixmap = 0;
#else
#ifdef X_DESK
- v->options.render_method = RENDER_METHOD_BASIC_HARDWARE;
+ /*v->options.render_method = RENDER_METHOD_BASIC_HARDWARE;*/
v->options.back_pixmap = 0;
#else
- v->options.render_method = RENDER_METHOD_3D_HARDWARE;
+ /*v->options.render_method = RENDER_METHOD_3D_HARDWARE;*/
v->options.back_pixmap = 0;
#endif
#endif
@@ -1817,9 +1802,6 @@ e_view_set_dir(E_View * v, char *path)
void
e_view_realize(E_View * v)
{
- int max_colors = 216;
- int font_cache = 1024 * 1024;
- int image_cache = 8192 * 1024;
char *font_dir;
D_ENTER;
@@ -1830,14 +1812,14 @@ e_view_realize(E_View * v)
v->size.w, v->size.h);
ecore_window_set_delete_inform(v->win.base);
font_dir = e_config_get("fonts");
- v->evas = evas_new_all(ecore_display_get(),
+
+ v->evas = e_evas_new_all(ecore_display_get(),
v->win.base,
0, 0, v->size.w, v->size.h,
- v->options.render_method,
- max_colors, font_cache, image_cache, font_dir);
- v->win.main = evas_get_window(v->evas);
+ font_dir);
+ v->win.main = e_evas_get_window(v->evas);
e_cursors_display_in_window(v->win.main, "View");
- evas_event_move(v->evas, -999999, -999999);
+ evas_event_feed_mouse_move(v->evas, -999999, -999999);
ecore_window_set_events(v->win.base,
XEV_VISIBILITY | XEV_CONFIGURE |
XEV_PROPERTY | XEV_FOCUS);
@@ -1846,10 +1828,14 @@ e_view_realize(E_View * v)
XEV_BUTTON | XEV_IN_OUT | XEV_KEY);
if (v->options.back_pixmap)
{
+ Evas_Engine_Info_Software_X11 *info;
+
v->pmap = ecore_pixmap_new(v->win.main, v->size.w, v->size.h, 0);
- evas_set_output(v->evas, ecore_display_get(), v->pmap,
- evas_get_visual(v->evas), evas_get_colormap(v->evas));
+ info = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(v->evas);
+ info->info.drawable = v->pmap;
+ evas_engine_info_set(v->evas, (Evas_Engine_Info *)info);
ecore_window_set_background_pixmap(v->win.main, v->pmap);
+ ecore_window_clear(v->win.main);
}
v->scrollbar.v = e_scrollbar_new(v);
e_scrollbar_set_change_func(v->scrollbar.v, e_view_scrollbar_v_change_cb, v);
@@ -1880,7 +1866,7 @@ e_view_realize(E_View * v)
void
e_view_populate(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
/* populate with icons for all files in the dir we are monitoring.
* This has to be called _after_ view_realize because
@@ -1900,7 +1886,7 @@ e_view_populate(E_View * v)
void
e_view_update(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -1938,24 +1924,19 @@ e_view_update(E_View * v)
}
if (v->options.back_pixmap)
{
- Imlib_Updates up;
+ Evas_List *up, *fp;
+ Evas_Rectangle *u;
- up = evas_render_updates(v->evas);
+ fp = up = evas_render_updates(v->evas);
/* special code to handle if we are double buffering to a pixmap */
/* and clear sections of the window if they got updated */
- if (up)
+ while (up)
{
- Imlib_Updates u;
-
- for (u = up; u; u = imlib_updates_get_next(u))
- {
- int x, y, w, h;
-
- imlib_updates_get_coordinates(u, &x, &y, &w, &h);
- ecore_window_clear_area(v->win.main, x, y, w, h);
- }
- imlib_updates_free(up);
+ u = up->data;
+ ecore_window_clear_area(v->win.main, u->x, u->y, u->w, u->h);
+ up = evas_list_next(up);
}
+ evas_render_updates_free(fp);
}
else
evas_render(v->evas);
@@ -1980,7 +1961,7 @@ e_view_file_add(E_View * v, E_File * f)
ic->changed = 1;
/* this basically allocates the obj.icon struct. Its image will be
* set later in icon_update_state */
- ic->obj.icon = evas_add_image_from_file(ic->view->evas, NULL);
+ ic->obj.icon = evas_object_image_add(ic->view->evas);
ic->obj.text = e_text_new(ic->view->evas, f->file, "filename");
v->icons = evas_list_append(v->icons, ic);
v->extents.valid = 0;
@@ -2116,9 +2097,9 @@ e_view_bg_reload(E_View * v)
v->bg = NULL;
if (v->evas)
{
- size = evas_get_image_cache(v->evas);
- evas_set_image_cache(v->evas, 0);
- evas_set_image_cache(v->evas, size);
+ size = evas_object_image_cache_get(v->evas);
+ evas_object_image_cache_flush(v->evas);
+ evas_object_image_cache_set(v->evas, size);
}
e_db_flush();
}
@@ -2147,9 +2128,9 @@ e_view_bg_reload(E_View * v)
e_bg_set_layer(v->bg, 100);
e_bg_resize(v->bg, v->size.w, v->size.h);
- e_bg_callback_add(v->bg, CALLBACK_MOUSE_UP, e_bg_up_cb, v);
- e_bg_callback_add(v->bg, CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
- e_bg_callback_add(v->bg, CALLBACK_MOUSE_MOVE, e_bg_move_cb, v);
+ e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_UP, e_bg_up_cb, v);
+ e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_DOWN, e_bg_down_cb, v);
+ e_bg_callback_add(v->bg, EVAS_CALLBACK_MOUSE_MOVE, e_bg_move_cb, v);
e_bg_show(v->bg);
}
@@ -2217,32 +2198,13 @@ e_dnd_data_request(Ecore_Event * ev)
* } Ecore_Event_Dnd_Data_Request;
*/
E_View *v;
- Evas_List ll;
+ Evas_List * ll;
char *data = NULL;
D_ENTER;
/* Me, my null, and an extra for the end '/r/n'... */
e_strdup(data, "");
- /* Need hostname for URL (file://hostname/...) */
-/* nooo nooo noo - never encode host names in url's -
- * file:/path/blah is local only - secondly.. why encode
- * url's with hosts? e17 only handles local files in the
- * fs - so why use url styles at all? NB - in my testing
- * in efm all the other apps didnt use the file:/host/blah
- * url formatting... so i think we want to do what everyone
- * else does here
- */
-
-/* this is o evil it's not funny - gethostbyname? you know
- * your window manager) could get hung here for minutes doing
- * this lookup? bad bad bad.
- *
- * if(gethostname( hostname, PATH_MAX))
- * {
- * strcpy( hostname, "localhost");
- * }
- */
e = ev->event;
if (!(v = e_view_machine_get_view_by_base_window(e->win)))
D_RETURN;
@@ -2258,6 +2220,7 @@ e_dnd_data_request(Ecore_Event * ev)
ic = ll->data;
if (ic->state.selected)
{
+ int size;
char buf[PATH_MAX];
if (first)
@@ -2271,9 +2234,10 @@ e_dnd_data_request(Ecore_Event * ev)
/* FIXME */
snprintf(buf, PATH_MAX, "\r\nfile:%s/%s", v->dir->dir,
ic->file->file);
- REALLOC(data, char, strlen(data) + strlen(buf) + 1);
+ size = strlen(data) + strlen(buf) + 1;
+ REALLOC(data, char, size);
- strcat(data, buf);
+ strncat(data, buf, size);
}
}
ecore_dnd_send_data(e->source_win, e->win,
@@ -2291,6 +2255,7 @@ e_dnd_data_request(Ecore_Event * ev)
ic = ll->data;
if (ic->state.selected)
{
+ int size;
char buf[PATH_MAX];
if (first)
@@ -2304,9 +2269,10 @@ e_dnd_data_request(Ecore_Event * ev)
/*FIXME */
snprintf(buf, PATH_MAX, "\n%s/%s", v->dir->dir,
ic->file->file);
- REALLOC(data, char, strlen(data) + strlen(buf) + 1);
+ size = strlen(data) + strlen(buf) + 1;
+ REALLOC(data, char, size);
- strcat(data, buf);
+ strncat(data, buf, size);
}
}
ecore_dnd_send_data(e->source_win, e->win,
diff --git a/src/view.h b/src/view.h
index bc646c42e..60777953b 100644
--- a/src/view.h
+++ b/src/view.h
@@ -13,6 +13,8 @@
#include "view_layout.h"
#include "observer.h"
+/*typedef int EVAS_RENDER_METHOD;*/
+
#ifndef E_VIEW_TYPEDEF
#define E_VIEW_TYPEDEF
typedef struct _E_View E_View;
@@ -74,12 +76,12 @@ struct _E_View
struct
{
- Evas_Render_Method render_method;
+ /* Evas_Render_Method render_method;*/
int back_pixmap;
}
options;
- Evas evas;
+ Evas * evas;
struct
{
Window base;
@@ -163,16 +165,16 @@ struct _E_View
config;
struct
{
- Evas_Object clip;
- Evas_Object edge_l;
- Evas_Object edge_r;
- Evas_Object edge_t;
- Evas_Object edge_b;
- Evas_Object middle;
- Evas_Object grad_l;
- Evas_Object grad_r;
- Evas_Object grad_t;
- Evas_Object grad_b;
+ Evas_Object * clip;
+ Evas_Object * edge_l;
+ Evas_Object * edge_r;
+ Evas_Object * edge_t;
+ Evas_Object * edge_b;
+ Evas_Object * middle;
+ Evas_Object * grad_l;
+ Evas_Object * grad_r;
+ Evas_Object * grad_t;
+ Evas_Object * grad_b;
}
obj;
}
@@ -226,13 +228,13 @@ struct _E_View
E_Iconbar *iconbar;
- Evas_List icons;
+ Evas_List * icons;
int have_resort_queued;
int changed;
- Evas_List epplet_contexts;
+ Evas_List * epplet_contexts;
Ebits_Object epplet_layout;
E_View_Look *look;
diff --git a/src/view_layout.c b/src/view_layout.c
index c0a1ccca7..7886c8d66 100644
--- a/src/view_layout.c
+++ b/src/view_layout.c
@@ -1,12 +1,12 @@
#include "e.h"
-#include "view_layout.h"
+#include "desktops.h"
#include "util.h"
static void e_view_layout_cleanup(E_View_Layout *layout);
static int e_view_layout_add_element(E_View_Layout *layout, char *name);
E_View_Layout *
-e_view_layout_new(E_View *v)
+e_view_layout_new(E_Desktop *d)
{
E_View_Layout *layout;
@@ -17,7 +17,7 @@ e_view_layout_new(E_View *v)
e_object_init(E_OBJECT(layout), (E_Cleanup_Func) e_view_layout_cleanup);
- layout->view = v;
+ layout->desktop = d;
D_RETURN_(layout);
}
@@ -25,7 +25,7 @@ e_view_layout_new(E_View *v)
static void
e_view_layout_cleanup(E_View_Layout *layout)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -54,22 +54,19 @@ void
e_view_layout_realize(E_View_Layout *layout)
{
Ebits_Object bits;
- Evas_List l;
+ Evas_List * l;
if (!layout) D_RETURN;
D_ENTER;
- if (layout->view->look->obj->layout)
- bits = ebits_load(layout->view->look->obj->layout);
+ if (layout->desktop->look->obj->layout)
+ bits = ebits_load(layout->desktop->look->obj->layout);
else
{
/* Our look doesnt provide a layout, falls back */
char buf[PATH_MAX];
- if(layout->view->is_desktop)
- snprintf(buf, PATH_MAX, "%sdesktop.bits.db", e_config_get("layout"));
- else
- snprintf(buf, PATH_MAX, "%sview.bits.db", e_config_get("layout"));
+ snprintf(buf, PATH_MAX, "%sdesktop.bits.db", e_config_get("layout"));
bits = ebits_load(buf);
}
@@ -78,12 +75,14 @@ e_view_layout_realize(E_View_Layout *layout)
D("layout bits loaded!\n")
layout->bits = bits;
layout->mod_time = ecore_get_time();
- if (layout->view->evas)
+ if (layout->desktop->evas)
{
- ebits_add_to_evas(layout->bits, layout->view->evas);
+ ebits_add_to_evas(layout->bits, layout->desktop->evas);
ebits_move(layout->bits, 0, 0);
- ebits_resize(layout->bits, layout->view->size.w, layout->view->size.h);
- D("add layout- w:%i, h:%i\n", layout->view->size.w, layout->view->size.h);
+ ebits_resize(layout->bits, layout->desktop->real.w,
+ layout->desktop->real.h);
+ D("add layout- w:%i, h:%i\n", layout->desktop->real.w,
+ layout->desktop->real.h);
for (l = ebits_get_bit_names(layout->bits); l; l = l->next)
{
char *name = l->data;
@@ -103,7 +102,7 @@ static int
e_view_layout_add_element(E_View_Layout *layout, char *name)
{
E_View_Layout_Element *el;
- Evas_List l;
+ Evas_List * l;
double x, y, w, h;
D_ENTER;
@@ -141,7 +140,7 @@ e_view_layout_add_element(E_View_Layout *layout, char *name)
int
e_view_layout_delete_element(E_View_Layout *layout, char *name)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
@@ -166,7 +165,7 @@ int
e_view_layout_get_element_geometry(E_View_Layout *layout, char *name,
double *x, double *y, double *w, double *h)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
if (layout && name)
{
@@ -192,7 +191,7 @@ e_view_layout_get_element_geometry(E_View_Layout *layout, char *name,
void
e_view_layout_update(E_View_Layout *layout)
{
- Evas_List l;
+ Evas_List * l;
double x, y, w, h;
D_ENTER;
@@ -200,8 +199,9 @@ e_view_layout_update(E_View_Layout *layout)
D_RETURN;
/* move/resize bits */
ebits_move(layout->bits, 0, 0);
- ebits_resize(layout->bits, layout->view->size.w, layout->view->size.h);
- D("update layout- w:%i, h:%i\n", layout->view->size.w, layout->view->size.h);
+ ebits_resize(layout->bits, layout->desktop->real.w, layout->desktop->real.h);
+ D("update layout- w:%i, h:%i\n", layout->desktop->real.w,
+ layout->desktop->real.h);
/* update elements */
for (l = layout->elements; l; l = l->next)
@@ -221,26 +221,27 @@ e_view_layout_update(E_View_Layout *layout)
if (e_view_layout_get_element_geometry(layout, "Icons",
&x, &y, &w, &h))
{
- layout->view->spacing.window.l = x;
- layout->view->spacing.window.r = layout->view->size.w - (x + w);
- layout->view->spacing.window.t = y;
- layout->view->spacing.window.b = layout->view->size.h - (y + h);
+ /* layout->desktop->spacing.window.l = x;
+ layout->desktop->spacing.window.r = layout->desktop->size.w - (x + w);
+ layout->desktop->spacing.window.t = y;
+ layout->desktop->spacing.window.b = layout->desktop->size.h - (y + h);
+ */
}
if (e_view_layout_get_element_geometry(layout, "Scrollbar_H",
&x, &y, &w, &h))
{
- e_scrollbar_move(layout->view->scrollbar.h, x, y);
- e_scrollbar_resize(layout->view->scrollbar.h, w, h);
+ /* e_scrollbar_move(layout->desktop->scrollbar.h, x, y);
+ e_scrollbar_resize(layout->desktop->scrollbar.h, w, h); */
}
if (e_view_layout_get_element_geometry(layout, "Scrollbar_V",
&x, &y, &w, &h))
{
- e_scrollbar_move(layout->view->scrollbar.v, x, y);
- e_scrollbar_resize(layout->view->scrollbar.v, w, h);
+ /* e_scrollbar_move(layout->desktop->scrollbar.v, x, y);
+ e_scrollbar_resize(layout->desktop->scrollbar.v, w, h); */
}
- if (layout->view->iconbar)
- e_iconbar_fix(layout->view->iconbar);
+ if (layout->desktop->iconbar)
+ e_iconbar_fix(layout->desktop->iconbar);
D_RETURN;
}
diff --git a/src/view_layout.h b/src/view_layout.h
index 72e77e24f..9ddbd4ab7 100644
--- a/src/view_layout.h
+++ b/src/view_layout.h
@@ -2,7 +2,7 @@
#define E_VIEW_LAYOUT_H
#include "e.h"
-#include "view.h"
+#include "e_view_look.h"
#include "object.h"
#ifndef E_VIEW_LAYOUT_TYPEDEF
@@ -16,16 +16,15 @@ typedef struct _E_View_Layout_Element E_View_Layout_Element;
typedef struct _E_View E_View;
#endif
-
struct _E_View_Layout
{
E_Object o;
- E_View *view;
+ E_Desktop *desktop;
Ebits_Object bits;
- Evas_List elements;
+ Evas_List * elements;
time_t mod_time;
};
@@ -36,7 +35,7 @@ struct _E_View_Layout_Element
double x, y, w, h;
};
-E_View_Layout *e_view_layout_new(E_View *v);
+E_View_Layout *e_view_layout_new(E_Desktop *d);
void e_view_layout_realize(E_View_Layout *layout);
void e_view_layout_update(E_View_Layout *layout);
diff --git a/tools/e_setup.c b/tools/e_setup.c
index d4597b2eb..23602d10c 100644
--- a/tools/e_setup.c
+++ b/tools/e_setup.c
@@ -1,4 +1,6 @@
+#include <X11/Xlib.h>
#include <Evas.h>
+#include <Evas_Engine_Software_X11.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
@@ -48,6 +50,17 @@ __dest = malloc(strlen(__var) + 1); \
if (__dest) strcpy(__dest, __var); \
} }
+#define RENDER_METHOD_ALPHA_SOFTWARE 0
+
+Evas *
+e_evas_new_all(Display *disp, Window parent_window,
+ int x, int y, int win_w, int win_h,
+ int render,
+ int max_colors, int fc, int ic,
+ char *font_dir);
+Window
+e_evas_get_window(Evas *evas);
+
/* */
/* */
/* */
@@ -241,12 +254,12 @@ e_file_link(char *link)
return f;
}
-Evas_List
+Evas_List *
e_file_list_dir(char *dir)
{
DIR *dirp;
struct dirent *dp;
- Evas_List list;
+ Evas_List * list;
dirp = opendir(dir);
if (!dirp) return NULL;
@@ -256,7 +269,7 @@ e_file_list_dir(char *dir)
if ((strcmp(dp->d_name, ".")) &&
(strcmp(dp->d_name, "..")))
{
- Evas_List l;
+ Evas_List * l;
char *f;
/* insertion sort */
@@ -279,7 +292,7 @@ e_file_list_dir(char *dir)
}
void
-e_file_list_dir_free(Evas_List list)
+e_file_list_dir_free(Evas_List * list)
{
while (list)
{
@@ -299,7 +312,7 @@ struct _text_zone
{
double x, y;
- Evas_Object clip;
+ Evas_Object * clip;
Ebits_Object *bg;
struct {
@@ -313,13 +326,13 @@ struct _text_zone
double dx, dy;
int go;
} move;
- Evas_List lines;
- Evas_List buttons;
+ Evas_List * lines;
+ Evas_List * buttons;
};
struct _text_zone_button
{
- Evas_Object label;
+ Evas_Object * label;
Ebits_Object *bg;
double x, y, w, h;
@@ -329,9 +342,9 @@ struct _text_zone_button
Window win_main;
Window win_evas;
-Evas evas;
+Evas *evas;
double scr_w, scr_h;
-Evas_Object pointer;
+Evas_Object * pointer;
/* our stuff */
void idle(void *data);
@@ -364,7 +377,7 @@ window_expose(Ecore_Event * ev)
Ecore_Event_Window_Expose *e;
e = (Ecore_Event_Window_Expose *)ev->event;
- evas_update_rect(evas, e->x, e->y, e->w, e->h);
+ evas_damage_rectangle_add(evas, e->x, e->y, e->w, e->h);
}
void
@@ -373,10 +386,10 @@ mouse_move(Ecore_Event * ev)
Ecore_Event_Mouse_Move *e;
e = (Ecore_Event_Mouse_Move *)ev->event;
- evas_move(evas, pointer,
- evas_screen_x_to_world(evas, e->x),
- evas_screen_y_to_world(evas, e->y));
- evas_event_move(evas, e->x, e->y);
+ evas_object_move(pointer,
+ evas_coord_screen_x_to_world(evas, e->x),
+ evas_coord_screen_y_to_world(evas, e->y));
+ evas_event_feed_mouse_move(evas, e->x, e->y);
}
void
@@ -385,7 +398,7 @@ mouse_down(Ecore_Event * ev)
Ecore_Event_Mouse_Down *e;
e = (Ecore_Event_Mouse_Down *)ev->event;
- evas_event_button_down(evas, e->x, e->y, e->button);
+ evas_event_feed_mouse_down(evas, e->button);
}
void
@@ -394,7 +407,7 @@ mouse_up(Ecore_Event * ev)
Ecore_Event_Mouse_Up *e;
e = (Ecore_Event_Mouse_Up *)ev->event;
- evas_event_button_up(evas, e->x, e->y, e->button);
+ evas_event_feed_mouse_up(evas, e->button);
}
void
@@ -438,7 +451,7 @@ setup(void)
ecore_window_get_geometry(0, NULL, NULL, &root_w, &root_h);
win_main = ecore_window_override_new(0, 0, 0, root_w, root_h);
- evas = evas_new_all(ecore_display_get(),
+ evas = e_evas_new_all(ecore_display_get(),
win_main,
0, 0, root_w, root_w,
RENDER_METHOD_ALPHA_SOFTWARE,
@@ -456,12 +469,15 @@ setup(void)
e_bg_resize(bg, root_w, root_h);
e_bg_show(bg);
- pointer = evas_add_image_from_file(evas, PACKAGE_DATA_DIR"/data/setup/pointer.png");
- evas_set_pass_events(evas, pointer, 1);
- evas_set_layer(evas, pointer, 1000000);
- evas_show(evas, pointer);
+ pointer = evas_object_image_add(evas);
+ evas_object_image_file_set(pointer,
+ PACKAGE_DATA_DIR"/data/setup/pointer.png",
+ NULL);
+ evas_object_pass_events_set(pointer, 1);
+ evas_object_layer_set(pointer, 1000000);
+ evas_object_show(pointer);
- win_evas = evas_get_window(evas);
+ win_evas = e_evas_get_window(evas);
ecore_window_set_events(win_evas, XEV_EXPOSE | XEV_BUTTON | XEV_MOUSE_MOVE | XEV_KEY);
ecore_set_blank_pointer(win_evas);
@@ -470,15 +486,18 @@ setup(void)
ecore_keyboard_grab(win_evas);
{
- Evas_Object o;
+ Evas_Object * o;
int w, h;
- o = evas_add_image_from_file(evas, PACKAGE_DATA_DIR"/data/setup/logo.png");
- evas_get_image_size(evas, o, &w, &h);
- evas_move(evas, o, (root_w - w) / 2, -32);
- evas_set_layer(evas, o, 20);
- evas_show(evas, o);
- evas_set_pass_events(evas, o, 1);
+ o = evas_object_image_add(evas);
+ evas_object_image_file_set(o,
+ PACKAGE_DATA_DIR"/data/setup/logo.png",
+ NULL);
+ evas_object_image_size_get(o, &w, &h);
+ evas_object_move(o, (root_w - w) / 2, -32);
+ evas_object_layer_set(o, 20);
+ evas_object_show(o);
+ evas_object_pass_events_set(o, 1);
}
{
Text_Zone *txz;
@@ -503,14 +522,18 @@ setup(void)
}
{
- Evas_Object o;
+ Evas_Object * o;
- o = evas_add_image_from_file(evas, PACKAGE_DATA_DIR"/data/setup/anim/e001.png");
- evas_move(evas, o, root_w - 120, -15);
- evas_set_layer(evas, o, 30);
- evas_show(evas, o);
+ o = evas_object_image_add(evas);
+ evas_object_image_file_set(o,
+ PACKAGE_DATA_DIR"/data/setup/anim/e001.png",
+ NULL);
+
+ evas_object_move(o, root_w - 120, -15);
+ evas_object_layer_set(o, 30);
+ evas_object_show(o);
animate_logo(0, o);
- evas_set_pass_events(evas, o, 1);
+ evas_object_pass_events_set(o, 1);
}
scr_w = root_w;
scr_h = root_h;
@@ -523,13 +546,13 @@ _txz_cb_show(void *data)
txz = (Text_Zone *)data;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
- evas_show(evas, l->data);
+ evas_object_show(l->data);
}
- evas_show(evas, txz->clip);
+ evas_object_show(txz->clip);
}
}
@@ -540,13 +563,13 @@ _txz_cb_hide(void *data)
txz = (Text_Zone *)data;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
- evas_hide(evas, l->data);
+ evas_object_hide(l->data);
}
- evas_hide(evas, txz->clip);
+ evas_object_hide(txz->clip);
}
}
@@ -577,11 +600,11 @@ _txz_cb_raise(void *data)
txz = (Text_Zone *)data;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
- evas_raise(evas, l->data);
+ evas_object_raise(l->data);
}
}
}
@@ -593,11 +616,11 @@ _txz_cb_lower(void *data)
txz = (Text_Zone *)data;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
- evas_lower(evas, l->data);
+ evas_object_lower(l->data);
}
}
}
@@ -609,11 +632,11 @@ _txz_cb_set_layer(void *data, int lay)
txz = (Text_Zone *)data;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
- evas_set_layer(evas, l->data, lay);
+ evas_object_layer_set(l->data, lay);
}
}
}
@@ -627,13 +650,13 @@ _txz_cb_get_min_size(void *data, double *minw, double *minh)
*minw = 0;
*minh = 0;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
double w, h;
- evas_get_geometry(evas, l->data, NULL, NULL, &w, &h);
+ evas_object_geometry_get(l->data, NULL, NULL, &w, &h);
if (w > *minw) *minw = w;
*minh += h;
}
@@ -651,13 +674,13 @@ _txz_cb_get_max_size(void *data, double *maxw, double *maxh)
*maxw = 0;
*maxh = 0;
{
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
{
double w, h;
- evas_get_geometry(evas, l->data, NULL, NULL, &w, &h);
+ evas_object_geometry_get(l->data, NULL, NULL, &w, &h);
if (w > *maxw) *maxw = w;
*maxh += h;
}
@@ -735,8 +758,8 @@ txz_new(double x, double y, char *text)
txz->x = 0;
txz->y = 0;
- txz->clip = evas_add_rectangle(evas);
- evas_set_color(evas, txz->clip, 255, 255, 255, 255);
+ txz->clip = evas_object_rectangle_add(evas);
+ evas_object_color_set(txz->clip, 255, 255, 255, 255);
txz->bg = ebits_load(PACKAGE_DATA_DIR"/data/setup/textzone.bits.db");
if (txz->bg)
{
@@ -769,15 +792,15 @@ txz_new(double x, double y, char *text)
NULL,
txz);
ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- CALLBACK_MOUSE_DOWN,
+ EVAS_CALLBACK_MOUSE_DOWN,
_txz_cb_title_down,
txz);
ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- CALLBACK_MOUSE_UP,
+ EVAS_CALLBACK_MOUSE_UP,
_txz_cb_title_up,
txz);
ebits_set_classed_bit_callback(txz->bg, "Title_Bar",
- CALLBACK_MOUSE_MOVE,
+ EVAS_CALLBACK_MOUSE_MOVE,
_txz_cb_title_move,
txz);
}
@@ -791,13 +814,13 @@ txz_new(double x, double y, char *text)
void
txz_free(Text_Zone *txz)
{
- Evas_List l;
+ Evas_List * l;
if (txz->bg)
ebits_free(txz->bg);
- evas_del_object(evas, txz->clip);
+ evas_object_del(txz->clip);
for (l = txz->lines; l; l = l->next)
- evas_del_object(evas, (Evas_Object)l->data);
+ evas_object_del((Evas_Object *)l->data);
if (txz->lines) evas_list_free(txz->lines);
FREE(txz);
}
@@ -805,19 +828,19 @@ txz_free(Text_Zone *txz)
void
txz_show(Text_Zone *txz)
{
- Evas_List l;
+ Evas_List * l;
if (txz->bg)
ebits_show(txz->bg);
for (l = txz->lines; l; l = l->next)
- evas_show(evas, (Evas_Object)l->data);
+ evas_object_show((Evas_Object *)l->data);
for (l = txz->buttons; l; l = l->next)
{
Text_Zone_Button *tb;
tb = l->data;
if (tb->bg) ebits_show(tb->bg);
- evas_show(evas, tb->label);
+ evas_object_show(tb->label);
}
txz_adjust_txt(txz);
}
@@ -825,19 +848,19 @@ txz_show(Text_Zone *txz)
void
txz_hide(Text_Zone *txz)
{
- Evas_List l;
+ Evas_List * l;
if (txz->bg)
ebits_hide(txz->bg);
for (l = txz->lines; l; l = l->next)
- evas_hide(evas, (Evas_Object)l->data);
+ evas_object_hide((Evas_Object *)l->data);
for (l = txz->buttons; l; l = l->next)
{
Text_Zone_Button *tb;
tb = l->data;
if (tb->bg) ebits_hide(tb->bg);
- evas_hide(evas, tb->label);
+ evas_object_hide(tb->label);
}
txz_adjust_txt(txz);
}
@@ -845,7 +868,7 @@ txz_hide(Text_Zone *txz)
void
txz_move(Text_Zone *txz, double x, double y)
{
- Evas_List l;
+ Evas_List * l;
txz->x = x;
txz->y = y;
@@ -861,10 +884,10 @@ txz_text(Text_Zone *txz, char *text)
{
char *p, *tok;
double ypos;
- Evas_List l;
+ Evas_List * l;
for (l = txz->lines; l; l = l->next)
- evas_del_object(evas, (Evas_Object)l->data);
+ evas_object_del((Evas_Object *)l->data);
if (txz->lines) evas_list_free(txz->lines);
txz->lines = NULL;
@@ -875,7 +898,7 @@ txz_text(Text_Zone *txz, char *text)
char line[4096], size[2], align[2], *str;
int sz;
double tw, th, hadv, vadv;
- Evas_Object o;
+ Evas_Object * o;
strncpy(line, p, (tok - p));
line[tok - p] = 0;
@@ -887,21 +910,23 @@ txz_text(Text_Zone *txz, char *text)
sz = atoi(size);
sz = 4 + (sz * 2);
- o = evas_add_text(evas, "nationff", sz, str);
- evas_set_layer(evas, o, 9);
- evas_set_color(evas, o, 0, 0, 0, 255);
+ o = evas_object_text_add(evas);
+ evas_object_text_font_set(o, "nationff", sz);
+ evas_object_text_text_set(o, str);
+ evas_object_layer_set(o, 9);
+ evas_object_color_set(o, 0, 0, 0, 255);
txz->lines = evas_list_append(txz->lines, o);
- tw = evas_get_text_width(evas, o);
- th = evas_get_text_height(evas, o);
- evas_text_get_advance(evas, o, &hadv, &vadv);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
+ hadv = evas_object_text_horiz_advance_get(o);
+ vadv = evas_object_text_vert_advance_get(o);
if (align[0] == 'l')
- evas_move(evas, o, txz->x, ypos);
+ evas_object_move(o, txz->x, ypos);
else if (align[0] == 'r')
- evas_move(evas, o, txz->x + 512 - tw, ypos);
+ evas_object_move(o, txz->x + 512 - tw, ypos);
else
- evas_move(evas, o, txz->x + ((512 - tw) / 2), ypos);
- evas_set_clip(evas, o, txz->clip);
- evas_put_data(evas, o, "align", (void *)((int)align[0]));
+ evas_object_move(o, txz->x + ((512 - tw) / 2), ypos);
+ evas_object_clip_set(o, txz->clip);
+ evas_object_data_set(o, "align", (void *)((int)align[0]));
ypos += th;
p = tok + 1;
@@ -927,10 +952,12 @@ txz_button(Text_Zone *txz, char *text, void (*func) (void *data), void *data)
ZERO(tb, Text_Zone_Button, 1);
txz->buttons = evas_list_append(txz->buttons, tb);
- tb->label = evas_add_text(evas, "nationff", 12, text);
- evas_set_pass_events(evas, tb->label, 1);
- evas_set_color(evas, tb->label, 0, 0, 0, 255);
- evas_set_layer(evas, tb->label, 12);
+ tb->label = evas_object_text_add(evas);
+ evas_object_text_font_set(tb->label,"nationff", 12);
+ evas_object_text_text_set(tb->label, text);
+ evas_object_pass_events_set(tb->label, 1);
+ evas_object_color_set(tb->label, 0, 0, 0, 255);
+ evas_object_layer_set(tb->label, 12);
tb->bg = ebits_load(PACKAGE_DATA_DIR"/data/setup/textzone_button.bits.db");
if (tb->bg)
ebits_add_to_evas(tb->bg, evas);
@@ -940,28 +967,27 @@ txz_button(Text_Zone *txz, char *text, void (*func) (void *data), void *data)
void
txz_adjust_txt(Text_Zone *txz)
{
- Evas_List l;
+ Evas_List * l;
double ypos;
double xpos;
ypos = txz->l.y + 4;
- evas_move(evas, txz->clip, txz->l.x, txz->l.y);
- evas_resize(evas, txz->clip, txz->l.w, txz->l.h);
+ evas_object_move(txz->clip, txz->l.x, txz->l.y);
+ evas_object_resize(txz->clip, txz->l.w, txz->l.h);
for (l = txz->lines; l; l = l->next)
{
- Evas_Object o;
+ Evas_Object * o;
double tw, th;
double x;
char align;
o = l->data;
- align = (char)((int)evas_get_data(evas, o, "align"));
+ align = (char)((int)evas_object_data_get(o, "align"));
x = txz->l.x + 4;
- tw = evas_get_text_width(evas, o);
- th = evas_get_text_height(evas, o);
+ evas_object_geometry_get(o, NULL, NULL, &tw, &th);
if (align == 'c') x = txz->l.x + 4 + ((txz->l.w - 8 - tw) / 2);
else if (align == 'r') x = txz->l.x + 4 + (txz->l.w - 8 - tw);
- evas_move(evas, o, x, ypos);
+ evas_object_move(o, x, ypos);
ypos += th;
}
xpos = 0;
@@ -971,8 +997,7 @@ txz_adjust_txt(Text_Zone *txz)
double tw, th;
tb = l->data;
- tw = evas_get_text_width(evas, tb->label);
- th = evas_get_text_height(evas, tb->label);
+ evas_object_geometry_get(tb->label, NULL, NULL, &tw, &th);
if (tb->bg)
{
int pl, pr, pt, pb;
@@ -983,8 +1008,8 @@ txz_adjust_txt(Text_Zone *txz)
ebits_show(tb->bg);
ebits_resize(tb->bg, tw + pl + pr, txz->b.h);
ebits_move(tb->bg, txz->b.x + xpos, txz->b.y);
- evas_move(evas, tb->label, txz->b.x + pl + xpos, txz->b.y + pt + ((txz->b.h - pt - pb - th) / 2));
- evas_show(evas, tb->label);
+ evas_object_move(tb->label, txz->b.x + pl + xpos, txz->b.y + pt + ((txz->b.h - pt - pb - th) / 2));
+ evas_object_show(tb->label);
xpos += tw + pl + pr;
}
}
@@ -993,13 +1018,13 @@ txz_adjust_txt(Text_Zone *txz)
void
animate_logo(int v, void *data)
{
- Evas_Object o;
+ Evas_Object * o;
double t;
static double start_t;
char buf[4096];
int frame;
- o = (Evas_Object)data;
+ o = (Evas_Object *)data;
if (v == 0) start_t = ecore_get_time();
t = ecore_get_time() - start_t;
frame = (int)(t * 25);
@@ -1008,10 +1033,78 @@ animate_logo(int v, void *data)
if (frame < 10) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e00%i.png", frame);
else if (frame < 100) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e0%i.png", frame);
else if (frame < 1000) sprintf(buf, PACKAGE_DATA_DIR"/data/setup/anim/e%i.png", frame);
- evas_set_image_file(evas, o, buf);
+ evas_object_image_file_set(o, buf, NULL);
ecore_add_event_timer("animate_logo", 0.01, animate_logo, 1, data);
}
+
+Evas *
+e_evas_new_all(Display *disp, Window parent_window,
+ int x, int y, int win_w, int win_h,
+ int render,
+ int max_colors, int fc, int ic,
+ char *font_dir)
+{
+ Evas *e;
+
+ e = evas_new();
+ evas_output_method_set(e, evas_render_method_lookup("software_x11"));
+ evas_output_size_set(e, win_w, win_h);
+ evas_output_viewport_set(e, 0, 0, win_w, win_h);
+ {
+ Evas_Engine_Info_Software_X11 *einfo;
+ XSetWindowAttributes att;
+ Window window;
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(e);
+
+ /* the following is specific to the engine */
+ einfo->info.display = disp;
+ einfo->info.visual = DefaultVisual(disp, DefaultScreen(disp));
+ einfo->info.colormap = DefaultColormap(disp, DefaultScreen(disp));
+
+ att.background_pixmap = None;
+ att.colormap = /*colormap*/ DefaultColormap(disp, DefaultScreen(disp));
+ att.border_pixel = 0;
+ att.event_mask = 0;
+ window = XCreateWindow(disp,
+ parent_window,
+ x, y, win_w, win_h, 0,
+ DefaultDepth(disp, DefaultScreen(disp)),
+ /*imlib_get_visual_depth(display, visual),*/
+ InputOutput,
+ einfo->info.visual,
+ CWColormap | CWBorderPixel | CWEventMask | CWBackPixmap,
+ &att);
+
+ einfo->info.drawable = window /*win*/;
+ einfo->info.depth = DefaultDepth(disp, DefaultScreen(disp));
+ einfo->info.rotation = 0;
+ einfo->info.debug = 0;
+ evas_engine_info_set(e, (Evas_Engine_Info *) einfo);
+ }
+
+ evas_object_image_cache_set(e, 0);
+ evas_object_font_cache_set(e, 0);
+ evas_object_font_path_append(e, font_dir);
+
+ return e;
+}
+
+Window
+e_evas_get_window(Evas *evas)
+{
+ Window win;
+ Evas_Engine_Info_Software_X11 *einfo;
+
+ einfo = (Evas_Engine_Info_Software_X11 *) evas_engine_info_get(evas);
+
+ /* the following is specific to the engine */
+ win = einfo->info.drawable;
+
+ return win;
+}
+
int
main(int argc, char **argv)
{