Tue Sep 28 14:18:44 PDT 1999 Michael Jennings <mej@eterm.org>

Several fixes here, some of which I forgot to commit a couple days
	ago.  Oopsie. =)


SVN revision: 438
This commit is contained in:
Michael Jennings 1999-09-28 19:38:43 +00:00
parent 5cf9f10625
commit 3630db17ab
20 changed files with 57 additions and 79 deletions

View File

@ -2494,3 +2494,9 @@ Fri Sep 24 13:05:40 PDT 1999 Michael Jennings <mej@eterm.org>
would hang if you had anything in auto mode and restarted E. would hang if you had anything in auto mode and restarted E.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Tue Sep 28 14:18:44 PDT 1999 Michael Jennings <mej@eterm.org>
Several fixes here, some of which I forgot to commit a couple days
ago. Oopsie. =)
-------------------------------------------------------------------------------

View File

@ -12,7 +12,7 @@ Eterm_SOURCES = main.c
Eterm_DEPENDENCIES = libEterm.la Eterm_DEPENDENCIES = libEterm.la
Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir) Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
INCLUDES = -I. -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS) INCLUDES = -I. -I$(top_srcdir) -I$(top_srcdir)/libmej -I.. -I$(includedir) -I$(prefix)/include $(X_CFLAGS)
LDADD = libEterm.la $(top_builddir)/libmej/libmej.la -L$(libdir) -L$(prefix)/lib $(LIBS) $(GRLIBS) $(X_LIBS) LDADD = libEterm.la $(top_builddir)/libmej/libmej.la -L$(libdir) -L$(prefix)/lib $(LIBS) $(GRLIBS) $(X_LIBS)
EXTRA_DIST = actions.h command.h debug.h e.h eterm_utmp.h events.h feature.h font.h graphics.h grkelot.h grx.h main.h menus.h misc.h \ EXTRA_DIST = actions.h command.h debug.h e.h eterm_utmp.h events.h feature.h font.h graphics.h grkelot.h grx.h main.h menus.h misc.h \

View File

@ -1775,13 +1775,13 @@ static void
xim_get_area(XRectangle *preedit_rect, XRectangle *status_rect, xim_get_area(XRectangle *preedit_rect, XRectangle *status_rect,
XRectangle *needed_rect) XRectangle *needed_rect)
{ {
preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (scrollBar.width) : 0); preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (scrollbar_trough_width()) : 0);
preedit_rect->y = Height2Pixel(TermWin.nrow - 1); preedit_rect->y = Height2Pixel(TermWin.nrow - 1);
preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (scrollBar.width) : 0); preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (scrollbar_trough_width()) : 0);
preedit_rect->height = Height2Pixel(1); preedit_rect->height = Height2Pixel(1);
status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (scrollBar.width) : 0; status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (scrollbar_trough_width()) : 0;
status_rect->y = Height2Pixel(TermWin.nrow - 1); status_rect->y = Height2Pixel(TermWin.nrow - 1);
status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1); status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1);

View File

@ -53,7 +53,6 @@
# define DndLink 7 # define DndLink 7
#endif #endif
# define menuBar_esc 10
# define scrollBar_esc 30 # define scrollBar_esc 30
/* Motif window hints */ /* Motif window hints */

View File

@ -50,6 +50,7 @@ extern void enl_query_for_image(unsigned char);
extern void eterm_ipc_parse(char *); extern void eterm_ipc_parse(char *);
extern void eterm_ipc_send(char *); extern void eterm_ipc_send(char *);
extern char *eterm_ipc_get(void); extern char *eterm_ipc_get(void);
extern char *enl_send_and_wait(char *);
extern void eterm_handle_winop(char *); extern void eterm_handle_winop(char *);
_XFUNCPROTOEND _XFUNCPROTOEND

View File

