diff options
author | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-07-27 16:01:16 -0400 |
---|---|---|
committer | Eamon Walsh <ewalsh@tycho.nsa.gov> | 2011-07-27 16:01:16 -0400 |
commit | 9f892f9b16a7316d8b0f4385ccbb3498f4f4c8e8 (patch) | |
tree | 13f5814962ecce47c45db62f0ded6266163da8bf /src | |
parent | 66760f38eec6e814d48b9c8d1e6cc33712519edb (diff) |
Simplify view moving code, remove unused view_translate().
Diffstat (limited to 'src')
-rw-r--r-- | src/display.c | 13 | ||||
-rw-r--r-- | src/display.h | 3 | ||||
-rw-r--r-- | src/view.c | 22 | ||||
-rw-r--r-- | src/view.h | 5 |
4 files changed, 3 insertions, 40 deletions
diff --git a/src/display.c b/src/display.c index 5b1be67..47b1b08 100644 --- a/src/display.c +++ b/src/display.c @@ -213,7 +213,7 @@ show_switcher(void) y = guest_height / 2 + CURSOR_WIDTH; TAILQ_FOREACH(v, &d->views, display_next) { - view_set_position(v->thumb, x + v->tpos.x, y + v->tpos.y); + view_move(v->thumb, x + v->tpos.x, y + v->tpos.y); v->thumb->visible = 1; } @@ -359,17 +359,6 @@ display_view_resize(struct view *v) } int -display_view_move(struct view *v) -{ - /* update thumbnail views */ - v->tpos.x = thumb_width * v->spos.x / v->buffer->desc.width; - v->tpos.y = thumb_height * v->spos.y / v->buffer->desc.height; - - show_switcher(); - return 0; -} - -int display_view_show(struct view *v) { v->thumb->mapped = v->mapped; diff --git a/src/display.h b/src/display.h index 11407c2..8037f1d 100644 --- a/src/display.h +++ b/src/display.h @@ -106,9 +106,6 @@ int display_view_resize(struct view *view); int -display_view_move(struct view *view); - -int display_view_show(struct view *view); int @@ -333,32 +333,12 @@ view_set_viewport(struct view *v, } int -view_set_position(struct view *v, int x, int y) +view_move(struct view *v, int x, int y) { if (v->spos.x != x || v->spos.y != y) { v->window->MoveTo(v->window, x, y); v->spos.x = x; v->spos.y = y; - - /* Notify display subsystem */ - if (!(v->flags & VIEW_FLAGS_THUMBNAIL)) - display_view_move(v); - } - - return 0; -} - -int -view_translate(struct view *v, int dx, int dy) -{ - if (dx != 0 || dy != 0) { - v->window->Move(v->window, dx, dy); - v->spos.x += dx; - v->spos.y += dy; - - /* Notify display subsystem */ - if (!(v->flags & VIEW_FLAGS_THUMBNAIL)) - display_view_move(v); } return 0; @@ -99,10 +99,7 @@ view_set_viewport(struct view *v, int force_refresh); int -view_set_position(struct view *v, int x, int y); - -int -view_translate(struct view *v, int dx, int dy); +view_move(struct view *v, int x, int y); void view_refresh(struct view *v); |