aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2001-08-05 12:48:18 +0000
committerCarsten Haitzler <raster@rasterman.com>2001-08-05 12:48:18 +0000
commit23e05d4d8316ad5e130362be3ccdf9d4cbe0f536 (patch)
treebbb7d572d9d7a3712d6f7245b736c7c21c27f5c2
parent05f5e706b777f5de8eef512fcd72d69114dd7fb0 (diff)
downloadenlightenment-23e05d4d8316ad5e130362be3ccdf9d4cbe0f536.tar.gz
enlightenment-23e05d4d8316ad5e130362be3ccdf9d4cbe0f536.tar.xz
enlightenment-23e05d4d8316ad5e130362be3ccdf9d4cbe0f536.zip
* fix apps menu
* cp -> tar SVN revision: 5045
-rw-r--r--Makefile.am11
-rw-r--r--data/config/behavior/default/apps_menu.dbbin20480 -> 20480 bytes
-rwxr-xr-xdata/scripts/build_app_menu_db.sh3
-rw-r--r--src/view.c91
-rw-r--r--src/view.h3
5 files changed, 95 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index 7b0514c27..99b335ddc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,18 +10,13 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 config.guess \
install-data-local:
@$(NORMAL_INSTALL)
if test -d $(srcdir)/data; then \
- $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/data; \
- for d in $(srcdir)/data/*; do \
- cp @CP_OPTIONS@ -f $$d $(DESTDIR)$(pkgdatadir)/data; \
- done \
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir); \
+ (cd $(srcdir); tar -cf - data) | (cd $(DESTDIR)$(pkgdatadir); tar -xf -) \
fi
dist-hook:
if test -d data; then \
- mkdir $(distdir)/data; \
- for d in data/*; do \
- cp @CP_OPTIONS@ $$d $(distdir)/data; \
- done \
+ (cd $(srcdir); tar -cf - data) | (cd $(distdir); tar -xf -) \
fi
EXTRA_DIST = README AUTHORS COPYING e.spec
diff --git a/data/config/behavior/default/apps_menu.db b/data/config/behavior/default/apps_menu.db
index c33c2264a..fbb346ec7 100644
--- a/data/config/behavior/default/apps_menu.db
+++ b/data/config/behavior/default/apps_menu.db
Binary files differ
diff --git a/data/scripts/build_app_menu_db.sh b/data/scripts/build_app_menu_db.sh
index 9b093e594..189a2db68 100755
--- a/data/scripts/build_app_menu_db.sh
+++ b/data/scripts/build_app_menu_db.sh
@@ -14,7 +14,8 @@ setup ()
finish ()
{
- edb_ed $DB add "/menu/count" int $MENUNUM
+ N=$[ $MENUNUM + 1 ];
+ edb_ed $DB add "/menu/count" int $N
}
menu ()
diff --git a/src/view.c b/src/view.c
index 908f0256f..fc1180bba 100644
--- a/src/view.c
+++ b/src/view.c
@@ -52,7 +52,7 @@ e_view_selection_update(E_View *v)
{
Evas_Gradient grad;
- /*create select objects */
+ /* create select objects */
v->select.obj.middle = evas_add_rectangle(v->evas);
evas_set_color(v->evas, v->select.obj.middle,
v->select.config.middle.r,
@@ -581,8 +581,8 @@ e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x, int *max
{
if (min_x) *min_x = 0;
if (min_y) *min_y = 0;
- if (max_x) *max_x = 0;
- if (max_y) *max_y = 0;
+ if (max_x) *max_x = 1;
+ if (max_y) *max_y = 1;
return;
}
for (l = v->icons; l; l = l->next)
@@ -595,6 +595,8 @@ e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x, int *max
if (ic->geom.x + ic->geom.w > x2) x2 = ic->geom.x + ic->geom.w;
if (ic->geom.y + ic->geom.h > y2) y2 = ic->geom.y + ic->geom.h;
}
+ if (x1 > 0) x1 = 0;
+ if (y1 > 0) y1 = 0;
if (min_x) *min_x = x1;
if (min_y) *min_y = y1;
if (max_x) *max_x = x2 - 1;
@@ -642,6 +644,86 @@ e_view_scroll_by(E_View *v, int sx, int sy)
e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy);
}
+void
+e_view_scroll_to_percent(E_View *v, double psx, double psy)
+{
+ int min_x, min_y, max_x, max_y;
+ int sx, sy;
+
+ e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
+ sx = (psx * ((double)max_x - (double)min_x)) - min_x;
+ sy = (psy * ((double)max_y - (double)min_y)) - min_y;
+ if (sx < v->size.w - v->spacing.window.r - max_x)
+ sx = v->size.w - v->spacing.window.r - max_x;
+ if (sx > v->spacing.window.l - min_x)
+ sx = v->spacing.window.l - min_x;
+ if (sy < v->size.h - v->spacing.window.b - max_y)
+ sy = v->size.h - v->spacing.window.b - max_y;
+ if (sy > v->spacing.window.t - min_y)
+ sy = v->spacing.window.t - min_y;
+ if ((sx == v->scroll.x) && (v->scroll.y == sy)) return;
+ v->scroll.x = sx;
+ v->scroll.y = sy;
+ e_view_icons_apply_xy(v);
+ if (v->bg) e_background_set_scroll(v->bg, v->scroll.x, v->scroll.y);
+}
+
+void
+e_view_get_viewable_percentage(E_View *v, double *vw, double *vh)
+{
+ int min_x, min_y, max_x, max_y;
+ double p;
+
+ e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
+ if (min_x == max_x)
+ {
+ if (vw) *vw = 0;
+ }
+ else
+ {
+ p = ((double)(v->size.w - v->spacing.window.l - v->spacing.window.r)) /
+ ((double)(max_x - min_x));
+ if (vw) *vw = p;
+ }
+ if (min_y == max_y)
+ {
+ if (vh) *vh = 0;
+ }
+ else
+ {
+ p = ((double)(v->size.h - v->spacing.window.t - v->spacing.window.b)) /
+ ((double)(max_y - min_y));
+ if (vh) *vh = p;
+ }
+}
+
+void
+e_view_get_position_percentage(E_View *v, double *vx, double *vy)
+{
+ int min_x, min_y, max_x, max_y;
+ double p;
+
+ e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
+ if (min_x == max_x)
+ {
+ if (vx) *vx = 0;
+ }
+ else
+ {
+ p = ((double)(v->scroll.x - min_x)) / ((double)(max_x - min_x));
+ if (vx) *vx = p;
+ }
+ if (min_y == max_y)
+ {
+ if (vy) *vy = 0;
+ }
+ else
+ {
+ p = ((double)(v->scroll.y - min_y)) / ((double)(max_y - min_y));
+ if (vy) *vy = p;
+ }
+}
+
static void
e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
{
@@ -1045,6 +1127,7 @@ e_configure(Eevent * ev)
}
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);
+ e_view_scroll_to(v, v->scroll.x, v->scroll.y);
e_view_arrange(v);
e_view_queue_geometry_record(v);
}
@@ -1209,7 +1292,7 @@ e_key_down(Eevent * ev)
}
else if (!strcmp(e->key, "Right"))
{
- e_view_scroll_by(v, 0, 8);
+ e_view_scroll_by(v, -8, 0);
}
else if (!strcmp(e->key, "Escape"))
{
diff --git a/src/view.h b/src/view.h
index 055328116..828e8bc71 100644
--- a/src/view.h
+++ b/src/view.h
@@ -183,6 +183,9 @@ void e_view_icons_get_extents(E_View *v, int *min_x, int *min_y, int *max_x
void e_view_icons_apply_xy(E_View *v);
void e_view_scroll_to(E_View *v, int sx, int sy);
void e_view_scroll_by(E_View *v, int sx, int sy);
+void e_view_scroll_to_percent(E_View *v, double psx, double psy);
+void e_view_get_viewable_percentage(E_View *v, double *vw, double *vh);
+void e_view_get_position_percentage(E_View *v, double *vx, double *vy);
void e_view_icon_update_state(E_Icon *ic);
void e_view_icon_invert_selection(E_Icon *ic);
void e_view_icon_select(E_Icon *ic);