## 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 \
+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.... |
+-----------------------------------------------------------------------------+
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
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
src/Makefile
lib/Makefile
client/Makefile
-intl/Makefile
po/Makefile.in
tools/Makefile
doc/Makefile
src/Makefile
lib/Makefile
client/Makefile
-intl/Makefile
po/Makefile.in
tools/Makefile
doc/Makefile
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"
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
* 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.
* 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.
--- /dev/null
+#!/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
+
-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 \
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 \
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)
#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);
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);
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)
D_RETURN;
}
-static void
+void
e_action_cleanup(E_Action * a)
{
D_ENTER;
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;
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;
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;
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;
void
e_action_stop_by_type(char *action)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
{
D_ENTER;
+ IF_FREE(eai->action);
e_object_cleanup(E_OBJECT(eai));
D_RETURN;
void
e_action_del_timer(E_Object * object, char *name)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
void
e_action_del_timer_object(E_Object * object)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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)
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;
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();
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);
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();
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);
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();
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);
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)
{
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)
{
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);
* 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,
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
static void
e_background_cleanup(E_Background * bg)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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);
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));
}
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;
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))
{
void
e_background_set_scroll(E_Background * bg, int sx, int sy)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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);
void
e_background_set_size(E_Background * bg, int w, int h)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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)
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)
{
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;
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);
}
}
}
{
E_Object o;
- Evas evas;
+ Evas * evas;
char *file;
struct
}
geom;
- Evas_List layers;
+ Evas_List * layers;
- Evas_Object base_obj;
+ Evas_Object * base_obj;
};
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,
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)
#include "cursors.h"
#include "border.h"
+#include "bordermenu.h"
#include "config.h"
#include "debug.h"
#include "actions.h"
#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;
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,
{
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);
void
e_border_update_borders(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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();
{
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)
{
{
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;
{
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);
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);
}
}
}
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);
}
}
}
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);
}
}
}
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;
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);
}
}
}
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;
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);
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;
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;
}
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);
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);
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;
}
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);
e_border_reshape(E_Border * b)
{
static Window shape_win = 0;
- static Evas e = NULL;
int pl, pr, pt, pb;
D_ENTER;
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))
}
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);
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;
}
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 */
}
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;
}
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)
{
/* 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;
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");
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);
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;
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))
{
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;
void
e_border_remove_all_mouse_grabs(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
void
e_border_attach_all_mouse_grabs(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
static time_t mod_date_settings = 0;
time_t mod;
int changed = 0;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
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);
}
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;
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");
}
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;
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)
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;
}
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) ||
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,
}
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)
{
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);
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;
}
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;
}
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;
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;
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);
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);
E_Border *
e_border_current_focused(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
for (l = borders; l; l = l->next)
void
e_border_focus_grab_ended(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
{
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)
{
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;
}
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;
+ }
+ }
+}
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;
int shape_changed;
int placed;
- Evas_List grabs;
E_Grab *click_grab;
E_Desktop *desk;
int hold_changes;
- Evas_List menus;
-
int changed;
};
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);
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
#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,
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)
}
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);
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); */
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;
}
{
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);
D_RETURN;
}
+
+void
+e_bordermenu_hide(void)
+{
+ if (bordermenu)
+ e_menu_hide(bordermenu);
+}
#include "e.h"
void e_bordermenu_do(E_Border * b);
+void e_bordermenu_hide(void);
#endif
#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[] = "";
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)
{
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());
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);
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;
{
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
#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
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);
static E_Cursor *
e_cursors_find(char *type)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
--- /dev/null
+#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;
+}
--- /dev/null
+#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
#include "debug.h"
-static int do_print = 0;
+static int do_print = 1;
static int calldepth = 0;
static void debug_whitespace(int calldepth);
#include <string.h>
#include "debug.h"
#include "delayed.h"
+#include "util.h"
static void
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;
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
#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);
#include "debug.h"
-#include "desktops.h"
#include "config.h"
#include "actions.h"
#include "border.h"
#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;
}
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);
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
* <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
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);
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;
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);
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;
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)
{
{
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;
}
{
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;
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);
}
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);
+}
#define E_DESKTOPS_H
#include "e.h"
-#include "view.h"
#include "border.h"
#include "object.h"
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;
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;
};
/**
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);
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
#endif
#include <Imlib2.h>
#include <Evas.h>
+#include <Evas_Engine_Software_X11.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
/* 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
{
#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(); \
}
#define E_PROF_DUMP \
{ \
-Evas_List __pl; \
+Evas_List * __pl; \
for (__pl = __e_profiles; __pl; __pl = __pl->next) \
{ \
E_Prof *__p; \
#include "file.h"
+#include "desktops.h"
#include "e_dir.h"
#include "e_view_machine.h"
#include "view.h"
}
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))
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())
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;
}
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);
static void
e_dir_handle_efsd_event_reply_getmeta(EfsdEvent * ev)
{
- Evas_List l;
+ Evas_List * l;
EfsdCmdId cmd;
D_ENTER;
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;
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;
}
e_dir_find_by_monitor_id(int id)
{
E_Dir *d;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
/* The realpath of the view's directory */
char *dir;
- Evas_List files;
+ Evas_List * files;
/*
* Evas_Object obj_bg;
+++ /dev/null
-/*#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;
-}
+++ /dev/null
-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());
- %}
-}
-
+++ /dev/null
-#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 */
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);
}
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;
*/
/* find an icon */
- strcpy(type, f->info.mime.type);
+ STRNCPY(type, f->info.mime.type, PATH_MAX);
p = type;
do
{
};
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);
-#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"
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
{
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);
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);
void
e_view_machine_close_all_views(void)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
/* Copy the list of views and unregister them */
e_view_machine_dir_lookup(char *path)
{
E_Dir *d;
- Evas_List l;
+ Evas_List * l;
char *realpath = NULL;
D_ENTER;
e_view_machine_look_lookup(char *path)
{
E_View_Look *vl;
- Evas_List l;
+ Evas_List * l;
char *realpath = NULL;
D_ENTER;
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)
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)
}
D_RETURN_(NULL);
}
-
-
#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;
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;
};
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;
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;
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;
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;
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;
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;
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;
/***/
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;
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,
D_ENTER;
em = _data;
- evas_show(em->evas, em->image_obj);
+ evas_object_show(em->image_obj);
D_RETURN;
}
D_ENTER;
em = _data;
- evas_hide(em->evas, em->image_obj);
+ evas_object_hide(em->image_obj);
D_RETURN;
}
D_ENTER;
em = _data;
- evas_move(em->evas, em->image_obj, x, y);
+ evas_object_move(em->image_obj, x, y);
D_RETURN;
}
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;
}
D_ENTER;
em = _data;
- evas_raise(em->evas, em->image_obj);
+ evas_object_raise(em->image_obj);
D_RETURN;
}
D_ENTER;
em = _data;
- evas_lower(em->evas, em->image_obj);
+ evas_object_lower(em->image_obj);
D_RETURN;
}
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;
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;
}
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;
}
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)
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)
/***/
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;
em = emb;
if (em->clip_obj)
- evas_del_object(em->evas, em->clip_obj);
+ evas_object_del(em->clip_obj);
FREE(em);
D_RETURN;
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
#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);
e_clear_selection(Ecore_Event * ev)
{
Ecore_Event_Clear_Selection *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
e_paste_request(Ecore_Event * ev)
{
Ecore_Event_Paste_Request *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
}
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;
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);
}
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;
}
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;
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);
}
D_RETURN;
+ UN(_e);
UN(_o);
UN(_b);
UN(_y);
/* 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;
}
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)
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))
{
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)
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,
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,
}
void
-e_entry_set_evas(E_Entry * entry, Evas evas)
+e_entry_set_evas(E_Entry * entry, Evas * evas)
{
D_ENTER;
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;
}
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;
}
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;
}
{
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);
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);
{
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);
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
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
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
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);
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);
struct _E_Entry
{
- Evas evas;
+ Evas * evas;
char *buffer;
int cursor_pos;
struct
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;
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);
+++ /dev/null
-#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
+++ /dev/null
-#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
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)
void
e_exec_broadcast_e_hack_found(Window win)
{
- Evas_List l;
+ Evas_List * l;
for (l = hack_found_cb; l; l = l->next)
{
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);
D_ENTER;
- strcpy(buf, file);
+ STRNCPY(buf, file, PATH_MAX);
p = strrchr(buf, '/');
if (!p)
{
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;
{
if ((strcmp(dp->d_name, ".")) && (strcmp(dp->d_name, "..")))
{
- Evas_List l;
+ Evas_List * l;
char *f;
/* insertion sort */
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
#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)
#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);
if (efsd_next_event(ec, &ev) >= 0)
{
- Evas_List l;
+ Evas_List * l;
for (l = fs_handlers; l; l = l->next)
{
}
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)
#include "config.h"
#include "embed.h"
#include "util.h"
+#include <Imlib2.h>
static struct
{
win;
struct
{
- Evas evas;
+ Evas * evas;
Ebits_Object bg;
E_Text *text;
- Evas_Object icon;
+ Evas_Object * icon;
Imlib_Image image;
}
disp;
{
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
}
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)
{
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);
+#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 */
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 */
/* 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);
/* 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)
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 */
{
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;
}
* @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 */
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 */
/* 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? */
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);
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)
{
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)
{
* @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 */
{
double ix, iy, aw, ah;
double len;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
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;
/* 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 */
/* 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 */
{
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;
}
/* 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;
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)
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);
}
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; */
}
}
}
/* 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
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);
/* 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;
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)
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) */
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++;
}
/* 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 */
/* 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)
{
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;
}
ib_bits_show(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
E_Iconbar_Icon *ic;
ic = l->data;
- evas_show(ic->iconbar->view->evas, ic->image);
+ evas_object_show(ic->image);
}
D_RETURN;
ib_bits_hide(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
E_Iconbar_Icon *ic;
ic = l->data;
- evas_hide(ic->iconbar->view->evas, ic->image);
+ evas_object_hide(ic->image);
}
D_RETURN;
ib_bits_move(void *data, double x, double y)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
ib_bits_resize(void *data, double w, double h)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
ib_bits_raise(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
E_Iconbar_Icon *ic;
ic = l->data;
- evas_raise(ic->iconbar->view->evas, ic->image);
+ evas_object_raise(ic->image);
}
D_RETURN;
ib_bits_lower(void *data)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
E_Iconbar_Icon *ic;
ic = l->data;
- evas_lower(ic->iconbar->view->evas, ic->image);
+ evas_object_lower(ic->image);
}
D_RETURN;
ib_bits_set_layer(void *data, int lay)
{
E_Iconbar *ib;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
/* 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;
/* 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;
/* 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 */
}
/* 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;
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;
{
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 */
{
if (e_exec_run(ic->exec) < 0)
{
- /* FIXME: display error */
+ D("Failed to execute: %s\n", ic->exec);
}
}
else
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);
}
}
}
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;
{
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;
{
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));
}
UN(data);
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
}
void
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;
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;
/* 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;
{
/* 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];
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);
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);
}
}
ib_child_handle(Ecore_Event * ev)
{
Ecore_Event_Child *e;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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)
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;
}
}
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)
{
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;
-}
{
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;
E_Iconbar *iconbar;
- Evas_Object image;
+ Evas_Object * image;
Imlib_Image imlib_image;
char *image_path;
int hilited;
struct
{
- Evas_Object image;
+ Evas_Object * image;
char *timer;
double start;
}
};
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);
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
#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;
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)
{
}
}
}
- else if (_b == 2)
+ else if (ev_info->button == 2)
{
}
- else if (_b == 3)
+ else if (ev_info->button == 3)
{
}
}
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;
ecore_window_dnd_finished();
D_RETURN;
}
- if (_b == 1)
+ if (ev_info->button == 1)
{
if (ic->state.just_executed)
{
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;
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;
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;
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)
_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;
}
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;
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;
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
}
static void
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)
E_Icon *
e_icon_find_by_file(E_View * view, char *file)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
}
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)
{
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;
}
}
{
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);
}
}
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);
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;
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;
void
e_icon_update_state(E_Icon * ic)
{
- char icon[PATH_MAX];
+ char icon[PATH_MAX], key[PATH_MAX];
int iw, ih;
D_ENTER;
}
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))
/* 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;
struct
{
- Evas_Object icon;
- Evas_Object event1;
- Evas_Object event2;
+ Evas_Object * icon;
+ Evas_Object * event1;
+ Evas_Object * event2;
E_Text *text;
struct
{
#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)
{
atexit(cb_exit);
e_exec_set_args(argc, argv);
- e_config_init();
-
/* Check command line options here: */
for (i = 1; i < argc; i++)
{
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;
}
#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 */
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)
static void
e_idle(void *data)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
ok = 1;
else
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
}
if (ok)
{
- Evas_List l;
+ Evas_List * l;
E_Menu *m = NULL;
E_Menu_Item *mi = NULL;
m = open_menus->data;
if ((e->time - m->time) > 200)
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
/* 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),
keyboard_nav = 0;
if (e->win == menu_event_win)
{
- Evas_List l;
+ Evas_List * l;
mouse_x = e->rx;
mouse_y = e->ry;
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;
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);
}
else
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
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);
}
}
}
e = ev->event;
{
- Evas_List l;
+ Evas_List * l;
for (l = open_menus; l; l = l->next)
{
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);
}
}
* @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;
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
/**
* @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;
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
- UN(_x);
- UN(_y);
+ UN(event_info);
}
void
void
e_menu_hide_submenus(E_Menu * menus_after)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
void
e_menu_select(int dx, int dy)
{
- Evas_List l, ll;
+ Evas_List *l, *ll;
int done = 0;
D_ENTER;
/* 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)
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)
{
static void
e_menu_cleanup(E_Menu * m)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
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 */
/* 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);
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;
}
{
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;
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)
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);
}
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);
mi->sep_file = NULL;
D_RETURN;
+ UN(m);
}
void
{
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)
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))
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);
void
e_menu_scroll_all_by(int dx, int dy)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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);
}
}
if (m->recalc_entries)
{
- Evas_List l;
+ Evas_List * l;
int max_w, max_h;
int i;
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)
}
if (m->redo_sel)
{
- Evas_List l;
+ Evas_List * l;
for (l = m->entries; l; l = l->next)
{
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;
}
}
}
+ e_menu_update_shape(m);
+
D_RETURN;
}
}
}
+ 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;
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;
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;
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);
#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);
observer,
E_Observee *
observee,
- E_Event_Type event);
+ E_Event_Type event,
+ void *data);
/* ------------ various callbacks ---------------------- */
static void
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);
static void
e_build_menu_unbuild(E_Build_Menu * bm)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
{
FILE *f;
char buf[PATH_MAX];
- Evas_List dirlist = NULL;
+ Evas_List * dirlist = NULL;
/* read .order file */
snprintf(buf, PATH_MAX, "%s/.order", dir);
/* if it isnt a "dot" file or dir */
if (s[0] != '.')
{
- Evas_List ll;
+ Evas_List * ll;
int have_it;
have_it = 0;
e_build_menu_new_from_iconified_borders()
{
E_Build_Menu *bm;
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
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;
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;
#include "e.h"
#include "object.h"
#include "observer.h"
+#include "menu.h"
typedef struct _E_Build_Menu E_Build_Menu;
E_Menu *menu;
- Evas_List menus;
- Evas_List commands;
+ Evas_List * menus;
+ Evas_List * commands;
int changed;
};
#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,
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)
{
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;
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 |
{
E_Object obj;
- Evas_List watched; /* list<E_Observee> */
+ Evas_List * watched; /* list<E_Observee> */
E_Event_Type event;
E_Notify_Func notify_func;
};
{
E_Object obj;
- Evas_List observers; /* list<E_Observer> */
+ Evas_List * observers; /* list<E_Observer> */
};
/**
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;
}
/* 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;
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;
/* 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;
/* 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;
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);
}
}
void
-e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas evas)
+e_scrollbar_add_to_evas(E_Scrollbar * sb, Evas * evas)
{
D_ENTER;
sb->direction = d;
if (sb->evas)
{
- Evas evas;
+ Evas * evas;
if (sb->base)
ebits_free(sb->base);
double range;
E_View *view;
- Evas evas;
+ Evas * evas;
Ebits_Object bar;
Ebits_Object base;
};
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);
#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;
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;
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);
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;
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;
}
{
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;
}
{
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;
}
{
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;
}
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;
}
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;
}
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;
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;
}
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);
#include "debug.h"
#include "util.h"
+#include "Evas.h"
+#include "Evas_Engine_Software_X11.h"
void
e_util_set_env(char *variable, char *content)
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;
+}
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) \
{ \
#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
#include "e_view_machine.h"
#include "e_file.h"
#include "globals.h"
+#include <Ebg.h>
static Ecore_Event *current_ev = NULL;
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);
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;
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;
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;
}
}
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;
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;
}
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;
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)
{
}
else if (v->select.last_count == 0)
{
- if (_b == 1)
+ if (ev_info->button == 1)
{
if (!(ev->mods & (multi_select_mod | range_select_mod)))
{
}
}
}
- else if (_b == 2)
+ else if (ev_info->button == 2)
{
#if 1
static E_Build_Menu *buildmenu = NULL;
}
#endif
}
- else if (_b == 3)
+ else if (ev_info->button == 3)
{
static E_Build_Menu *buildmenu = NULL;
}
}
}
- 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;
}
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;
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);
D_RETURN;
UN(_e);
UN(_o);
- UN(_b);
}
void
e_view_deselect_all(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
void
e_view_deselect_all_except(E_Icon * not_ic)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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;
void
e_view_icons_apply_xy(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
static void
e_idle(void *data)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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);
{
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;
}
{
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;
}
{
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;
}
{
if (v->is_desktop)
{
- evas_event_enter(v->evas);
+ evas_event_feed_mouse_in(v->evas);
}
current_ev = NULL;
D_RETURN;
{
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;
}
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;
}
void
e_view_resort_alphabetical(E_View * v)
{
- Evas_List icons = NULL, l;
+ Evas_List *icons = NULL, *l;
E_Icon **array;
int i, count;
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;
* 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)
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)
{
#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
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;
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);
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);
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
void
e_view_update(E_View * v)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
}
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);
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;
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();
}
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);
}
* } 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;
ic = ll->data;
if (ic->state.selected)
{
+ int size;
char buf[PATH_MAX];
if (first)
/* 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,
ic = ll->data;
if (ic->state.selected)
{
+ int size;
char buf[PATH_MAX];
if (first)
/*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,
#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;
struct
{
- Evas_Render_Method render_method;
+ /* Evas_Render_Method render_method;*/
int back_pixmap;
}
options;
- Evas evas;
+ Evas * evas;
struct
{
Window base;
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;
}
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;
#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;
e_object_init(E_OBJECT(layout), (E_Cleanup_Func) e_view_layout_cleanup);
- layout->view = v;
+ layout->desktop = d;
D_RETURN_(layout);
}
static void
e_view_layout_cleanup(E_View_Layout *layout)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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);
}
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;
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;
int
e_view_layout_delete_element(E_View_Layout *layout, char *name)
{
- Evas_List l;
+ Evas_List * l;
D_ENTER;
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)
{
void
e_view_layout_update(E_View_Layout *layout)
{
- Evas_List l;
+ Evas_List * l;
double x, y, w, h;
D_ENTER;
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)
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;
}
#define E_VIEW_LAYOUT_H
#include "e.h"
-#include "view.h"
+#include "e_view_look.h"
#include "object.h"
#ifndef E_VIEW_LAYOUT_TYPEDEF
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;
};
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);
+#include <X11/Xlib.h>
#include <Evas.h>
+#include <Evas_Engine_Software_X11.h>
#include <Ebits.h>
#include <Ecore.h>
#include <Edb.h>
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);
+
/* */
/* */
/* */
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;
if ((strcmp(dp->d_name, ".")) &&
(strcmp(dp->d_name, "..")))
{
- Evas_List l;
+ Evas_List * l;
char *f;
/* insertion sort */
}
void
-e_file_list_dir_free(Evas_List list)
+e_file_list_dir_free(Evas_List * list)
{
while (list)
{
{
double x, y;
- Evas_Object clip;
+ Evas_Object * clip;
Ebits_Object *bg;
struct {
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;
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);
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
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
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
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
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,
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);
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;
}
{
- 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;
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);
}
}
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);
}
}
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);
}
}
}
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);
}
}
}
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);
}
}
}
*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;
}
*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;
}
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)
{
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);
}
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);
}
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);
}
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);
}
void
txz_move(Text_Zone *txz, double x, double y)
{
- Evas_List l;
+ Evas_List * l;
txz->x = x;
txz->y = y;
{
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;
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;
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;
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);
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;
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;
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;
}
}
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);
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)
{