diff options
| author | Alexander Gramiak | 2019-04-11 09:00:58 -0600 |
|---|---|---|
| committer | Alexander Gramiak | 2019-04-26 16:10:49 -0600 |
| commit | da9541dd1086b7bab52940c82915efe114bb7419 (patch) | |
| tree | 24c279c12ad07586d77b30f410ce0ea1a38adcf6 /src/w32term.c | |
| parent | ff4e31fa328a2cee5197beb20f068eb021712b5c (diff) | |
| download | emacs-da9541dd1086b7bab52940c82915efe114bb7419.tar.gz emacs-da9541dd1086b7bab52940c82915efe114bb7419.zip | |
Add prefixes to some window system-dependent procedures
* src/nsterm.m (note_mouse_movement):
* src/w32fns.c (construct_console_modifiers):
* src/w32inevt.c:
* src/w32term.c (frame_highlight, frame_unhighlight)
(construct_mouse_click, construct_mouse_wheel, construct_drag_n_drop)
(lispy_file_action, queue_notifications, note_mouse_movement):
* src/w32term.h:
* src/xterm.c (frame_highlight, frame_unhighlight)
(construct_mouse_click, note_mouse_movement, get_current_wm_state):
Add and use window system prefixes.
Diffstat (limited to 'src/w32term.c')
| -rw-r--r-- | src/w32term.c | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/src/w32term.c b/src/w32term.c index a43d43c5583..edcdc56a9ea 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -180,8 +180,8 @@ static void w32_initialize (void); | |||
| 180 | static void x_update_end (struct frame *); | 180 | static void x_update_end (struct frame *); |
| 181 | static void w32_frame_up_to_date (struct frame *); | 181 | static void w32_frame_up_to_date (struct frame *); |
| 182 | static void x_clear_frame (struct frame *); | 182 | static void x_clear_frame (struct frame *); |
| 183 | static void frame_highlight (struct frame *); | 183 | static void w32_frame_highlight (struct frame *); |
| 184 | static void frame_unhighlight (struct frame *); | 184 | static void w32_frame_unhighlight (struct frame *); |
| 185 | static void x_new_focus_frame (struct w32_display_info *, | 185 | static void x_new_focus_frame (struct w32_display_info *, |
| 186 | struct frame *); | 186 | struct frame *); |
| 187 | static void x_focus_changed (int, int, struct w32_display_info *, | 187 | static void x_focus_changed (int, int, struct w32_display_info *, |
| @@ -2904,14 +2904,14 @@ x_scroll_run (struct window *w, struct run *run) | |||
| 2904 | ***********************************************************************/ | 2904 | ***********************************************************************/ |
| 2905 | 2905 | ||
| 2906 | static void | 2906 | static void |
| 2907 | frame_highlight (struct frame *f) | 2907 | w32_frame_highlight (struct frame *f) |
| 2908 | { | 2908 | { |
| 2909 | gui_update_cursor (f, 1); | 2909 | gui_update_cursor (f, 1); |
| 2910 | x_set_frame_alpha (f); | 2910 | x_set_frame_alpha (f); |
| 2911 | } | 2911 | } |
| 2912 | 2912 | ||
| 2913 | static void | 2913 | static void |
| 2914 | frame_unhighlight (struct frame *f) | 2914 | w32_frame_unhighlight (struct frame *f) |
| 2915 | { | 2915 | { |
| 2916 | gui_update_cursor (f, 1); | 2916 | gui_update_cursor (f, 1); |
| 2917 | x_set_frame_alpha (f); | 2917 | x_set_frame_alpha (f); |
| @@ -3059,9 +3059,9 @@ x_frame_rehighlight (struct w32_display_info *dpyinfo) | |||
| 3059 | if (dpyinfo->x_highlight_frame != old_highlight) | 3059 | if (dpyinfo->x_highlight_frame != old_highlight) |
| 3060 | { | 3060 | { |
| 3061 | if (old_highlight) | 3061 | if (old_highlight) |
| 3062 | frame_unhighlight (old_highlight); | 3062 | w32_frame_unhighlight (old_highlight); |
| 3063 | if (dpyinfo->x_highlight_frame) | 3063 | if (dpyinfo->x_highlight_frame) |
| 3064 | frame_highlight (dpyinfo->x_highlight_frame); | 3064 | w32_frame_highlight (dpyinfo->x_highlight_frame); |
| 3065 | } | 3065 | } |
| 3066 | } | 3066 | } |
| 3067 | 3067 | ||
| @@ -3168,7 +3168,8 @@ parse_button (int message, int xbutton, int * pbutton, int * pup) | |||
| 3168 | the mouse. */ | 3168 | the mouse. */ |
| 3169 | 3169 | ||
| 3170 | static Lisp_Object | 3170 | static Lisp_Object |
| 3171 | construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) | 3171 | w32_construct_mouse_click (struct input_event *result, W32Msg *msg, |
| 3172 | struct frame *f) | ||
| 3172 | { | 3173 | { |
| 3173 | int button = 0; | 3174 | int button = 0; |
| 3174 | int up = 0; | 3175 | int up = 0; |
| @@ -3194,7 +3195,8 @@ construct_mouse_click (struct input_event *result, W32Msg *msg, struct frame *f) | |||
| 3194 | } | 3195 | } |
| 3195 | 3196 | ||
| 3196 | static Lisp_Object | 3197 | static Lisp_Object |
| 3197 | construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f) | 3198 | w32_construct_mouse_wheel (struct input_event *result, W32Msg *msg, |
| 3199 | struct frame *f) | ||
| 3198 | { | 3200 | { |
| 3199 | POINT p; | 3201 | POINT p; |
| 3200 | int delta; | 3202 | int delta; |
| @@ -3228,7 +3230,8 @@ construct_mouse_wheel (struct input_event *result, W32Msg *msg, struct frame *f) | |||
| 3228 | } | 3230 | } |
| 3229 | 3231 | ||
| 3230 | static Lisp_Object | 3232 | static Lisp_Object |
| 3231 | construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f) | 3233 | w32_construct_drag_n_drop (struct input_event *result, W32Msg *msg, |
| 3234 | struct frame *f) | ||
| 3232 | { | 3235 | { |
| 3233 | Lisp_Object files; | 3236 | Lisp_Object files; |
| 3234 | Lisp_Object frame; | 3237 | Lisp_Object frame; |
| @@ -3307,7 +3310,7 @@ construct_drag_n_drop (struct input_event *result, W32Msg *msg, struct frame *f) | |||
| 3307 | /* File event notifications (see w32notify.c). */ | 3310 | /* File event notifications (see w32notify.c). */ |
| 3308 | 3311 | ||
| 3309 | Lisp_Object | 3312 | Lisp_Object |
| 3310 | lispy_file_action (DWORD action) | 3313 | w32_lispy_file_action (DWORD action) |
| 3311 | { | 3314 | { |
| 3312 | static char unknown_fmt[] = "unknown-action(%d)"; | 3315 | static char unknown_fmt[] = "unknown-action(%d)"; |
| 3313 | Lisp_Object retval; | 3316 | Lisp_Object retval; |
| @@ -3347,8 +3350,8 @@ lispy_file_action (DWORD action) | |||
| 3347 | function runs when the WM_EMACS_FILENOTIFY message arrives from a | 3350 | function runs when the WM_EMACS_FILENOTIFY message arrives from a |
| 3348 | watcher thread. */ | 3351 | watcher thread. */ |
| 3349 | static void | 3352 | static void |
| 3350 | queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f, | 3353 | w32_queue_notifications (struct input_event *event, W32Msg *msg, |
| 3351 | int *evcount) | 3354 | struct frame *f, int *evcount) |
| 3352 | { | 3355 | { |
| 3353 | struct notifications_set *ns = NULL; | 3356 | struct notifications_set *ns = NULL; |
| 3354 | Lisp_Object frame; | 3357 | Lisp_Object frame; |
| @@ -3407,7 +3410,7 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f, | |||
| 3407 | already be defined at this point. */ | 3410 | already be defined at this point. */ |
| 3408 | Lisp_Object fname | 3411 | Lisp_Object fname |
| 3409 | = code_convert_string_norecord (utf_16_fn, cs, 0); | 3412 | = code_convert_string_norecord (utf_16_fn, cs, 0); |
| 3410 | Lisp_Object action = lispy_file_action (fni->Action); | 3413 | Lisp_Object action = w32_lispy_file_action (fni->Action); |
| 3411 | 3414 | ||
| 3412 | event->kind = FILE_NOTIFY_EVENT; | 3415 | event->kind = FILE_NOTIFY_EVENT; |
| 3413 | event->timestamp = msg->msg.time; | 3416 | event->timestamp = msg->msg.time; |
| @@ -3445,7 +3448,7 @@ queue_notifications (struct input_event *event, W32Msg *msg, struct frame *f, | |||
| 3445 | another motion event, so we can check again the next time it moves. */ | 3448 | another motion event, so we can check again the next time it moves. */ |
| 3446 | 3449 | ||
| 3447 | static int | 3450 | static int |
| 3448 | note_mouse_movement (struct frame *frame, MSG *msg) | 3451 | w32_note_mouse_movement (struct frame *frame, MSG *msg) |
| 3449 | { | 3452 | { |
| 3450 | struct w32_display_info *dpyinfo; | 3453 | struct w32_display_info *dpyinfo; |
| 3451 | int mouse_x = LOWORD (msg->lParam); | 3454 | int mouse_x = LOWORD (msg->lParam); |
| @@ -5020,7 +5023,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5020 | last_mouse_window = window; | 5023 | last_mouse_window = window; |
| 5021 | } | 5024 | } |
| 5022 | 5025 | ||
| 5023 | if (!note_mouse_movement (f, &msg.msg)) | 5026 | if (!w32_note_mouse_movement (f, &msg.msg)) |
| 5024 | help_echo_string = previous_help_echo_string; | 5027 | help_echo_string = previous_help_echo_string; |
| 5025 | } | 5028 | } |
| 5026 | else | 5029 | else |
| @@ -5064,7 +5067,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5064 | 5067 | ||
| 5065 | if (f) | 5068 | if (f) |
| 5066 | { | 5069 | { |
| 5067 | construct_mouse_click (&inev, &msg, f); | 5070 | w32_construct_mouse_click (&inev, &msg, f); |
| 5068 | 5071 | ||
| 5069 | /* Is this in the tool-bar? */ | 5072 | /* Is this in the tool-bar? */ |
| 5070 | if (WINDOWP (f->tool_bar_window) | 5073 | if (WINDOWP (f->tool_bar_window) |
| @@ -5129,7 +5132,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5129 | || f == dpyinfo->w32_focus_frame) | 5132 | || f == dpyinfo->w32_focus_frame) |
| 5130 | /* Emit an Emacs wheel-up/down event. */ | 5133 | /* Emit an Emacs wheel-up/down event. */ |
| 5131 | { | 5134 | { |
| 5132 | construct_mouse_wheel (&inev, &msg, f); | 5135 | w32_construct_mouse_wheel (&inev, &msg, f); |
| 5133 | 5136 | ||
| 5134 | /* Ignore any mouse motion that happened before this | 5137 | /* Ignore any mouse motion that happened before this |
| 5135 | event; any subsequent mouse-movement Emacs events | 5138 | event; any subsequent mouse-movement Emacs events |
| @@ -5146,7 +5149,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5146 | 5149 | ||
| 5147 | if (f1 && FRAME_LIVE_P (f1) && FRAME_W32_P (f1)) | 5150 | if (f1 && FRAME_LIVE_P (f1) && FRAME_W32_P (f1)) |
| 5148 | { | 5151 | { |
| 5149 | construct_mouse_wheel (&inev, &msg, f1); | 5152 | w32_construct_mouse_wheel (&inev, &msg, f1); |
| 5150 | f1->mouse_moved = false; | 5153 | f1->mouse_moved = false; |
| 5151 | f1->last_tool_bar_item = -1; | 5154 | f1->last_tool_bar_item = -1; |
| 5152 | dpyinfo->last_mouse_frame = f1; | 5155 | dpyinfo->last_mouse_frame = f1; |
| @@ -5166,7 +5169,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5166 | f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 5169 | f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
| 5167 | 5170 | ||
| 5168 | if (f) | 5171 | if (f) |
| 5169 | construct_drag_n_drop (&inev, &msg, f); | 5172 | w32_construct_drag_n_drop (&inev, &msg, f); |
| 5170 | break; | 5173 | break; |
| 5171 | 5174 | ||
| 5172 | case WM_HSCROLL: | 5175 | case WM_HSCROLL: |
| @@ -5577,7 +5580,7 @@ w32_read_socket (struct terminal *terminal, | |||
| 5577 | case WM_EMACS_FILENOTIFY: | 5580 | case WM_EMACS_FILENOTIFY: |
| 5578 | f = x_window_to_frame (dpyinfo, msg.msg.hwnd); | 5581 | f = x_window_to_frame (dpyinfo, msg.msg.hwnd); |
| 5579 | if (f) | 5582 | if (f) |
| 5580 | queue_notifications (&inev, &msg, f, &count); | 5583 | w32_queue_notifications (&inev, &msg, f, &count); |
| 5581 | break; | 5584 | break; |
| 5582 | #endif | 5585 | #endif |
| 5583 | 5586 | ||