@ -57,7 +57,7 @@ unsigned char keypress_exit = 0;
event_master_t event_master; event_master_t event_master;
event_dispatcher_data_t primary_data; event_dispatcher_data_t primary_data;
mouse_button_state_t button_state = mouse_button_state_t button_state =
{0, 0, 0, 0, 0, 0, 0}; {0, 0, 0, 0, 0, 0, 0, 0};
/********** The Event Handling Subsystem **********/ /********** The Event Handling Subsystem **********/
void void
@ -504,6 +504,7 @@ handle_button_press(event_t * ev)
XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime); XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime);
} }
if (action_dispatch(ev, 0)) { if (action_dispatch(ev, 0)) {
button_state.ignore_release = 1;
return 1; return 1;
} }
@ -565,6 +566,11 @@ handle_button_release(event_t * ev)
D_EVENTS(("handle_button_release(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window)); D_EVENTS(("handle_button_release(ev [0x%08x] on window 0x%08x)\n", ev, ev->xany.window));
if (button_state.ignore_release == 1) {
button_state.ignore_release = 0;
return 0;
}
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0); REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
button_state.mouse_offset = 0; button_state.mouse_offset = 0;
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0)); button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
@ -596,17 +602,11 @@ handle_button_release(event_t * ev)
switch (ev->xbutton.button) { switch (ev->xbutton.button) {
case Button1: case Button1:
case Button3: case Button3:
#if defined(CTRL_CLICK_RAISE) || defined(CTRL_CLICK_MENU) selection_make(ev->xbutton.time);
if (!(ev->xbutton.state & ControlMask))
#endif
selection_make(ev->xbutton.time);
break; break;
case Button2: case Button2:
#ifdef CTRL_CLICK_SCROLLBAR selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y);
if (!(ev->xbutton.state & ControlMask))
#endif
selection_request(ev->xbutton.time, ev->xbutton.x, ev->xbutton.y);
break; break;
case Button4: case Button4:
scr_page(UP, (ev->xbutton.state & ShiftMask) ? 1 : 5); scr_page(UP, (ev->xbutton.state & ShiftMask) ? 1 : 5);

View File

@ -80,6 +80,7 @@ typedef struct {
typedef struct { typedef struct {
unsigned short clicks, bypass_keystate, report_mode, mouse_offset; unsigned short clicks, bypass_keystate, report_mode, mouse_offset;
Time button_press, last_button_press, activate_time; Time button_press, last_button_press, activate_time;
unsigned char ignore_release;
} mouse_button_state_t; } mouse_button_state_t;
/************ Variables ************/ /************ Variables ************/

View File

@ -192,21 +192,6 @@
/* #define SCROLLBAR_INITIAL_DELAY 40 */ /* #define SCROLLBAR_INITIAL_DELAY 40 */
/* #define SCROLLBAR_CONTINUOUS_DELAY 2 */ /* #define SCROLLBAR_CONTINUOUS_DELAY 2 */
/* An alternative placement of the menubar shadow */
/* #define MENUBAR_SHADOW_IN */
/* An alternative placement of the menu shadow */
#define MENU_SHADOW_IN
/* Allow Ctrl+Button1 in a window to raise and steal focus */
#define CTRL_CLICK_RAISE
/* Allow Ctrl+Button2 in a window to toggle the scrollbar */
#define CTRL_CLICK_SCROLLBAR
/* Allow Ctrl+Button3 in a window to toggle the menubar */
#define CTRL_CLICK_MENU
/********************* Multi-lingual support options *********************/ /********************* Multi-lingual support options *********************/
/* Allow option/attribute for Meta to set the 8th bit */ /* Allow option/attribute for Meta to set the 8th bit */
@ -297,8 +282,8 @@
# define FONT4 "13x26" # define FONT4 "13x26"
#else /* MULTI_CHARSET */ #else /* MULTI_CHARSET */
# define FONT0 "fixed" # define FONT0 "fixed"
# define FONT1 "6x10" # define FONT1 "5x7"
# define FONT2 "6x13" # define FONT2 "6x10"
# define FONT3 "7x14" # define FONT3 "7x14"
# define FONT4 "8x13" # define FONT4 "8x13"
#endif /* MULTI_CHARSET */ #endif /* MULTI_CHARSET */
@ -331,7 +316,7 @@ inline void *memmove(void *, const void *, size_t);
/* COLORTERM, TERM environment variables */ /* COLORTERM, TERM environment variables */
#ifdef MULTI_CHARSET #ifdef MULTI_CHARSET
# define TERMENV "kterm" # define TERMENV "kterm"
# define COLORTERMENV "Kterm" # define COLORTERMENV "Eterm"
#else #else
# define TERMENV "xterm" # define TERMENV "xterm"
# define COLORTERMENV "Eterm" # define COLORTERMENV "Eterm"

View File

@ -65,10 +65,10 @@ typedef struct font_struct {
/************ Variables ************/ /************ Variables ************/
extern unsigned char font_change_count; extern unsigned char font_change_count;
extern const char *def_fontName[]; extern const char *def_fontName[];
extern const char *rs_font[NFONTS]; extern char *rs_font[NFONTS];
# ifdef MULTI_CHARSET # ifdef MULTI_CHARSET
extern const char *def_mfontName[]; extern const char *def_mfontName[];
extern const char *rs_mfont[NFONTS]; extern char *rs_mfont[NFONTS];
# endif # endif
/************ Function Prototypes ************/ /************ Function Prototypes ************/

View File

@ -200,11 +200,11 @@ char *rs_preeditType = NULL;
#endif #endif
char *rs_name = NULL; char *rs_name = NULL;
#ifndef NO_BOLDFONT #ifndef NO_BOLDFONT
const char *rs_boldFont = NULL; char *rs_boldFont = NULL;
#endif #endif
const char *rs_font[NFONTS]; char *rs_font[NFONTS];
#ifdef MULTI_CHARSET #ifdef MULTI_CHARSET
const char *rs_mfont[NFONTS]; char *rs_mfont[NFONTS];
#endif #endif
#ifdef PRINTPIPE #ifdef PRINTPIPE
char *rs_print_pipe = NULL; char *rs_print_pipe = NULL;
@ -782,16 +782,6 @@ version(void)
#else #else
printf(" -SCROLLBAR_BUTTON_CONTINUAL_SCROLLING"); printf(" -SCROLLBAR_BUTTON_CONTINUAL_SCROLLING");
#endif #endif
#ifdef MENU_SHADOW_IN
printf(" +MENU_SHADOW_IN");
#else
printf(" -MENU_SHADOW_IN");
#endif
#ifdef CTRL_CLICK_RAISE
printf(" +CTRL_CLICK_RAISE");
#else
printf(" -CTRL_CLICK_RAISE");
#endif
#ifdef META8_OPTION #ifdef META8_OPTION
printf(" +META8_OPTION"); printf(" +META8_OPTION");
#else #else
@ -2470,6 +2460,8 @@ parse_image(char *buff)
images[idx].mode = (MODE_VIEWPORT | ALLOW_VIEWPORT); images[idx].mode = (MODE_VIEWPORT | ALLOW_VIEWPORT);
} else if (!BEG_STRCASECMP(mode, "auto ")) { } else if (!BEG_STRCASECMP(mode, "auto ")) {
images[idx].mode = (MODE_AUTO | ALLOW_AUTO); images[idx].mode = (MODE_AUTO | ALLOW_AUTO);
} else if (!BEG_STRCASECMP(mode, "solid ")) {
images[idx].mode = MODE_SOLID;
} else { } else {
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), mode); print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), mode);
} }
@ -2485,6 +2477,7 @@ parse_image(char *buff)
images[idx].mode |= ALLOW_VIEWPORT; images[idx].mode |= ALLOW_VIEWPORT;
} else if (!BEG_STRCASECMP("auto", allow)) { } else if (!BEG_STRCASECMP("auto", allow)) {
images[idx].mode |= ALLOW_AUTO; images[idx].mode |= ALLOW_AUTO;
} else if (!BEG_STRCASECMP("solid", allow)) {
} else { } else {
print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), allow); print_error("Parse error in file %s, line %lu: Invalid mode \"%s\"", file_peek_path(), file_peek_line(), allow);
} }

