Thu Nov 18 21:47:02 PST 1999 Michael Jennings <mej@eterm.org>

I've rewritten almost the entire scrollbar.  It mostly works, but it
	still has issues.  I've put an #error directive in so that it won't
	compile; take it out if you *really* wanna try it.  It's much more
	efficient than before.


SVN revision: 1333
eterm-0.10
Michael Jennings 24 years ago
parent 5894debb3a
commit c58c7d411b
  1. 8
      ChangeLog
  2. 2
      acconfig.h
  3. 2
      configure.in
  4. 13
      src/Makefile.am
  5. 39
      src/actions.c
  6. 39
      src/actions.h
  7. 38
      src/command.c
  8. 4
      src/command.h
  9. 102
      src/draw.c
  10. 54
      src/draw.h
  11. 40
      src/e.c
  12. 39
      src/e.h
  13. 54
      src/events.c
  14. 47
      src/events.h
  15. 1
      src/feature.h
  16. 0
      src/icon.h
  17. 45
      src/menus.c
  18. 39
      src/menus.h
  19. 94
      src/misc.c
  20. 44
      src/misc.h
  21. 89
      src/options.c
  22. 45
      src/options.h
  23. 56
      src/pixmap.c
  24. 46
      src/pixmap.h
  25. 2
      src/screen.c
  26. 1225
      src/scrollbar.c
  27. 212
      src/scrollbar.h
  28. 8
      src/startup.c
  29. 4
      src/startup.h
  30. 23
      src/system.c
  31. 23
      src/system.h
  32. 13
      src/term.c
  33. 39
      src/timer.c
  34. 39
      src/timer.h
  35. 18
      src/windows.c

@ -2799,3 +2799,11 @@ Wed Nov 17 18:34:43 PST 1999 Michael Jennings <mej@eterm.org>
You can also remove any existing color modifiers using "clear".
-------------------------------------------------------------------------------
Thu Nov 18 21:47:02 PST 1999 Michael Jennings <mej@eterm.org>
I've rewritten almost the entire scrollbar. It mostly works, but it
still has issues. I've put an #error directive in so that it won't
compile; take it out if you *really* wanna try it. It's much more
efficient than before.
-------------------------------------------------------------------------------

@ -302,8 +302,6 @@
#undef KS_DELETE
#undef NO_DELETE_KEY
#undef NO_XLOCALE
#undef PIXMAP_MENUBAR
#undef PIXMAP_SCROLLBAR
#undef UTMP_SUPPORT
#undef MULTI_CHARSET
#undef USE_XIM

@ -216,7 +216,6 @@ AC_ARG_WITH(imlib,
CFLAGS="$CFLAGS -I${withval}/include -L${withval}/lib"
GRLIBS="-lImlib"
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(PIXMAP_SCROLLBAR)
AC_DEFINE(BACKING_STORE)
else
AC_MSG_RESULT(no)
@ -224,7 +223,6 @@ AC_ARG_WITH(imlib,
fi, AC_MSG_RESULT(yes)
GRLIBS="-lImlib"
AC_DEFINE(PIXMAP_SUPPORT)
AC_DEFINE(PIXMAP_SCROLLBAR)
AC_DEFINE(BACKING_STORE)
)
AC_MSG_CHECKING(for transparency support)

@ -2,8 +2,14 @@
lib_LTLIBRARIES = libEterm.la
libEterm_la_SOURCES = actions.c command.c e.c events.c font.c grkelot.c menus.c misc.c netdisp.c \
options.c pixmap.c screen.c scrollbar.c startup.c system.c term.c timer.c utmp.c windows.c
libEterm_la_SOURCES = actions.c actions.h command.c command.h debug.h draw.c \
draw.h e.c e.h eterm_utmp.h events.c events.h feature.h \
font.c font.h grkelot.c grkelot.h icon.h menus.c menus.h \
misc.c misc.h netdisp.c options.c options.h pixmap.c \
pixmap.h profile.h screen.c screen.h scrollbar.c \
scrollbar.h startup.c startup.h system.c system.h term.c \
term.h timer.c timer.h utmp.c windows.c windows.h
libEterm_la_DEPENDENCIES = $(top_builddir)/libmej/libmej.la feature.h
libEterm_la_LDFLAGS = -release $(VERSION)
@ -14,6 +20,3 @@ Eterm_LDFLAGS = -rpath $(libdir):$(pkglibdir)
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)
EXTRA_DIST = actions.h command.h debug.h e.h eterm_utmp.h events.h feature.h font.h grkelot.h menus.h misc.h options.h \
pixmap.h profile.h screen.h scrollbar.h startup.h system.h term.h timer.h windows.h Eterm.xpm

