summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 \
10install-data-local: 10install-data-local:
11 @$(NORMAL_INSTALL) 11 @$(NORMAL_INSTALL)
12 if test -d $(srcdir)/data; then \ 12 if test -d $(srcdir)/data; then \
13 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/data; \ 13 $(mkinstalldirs) $(DESTDIR)$(pkgdatadir); \
14 for d in $(srcdir)/data/*; do \ 14 (cd $(srcdir); tar -cf - data) | (cd $(DESTDIR)$(pkgdatadir); tar -xf -) \
15 cp @CP_OPTIONS@ -f $$d $(DESTDIR)$(pkgdatadir)/data; \
16 done \
17 fi 15 fi
18 16
19dist-hook: 17dist-hook:
20 if test -d data; then \ 18 if test -d data; then \
21 mkdir $(distdir)/data; \ 19 (cd $(srcdir); tar -cf - data) | (cd $(distdir); tar -xf -) \
22 for d in data/*; do \
23 cp @CP_OPTIONS@ $$d $(distdir)/data; \
24 done \
25 fi 20 fi
26 21
27EXTRA_DIST = README AUTHORS COPYING e.spec 22EXTRA_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 ()
14 14
15finish () 15finish ()
16{ 16{
17 edb_ed $DB add "/menu/count" int $MENUNUM 17 N=$[ $MENUNUM + 1 ];
18 edb_ed $DB add "/menu/count" int $N
18} 19}
19 20
20menu () 21menu ()
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)
52 { 52 {
53 Evas_Gradient grad; 53 Evas_Gradient grad;
54 54
55 /*create select objects */ 55 /* create select objects */
56 v->select.obj.middle = evas_add_rectangle(v->evas); 56 v->select.obj.middle = evas_add_rectangle(v->evas);
57 evas_set_color(v->evas, v->select.obj.middle, 57 evas_set_color(v->evas, v->select.obj.middle,
58 v->select.config.middle.r, 58 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
581 { 581 {
582 if (min_x) *min_x = 0; 582 if (min_x) *min_x = 0;
583 if (min_y) *min_y = 0; 583 if (min_y) *min_y = 0;
584 if (max_x) *max_x = 0; 584 if (max_x) *max_x = 1;
585 if (max_y) *max_y = 0; 585 if (max_y) *max_y = 1;
586 return; 586 return;
587 } 587 }
588 for (l = v->icons; l; l = l->next) 588 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
595 if (ic->geom.x + ic->geom.w > x2) x2 = ic->geom.x + ic->geom.w; 595 if (ic->geom.x + ic->geom.w > x2) x2 = ic->geom.x + ic->geom.w;
596 if (ic->geom.y + ic->geom.h > y2) y2 = ic->geom.y + ic->geom.h; 596 if (ic->geom.y + ic->geom.h > y2) y2 = ic->geom.y + ic->geom.h;
597 } 597 }
598 if (x1 > 0) x1 = 0;
599 if (y1 > 0) y1 = 0;
598 if (min_x) *min_x = x1; 600 if (min_x) *min_x = x1;
599 if (min_y) *min_y = y1; 601 if (min_y) *min_y = y1;
600 if (max_x) *max_x = x2 - 1; 602 if (max_x) *max_x = x2 - 1;
@@ -642,6 +644,86 @@ e_view_scroll_by(E_View *v, int sx, int sy)
642 e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy); 644 e_view_scroll_to(v, v->scroll.x + sx, v->scroll.y + sy);
643} 645}
644 646
647void
648e_view_scroll_to_percent(E_View *v, double psx, double psy)
649{
650 int min_x, min_y, max_x, max_y;
651 int sx, sy;
652
653 e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
654 sx = (psx * ((double)max_x - (double)min_x)) - min_x;
655 sy = (psy * ((double)max_y - (double)min_y)) - min_y;
656 if (sx < v->size.w - v->spacing.window.r - max_x)
657 sx = v->size.w - v->spacing.window.r - max_x;
658 if (sx > v->spacing.window.l - min_x)
659 sx = v->spacing.window.l - min_x;
660 if (sy < v->size.h - v->spacing.window.b - max_y)
661 sy = v->size.h - v->spacing.window.b - max_y;
662 if (sy > v->spacing.window.t - min_y)
663 sy = v->spacing.window.t - min_y;
664 if ((sx == v->scroll.x) && (v->scroll.y == sy)) return;
665 v->scroll.x = sx;
666 v->scroll.y = sy;
667 e_view_icons_apply_xy(v);
668 if (v->bg) e_background_set_scroll(v->bg, v->scroll.x, v->scroll.y);
669}
670
671void
672e_view_get_viewable_percentage(E_View *v, double *vw, double *vh)
673{
674 int min_x, min_y, max_x, max_y;
675 double p;
676
677 e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
678 if (min_x == max_x)
679 {
680 if (vw) *vw = 0;
681 }
682 else
683 {
684 p = ((double)(v->size.w - v->spacing.window.l - v->spacing.window.r)) /
685 ((double)(max_x - min_x));
686 if (vw) *vw = p;
687 }
688 if (min_y == max_y)
689 {
690 if (vh) *vh = 0;
691 }
692 else
693 {
694 p = ((double)(v->size.h - v->spacing.window.t - v->spacing.window.b)) /
695 ((double)(max_y - min_y));
696 if (vh) *vh = p;
697 }
698}
699
700void
701e_view_get_position_percentage(E_View *v, double *vx, double *vy)
702{
703 int min_x, min_y, max_x, max_y;
704 double p;
705
706 e_view_icons_get_extents(v, &min_x, &min_y, &max_x, &max_y);
707 if (min_x == max_x)
708 {
709 if (vx) *vx = 0;
710 }
711 else
712 {
713 p = ((double)(v->scroll.x - min_x)) / ((double)(max_x - min_x));
714 if (vx) *vx = p;
715 }
716 if (min_y == max_y)
717 {
718 if (vy) *vy = 0;
719 }
720 else
721 {
722 p = ((double)(v->scroll.y - min_y)) / ((double)(max_y - min_y));
723 if (vy) *vy = p;
724 }
725}
726
645static void 727static void
646e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y) 728e_icon_down_cb(void *_data, Evas _e, Evas_Object _o, int _b, int _x, int _y)
647{ 729{
@@ -1045,6 +1127,7 @@ e_configure(Eevent * ev)
1045 } 1127 }
1046 evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h); 1128 evas_set_output_viewport(v->evas, 0, 0, v->size.w, v->size.h);
1047 evas_set_output_size(v->evas, v->size.w, v->size.h); 1129 evas_set_output_size(v->evas, v->size.w, v->size.h);
1130 e_view_scroll_to(v, v->scroll.x, v->scroll.y);
1048 e_view_arrange(v); 1131 e_view_arrange(v);
1049 e_view_queue_geometry_record(v); 1132 e_view_queue_geometry_record(v);
1050 } 1133 }
@@ -1209,7 +1292,7 @@ e_key_down(Eevent * ev)
1209 } 1292 }
1210 else if (!strcmp(e->key, "Right")) 1293 else if (!strcmp(e->key, "Right"))
1211 { 1294 {
1212 e_view_scroll_by(v, 0, 8); 1295 e_view_scroll_by(v, -8, 0);
1213 } 1296 }
1214 else if (!strcmp(e->key, "Escape")) 1297 else if (!strcmp(e->key, "Escape"))
1215 { 1298 {
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
183void e_view_icons_apply_xy(E_View *v); 183void e_view_icons_apply_xy(E_View *v);
184void e_view_scroll_to(E_View *v, int sx, int sy); 184void e_view_scroll_to(E_View *v, int sx, int sy);
185void e_view_scroll_by(E_View *v, int sx, int sy); 185void e_view_scroll_by(E_View *v, int sx, int sy);
186void e_view_scroll_to_percent(E_View *v, double psx, double psy);
187void e_view_get_viewable_percentage(E_View *v, double *vw, double *vh);
188void e_view_get_position_percentage(E_View *v, double *vx, double *vy);
186void e_view_icon_update_state(E_Icon *ic); 189void e_view_icon_update_state(E_Icon *ic);
187void e_view_icon_invert_selection(E_Icon *ic); 190void e_view_icon_invert_selection(E_Icon *ic);
188void e_view_icon_select(E_Icon *ic); 191void e_view_icon_select(E_Icon *ic);