comparison src/macterm.c @ 45803:9484de301252

Rename enum event_kind items.
author Pavel Janík <Pavel@Janik.cz>
date Thu, 13 Jun 2002 14:59:38 +0000
parents 0b6da8b7d7ac
children 39cdf9669519
comparison
equal deleted inserted replaced
45802:d4c9f3bd6dfa 45803:9484de301252
6763 EventRecord *event; 6763 EventRecord *event;
6764 struct frame *f; 6764 struct frame *f;
6765 { 6765 {
6766 Point mouseLoc; 6766 Point mouseLoc;
6767 6767
6768 result->kind = mouse_click; 6768 result->kind = MOUSE_CLICK_EVENT;
6769 result->code = 0; /* only one mouse button */ 6769 result->code = 0; /* only one mouse button */
6770 result->timestamp = event->when; 6770 result->timestamp = event->when;
6771 result->modifiers = event->what == mouseDown ? down_modifier : up_modifier; 6771 result->modifiers = event->what == mouseDown ? down_modifier : up_modifier;
6772 6772
6773 mouseLoc = event->where; 6773 mouseLoc = event->where;
8710 bar = XSCROLL_BAR (bar)->next; 8710 bar = XSCROLL_BAR (bar)->next;
8711 } 8711 }
8712 } 8712 }
8713 8713
8714 /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind 8714 /* Handle a mouse click on the scroll bar BAR. If *EMACS_EVENT's kind
8715 is set to something other than no_event, it is enqueued. 8715 is set to something other than NO_EVENT, it is enqueued.
8716 8716
8717 This may be called from a signal handler, so we have to ignore GC 8717 This may be called from a signal handler, so we have to ignore GC
8718 mark bits. */ 8718 mark bits. */
8719 8719
8720 static void 8720 static void
8725 struct input_event *bufp; 8725 struct input_event *bufp;
8726 { 8726 {
8727 if (! GC_WINDOWP (bar->window)) 8727 if (! GC_WINDOWP (bar->window))
8728 abort (); 8728 abort ();
8729 8729
8730 bufp->kind = scroll_bar_click; 8730 bufp->kind = SCROLL_BAR_CLICK_EVENT;
8731 bufp->frame_or_window = bar->window; 8731 bufp->frame_or_window = bar->window;
8732 bufp->arg = Qnil; 8732 bufp->arg = Qnil;
8733 8733
8734 bar->dragging = Qnil; 8734 bar->dragging = Qnil;
8735 8735
12332 #endif 12332 #endif
12333 12333
12334 GlobalToLocal (&mouse_loc); 12334 GlobalToLocal (&mouse_loc);
12335 12335
12336 bufp->code = 0; /* only one mouse button */ 12336 bufp->code = 0; /* only one mouse button */
12337 bufp->kind = scroll_bar_click; 12337 bufp->kind = SCROLL_BAR_CLICK_EVENT;
12338 bufp->frame_or_window = tracked_scroll_bar->window; 12338 bufp->frame_or_window = tracked_scroll_bar->window;
12339 bufp->part = scroll_bar_handle; 12339 bufp->part = scroll_bar_handle;
12340 bufp->modifiers = up_modifier; 12340 bufp->modifiers = up_modifier;
12341 bufp->timestamp = er.when * (1000 / 60); 12341 bufp->timestamp = er.when * (1000 / 60);
12342 /* ticks to milliseconds */ 12342 /* ticks to milliseconds */
12357 case inMenuBar: 12357 case inMenuBar:
12358 { 12358 {
12359 struct frame *f = ((mac_output *) 12359 struct frame *f = ((mac_output *)
12360 GetWRefCon (FrontWindow ()))->mFP; 12360 GetWRefCon (FrontWindow ()))->mFP;
12361 saved_menu_event_location = er.where; 12361 saved_menu_event_location = er.where;
12362 bufp->kind = menu_bar_activate_event; 12362 bufp->kind = MENU_BAR_ACTIVATE_EVENT;
12363 XSETFRAME (bufp->frame_or_window, f); 12363 XSETFRAME (bufp->frame_or_window, f);
12364 count++; 12364 count++;
12365 } 12365 }
12366 break; 12366 break;
12367 12367
12419 tracked_scroll_bar = NULL; 12419 tracked_scroll_bar = NULL;
12420 } 12420 }
12421 } 12421 }
12422 else 12422 else
12423 { 12423 {
12424 bufp->kind = mouse_click; 12424 bufp->kind = MOUSE_CLICK_EVENT;
12425 XSETFRAME (bufp->frame_or_window, mwp->mFP); 12425 XSETFRAME (bufp->frame_or_window, mwp->mFP);
12426 if (er.what == mouseDown) 12426 if (er.what == mouseDown)
12427 mouse_tracking_in_progress 12427 mouse_tracking_in_progress
12428 = mouse_tracking_mouse_movement; 12428 = mouse_tracking_mouse_movement;
12429 else 12429 else
12458 break; 12458 break;
12459 12459
12460 case inGoAway: 12460 case inGoAway:
12461 if (TrackGoAway (window_ptr, er.where)) 12461 if (TrackGoAway (window_ptr, er.where))
12462 { 12462 {
12463 bufp->kind = delete_window_event; 12463 bufp->kind = DELETE_WINDOW_EVENT;
12464 XSETFRAME (bufp->frame_or_window, 12464 XSETFRAME (bufp->frame_or_window,
12465 ((mac_output *) GetWRefCon (window_ptr))->mFP); 12465 ((mac_output *) GetWRefCon (window_ptr))->mFP);
12466 count++; 12466 count++;
12467 } 12467 }
12468 break; 12468 break;
12500 ObscureCursor (); 12500 ObscureCursor ();
12501 12501
12502 if (keycode == 0x33) /* delete key (charCode translated to 0x8) */ 12502 if (keycode == 0x33) /* delete key (charCode translated to 0x8) */
12503 { 12503 {
12504 bufp->code = 0x7f; 12504 bufp->code = 0x7f;
12505 bufp->kind = ascii_keystroke; 12505 bufp->kind = ASCII_KEYSTROKE_EVENT;
12506 } 12506 }
12507 else if (keycode_to_xkeysym (keycode, &xkeysym)) 12507 else if (keycode_to_xkeysym (keycode, &xkeysym))
12508 { 12508 {
12509 bufp->code = 0xff00 | xkeysym; 12509 bufp->code = 0xff00 | xkeysym;
12510 bufp->kind = non_ascii_keystroke; 12510 bufp->kind = NON_ASCII_KEYSTROKE_EVENT;
12511 } 12511 }
12512 else 12512 else
12513 { 12513 {
12514 if (er.modifiers 12514 if (er.modifiers
12515 & (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey)) 12515 & (NILP (Vmac_command_key_is_meta) ? optionKey : cmdKey))
12526 bufp->code = KeyTranslate (kchr_ptr, new_keycode, 12526 bufp->code = KeyTranslate (kchr_ptr, new_keycode,
12527 &some_state) & 0xff; 12527 &some_state) & 0xff;
12528 } 12528 }
12529 else 12529 else
12530 bufp->code = er.message & charCodeMask; 12530 bufp->code = er.message & charCodeMask;
12531 bufp->kind = ascii_keystroke; 12531 bufp->kind = ASCII_KEYSTROKE_EVENT;
12532 } 12532 }
12533 } 12533 }
12534 12534
12535 /* If variable mac-convert-keyboard-input-to-latin-1 is non-nil, 12535 /* If variable mac-convert-keyboard-input-to-latin-1 is non-nil,
12536 convert non-ASCII characters typed at the Mac keyboard 12536 convert non-ASCII characters typed at the Mac keyboard
12537 (presumed to be in the Mac Roman encoding) to iso-latin-1 12537 (presumed to be in the Mac Roman encoding) to iso-latin-1
12538 encoding before they are passed to Emacs. This enables the 12538 encoding before they are passed to Emacs. This enables the
12539 Mac keyboard to be used to enter non-ASCII iso-latin-1 12539 Mac keyboard to be used to enter non-ASCII iso-latin-1
12540 characters directly. */ 12540 characters directly. */
12541 if (mac_keyboard_text_encoding != kTextEncodingMacRoman 12541 if (mac_keyboard_text_encoding != kTextEncodingMacRoman
12542 && bufp->kind == ascii_keystroke && bufp->code >= 128) 12542 && bufp->kind == ASCII_KEYSTROKE_EVENT && bufp->code >= 128)
12543 { 12543 {
12544 static TECObjectRef converter = NULL; 12544 static TECObjectRef converter = NULL;
12545 OSStatus the_err = noErr; 12545 OSStatus the_err = noErr;
12546 OSStatus convert_status = noErr; 12546 OSStatus convert_status = noErr;
12547 12547
12608 case kHighLevelEvent: 12608 case kHighLevelEvent:
12609 drag_and_drop_file_list = Qnil; 12609 drag_and_drop_file_list = Qnil;
12610 12610
12611 AEProcessAppleEvent(&er); 12611 AEProcessAppleEvent(&er);
12612 12612
12613 /* Build a drag_n_drop type event as is done in 12613 /* Build a DRAG_N_DROP_EVENT type event as is done in
12614 constuct_drag_n_drop in w32term.c. */ 12614 constuct_drag_n_drop in w32term.c. */
12615 if (!NILP (drag_and_drop_file_list)) 12615 if (!NILP (drag_and_drop_file_list))
12616 { 12616 {
12617 struct frame *f; 12617 struct frame *f;
12618 WindowPtr wp; 12618 WindowPtr wp;
12622 if (!wp) 12622 if (!wp)
12623 f = NULL; 12623 f = NULL;
12624 else 12624 else
12625 f = ((mac_output *) GetWRefCon (wp))->mFP; 12625 f = ((mac_output *) GetWRefCon (wp))->mFP;
12626 12626
12627 bufp->kind = drag_n_drop; 12627 bufp->kind = DRAG_N_DROP_EVENT;
12628 bufp->code = 0; 12628 bufp->code = 0;
12629 bufp->timestamp = er.when * (1000 / 60); 12629 bufp->timestamp = er.when * (1000 / 60);
12630 /* ticks to milliseconds */ 12630 /* ticks to milliseconds */
12631 bufp->modifiers = 0; 12631 bufp->modifiers = 0;
12632 12632