@ -1,27 +1,24 @@
/* actions.c -- Eterm action class module
* -- 3 August 1999, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";

@ -1,27 +1,24 @@
/* actions.h -- Eterm action class module header file
* -- 3 August 1999, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1999-1997, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _ACTIONS_H_

@ -1766,13 +1766,13 @@ static void
xim_get_area(XRectangle *preedit_rect, XRectangle *status_rect,
XRectangle *needed_rect)
{
preedit_rect->x = needed_rect->width + (scrollbar_visible() && !(Options & Opt_scrollBar_right) ? (scrollbar_trough_width()) : 0);
preedit_rect->x = needed_rect->width + (scrollbar_is_visible() && !(Options & Opt_scrollbar_right) ? (scrollbar_trough_width()) : 0);
preedit_rect->y = Height2Pixel(TermWin.nrow - 1);
preedit_rect->width = Width2Pixel(TermWin.ncol + 1) - needed_rect->width + (!(Options & Opt_scrollBar_right) ? (scrollbar_trough_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);
status_rect->x = (scrollbar_visible() && !(Options & Opt_scrollBar_right)) ? (scrollbar_trough_width()) : 0;
status_rect->x = (scrollbar_is_visible() && !(Options & Opt_scrollbar_right)) ? (scrollbar_trough_width()) : 0;
status_rect->y = Height2Pixel(TermWin.nrow - 1);
status_rect->width = needed_rect->width ? needed_rect->width : Width2Pixel(TermWin.ncol + 1);
@ -2035,10 +2035,10 @@ run_command(char *argv[])
/* add Backspace value */
SavedModes |= (PrivateModes & PrivMode_BackSpace);
/* add value for scrollBar */
if (scrollbar_visible()) {
PrivateModes |= PrivMode_scrollBar;
SavedModes |= PrivMode_scrollBar;
/* add value for scrollbar */
if (scrollbar_is_visible()) {
PrivateModes |= PrivMode_scrollbar;
SavedModes |= PrivMode_scrollbar;
}
#if DEBUG >= DEBUG_TTYMODE && defined(HAVE_TERMIOS_H)
if (debug_level >= DEBUG_TTYMODE) {
@ -2407,12 +2407,13 @@ cmd_getc(void)
XNextEvent(Xdisplay, &ev);
#ifdef USE_XIM
if (!XFilterEvent(&ev, ev.xkey.window)) {
event_dispatch(&ev);
}
#else
event_dispatch(&ev);
if (Input_Context != NULL) {
if (!XFilterEvent(&ev, ev.xkey.window)) {
event_dispatch(&ev);
}
} else
#endif
event_dispatch(&ev);
/* in case button actions pushed chars to cmdbuf */
if (CHARS_READ()) {
@ -2421,12 +2422,12 @@ cmd_getc(void)
}
#ifdef SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
if (scrollbar_isUp()) {
if (scrollbar_uparrow_is_pressed()) {
if (!scroll_arrow_delay-- && scr_page(UP, 1)) {
scroll_arrow_delay = SCROLLBAR_CONTINUOUS_DELAY;
refreshed = 0;
}
} else if (scrollbar_isDn()) {
} else if (scrollbar_downarrow_is_pressed()) {
if (!scroll_arrow_delay-- && scr_page(DN, 1)) {
scroll_arrow_delay = SCROLLBAR_CONTINUOUS_DELAY;
refreshed = 0;
@ -2443,7 +2444,7 @@ cmd_getc(void)
if (refreshed
#ifdef SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
&& !(scrollbar_isUpDn())
&& !(scrollbar_arrow_is_pressed())
#endif
) {
delay = NULL;
@ -2483,11 +2484,8 @@ cmd_getc(void)
refreshed = 1;
D_CMD(("cmd_getc(): select() timed out, time to update the screen.\n"));
scr_refresh(refresh_type);
/* FIXME: This call is only here to update the anchor size/position.
It should be replaced with a call to a function that does just that
rather than calling a function that updates the background also. */
if (scrollbar_visible()) {
scrollbar_show(1);
if (scrollbar_is_visible()) {
scrollbar_anchor_update_position(1);
}
#ifdef USE_XIM
xim_send_spot();

@ -53,7 +53,7 @@
# define DndLink 7
#endif
# define scrollBar_esc 30
# define scrollbar_esc 30
/* Motif window hints */
#define MWM_HINTS_FUNCTIONS (1L << 0)
@ -98,7 +98,7 @@
# define PrivMode_MouseX11 (1LU<<12)
/* too annoying to implement X11 highlight tracking */
/* #define PrivMode_MouseX11Track (1LU<<13) */
# define PrivMode_scrollBar (1LU<<14)
# define PrivMode_scrollbar (1LU<<14)
# define PrivMode_menuBar (1LU<<15)
#define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11)

@ -0,0 +1,102 @@
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";
#include "config.h"
#include "feature.h"
#include "../libmej/debug.h"
#include "../libmej/mem.h"
#include "../libmej/strings.h"
#include "debug.h"
#include "draw.h"
#include "misc.h"
#include "pixmap.h"
#include "startup.h"
void
draw_shadow(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int h, int shadow)
{
ASSERT(w != 0);
ASSERT(h != 0);
LOWER_BOUND(shadow, 1);
for (w += x - 1, h += y - 1; shadow > 0; shadow--, w--, h--) {
XDrawLine(Xdisplay, win, gc_top, x, y, w, y);
XDrawLine(Xdisplay, win, gc_top, x, y, x, h);
x++; y++;
XDrawLine(Xdisplay, win, gc_bottom, w, h, w, y);
XDrawLine(Xdisplay, win, gc_bottom, w, h, x, h);
}
}
void
draw_arrow(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int shadow, unsigned char type)
{
BOUND(shadow, 1, 2);
switch (type) {
case DRAW_ARROW_UP:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, win, gc_top, x, y + w, x + w / 2, y);
XDrawLine(Xdisplay, win, gc_bottom, x + w, y + w, x + w / 2, y);
XDrawLine(Xdisplay, win, gc_bottom, x + w, y + w, x, y + w);
}
break;
case DRAW_ARROW_DOWN:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, win, gc_top, x, y, x + w / 2, y + w);
XDrawLine(Xdisplay, win, gc_top, x, y, x + w, y);
XDrawLine(Xdisplay, win, gc_bottom, x + w, y, x + w / 2, y + w);
}
break;
case DRAW_ARROW_LEFT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, win, gc_bottom, x + w, y + w, x + w, y);
XDrawLine(Xdisplay, win, gc_bottom, x + w, y + w, x, y + w / 2);
XDrawLine(Xdisplay, win, gc_top, x, y + w / 2, x + w, y);
}
break;
case DRAW_ARROW_RIGHT:
for (; shadow > 0; shadow--, x++, y++, w--) {
XDrawLine(Xdisplay, win, gc_top, x, y, x, y + w);
XDrawLine(Xdisplay, win, gc_top, x, y, x + w, y + w / 2);
XDrawLine(Xdisplay, win, gc_bottom, x, y + w, x + w, y + w / 2);
}
break;
default:
break;
}
}
void
draw_box(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int h)
{
XDrawLine(Xdisplay, win, gc_top, x + w, y, x, y);
XDrawLine(Xdisplay, win, gc_top, x, y, x, y + h);
XDrawLine(Xdisplay, win, gc_bottom, x, y + h, x + w, y + h);
XDrawLine(Xdisplay, win, gc_bottom, x + w, y + h, x + w, y);
}

@ -0,0 +1,54 @@
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _DRAW_H_
#define _DRAW_H_
#include <X11/Xfuncproto.h>
#include <X11/Intrinsic.h> /* Xlib, Xutil, Xresource, Xfuncproto */
/************ Macros and Definitions ************/
#define DRAW_ARROW_UP (1UL << 0)
#define DRAW_ARROW_DOWN (1UL << 1)
#define DRAW_ARROW_LEFT (1UL << 2)
#define DRAW_ARROW_RIGHT (1UL << 3)
#define draw_uparrow_raised(win, g1, g2, x, y, w, s) draw_arrow(win, g1, g2, x, y, w, s, DRAW_ARROW_UP)
#define draw_uparrow_clicked(win, g1, g2, x, y, w, s) draw_arrow(win, g2, g1, x, y, w, s, DRAW_ARROW_UP)
#define draw_downarrow_raised(win, g1, g2, x, y, w, s) draw_arrow(win, g1, g2, x, y, w, s, DRAW_ARROW_DOWN)
#define draw_downarrow_clicked(win, g1, g2, x, y, w, s) draw_arrow(win, g2, g1, x, y, w, s, DRAW_ARROW_DOWN)
/************ Structures ************/
/************ Variables ************/
/************ Function Prototypes ************/
_XFUNCPROTOBEGIN
extern void draw_shadow(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int h, int shadow);
extern void draw_arrow(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int shadow, unsigned char type);
extern void draw_box(Window win, GC gc_top, GC gc_bottom, int x, int y, int w, int h);
_XFUNCPROTOEND
#endif /* _DRAW_H_ */

@ -1,26 +1,24 @@
/* e.c -- Eterm Enlightenment support
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";

@ -1,27 +1,24 @@
/* e.h -- Eterm Enlightenment support module header file
* -- 6 June 1999, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _E_H_

@ -1,27 +1,24 @@
/* events.c -- Eterm events module
* -- 29 April 1999, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";
@ -158,12 +155,13 @@ event_init_primary_dispatcher(void)
event_data_add_mywin(&primary_data, TermWin.parent);
event_data_add_mywin(&primary_data, TermWin.vt);
event_data_add_mywin(&primary_data, scrollBar.win);
if (scrollbar_is_pixmapped()) {
event_data_add_mywin(&primary_data, scrollBar.up_win);
event_data_add_mywin(&primary_data, scrollBar.dn_win);
event_data_add_mywin(&primary_data, scrollBar.sa_win);
}
#if 0
event_data_add_mywin(&primary_data, scrollbar_get_win());
event_data_add_mywin(&primary_data, scrollbar_get_uparrow_win());
event_data_add_mywin(&primary_data, scrollbar_get_downarrow_win());
event_data_add_mywin(&primary_data, scrollbar_get_anchor_win());
#endif
if (desktop_window != None) {
event_data_add_parent(&primary_data, desktop_window);
}
@ -388,7 +386,7 @@ handle_focus_in(event_t * ev)
redraw_image(image_bg);
}
if (Options & Opt_scrollbar_popup) {
map_scrollbar(Options & Opt_scrollBar);
map_scrollbar(Options & Opt_scrollbar);
}
#ifdef USE_XIM
if (Input_Context != NULL)

@ -1,27 +1,24 @@
/* events.h -- Eterm events module header file
* -- 29 April 1999, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _EVENTS_H_
@ -35,10 +32,10 @@
# define XEVENT_IS_MYWIN(ev) (((ev)->xany.window == TermWin.parent) \
|| ((ev)->xany.window == TermWin.vt) \
|| ((ev)->xany.window == menuBar.win) \
|| (scrollbar_uparrow_is_pixmapped() && ((ev)->xany.window == scrollBar.up_win)) \
|| (scrollbar_downarrow_is_pixmapped() && ((ev)->xany.window == scrollBar.dn_win)) \
|| (scrollbar_anchor_is_pixmapped() && ((ev)->xany.window == scrollBar.sa_win)) \
|| ((ev)->xany.window == scrollBar.win))
|| (scrollbar_uparrow_is_pixmapped() && ((ev)->xany.window == scrollbar.up_win)) \
|| (scrollbar_downarrow_is_pixmapped() && ((ev)->xany.window == scrollbar.dn_win)) \
|| (scrollbar_anchor_is_pixmapped() && ((ev)->xany.window == scrollbar.sa_win)) \
|| ((ev)->xany.window == scrollbar.win))
# define XEVENT_IS_PARENT(ev) (((ev)->xany.window == TermWin.wm_parent) \
|| ((ev)->xany.window == TermWin.wm_grandparent))
#endif

@ -266,7 +266,6 @@
#define FONT0_IDX 2
#ifndef PIXMAP_SUPPORT
# undef PIXMAP_SCROLLBAR
# undef BACKING_STORE
# undef PIXMAP_OFFSET
# undef IMLIB_TRANS

@ -1,26 +1,24 @@
/* menus.c -- Eterm popup menu module
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";
@ -34,6 +32,7 @@ static const char cvs_ident[] = "$Id$";
#include "../libmej/mem.h"
#include "../libmej/strings.h"
#include "command.h"
#include "draw.h"
#include "e.h"
#include "events.h"
#include "font.h"
@ -906,7 +905,7 @@ menu_draw(menu_t * menu)
XTextExtents(menu->font, menu->title, len, &direction, &ascent, &descent, &chars);
draw_string(menu->win, menu->gc, center_coords(2 * MENU_HGAP, menu->w - 2 * MENU_HGAP) - (chars.width >> 1),
str_y - chars.descent - MENU_VGAP / 2, menu->title, len);
Draw_Shadow(menu->win, topShadowGC, botShadowGC, str_x, str_y - chars.descent - MENU_VGAP / 2 + 1, menu->w - (4 * MENU_HGAP), MENU_VGAP);
draw_shadow(menu->win, topShadowGC, botShadowGC, str_x, str_y - chars.descent - MENU_VGAP / 2 + 1, menu->w - (4 * MENU_HGAP), MENU_VGAP, 2);
str_y += MENU_VGAP;
for (i = 0; i < menu->numitems; i++) {
@ -923,7 +922,7 @@ menu_draw(menu_t * menu)
D_MENU((" -> Hot Area at %hu, %hu to %hu, %hu (width %hu, height %hu)\n", item->x, item->y, item->x + item->w, item->y + item->h,
item->w, item->h));
}
Draw_Shadow(menu->win, botShadowGC, topShadowGC, str_x, str_y - MENU_VGAP - MENU_VGAP / 2, menu->w - 4 * MENU_HGAP, MENU_VGAP);
draw_shadow(menu->win, botShadowGC, topShadowGC, str_x, str_y - MENU_VGAP - MENU_VGAP / 2, menu->w - 4 * MENU_HGAP, MENU_VGAP, 2);
} else {
str_y += menu->fheight + MENU_VGAP;

@ -1,27 +1,26 @@
/* menus.h -- Eterm popup menu module header file
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _MENUS_H
# define _MENUS_H

@ -287,97 +287,3 @@ find_file(const char *file, const char *ext)
}
/*----------------------------------------------------------------------*
* miscellaneous drawing routines
*/
/*
* draw bottomShadow/highlight along top/left sides of the window
*/
void
Draw_tl(Window win, GC gc, int x, int y, int w, int h)
{
int shadow = SHADOW;
if (w == 0 || h == 0) {
shadow = 1;
}
w += (x - 1);
h += (y - 1);
for (; shadow > 0; shadow--, x++, y++, w--, h--) {
XDrawLine(Xdisplay, win, gc, x, y, w, y);
XDrawLine(Xdisplay, win, gc, x, y, x, h);
}
}
/*
* draw bottomShadow/highlight along the bottom/right sides of the window
*/
void
Draw_br(Window win, GC gc, int x, int y, int w, int h)
{
int shadow = SHADOW;
if (w == 0 || h == 0) {
shadow = 1;
}
w += (x - 1);
h += (y - 1);
x++;
y++;
for (; shadow > 0; shadow--, x++, y++, w--, h--) {
XDrawLine(Xdisplay, win, gc, w, h, w, y);
XDrawLine(Xdisplay, win, gc, w, h, x, h);
}
}
void
Draw_Shadow(Window win, GC topShadow, GC botShadow, int x, int y, int w, int h)
{
Draw_tl(win, topShadow, x, y, w, h);
Draw_br(win, botShadow, x, y, w, h);
}
/* button shapes */
void
Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int type)
{
switch (type) {
case 'r': /* right triangle */
XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w);
XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y + w / 2);
XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w / 2);
break;
case 'l': /* left triangle */
XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y);
XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w / 2);
XDrawLine(Xdisplay, win, topShadow, x, y + w / 2, x + w, y);
break;
case 'd': /* down triangle */
XDrawLine(Xdisplay, win, topShadow, x, y, x + w / 2, y + w);
XDrawLine(Xdisplay, win, topShadow, x, y, x + w, y);
XDrawLine(Xdisplay, win, botShadow, x + w, y, x + w / 2, y + w);
break;
case 'u': /* up triangle */
XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w / 2, y);
XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x, y + w);
XDrawLine(Xdisplay, win, topShadow, x, y + w, x + w / 2, y);
break;
#if 0
case 's': /* square */
XDrawLine(Xdisplay, win, topShadow, x + w, y, x, y);
XDrawLine(Xdisplay, win, topShadow, x, y, x, y + w);
XDrawLine(Xdisplay, win, botShadow, x, y + w, x + w, y + w);
XDrawLine(Xdisplay, win, botShadow, x + w, y + w, x + w, y);
break;
#endif
}
}

