Mercurial > hg > xemacs-beta
comparison src/event-stream.c @ 282:c42ec1d1cded r21-0b39
Import from CVS: tag r21-0b39
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:33:18 +0200 |
parents | 7df0dd720c89 |
children | 558f606b08ae |
comparison
equal
deleted
inserted
replaced
281:090b52736db2 | 282:c42ec1d1cded |
---|---|
555 | 555 |
556 /* If a longjmp() happens in the callback, we're screwed. | 556 /* If a longjmp() happens in the callback, we're screwed. |
557 Let's hope it doesn't. I think the code here is fairly | 557 Let's hope it doesn't. I think the code here is fairly |
558 clean and doesn't do this. */ | 558 clean and doesn't do this. */ |
559 emacs_is_blocking = 1; | 559 emacs_is_blocking = 1; |
560 | 560 #if 0 |
561 /* Do not poll for quit while blocking, because this prevents idle | 561 /* Do this if the poll-for-quit timer seems to be taking too |
562 XEmacs from swapping out from memory */ | 562 much CPU time when idle ... */ |
563 reset_poll_for_quit (); | 563 reset_poll_for_quit (); |
564 | 564 #endif |
565 event_stream->next_event_cb (event); | 565 event_stream->next_event_cb (event); |
566 | 566 #if 0 |
567 init_poll_for_quit (); | 567 init_poll_for_quit (); |
568 | 568 #endif |
569 emacs_is_blocking = 0; | 569 emacs_is_blocking = 0; |
570 | 570 |
571 #ifdef DEBUG_XEMACS | 571 #ifdef DEBUG_XEMACS |
572 /* timeout events have more info set later, so | 572 /* timeout events have more info set later, so |
573 print the event out in next_event_internal(). */ | 573 print the event out in next_event_internal(). */ |
1607 { | 1607 { |
1608 Lisp_Object event = Fmake_event (Qnil, Qnil); | 1608 Lisp_Object event = Fmake_event (Qnil, Qnil); |
1609 | 1609 |
1610 XEVENT (event)->event_type = misc_user_event; | 1610 XEVENT (event)->event_type = misc_user_event; |
1611 XEVENT (event)->channel = channel; | 1611 XEVENT (event)->channel = channel; |
1612 XEVENT (event)->event.eval.function = function; | 1612 XEVENT (event)->event.misc.function = function; |
1613 XEVENT (event)->event.eval.object = object; | 1613 XEVENT (event)->event.misc.object = object; |
1614 XEVENT (event)->event.misc.button = 0; | |
1615 XEVENT (event)->event.misc.modifiers = 0; | |
1616 XEVENT (event)->event.misc.x = -1; | |
1617 XEVENT (event)->event.misc.y = -1; | |
1614 enqueue_command_event (event); | 1618 enqueue_command_event (event); |
1615 | 1619 |
1616 return event; | 1620 return event; |
1617 } | 1621 } |
1618 | 1622 |
2237 switch (XEVENT_TYPE (event)) | 2241 switch (XEVENT_TYPE (event)) |
2238 { | 2242 { |
2239 default: | 2243 default: |
2240 goto RETURN; | 2244 goto RETURN; |
2241 case button_release_event: | 2245 case button_release_event: |
2242 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
2243 case dnd_drop_event: | |
2244 #endif | |
2245 case misc_user_event: | 2246 case misc_user_event: |
2246 /* don't echo menu accelerator keys */ | 2247 /* don't echo menu accelerator keys */ |
2247 reset_key_echo (command_builder, 1); | 2248 reset_key_echo (command_builder, 1); |
2248 goto EXECUTE_KEY; | 2249 goto EXECUTE_KEY; |
2249 case button_press_event: /* key or mouse input can trigger prompting */ | 2250 case button_press_event: /* key or mouse input can trigger prompting */ |
4031 EVENT_CHAIN_LOOP (event, Vthis_command_keys) | 4032 EVENT_CHAIN_LOOP (event, Vthis_command_keys) |
4032 { | 4033 { |
4033 if (EVENTP (event) | 4034 if (EVENTP (event) |
4034 && (XEVENT_TYPE (event) == button_press_event | 4035 && (XEVENT_TYPE (event) == button_press_event |
4035 || XEVENT_TYPE (event) == button_release_event | 4036 || XEVENT_TYPE (event) == button_release_event |
4036 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
4037 || XEVENT_TYPE (event) == dnd_drop_event | |
4038 #endif | |
4039 || XEVENT_TYPE (event) == misc_user_event)) | 4037 || XEVENT_TYPE (event) == misc_user_event)) |
4040 { | 4038 { |
4041 if (!n) | 4039 if (!n) |
4042 { | 4040 { |
4043 /* must copy to avoid an abort() in next_event_internal() */ | 4041 /* must copy to avoid an abort() in next_event_internal() */ |
4065 if (EVENTP (event)) | 4063 if (EVENTP (event)) |
4066 switch (XEVENT_TYPE (event)) | 4064 switch (XEVENT_TYPE (event)) |
4067 { | 4065 { |
4068 case button_press_event : | 4066 case button_press_event : |
4069 case button_release_event : | 4067 case button_release_event : |
4070 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
4071 case dnd_drop_event: | |
4072 #endif | |
4073 case misc_user_event : | 4068 case misc_user_event : |
4074 if (n == 0) | 4069 if (n == 0) |
4075 return event; | 4070 return event; |
4076 n--; | 4071 n--; |
4077 break; | 4072 break; |
4171 if (e->event_type == key_press_event) | 4166 if (e->event_type == key_press_event) |
4172 e->event.key.modifiers |= MOD_META; | 4167 e->event.key.modifiers |= MOD_META; |
4173 else if (e->event_type == button_press_event | 4168 else if (e->event_type == button_press_event |
4174 || e->event_type == button_release_event) | 4169 || e->event_type == button_release_event) |
4175 e->event.button.modifiers |= MOD_META; | 4170 e->event.button.modifiers |= MOD_META; |
4176 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
4177 else if (e->event_type == dnd_drop_event) | |
4178 e->event.dnd_drop.modifiers |= MOD_META; | |
4179 #endif | |
4180 else | 4171 else |
4181 abort (); | 4172 abort (); |
4182 | 4173 |
4183 { | 4174 { |
4184 int tckn = event_chain_count (Vthis_command_keys); | 4175 int tckn = event_chain_count (Vthis_command_keys); |
4274 case key_press_event: | 4265 case key_press_event: |
4275 Vcurrent_mouse_event = Qnil; | 4266 Vcurrent_mouse_event = Qnil; |
4276 break; | 4267 break; |
4277 case button_press_event: | 4268 case button_press_event: |
4278 case button_release_event: | 4269 case button_release_event: |
4279 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
4280 case dnd_drop_event: | |
4281 #endif | |
4282 case misc_user_event: | 4270 case misc_user_event: |
4283 Vcurrent_mouse_event = Fcopy_event (event, Qnil); | 4271 Vcurrent_mouse_event = Fcopy_event (event, Qnil); |
4284 break; | 4272 break; |
4285 default: break; | 4273 default: break; |
4286 } | 4274 } |
4504 command_builder = XCOMMAND_BUILDER (XCONSOLE (console)->command_builder); | 4492 command_builder = XCOMMAND_BUILDER (XCONSOLE (console)->command_builder); |
4505 switch (XEVENT (event)->event_type) | 4493 switch (XEVENT (event)->event_type) |
4506 { | 4494 { |
4507 case button_press_event: | 4495 case button_press_event: |
4508 case button_release_event: | 4496 case button_release_event: |
4509 #if defined(HAVE_OFFIX_DND) || defined(HAVE_MS_WINDOWS) | |
4510 case dnd_drop_event: | |
4511 #endif | |
4512 case key_press_event: | 4497 case key_press_event: |
4513 { | 4498 { |
4514 Lisp_Object leaf = lookup_command_event (command_builder, event, 1); | 4499 Lisp_Object leaf = lookup_command_event (command_builder, event, 1); |
4515 | 4500 |
4516 if (KEYMAPP (leaf)) | 4501 if (KEYMAPP (leaf)) |