View File

@ -242,7 +242,7 @@ extern char *rs_pixmapScale;
extern char *rs_config_file; extern char *rs_config_file;
extern unsigned int rs_line_space; extern unsigned int rs_line_space;
#ifndef NO_BOLDFONT #ifndef NO_BOLDFONT
extern const char *rs_boldFont; extern char *rs_boldFont;
#endif #endif
#ifdef PRINTPIPE #ifdef PRINTPIPE
extern char *rs_print_pipe; extern char *rs_print_pipe;

View File

@ -29,6 +29,7 @@ static const char cvs_ident[] = "$Id$";
#include "mem.h" #include "mem.h"
#include "graphics.h" #include "graphics.h"
#include "screen.h" #include "screen.h"
#include "scrollbar.h"
#include "options.h" #include "options.h"
#ifdef PIXMAP_SUPPORT #ifdef PIXMAP_SUPPORT
# include "pixmap.h" # include "pixmap.h"
@ -3181,6 +3182,8 @@ debug_colors(void)
void xim_get_position(XPoint *pos) void xim_get_position(XPoint *pos)
{ {
pos->x = Col2Pixel(screen.col); pos->x = Col2Pixel(screen.col);
if (scrollbar_visible() && !(Options & Opt_scrollBar_right))
pos->x += scrollbar_trough_width();
pos->y = Height2Pixel(screen.row) + TermWin.font->ascent pos->y = Height2Pixel(screen.row) + TermWin.font->ascent
+ TermWin.internalBorder; + TermWin.internalBorder;
} }

