[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lib-src/emacstool.c
From: |
Pavel Janík |
Subject: |
[Emacs-diffs] Changes to emacs/lib-src/emacstool.c |
Date: |
Wed, 19 Dec 2001 02:24:46 -0500 |
Index: emacs/lib-src/emacstool.c
diff -c emacs/lib-src/emacstool.c:1.7 emacs/lib-src/emacstool.c:1.8
*** emacs/lib-src/emacstool.c:1.7 Mon Jan 15 04:18:04 1996
--- emacs/lib-src/emacstool.c Wed Dec 19 02:24:46 2001
***************
*** 20,26 ****
/*
* For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater)
! * Insert a notifier filter-function to convert all useful input
* to "key" sequences that emacs can understand. See: Emacstool(1).
*
* Author: Jeff Peck, Sun Microsystems, Inc. <address@hidden>
--- 20,26 ----
/*
* For Emacs in SunView/Sun-Windows: (supported by Sun Unix v3.2 or greater)
! * Insert a notifier filter-function to convert all useful input
* to "key" sequences that emacs can understand. See: Emacstool(1).
*
* Author: Jeff Peck, Sun Microsystems, Inc. <address@hidden>
***************
*** 111,117 ****
Icon frame_icon;
/* make an icon_image for the default frame_icon */
! static short default_image[258] =
{
#include <images/terminal.icon>
};
--- 111,117 ----
Icon frame_icon;
/* make an icon_image for the default frame_icon */
! static short default_image[258] =
{
#include <images/terminal.icon>
};
***************
*** 157,163 ****
* we must keep track of the accumulated time.
*
* If someone writes a SUN-SET-INPUT-MASK for emacstool,
! * That could be used to selectively disable UP events,
* and then this cruft wouldn't be necessary.
*/
static long prev_event_sec = 0;
--- 157,163 ----
* we must keep track of the accumulated time.
*
* If someone writes a SUN-SET-INPUT-MASK for emacstool,
! * That could be used to selectively disable UP events,
* and then this cruft wouldn't be necessary.
*/
static long prev_event_sec = 0;
***************
*** 173,185 ****
{
long sec_delta = now_sec - prev_sec;
long usec_delta = now_usec - prev_usec;
!
if (usec_delta < 0) { /* "borrow" a second */
usec_delta += 1000000;
--sec_delta;
}
!
! if (sec_delta >= 10)
return (9999); /* Infinity */
else
return ((sec_delta * 1000) + (usec_delta / 1000));
--- 173,185 ----
{
long sec_delta = now_sec - prev_sec;
long usec_delta = now_usec - prev_usec;
!
if (usec_delta < 0) { /* "borrow" a second */
usec_delta += 1000000;
--sec_delta;
}
!
! if (sec_delta >= 10)
return (9999); /* Infinity */
else
return ((sec_delta * 1000) + (usec_delta / 1000));
***************
*** 215,232 ****
/* UP L5 & L7 is Expose & Open, let them pass to sunview */
if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7))
! if(event_is_up (event))
return notify_next_event_func (window, event, arg, type);
else return NOTIFY_IGNORED;
if (event_is_button (event)) { /* do Mouse Button events */
/* Commented out so that we send mouse up events too.
! if (event_is_up (event))
return notify_next_event_func (window, event, arg, type);
*/
time_stamp = event_time (event);
ttysw_input (tty_win, mouse_prefix, m_prefix_length);
! sprintf (buffer, "(%d %d %d %d)\015",
button_value (event),
(event_x (event) - left_margin) / font_width,
event_y (event) / font_height,
--- 215,232 ----
/* UP L5 & L7 is Expose & Open, let them pass to sunview */
if (event_id(event) == KEY_LEFT(5) || event_id(event) == KEY_LEFT(7))
! if(event_is_up (event))
return notify_next_event_func (window, event, arg, type);
else return NOTIFY_IGNORED;
if (event_is_button (event)) { /* do Mouse Button events */
/* Commented out so that we send mouse up events too.
! if (event_is_up (event))
return notify_next_event_func (window, event, arg, type);
*/
time_stamp = event_time (event);
ttysw_input (tty_win, mouse_prefix, m_prefix_length);
! sprintf (buffer, "(%d %d %d %d)\015",
button_value (event),
(event_x (event) - left_margin) / font_width,
event_y (event) / font_height,
***************
*** 238,251 ****
prev_event_usec = time_stamp.tv_usec;
return NOTIFY_IGNORED;
}
!
{ /* Do the function key events */
int d;
char c = (char) 0;
if ((event_is_key_left (event)) ?
! ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') :
((event_is_key_right (event)) ?
! ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') :
((event_is_key_top (event)) ?
((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0)))
{
--- 238,251 ----
prev_event_usec = time_stamp.tv_usec;
return NOTIFY_IGNORED;
}
!
{ /* Do the function key events */
int d;
char c = (char) 0;
if ((event_is_key_left (event)) ?
! ((d = event_id(event) - KEY_LEFT(1) + 'a'), c='l') :
((event_is_key_right (event)) ?
! ((d = event_id(event) - KEY_RIGHT(1) + 'a'), c='r') :
((event_is_key_top (event)) ?
((d = event_id(event) - KEY_TOP(1) + 'a'), c='t') : 0)))
{
***************
*** 256,269 ****
if (event_meta_is_down (event)) c = c + 128;
#ifdef WANT_CAPS_LOCK
/* set a toggle and relabel window so T1 can act like caps-lock */
! if (event_id(event) == KEY_TOP(1))
{
/* make a frame label with and without CAPS */
! strcpy (buffer, Caps);
title = &buffer[CAPS_LEN];
strncpy (title, (char *)window_get (frame, FRAME_LABEL),
BUFFER_SIZE - CAPS_LEN);
! buffer[BUFFER_SIZE] = (char) 0;
if (strncmp (title, Caps, CAPS_LEN) == 0)
title += CAPS_LEN; /* already Caps */
caps_lock = (caps_lock ? 0 : CAPS_LEN);
--- 256,269 ----
if (event_meta_is_down (event)) c = c + 128;
#ifdef WANT_CAPS_LOCK
/* set a toggle and relabel window so T1 can act like caps-lock */
! if (event_id(event) == KEY_TOP(1))
{
/* make a frame label with and without CAPS */
! strcpy (buffer, Caps);
title = &buffer[CAPS_LEN];
strncpy (title, (char *)window_get (frame, FRAME_LABEL),
BUFFER_SIZE - CAPS_LEN);
! buffer[BUFFER_SIZE] = (char) 0;
if (strncmp (title, Caps, CAPS_LEN) == 0)
title += CAPS_LEN; /* already Caps */
caps_lock = (caps_lock ? 0 : CAPS_LEN);
***************
*** 278,284 ****
return NOTIFY_IGNORED;
}
}
! if ((event_is_ascii(event) || event_is_meta(event))
&& event_is_up(event)) return NOTIFY_IGNORED;
#ifdef WANT_CAPS_LOCK
/* shift alpha chars to upper case if toggle is set */
--- 278,284 ----
return NOTIFY_IGNORED;
}
}
! if ((event_is_ascii(event) || event_is_meta(event))
&& event_is_up(event)) return NOTIFY_IGNORED;
#ifdef WANT_CAPS_LOCK
/* shift alpha chars to upper case if toggle is set */
***************
*** 302,308 ****
char **argv;
{
int error_code; /* Error codes */
!
#ifdef JLE
setlocale(LC_ALL, "");
#endif JLE
--- 302,308 ----
char **argv;
{
int error_code; /* Error codes */
!
#ifdef JLE
setlocale(LC_ALL, "");
#endif JLE
***************
*** 330,339 ****
{fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ;
} ;
} ;
!
/* find command to run as subprocess in window */
if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command
name */
! argv[0] = emacs_name;
/* Emacstool recognizes two special args: -rc <file> and -bold <bold-name>
*/
for (argc = 1; argv[argc]; argc++) /* Use last one on line */
{
--- 330,339 ----
{fprintf (stderr, "%s: Could not clear TERMCAP\n", argv[0]) ;} ;
} ;
} ;
!
/* find command to run as subprocess in window */
if (!(argv[0] = (char *)getenv("EMACSTOOL"))) /* Set emacs command
name */
! argv[0] = emacs_name;
/* Emacstool recognizes two special args: -rc <file> and -bold <bold-name>
*/
for (argc = 1; argv[argc]; argc++) /* Use last one on line */
{
***************
*** 346,352 ****
}
}
! if (!(strcmp ("-bold", argv[argc])))
{int i = argc;
argv[argc--]=0; /* kill the -bold argument */
if (argv[i+1]) { /* move to bold_name and squeeze the rest */
--- 346,352 ----
}
}
! if (!(strcmp ("-bold", argv[argc])))
{int i = argc;
argv[argc--]=0; /* kill the -bold argument */
if (argv[i+1]) { /* move to bold_name and squeeze the rest */
***************
*** 407,415 ****
/* Create a tty with emacs in it */
tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE,
! TTY_QUIT_ON_CHILD_DEATH, TRUE,
TTY_BOLDSTYLE, TTYSW_BOLD_INVERT,
! TTY_ARGV, argv,
0);
if (bold_name) {
--- 407,415 ----
/* Create a tty with emacs in it */
tty_win = xv_create (frame, SWTYPE, WIN_IS_CLIENT_PANE,
! TTY_QUIT_ON_CHILD_DEATH, TRUE,
TTY_BOLDSTYLE, TTYSW_BOLD_INVERT,
! TTY_ARGV, argv,
0);
if (bold_name) {
***************
*** 435,449 ****
tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0);
xv_set(tty_view,
! WIN_CONSUME_EVENTS,
WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
ACTION_ADJUST, ACTION_MENU,
! WIN_ASCII_EVENTS,
WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
0,
0);
/* Interpose my event function */
! return (int) notify_interpose_event_func
(tty_view, input_event_filter_function, NOTIFY_SAFE);
}
#else
--- 435,449 ----
tty_view = (Xv_Window) xv_get (tty_win, OPENWIN_NTH_VIEW, 0);
xv_set(tty_view,
! WIN_CONSUME_EVENTS,
WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
ACTION_ADJUST, ACTION_MENU,
! WIN_ASCII_EVENTS,
WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
0,
0);
/* Interpose my event function */
! return (int) notify_interpose_event_func
(tty_view, input_event_filter_function, NOTIFY_SAFE);
}
#else
***************
*** 481,500 ****
tty_view = tty_win;
window_set(tty_view,
! WIN_CONSUME_PICK_EVENTS,
WIN_STOP,
WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
/* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */
0,
! WIN_CONSUME_KBD_EVENTS,
WIN_STOP,
! WIN_ASCII_EVENTS,
WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
/* WIN_UP_ASCII_EVENTS, */
0,
0);
/* Interpose my event function */
! return (int) notify_interpose_event_func
(tty_view, input_event_filter_function, NOTIFY_SAFE);
}
#endif XVIEW
--- 481,500 ----
tty_view = tty_win;
window_set(tty_view,
! WIN_CONSUME_PICK_EVENTS,
WIN_STOP,
WIN_MOUSE_BUTTONS, WIN_UP_EVENTS,
/* LOC_WINENTER, LOC_WINEXIT, LOC_MOVE, */
0,
! WIN_CONSUME_KBD_EVENTS,
WIN_STOP,
! WIN_ASCII_EVENTS,
WIN_LEFT_KEYS, WIN_TOP_KEYS, WIN_RIGHT_KEYS,
/* WIN_UP_ASCII_EVENTS, */
0,
0);
/* Interpose my event function */
! return (int) notify_interpose_event_func
(tty_view, input_event_filter_function, NOTIFY_SAFE);
}
#endif XVIEW
- [Emacs-diffs] Changes to emacs/lib-src/emacstool.c,
Pavel Janík <=