aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1996-04-29 15:58:16 +0000
committerRichard M. Stallman1996-04-29 15:58:16 +0000
commit35b3402f5e0f11df6b2b77afb36d8cd587fa5de8 (patch)
tree27faa4abe332c4959d40a0cd28b128714b890851 /src
parent469937ac967eb70672eb9f2fd8f23e5c681c0116 (diff)
downloademacs-35b3402f5e0f11df6b2b77afb36d8cd587fa5de8.tar.gz
emacs-35b3402f5e0f11df6b2b77afb36d8cd587fa5de8.zip
(make_lispy_event): FRAME_MENU_BAR_ITEMS now has
four elements per item. Add a separate slot for the hpos. (menu_bar_items): Likewise. (menu_bar_item): Initialize the hpos slot to 0.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 2756687154b..1d07ff0df6a 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3712,11 +3712,11 @@ make_lispy_event (event)
3712 3712
3713 item = Qnil; 3713 item = Qnil;
3714 items = FRAME_MENU_BAR_ITEMS (f); 3714 items = FRAME_MENU_BAR_ITEMS (f);
3715 for (i = 0; i < XVECTOR (items)->size; i += 3) 3715 for (i = 0; i < XVECTOR (items)->size; i += 4)
3716 { 3716 {
3717 Lisp_Object pos, string; 3717 Lisp_Object pos, string;
3718 string = XVECTOR (items)->contents[i + 1]; 3718 string = XVECTOR (items)->contents[i + 1];
3719 pos = XVECTOR (items)->contents[i + 2]; 3719 pos = XVECTOR (items)->contents[i + 3];
3720 if (NILP (string)) 3720 if (NILP (string))
3721 break; 3721 break;
3722 if (column >= XINT (pos) 3722 if (column >= XINT (pos)
@@ -5045,29 +5045,31 @@ menu_bar_items (old)
5045 int i; 5045 int i;
5046 int end = menu_bar_items_index; 5046 int end = menu_bar_items_index;
5047 5047
5048 for (i = 0; i < end; i += 3) 5048 for (i = 0; i < end; i += 4)
5049 if (EQ (XCONS (tail)->car, XVECTOR (menu_bar_items_vector)->contents[i])) 5049 if (EQ (XCONS (tail)->car, XVECTOR (menu_bar_items_vector)->contents[i]))
5050 { 5050 {
5051 Lisp_Object tem0, tem1, tem2; 5051 Lisp_Object tem0, tem1, tem2, tem3;
5052 /* Move the item at index I to the end, 5052 /* Move the item at index I to the end,
5053 shifting all the others forward. */ 5053 shifting all the others forward. */
5054 tem0 = XVECTOR (menu_bar_items_vector)->contents[i + 0]; 5054 tem0 = XVECTOR (menu_bar_items_vector)->contents[i + 0];
5055 tem1 = XVECTOR (menu_bar_items_vector)->contents[i + 1]; 5055 tem1 = XVECTOR (menu_bar_items_vector)->contents[i + 1];
5056 tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2]; 5056 tem2 = XVECTOR (menu_bar_items_vector)->contents[i + 2];
5057 if (end > i + 3) 5057 tem3 = XVECTOR (menu_bar_items_vector)->contents[i + 3];
5058 bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 3], 5058 if (end > i + 4)
5059 bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4],
5059 &XVECTOR (menu_bar_items_vector)->contents[i], 5060 &XVECTOR (menu_bar_items_vector)->contents[i],
5060 (end - i - 3) * sizeof (Lisp_Object)); 5061 (end - i - 4) * sizeof (Lisp_Object));
5061 XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem0; 5062 XVECTOR (menu_bar_items_vector)->contents[end - 4] = tem0;
5062 XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem1; 5063 XVECTOR (menu_bar_items_vector)->contents[end - 3] = tem1;
5063 XVECTOR (menu_bar_items_vector)->contents[end - 1] = tem2; 5064 XVECTOR (menu_bar_items_vector)->contents[end - 2] = tem2;
5065 XVECTOR (menu_bar_items_vector)->contents[end - 1] = tem3;
5064 break; 5066 break;
5065 } 5067 }
5066 } 5068 }
5067 5069
5068 /* Add nil, nil, nil at the end. */ 5070 /* Add nil, nil, nil at the end. */
5069 i = menu_bar_items_index; 5071 i = menu_bar_items_index;
5070 if (i + 3 > XVECTOR (menu_bar_items_vector)->size) 5072 if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
5071 { 5073 {
5072 Lisp_Object tem; 5074 Lisp_Object tem;
5073 int newsize = 2 * i; 5075 int newsize = 2 * i;
@@ -5080,6 +5082,7 @@ menu_bar_items (old)
5080 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 5082 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
5081 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 5083 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
5082 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil; 5084 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
5085 XVECTOR (menu_bar_items_vector)->contents[i++] = Qnil;
5083 menu_bar_items_index = i; 5086 menu_bar_items_index = i;
5084 5087
5085 Vinhibit_quit = oquit; 5088 Vinhibit_quit = oquit;
@@ -5161,14 +5164,14 @@ menu_bar_item (key, item_string, def)
5161 /* If a map has an explicit `undefined' as definition, 5164 /* If a map has an explicit `undefined' as definition,
5162 discard any previously made menu bar item. */ 5165 discard any previously made menu bar item. */
5163 5166
5164 for (i = 0; i < menu_bar_items_index; i += 3) 5167 for (i = 0; i < menu_bar_items_index; i += 4)
5165 if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i])) 5168 if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i]))
5166 { 5169 {
5167 if (menu_bar_items_index > i + 3) 5170 if (menu_bar_items_index > i + 4)
5168 bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 3], 5171 bcopy (&XVECTOR (menu_bar_items_vector)->contents[i + 4],
5169 &XVECTOR (menu_bar_items_vector)->contents[i], 5172 &XVECTOR (menu_bar_items_vector)->contents[i],
5170 (menu_bar_items_index - i - 3) * sizeof (Lisp_Object)); 5173 (menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
5171 menu_bar_items_index -= 3; 5174 menu_bar_items_index -= 4;
5172 return; 5175 return;
5173 } 5176 }
5174 5177
@@ -5197,7 +5200,7 @@ menu_bar_item (key, item_string, def)
5197 return; 5200 return;
5198 5201
5199 /* Find any existing item for this KEY. */ 5202 /* Find any existing item for this KEY. */
5200 for (i = 0; i < menu_bar_items_index; i += 3) 5203 for (i = 0; i < menu_bar_items_index; i += 4)
5201 if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i])) 5204 if (EQ (key, XVECTOR (menu_bar_items_vector)->contents[i]))
5202 break; 5205 break;
5203 5206
@@ -5205,7 +5208,7 @@ menu_bar_item (key, item_string, def)
5205 if (i == menu_bar_items_index) 5208 if (i == menu_bar_items_index)
5206 { 5209 {
5207 /* If vector is too small, get a bigger one. */ 5210 /* If vector is too small, get a bigger one. */
5208 if (i + 3 > XVECTOR (menu_bar_items_vector)->size) 5211 if (i + 4 > XVECTOR (menu_bar_items_vector)->size)
5209 { 5212 {
5210 Lisp_Object tem; 5213 Lisp_Object tem;
5211 int newsize = 2 * i; 5214 int newsize = 2 * i;
@@ -5218,6 +5221,7 @@ menu_bar_item (key, item_string, def)
5218 XVECTOR (menu_bar_items_vector)->contents[i++] = key; 5221 XVECTOR (menu_bar_items_vector)->contents[i++] = key;
5219 XVECTOR (menu_bar_items_vector)->contents[i++] = item_string; 5222 XVECTOR (menu_bar_items_vector)->contents[i++] = item_string;
5220 XVECTOR (menu_bar_items_vector)->contents[i++] = Fcons (def, Qnil); 5223 XVECTOR (menu_bar_items_vector)->contents[i++] = Fcons (def, Qnil);
5224 XVECTOR (menu_bar_items_vector)->contents[i++] = make_number (0);
5221 menu_bar_items_index = i; 5225 menu_bar_items_index = i;
5222 } 5226 }
5223 /* We did find an item for this KEY. Add DEF to its list of maps. */ 5227 /* We did find an item for this KEY. Add DEF to its list of maps. */