diff options
| author | Pavel Janík | 2001-12-19 07:24:46 +0000 |
|---|---|---|
| committer | Pavel Janík | 2001-12-19 07:24:46 +0000 |
| commit | 5b2b0b72d593e46253d130b06f88f303f59d6763 (patch) | |
| tree | 2c722fd193af5d71f4619a1c031b52db7f8f1dd5 /lib-src | |
| parent | b8509940e96d5e4d9f0c7de480291accbb3b56d1 (diff) | |
| download | emacs-5b2b0b72d593e46253d130b06f88f303f59d6763.tar.gz emacs-5b2b0b72d593e46253d130b06f88f303f59d6763.zip | |
Clean-up whitespaces.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/emacstool.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib-src/emacstool.c b/lib-src/emacstool.c index a246e1faacb..4c859d15c8e 100644 --- a/lib-src/emacstool.c +++ b/lib-src/emacstool.c | |||
| @@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 20 | 20 | ||
| 21 | /* | 21 | /* |
| 22 | * For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater) | 22 | * For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater) |
| 23 | * Insert a notifier filter-function to convert all useful input | 23 | * Insert a notifier filter-function to convert all useful input |
| 24 | * to "key" sequences that emacs can understand. See: Emacstool(1). | 24 | * to "key" sequences that emacs can understand. See: Emacstool(1). |
| 25 | * | 25 | * |
| 26 | * Author: Jeff Peck, Sun Microsystems, Inc. <peck@eng.sun.com> | 26 | * Author: Jeff Peck, Sun Microsystems, Inc. <peck@eng.sun.com> |
| @@ -111,7 +111,7 @@ FILE *console; /* for debugging: setenv DEBUGEMACSTOOL */ | |||
| 111 | 111 | ||
| 112 | Icon frame_icon; | 112 | Icon frame_icon; |
| 113 | /* make an icon_image for the default frame_icon */ | 113 | /* make an icon_image for the default frame_icon */ |
| 114 | static short default_image[258] = | 114 | static short default_image[258] = |
| 115 | { | 115 | { |
| 116 | #include <images/terminal.icon> | 116 | #include <images/terminal.icon> |
| 117 | }; | 117 | }; |
| @@ -157,7 +157,7 @@ button_value (event) | |||
| 157 | * we must keep track of the accumulated time. | 157 | * we must keep track of the accumulated time. |
| 158 | * | 158 | * |
| 159 | * If someone writes a SUN-SET-INPUT-MASK for emacstool, | 159 | * If someone writes a SUN-SET-INPUT-MASK for emacstool, |
| 160 | * That could be used to selectively disable UP events, | 160 | * That could be used to selectively disable UP events, |
| 161 | * and then this cruft wouldn't be necessary. | 161 | * and then this cruft wouldn't be necessary. |
| 162 | */ | 162 | */ |
| 163 | static long prev_event_sec = 0; | 163 | static long prev_event_sec = 0; |
| @@ -173,13 +173,13 @@ time_delta (now_sec, now_usec, prev_sec, prev_usec) | |||
| 173 | { | 173 | { |
| 174 | long sec_delta = now_sec - prev_sec; | 174 | long sec_delta = now_sec - prev_sec; |
| 175 | long usec_delta = now_usec - prev_usec; | 175 | long usec_delta = now_usec - prev_usec; |
| 176 | 176 | ||
| 177 | if (usec_delta < 0) { /* "borrow" a second */ | 177 | if (usec_delta < 0) { /* "borrow" a second */ |
| 178 | usec_delta += 1000000; | 178 | usec_delta += 1000000; |
| 179 | --sec_delta; | 179 | --sec_delta; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | if (sec_delta >= 10) | 182 | if (sec_delta >= 10) |
| 183 | return (9999); /* Infinity */ | 183 | return (9999); /* Infinity */ |
| 184 | else | 184 | else |
| 185 | return ((sec_delta * 1000) + (usec_delta / 1000)); | 185 | return ((sec_delta * 1000) + (usec_delta / 1000)); |
| @@ -215,18 +215,18 @@ input_event_filter_function (window, event, arg, type) | |||
| 215 | 215 | ||
| 216 | /* UP L5 & L7 is Expose & Open, let them pass to sunview */ | 216 | /* UP L5 & L7 is Expose & Open, let them pass to sunview */ |
| 217 | if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7)) | 217 | if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7)) |
| 218 | if(event_is_up (event)) | 218 | if(event_is_up (event)) |
| 219 | return notify_next_event_func (window, event, arg, type); | 219 | return notify_next_event_func (window, event, arg, type); |
| 220 | else return NOTIFY_IGNORED; | 220 | else return NOTIFY_IGNORED; |
| 221 | 221 | ||
| 222 | if (event_is_button (event)) { /* do Mouse Button events */ | 222 | if (event_is_button (event)) { /* do Mouse Button events */ |
| 223 | /* Commented out so that we send mouse up events too. | 223 | /* Commented out so that we send mouse up events too. |
| 224 | if (event_is_up (event)) | 224 | if (event_is_up (event)) |
| 225 | return notify_next_event_func (window, event, arg, type); | 225 | return notify_next_event_func (window, event, arg, type); |
| 226 | */ | 226 | */ |
| 227 | time_stamp = event_time (event); | 227 | time_stamp = event_time (event); |
| 228 | ttysw_input (tty_win, mouse_prefix, m_prefix_length); | 228 | ttysw_input (tty_win, mouse_prefix, m_prefix_length); |
| 229 | sprintf (buffer, "(%d %d %d %d)\015", | 229 | sprintf (buffer, "(%d %d %d %d)\015", |
| 230 | button_value (event), | 230 | button_value (event), |
| 231 | (event_x (event) - left_margin) / font_width, | 231 | (event_x (event) - left_margin) / font_width, |
| 232 | event_y (event) / font_height, | 232 | event_y (event) / font_height, |
| @@ -238,14 +238,14 @@ input_event_filter_function (window, event, arg, type) | |||
| 238 | prev_event_usec = time_stamp.tv_usec; | 238 | prev_event_usec = time_stamp.tv_usec; |
| 239 | return NOTIFY_IGNORED; | 239 | return NOTIFY_IGNORED; |
| 240 | } | 240 | } |
| 241 | 241 | ||
| 242 | { /* Do the function key events */ | 242 | { /* Do the function key events */ |
| 243 | int d; | 243 | int d; |
| 244 | char c = (char) 0; | 244 | char c = (char) 0; |
| 245 | if ((event_is_key_left (event)) ? | 245 | if ((event_is_key_left (event)) ? |
| 246 | ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') : | 246 | ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') : |
| 247 | ((event_is_key_right (event)) ? | 247 | ((event_is_key_right (event)) ? |
| 248 | ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') : | 248 | ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') : |
| 249 | ((event_is_key_top (event)) ? | 249 | ((event_is_key_top (event)) ? |
| 250 | ((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0))) | 250 | ((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0))) |
| 251 | { | 251 | { |
| @@ -256,14 +256,14 @@ input_event_filter_function (window, event, arg, type) | |||
| 256 | if (event_meta_is_down (event)) c = c + 128; | 256 | if (event_meta_is_down (event)) c = c + 128; |
| 257 | #ifdef WANT_CAPS_LOCK | 257 | #ifdef WANT_CAPS_LOCK |
| 258 | /* set a toggle and relabel window so T1 can act like caps-lock */ | 258 | /* set a toggle and relabel window so T1 can act like caps-lock */ |
| 259 | if (event_id(event) == KEY_TOP(1)) | 259 | if (event_id(event) == KEY_TOP(1)) |
| 260 | { | 260 | { |
| 261 | /* make a frame label with and without CAPS */ | 261 | /* make a frame label with and without CAPS */ |
| 262 | strcpy (buffer, Caps); | 262 | strcpy (buffer, Caps); |
| 263 | title = &buffer[CAPS_LEN]; | 263 | title = &buffer[CAPS_LEN]; |
| 264 | strncpy (title, (char *)window_get (frame, FRAME_LABEL), | 264 | strncpy (title, (char *)window_get (frame, FRAME_LABEL), |
| 265 | BUFFER_SIZE - CAPS_LEN); | 265 | BUFFER_SIZE - CAPS_LEN); |
| 266 | buffer[BUFFER_SIZE] = (char) 0; | 266 | buffer[BUFFER_SIZE] = (char) 0; |
| 267 | if (strncmp (title, Caps, CAPS_LEN) == 0) | 267 | if (strncmp (title, Caps, CAPS_LEN) == 0) |
| 268 | title += CAPS_LEN; /* already Caps */ | 268 | title += CAPS_LEN; /* already Caps */ |
| 269 | caps_lock = (caps_lock ? 0 : CAPS_LEN); | 269 | caps_lock = (caps_lock ? 0 : CAPS_LEN); |
| @@ -278,7 +278,7 @@ input_event_filter_function (window, event, arg, type) | |||
| 278 | return NOTIFY_IGNORED; | 278 | return NOTIFY_IGNORED; |
| 279 | } | 279 | } |
| 280 | } | 280 | } |
| 281 | if ((event_is_ascii(event) || event_is_meta(event)) | 281 | if ((event_is_ascii(event) || event_is_meta(event)) |
| 282 | && event_is_up(event)) return NOTIFY_IGNORED; | 282 | && event_is_up(event)) return NOTIFY_IGNORED; |
| 283 | #ifdef WANT_CAPS_LOCK | 283 | #ifdef WANT_CAPS_LOCK |
| 284 | /* shift alpha chars to upper case if toggle is set */ | 284 | /* shift alpha chars to upper case if toggle is set */ |
| @@ -302,7 +302,7 @@ main (argc, argv) | |||
| 302 | char **argv; | 302 | char **argv; |
| 303 | { | 303 | { |
| 304 | int error_code; /* Error codes */ | 304 | int error_code; /* Error codes */ |
| 305 | 305 | ||
| 306 | #ifdef JLE | 306 | #ifdef JLE |
| 307 | setlocale(LC_ALL, ""); | 307 | setlocale(LC_ALL, ""); |
| 308 | #endif JLE | 308 | #endif JLE |
| @@ -330,10 +330,10 @@ main (argc, argv) | |||
| 330 | {fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ; | 330 | {fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ; |
| 331 | } ; | 331 | } ; |
| 332 | } ; | 332 | } ; |
| 333 | 333 | ||
| 334 | /* find command to run as subprocess in window */ | 334 | /* find command to run as subprocess in window */ |
| 335 | if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command name */ | 335 | if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command name */ |
| 336 | argv[0] = emacs_name; | 336 | argv[0] = emacs_name; |
| 337 | /* Emacstool recognizes two special args: -rc <file> and -bold <bold-name> */ | 337 | /* Emacstool recognizes two special args: -rc <file> and -bold <bold-name> */ |
| 338 | for (argc = 1; argv[argc]; argc++) /* Use last one on line */ | 338 | for (argc = 1; argv[argc]; argc++) /* Use last one on line */ |
| 339 | { | 339 | { |
| @@ -346,7 +346,7 @@ main (argc, argv) | |||
| 346 | } | 346 | } |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | if (!(strcmp ("-bold", argv[argc]))) | 349 | if (!(strcmp ("-bold", argv[argc]))) |
| 350 | {int i = argc; | 350 | {int i = argc; |
| 351 | argv[argc--]=0; /* kill the -bold argument */ | 351 | argv[argc--]=0; /* kill the -bold argument */ |
| 352 | if (argv[i+1]) { /* move to bold_name and squeeze the rest */ | 352 | if (argv[i+1]) { /* move to bold_name and squeeze the rest */ |
| @@ -407,9 +407,9 @@ int interpose_on_window(argc,argv) | |||
| 407 | 407 | ||
| 408 | /* Create a tty with emacs in it */ | 408 | /* Create a tty with emacs in it */ |
| 409 | tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE, | 409 | tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE, |
| 410 | TTY_QUIT_ON_CHILD_DEATH, TRUE, | 410 | TTY_QUIT_ON_CHILD_DEATH, TRUE, |
| 411 | TTY_BOLDSTYLE, TTYSW_BOLD_INVERT, | 411 | TTY_BOLDSTYLE, TTYSW_BOLD_INVERT, |
| 412 | TTY_ARGV, argv, | 412 | TTY_ARGV, argv, |
| 413 | 0); | 413 | 0); |
| 414 | 414 | ||
| 415 | if (bold_name) { | 415 | if (bold_name) { |
| @@ -435,15 +435,15 @@ int interpose_on_window(argc,argv) | |||
| 435 | 435 | ||
| 436 | tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0); | 436 | tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0); |
| 437 | xv_set(tty_view, | 437 | xv_set(tty_view, |
| 438 | WIN_CONSUME_EVENTS, | 438 | WIN_CONSUME_EVENTS, |
| 439 | WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, | 439 | WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, |
| 440 | ACTION_ADJUST, ACTION_MENU, | 440 | ACTION_ADJUST, ACTION_MENU, |
| 441 | WIN_ASCII_EVENTS, | 441 | WIN_ASCII_EVENTS, |
| 442 | WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, | 442 | WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, |
| 443 | 0, | 443 | 0, |
| 444 | 0); | 444 | 0); |
| 445 | /* Interpose my event function */ | 445 | /* Interpose my event function */ |
| 446 | return (int) notify_interpose_event_func | 446 | return (int) notify_interpose_event_func |
| 447 | (tty_view, input_event_filter_function, NOTIFY_SAFE); | 447 | (tty_view, input_event_filter_function, NOTIFY_SAFE); |
| 448 | } | 448 | } |
| 449 | #else | 449 | #else |
| @@ -481,20 +481,20 @@ int interpose_on_window (argc, argv) | |||
| 481 | 481 | ||
| 482 | tty_view = tty_win; | 482 | tty_view = tty_win; |
| 483 | window_set(tty_view, | 483 | window_set(tty_view, |
| 484 | WIN_CONSUME_PICK_EVENTS, | 484 | WIN_CONSUME_PICK_EVENTS, |
| 485 | WIN_STOP, | 485 | WIN_STOP, |
| 486 | WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, | 486 | WIN_MOUSE_BUTTONS, WIN_UP_EVENTS, |
| 487 | /* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */ | 487 | /* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */ |
| 488 | 0, | 488 | 0, |
| 489 | WIN_CONSUME_KBD_EVENTS, | 489 | WIN_CONSUME_KBD_EVENTS, |
| 490 | WIN_STOP, | 490 | WIN_STOP, |
| 491 | WIN_ASCII_EVENTS, | 491 | WIN_ASCII_EVENTS, |
| 492 | WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, | 492 | WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS, |
| 493 | /* WIN_UP_ASCII_EVENTS, */ | 493 | /* WIN_UP_ASCII_EVENTS, */ |
| 494 | 0, | 494 | 0, |
| 495 | 0); | 495 | 0); |
| 496 | /* Interpose my event function */ | 496 | /* Interpose my event function */ |
| 497 | return (int) notify_interpose_event_func | 497 | return (int) notify_interpose_event_func |
| 498 | (tty_view, input_event_filter_function, NOTIFY_SAFE); | 498 | (tty_view, input_event_filter_function, NOTIFY_SAFE); |
| 499 | } | 499 | } |
| 500 | #endif XVIEW | 500 | #endif XVIEW |