View File

@ -297,11 +297,11 @@ lookup_key(XEvent * ev)
#ifdef KEYSYM_ATTRIBUTE #ifdef KEYSYM_ATTRIBUTE
if (!(shft | ctrl) && KeySym_map[keysym - 0xFF00] != NULL) { if (!(shft | ctrl) && KeySym_map[keysym - 0xFF00] != NULL) {
const unsigned char *kbuf; const unsigned char *tmpbuf;
unsigned int len; unsigned int len;
kbuf = (KeySym_map[keysym - 0xFF00]); tmpbuf = (KeySym_map[keysym - 0xFF00]);
len = *kbuf++; len = *tmpbuf++;
/* escape prefix */ /* escape prefix */
if (meta if (meta
@ -313,7 +313,7 @@ lookup_key(XEvent * ev)
tt_write(&ch, 1); tt_write(&ch, 1);
} }
tt_write(kbuf, len); tt_write(tmpbuf, len);
LK_RET(); LK_RET();
} else } else
#endif #endif
@ -348,7 +348,7 @@ lookup_key(XEvent * ev)
#endif #endif
case XK_Home: case XK_Home:
len = strlen(strcpy(kbuf, KS_HOME)); len = strlen(strcpy(kbuf, KS_HOME));
break; break;
#ifdef XK_KP_Left #ifdef XK_KP_Left

View File

@ -83,8 +83,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -82,8 +82,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -83,8 +83,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -83,8 +83,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -83,8 +83,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -83,8 +83,8 @@ begin main
# not been set and Eterm cannot map the foreground color to one of the # not been set and Eterm cannot map the foreground color to one of the
# high-intensity colors (8-15). # high-intensity colors (8-15).
font 0 fixed font 0 fixed
font 1 6x10 font 1 5x7
font 2 6x13 font 2 6x10
font 3 8x13 font 3 8x13
font 4 9x15 font 4 9x15
# font bold 7x14 # font bold 7x14

View File

@ -30,26 +30,22 @@
# define FALSE (0) # define FALSE (0)
#endif #endif
#ifndef TRUE #ifndef TRUE
# define TRUE (!FALSE) # define TRUE (1)
#endif #endif
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
int scale = FALSE, trans = FALSE; int scale = FALSE, trans = FALSE;
unsigned int i, pic = 0, tint = 0, shade = 0; unsigned int i, pic = 0;
for (i = 1; i < argc; i++) { for (i = 1; i < argc; i++) {
if (strcasecmp(argv[i], "-scale") == 0) { if (strcasecmp(argv[i], "-scale") == 0) {
scale = TRUE; scale = TRUE;
} else if (strcasecmp(argv[i], "-trans") == 0) { } else if (strcasecmp(argv[i], "-trans") == 0) {
trans = TRUE; trans = TRUE;
} else if (strcasecmp(argv[i], "-tint") == 0 && i < argc - 1) {
tint = ++i;
} else if (strcasecmp(argv[i], "-shade") == 0 && i < argc - 1) {
shade = ++i;
} else if (strncasecmp(argv[i], "-h", 2) == 0) { } else if (strncasecmp(argv[i], "-h", 2) == 0) {
printf("Usage: %s [[-scale] file] [-trans] [-tint 0xACOLOR] [-shade nn%]\n", argv[0]); printf("Usage: %s [[-scale] file] [-trans]\n", argv[0]);
return 0; return 0;
} else { } else {
pic = i; pic = i;
@ -58,16 +54,10 @@ main(int argc, char **argv)
if (pic && argv[pic]) { if (pic && argv[pic]) {
printf("\033]6;0;0\a"); printf("\033]6;0;0\a");
printf("\033]20;%s%s\a", argv[pic], scale ? ";100x100+0+0" : ";0"); printf("\033]20;%s%s\a", argv[pic], scale ? "@100x100+50+50:scale" : "@0x0+0+0:tile");
} }
if (trans) { if (trans) {
printf("\033]6;0;1\a"); printf("\033]6;0;1\a");
} }
if (tint && argv[tint]) {
printf("\033]6;2;%s\a", argv[tint]);
}
if (shade && argv[shade]) {
printf("\033]6;1;%s\a", argv[shade]);
}
return 0; return 0;
} }