Lines Matching refs:m

39 link_col_major(MENU *m)  in link_col_major()  argument
48 for (i = IthItem(m, 0), n = 0; i; i = IthItem(m, ++n)) { in link_col_major()
51 Left(i) = c ? IthItem(m, n-Rows(m)) : (ITEM *) NULL; in link_col_major()
52 if (n + Rows(m) >= Nitems(m)) { in link_col_major()
55 Right(i) = IthItem(m, n + Rows(m)); in link_col_major()
57 Up(i) = r ? IthItem(m, n-1) : (ITEM *) NULL; in link_col_major()
58 Down(i) = (r == Rows(m)-1) ? (ITEM *)0 : IthItem(m, n+1); in link_col_major()
59 if (++r == Rows(m)) { in link_col_major()
65 Down(IthItem(m, n-1)) = IthItem(m, n - Rows(m)); in link_col_major()
68 if (Cyclic(m)) { in link_col_major()
71 r = Rows(m) * (Nitems(m)/Rows(m)); in link_col_major()
72 for (n = 0; n < Rows(m); n++) { in link_col_major()
74 if (left >= Nitems(m)) { in link_col_major()
75 left -= Rows(m); in link_col_major()
77 Left(IthItem(m, n)) = IthItem(m, left); in link_col_major()
78 Right(IthItem(m, left)) = IthItem(m, n); in link_col_major()
83 for (n = 0; n < Nitems(m); n += Rows(m)) { in link_col_major()
84 up = n + Rows(m) - 1; in link_col_major()
85 if (up >= Nitems(m)) { in link_col_major()
86 Up(IthItem(m, n)) = IthItem(m, n-1); in link_col_major()
88 Up(IthItem(m, n)) = IthItem(m, up); in link_col_major()
89 Down(IthItem(m, up)) = IthItem(m, n); in link_col_major()
96 link_row_major(MENU *m) in link_row_major() argument
105 for (i = IthItem(m, 0), n = 0; i; i = IthItem(m, ++n)) { in link_row_major()
108 Left(i) = c ? IthItem(m, n-1) : (ITEM *) NULL; in link_row_major()
109 Right(i) = (c == Cols(m)-1 || n == Nitems(m)-1) ? (ITEM *)0 : in link_row_major()
110 IthItem(m, n+1); in link_row_major()
111 Up(i) = r ? IthItem(m, n-Cols(m)) : (ITEM *) NULL; in link_row_major()
113 if (n+Cols(m) < Nitems(m)) { in link_row_major()
114 Down(i) = IthItem(m, n + Cols(m)); in link_row_major()
116 if (r == Rows(m)-1) { in link_row_major()
123 Down(i) = IthItem(m, Nitems(m)-1); in link_row_major()
126 if (++c == Cols(m)) { in link_row_major()
132 if (Cyclic(m)) { in link_row_major()
136 for (n = 0; n < Nitems(m); n += Cols(m)) { in link_row_major()
137 left = n + Cols(m) - 1; in link_row_major()
138 if (left >= Nitems(m)) { in link_row_major()
139 left = Nitems(m) - 1; in link_row_major()
141 Left(IthItem(m, n)) = IthItem(m, left); in link_row_major()
142 Right(IthItem(m, left)) = IthItem(m, n); in link_row_major()
147 r = (Rows(m) - 1) * Cols(m); in link_row_major()
148 for (n = 0; n < Cols(m); n++) { in link_row_major()
154 if (up >= Nitems(m)) { in link_row_major()
155 Up(IthItem(m, n)) = IthItem(m, Nitems(m)-1); in link_row_major()
157 Up(IthItem(m, n)) = IthItem(m, up); in link_row_major()
158 Down(IthItem(m, up)) = IthItem(m, n); in link_row_major()
165 _link_items(MENU *m) in _link_items() argument
167 if (Items(m) && IthItem(m, 0)) { in _link_items()
168 ResetLink(m); in _link_items()
169 if (RowMajor(m)) { in _link_items()
170 link_row_major(m); in _link_items()
172 link_col_major(m); in _link_items()