about summary refs log tree commit diff stats
path: root/apps/browse/paginated-screen.mu
diff options
context:
space:
mode:
Diffstat (limited to 'apps/browse/paginated-screen.mu')
-rw-r--r--apps/browse/paginated-screen.mu17
1 files changed, 12 insertions, 5 deletions
diff --git a/apps/browse/paginated-screen.mu b/apps/browse/paginated-screen.mu
index 9da3e4d7..3723cbf3 100644
--- a/apps/browse/paginated-screen.mu
+++ b/apps/browse/paginated-screen.mu
@@ -6,6 +6,7 @@ type paginated-screen {
   screen: (handle screen)
   nrows: int  # const
   ncols: int  # const
+  page-width: int
   toprow: int
   botrow: int
   leftcol: int
@@ -14,20 +15,19 @@ type paginated-screen {
   col: int
 }
 
-fn initialize-fake-paginated-screen _self: (addr paginated-screen), nrows: int, ncols: int {
+fn initialize-fake-paginated-screen _self: (addr paginated-screen), nrows: int, ncols: int, page-width: int {
   var self/esi: (addr paginated-screen) <- copy _self
   var screen-ah/eax: (addr handle screen) <- get self, screen
   allocate screen-ah
   var screen-addr/eax: (addr screen) <- lookup *screen-ah
   initialize-screen screen-addr, nrows, ncols
-  initialize-paginated-screen self
+  initialize-paginated-screen self, page-width
 }
 
-fn initialize-paginated-screen _self: (addr paginated-screen) {
+fn initialize-paginated-screen _self: (addr paginated-screen), page-width: int {
   # hardcoded parameters:
   #   top-margin
   #   page-margin
-  #   page-width
   var self/esi: (addr paginated-screen) <- copy _self
   var screen-ah/eax: (addr handle screen) <- get self, screen
   var _screen-addr/eax: (addr screen) <- lookup *screen-ah
@@ -42,6 +42,12 @@ fn initialize-paginated-screen _self: (addr paginated-screen) {
   # self->ncols = ncols
   dest <- get self, ncols
   copy-to *dest, ncols
+  # self->page-width = page-width
+  {
+    var pg/eax: int <- copy page-width
+    dest <- get self, page-width
+    copy-to *dest, pg
+  }
   # self->toprow = top-margin
   dest <- get self, toprow
   copy-to *dest, 2  # top-margin
@@ -131,6 +137,7 @@ fn next-line _self: (addr paginated-screen) {
 
 fn next-page _self: (addr paginated-screen) {
   var self/esi: (addr paginated-screen) <- copy _self
+  var pg/edi: (addr int) <- get self, page-width
   var tmp/eax: (addr int) <- copy 0
   var tmp2/ecx: int <- copy 0
 #?   # temporary: stop
@@ -147,7 +154,7 @@ fn next-page _self: (addr paginated-screen) {
   copy-to *tmp, tmp2
   # self->rightcol = self->leftcol + page-width
   tmp2 <- copy *tmp
-  tmp2 <- add 0x40  # page-width
+  tmp2 <- add *pg
   tmp <- get self, rightcol
   copy-to *tmp, tmp2
   # self->row = self->toprow
gt; 2011-04-05 17:07:29 +0200 committer hut <hut@lavabit.com> 2011-04-05 17:07:29 +0200 This gonna be cool once it's finished' href='/akspecs/ranger/commit/CHANGELOG?h=v1.5.4&id=2ed2d4f79238ce505724fc5873c6a912e19be305'>2ed2d4f7 ^
b7b8f3a0 ^




c8f870cb ^



ef2b1e37 ^















81f5ac9e ^
efd7c0c1 ^






cbcd3325 ^






81f5ac9e ^
cbcd3325 ^
d3bcb234 ^

cbcd3325 ^
81f5ac9e ^











cbcd3325 ^
90018274 ^




cbcd3325 ^
95e021ae ^

c928a9eb ^
95e021ae ^
cbcd3325 ^
95e021ae ^















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154