@ -1,26 +1,24 @@
/* misc.h -- Eterm toolkit header file
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef _MISC_H_
@ -44,11 +42,7 @@ extern char *str_trim(char *str);
extern int parse_escaped_string(char *str);
extern const char *search_path(const char *pathlist, const char *file, const char *ext);
extern const char *find_file(const char *file, const char *ext);
extern void Draw_tl(Window win, GC gc, int x, int y, int w, int h);
extern void Draw_br(Window win, GC gc, int x, int y, int w, int h);
extern void Draw_Shadow(Window win, GC topShadow, GC botShadow, int x, int y, int w, int h);
extern void Draw_Triangle(Window win, GC topShadow, GC botShadow, int x, int y, int w, int type);
_XFUNCPROTOEND
#endif /* whole file */
#endif

@ -1,27 +1,24 @@
/* options.c -- Eterm options module
* -- 25 July 1997, mej
/*
* Copyright (C) 1999-1997, Michael Jennings
*
* This file is original work by Michael Jennings <mej@eterm.org> and
* Tuomo Venalainen <vendu@cc.hut.fi>. This file, and any other file
* bearing this same message or a similar one, is distributed under
* the GNU Public License (GPL) as outlined in the COPYING file.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
static const char cvs_ident[] = "$Id$";
@ -184,7 +181,7 @@ eterm_func builtins[] =
{"appname", builtin_appname, 0},
{(char *) NULL, (eterm_function_ptr) NULL, 0}
};
unsigned long Options = (Opt_scrollBar), image_toggles = 0;
unsigned long Options = (Opt_scrollbar), image_toggles = 0;
static menu_t *curmenu;
char *theme_dir = NULL, *user_dir = NULL;
char **rs_execArgs = NULL; /* Args to exec (-e or --exec) */
@ -377,14 +374,14 @@ static const struct {
/* =======[ Toggles ]======= */
OPT_BOOL('l', "login-shell", "login shell, prepend - to shell name", &Options, Opt_loginShell),
OPT_BOOL('s', "scrollbar", "display scrollbar", &Options, Opt_scrollBar),
OPT_BOOL('s', "scrollbar", "display scrollbar", &Options, Opt_scrollbar),
OPT_BOOL('u', "utmp-logging", "make a utmp entry", &Options, Opt_utmpLogging),
OPT_BOOL('v', "visual-bell", "visual bell", &Options, Opt_visualBell),
OPT_BOOL('H', "home-on-echo", "jump to bottom on output", &Options, Opt_homeOnEcho),
OPT_BLONG("home-on-input", "jump to bottom on input", &Options, Opt_homeOnInput),
OPT_BOOL('E', "home-on-refresh", "jump to bottom on refresh (^L)", &Options, Opt_homeOnRefresh),
OPT_BLONG("scrollbar-right", "display the scrollbar on the right", &Options, Opt_scrollBar_right),
OPT_BLONG("scrollbar-floating", "display the scrollbar with no trough", &Options, Opt_scrollBar_floating),
OPT_BLONG("scrollbar-right", "display the scrollbar on the right", &Options, Opt_scrollbar_right),
OPT_BLONG("scrollbar-floating", "display the scrollbar with no trough", &Options, Opt_scrollbar_floating),
OPT_BLONG("scrollbar-popup", "popup the scrollbar only when focused", &Options, Opt_scrollbar_popup),
OPT_BOOL('x', "borderless", "force Eterm to have no borders", &Options, Opt_borderless),
#ifndef NO_MAPALERT
@ -585,11 +582,6 @@ version(void)
#else
printf(" -BACKGROUND_CYCLING_SUPPORT");
#endif
#ifdef PIXMAP_SCROLLBAR
printf(" +PIXMAP_SCROLLBAR");
#else
printf(" -PIXMAP_SCROLLBAR");
#endif
#ifdef BACKING_STORE
printf(" +BACKING_STORE");
#else
@ -1875,9 +1867,9 @@ parse_toggles(char *buff)
}
} else if (!BEG_STRCASECMP(buff, "scrollbar ")) {
if (bool_val) {
Options |= Opt_scrollBar;
Options |= Opt_scrollbar;
} else {
Options &= ~(Opt_scrollBar);
Options &= ~(Opt_scrollbar);
}
} else if (!BEG_STRCASECMP(buff, "utmp_logging ")) {
@ -1932,16 +1924,16 @@ parse_toggles(char *buff)
} else if (!BEG_STRCASECMP(buff, "scrollbar_floating ")) {
if (bool_val) {
Options |= Opt_scrollBar_floating;
Options |= Opt_scrollbar_floating;
} else {
Options &= ~(Opt_scrollBar_floating);
Options &= ~(Opt_scrollbar_floating);
}
} else if (!BEG_STRCASECMP(buff, "scrollbar_right ")) {
if (bool_val) {
Options |= Opt_scrollBar_right;
Options |= Opt_scrollbar_right;
} else {
Options &= ~(Opt_scrollBar_right);
Options &= ~(Opt_scrollbar_right);
}
} else if (!BEG_STRCASECMP(buff, "scrollbar_popup ")) {
if (bool_val) {
@ -3092,7 +3084,7 @@ init_defaults(void)
}
#endif
Options = (Opt_scrollBar | Opt_select_trailing_spaces);
Options = (Opt_scrollbar | Opt_select_trailing_spaces);
Xdisplay = NULL;
display_name = NULL;
rs_term_name = NULL;
@ -3129,19 +3121,19 @@ post_parse(void)
if (rs_scrollbar_type) {
if (!strcasecmp(rs_scrollbar_type, "xterm")) {
#ifdef XTERM_SCROLLBAR
scrollBar.type = SCROLLBAR_XTERM;
scrollbar_set_type(SCROLLBAR_XTERM);
#else
print_error("Support for xterm scrollbars was not compiled in. Sorry.");
#endif
} else if (!strcasecmp(rs_scrollbar_type, "next")) {
#ifdef NEXT_SCROLLBAR
scrollBar.type = SCROLLBAR_NEXT;
scrollbar_set_type(SCROLLBAR_NEXT);
#else
print_error("Support for NeXT scrollbars was not compiled in. Sorry.");
#endif
} else if (!strcasecmp(rs_scrollbar_type, "motif")) {
#ifdef MOTIF_SCROLLBAR
scrollBar.type = SCROLLBAR_MOTIF;
scrollbar_set_type(SCROLLBAR_MOTIF);
#else
print_error("Support for motif scrollbars was not compiled in. Sorry.");
#endif
@ -3150,12 +3142,7 @@ post_parse(void)
}
}
if (rs_scrollbar_width) {
scrollBar.width = rs_scrollbar_width;
}
if (scrollBar.type == SCROLLBAR_XTERM) {
scrollbar_set_shadow(0);
} else {
scrollbar_set_shadow((Options & Opt_scrollBar_floating) ? 0 : SHADOW);
scrollbar_set_width(rs_scrollbar_width);
}
/* set any defaults not already set */
@ -3168,7 +3155,7 @@ post_parse(void)
}
/* no point having a scrollbar without having any scrollback! */
if (!TermWin.saveLines)
Options &= ~Opt_scrollBar;
Options &= ~Opt_scrollbar;
#ifdef PRINTPIPE
if (!rs_print_pipe)