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
This commit is contained in:
parent
5894debb3a
commit
c58c7d411b
|
@ -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_ */
|
40
src/e.c
40
src/e.c
|
@ -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
|
||||
*
|
||||
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
|
||||
* 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:
|
||||
*
|
||||
* 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 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$";
|
||||
|
|
39
src/e.h
39
src/e.h
|
@ -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_
|
||||
|
|
54
src/events.c
54
src/events.c
|
@ -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)
|
||||
|
|
47
src/events.h
47
src/events.h
|
@ -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
|
||||
|
|
45
src/menus.c
45
src/menus.c
|
@ -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
|
||||
*
|
||||
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
|
||||
* 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:
|
||||
*
|
||||
* 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 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$";
|
||||
|
@ -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;
|
||||
|
|
39
src/menus.h
39
src/menus.h
|
@ -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
|
||||
|
||||
|
|
94
src/misc.c
94
src/misc.c
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
44
src/misc.h
44
src/misc.h
|
@ -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)
|
||||
|
@ -3468,7 +3455,7 @@ save_config(char *path)
|
|||
if (rs_desktop != -1) {
|
||||
fprintf(fp, " desktop %d\n", rs_desktop);
|
||||
}
|
||||
fprintf(fp, " scrollbar_type %s\n", (scrollBar.type == SCROLLBAR_XTERM ? "xterm" : (scrollBar.type == SCROLLBAR_MOTIF ? "motif" : "next")));
|
||||
fprintf(fp, " scrollbar_type %s\n", (scrollbar_get_type() == SCROLLBAR_XTERM ? "xterm" : (scrollbar_get_type() == SCROLLBAR_MOTIF ? "motif" : "next")));
|
||||
fprintf(fp, " scrollbar_width %d\n", scrollbar_anchor_width());
|
||||
for (i = 0; i < 5; i++) {
|
||||
fprintf(fp, " font %d %s\n", i, rs_font[i]);
|
||||
|
@ -3786,15 +3773,15 @@ save_config(char *path)
|
|||
fprintf(fp, " map_alert %d\n", (Options & Opt_mapAlert ? 1 : 0));
|
||||
fprintf(fp, " visual_bell %d\n", (Options & Opt_visualBell ? 1 : 0));
|
||||
fprintf(fp, " login_shell %d\n", (Options & Opt_loginShell ? 1 : 0));
|
||||
fprintf(fp, " scrollbar %d\n", (Options & Opt_scrollBar ? 1 : 0));
|
||||
fprintf(fp, " scrollbar %d\n", (Options & Opt_scrollbar ? 1 : 0));
|
||||
fprintf(fp, " utmp_logging %d\n", (Options & Opt_utmpLogging ? 1 : 0));
|
||||
fprintf(fp, " meta8 %d\n", (Options & Opt_meta8 ? 1 : 0));
|
||||
fprintf(fp, " iconic %d\n", (Options & Opt_iconic ? 1 : 0));
|
||||
fprintf(fp, " home_on_echo %d\n", (Options & Opt_homeOnEcho ? 1 : 0));
|
||||
fprintf(fp, " home_on_input %d\n", (Options & Opt_homeOnInput ? 1 : 0));
|
||||
fprintf(fp, " home_on_refresh %d\n", (Options & Opt_homeOnRefresh ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_floating %d\n", (Options & Opt_scrollBar_floating ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_right %d\n", (Options & Opt_scrollBar_right ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_floating %d\n", (Options & Opt_scrollbar_floating ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_right %d\n", (Options & Opt_scrollbar_right ? 1 : 0));
|
||||
fprintf(fp, " scrollbar_popup %d\n", (Options & Opt_scrollbar_popup ? 1 : 0));
|
||||
fprintf(fp, " borderless %d\n", (Options & Opt_borderless ? 1 : 0));
|
||||
fprintf(fp, " backing_store %d\n", (Options & Opt_backing_store ? 1 : 0));
|
||||
|
|
|
@ -1,27 +1,24 @@
|
|||
/* options.h -- Eterm options module header file
|
||||
* -- 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.
|
||||
*/
|
||||
|
||||
#ifndef _OPTIONS_H_
|
||||
|
@ -57,12 +54,12 @@
|
|||
# define Opt_mapAlert (1LU << 4)
|
||||
# define Opt_reverseVideo (1LU << 5)
|
||||
# define Opt_utmpLogging (1LU << 6)
|
||||
# define Opt_scrollBar (1LU << 7)
|
||||
# define Opt_scrollbar (1LU << 7)
|
||||
# define Opt_meta8 (1LU << 8)
|
||||
# define Opt_exec (1LU << 9)
|
||||
# define Opt_homeOnEcho (1LU << 10)
|
||||
# define Opt_homeOnRefresh (1LU << 11)
|
||||
# define Opt_scrollBar_right (1LU << 12)
|
||||
# define Opt_scrollbar_right (1LU << 12)
|
||||
# define Opt_borderless (1LU << 13)
|
||||
# define Opt_backing_store (1LU << 14)
|
||||
# define Opt_noCursor (1LU << 15)
|
||||
|
@ -74,7 +71,7 @@
|
|||
# define Opt_scrollbar_popup (1LU << 21)
|
||||
# define Opt_select_trailing_spaces (1LU << 22)
|
||||
# define Opt_install (1LU << 23)
|
||||
# define Opt_scrollBar_floating (1LU << 24)
|
||||
# define Opt_scrollbar_floating (1LU << 24)
|
||||
|
||||
# define IMOPT_TRANS (1U << 0)
|
||||
# define IMOPT_VIEWPORT (1U << 1)
|
||||
|
|
56
src/pixmap.c
56
src/pixmap.c
|
@ -1,26 +1,24 @@
|
|||
/* pixmap.c -- Eterm pixmap handling routines
|
||||
|
||||
* 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
|
||||
*
|
||||
* Copyright (C) 1997-1999, Michael Jennings and Tuomo Venalainen
|
||||
* 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:
|
||||
*
|
||||
* 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 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$";
|
||||
|
@ -39,16 +37,14 @@ static const char cvs_ident[] = "$Id$";
|
|||
#include "../libmej/mem.h"
|
||||
#include "../libmej/strings.h"
|
||||
#include "e.h"
|
||||
#include "icon.h"
|
||||
#include "startup.h"
|
||||
#include "menus.h"
|
||||
#include "options.h"
|
||||
#include "pixmap.h"
|
||||
#include "screen.h"
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
# include "scrollbar.h"
|
||||
#endif
|
||||
#include "scrollbar.h"
|
||||
#include "term.h"
|
||||
#include "Eterm.xpm" /* Icon pixmap */
|
||||
|
||||
#ifdef PIXMAP_SUPPORT
|
||||
Pixmap desktop_pixmap = None;
|
||||
|
@ -63,10 +59,8 @@ image_t images[image_max] =
|
|||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
# endif
|
||||
{None, 0, NULL, NULL, NULL, NULL},
|
||||
{None, 0, NULL, NULL, NULL, NULL}
|
||||
};
|
||||
|
@ -96,14 +90,12 @@ get_image_type(unsigned short type)
|
|||
case image_right:
|
||||
return "image_right";
|
||||
break;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
case image_sb:
|
||||
return "image_sb";
|
||||
break;
|
||||
case image_sa:
|
||||
return "image_sa";
|
||||
break;
|
||||
# endif
|
||||
case image_menu:
|
||||
return "image_menu";
|
||||
break;
|
||||
|
@ -327,10 +319,8 @@ get_iclass_name(unsigned char which)
|
|||
case image_down: return "ETERM_ARROW_DOWN"; break;
|
||||
case image_left: return "ETERM_ARROW_LEFT"; break;
|
||||
case image_right: return "ETERM_ARROW_RIGHT"; break;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
case image_sb: return "ETERM_TROUGH"; break;
|
||||
case image_sa: return "ETERM_ANCHOR"; break;
|
||||
# endif
|
||||
case image_menu: return "ETERM_MENU_ITEM"; break;
|
||||
case image_submenu: return "ETERM_MENU_SUBMENU"; break;
|
||||
default:
|
||||
|
@ -475,7 +465,6 @@ redraw_image(unsigned char which) {
|
|||
render_simage(images[image_down].current, scrollbar_get_downarrow_win(), scrollbar_arrow_width(), scrollbar_arrow_width(), image_down, 0);
|
||||
scrollbar_show(0);
|
||||
break;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
case image_sb:
|
||||
render_simage(images[image_sb].current, scrollbar_get_win(), scrollbar_trough_width(), scrollbar_trough_height(), image_sb, 0);
|
||||
scrollbar_show(0);
|
||||
|
@ -484,7 +473,6 @@ redraw_image(unsigned char which) {
|
|||
render_simage(images[image_sa].current, scrollbar_get_anchor_win(), scrollbar_anchor_width(), scrollbar_anchor_height(), image_sa, 0);
|
||||
scrollbar_show(0);
|
||||
break;
|
||||
# endif
|
||||
default:
|
||||
D_PIXMAP(("redraw_image(): Bad value %u\n", which));
|
||||
break;
|
||||
|
@ -800,10 +788,8 @@ render_simage(simage_t * simg, Window win, unsigned short width, unsigned short
|
|||
case image_down:
|
||||
case image_left:
|
||||
case image_right:
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
case image_sb:
|
||||
case image_sa:
|
||||
# endif
|
||||
cidx = (TermWin.focus ? scrollColor : unfocusedScrollColor);
|
||||
break;
|
||||
case image_menu:
|
||||
|
|
46
src/pixmap.h
46
src/pixmap.h
|
@ -1,26 +1,24 @@
|
|||
/* pixmap.h -- Eterm pixmap 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 _PIXMAP_H
|
||||
|
@ -61,10 +59,8 @@ enum {
|
|||
image_down,
|
||||
image_left,
|
||||
image_right,
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
image_sb,
|
||||
image_sa,
|
||||
#endif
|
||||
image_menu,
|
||||
image_submenu,
|
||||
image_max
|
||||
|
@ -92,6 +88,12 @@ enum {
|
|||
#define ALLOW_AUTO 0x80
|
||||
#define ALLOW_MASK 0xf0
|
||||
|
||||
/* Image states */
|
||||
#define IMAGE_STATE_CURRENT (0)
|
||||
#define IMAGE_STATE_NORMAL (1)
|
||||
#define IMAGE_STATE_SELECTED (2)
|
||||
#define IMAGE_STATE_CLICKED (3)
|
||||
|
||||
/* Helper macros */
|
||||
#define FOREACH_IMAGE(x) do {unsigned char idx; for (idx = 0; idx < image_max; idx++) { x } } while (0)
|
||||
#define image_set_mode(which, bit) do {images[which].mode &= ~(MODE_MASK); images[which].mode |= (bit);} while (0)
|
||||
|
|
|
@ -3163,7 +3163,7 @@ debug_colors(void)
|
|||
void xim_get_position(XPoint *pos)
|
||||
{
|
||||
pos->x = Col2Pixel(screen.col);
|
||||
if (scrollbar_visible() && !(Options & Opt_scrollBar_right))
|
||||
if (scrollbar_is_visible() && !(Options & Opt_scrollbar_right))
|
||||
pos->x += scrollbar_trough_width();
|
||||
pos->y = Height2Pixel(screen.row) + TermWin.font->ascent
|
||||
+ TermWin.internalBorder;
|
||||
|
|
1257
src/scrollbar.c
1257
src/scrollbar.c
File diff suppressed because it is too large
Load Diff
212
src/scrollbar.h
212
src/scrollbar.h
|
@ -1,137 +1,114 @@
|
|||
/* scrollbar.h -- Eterm scrollbar 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 _SCROLLBAR_H
|
||||
# define _SCROLLBAR_H
|
||||
#define _SCROLLBAR_H
|
||||
|
||||
# include <X11/Xfuncproto.h>
|
||||
# include <ctype.h>
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
# include <Imlib.h>
|
||||
# endif
|
||||
# include "events.h"
|
||||
#include <X11/Xfuncproto.h>
|
||||
#include <ctype.h>
|
||||
#include <Imlib.h>
|
||||
#include "events.h"
|
||||
|
||||
/************ Macros and Definitions ************/
|
||||
/* Scrollbar types we support */
|
||||
# define SCROLLBAR_MOTIF 1
|
||||
# define SCROLLBAR_XTERM 2
|
||||
# define SCROLLBAR_NEXT 3
|
||||
#define SCROLLBAR_MOTIF 1
|
||||
#define SCROLLBAR_XTERM 2
|
||||
#define SCROLLBAR_NEXT 3
|
||||
|
||||
/* Scrollbar states */
|
||||
#define SCROLLBAR_STATE_VISIBLE (1UL << 0)
|
||||
#define SCROLLBAR_STATE_MOVING (1UL << 1)
|
||||
#define SCROLLBAR_STATE_UP_CLICKED (1UL << 2)
|
||||
#define SCROLLBAR_STATE_DOWN_CLICKED (1UL << 3)
|
||||
|
||||
/* Scrollbar state macros */
|
||||
#define scrollbar_visible() (scrollBar.state)
|
||||
#define scrollbar_isMotion() (scrollBar.state == 'm')
|
||||
#define scrollbar_isUp() (scrollBar.state == 'U')
|
||||
#define scrollbar_isDn() (scrollBar.state == 'D')
|
||||
#define scrollbar_isUpDn() (isupper(scrollBar.state))
|
||||
#define scrollbar_setNone() do { D_SCROLLBAR(("scrollbar_setNone(): Cancelling motion.\n")); scrollBar.state = 1; } while (0)
|
||||
#define scrollbar_setMotion() do { D_SCROLLBAR(("scrollbar_setMotion()\n")); scrollBar.state = 'm'; } while (0)
|
||||
#define scrollbar_setUp() do { D_SCROLLBAR(("scrollbar_setUp()\n")); scrollBar.state = 'U'; } while (0)
|
||||
#define scrollbar_setDn() do { D_SCROLLBAR(("scrollbar_setNone()\n")); scrollBar.state = 'D'; } while (0)
|
||||
#define scrollbar_is_visible() (scrollbar.state & SCROLLBAR_STATE_VISIBLE)
|
||||
#define scrollbar_is_moving() (scrollbar.state & SCROLLBAR_STATE_MOVING)
|
||||
#define scrollbar_uparrow_is_pressed() (scrollbar.state & SCROLLBAR_STATE_UP_CLICKED)
|
||||
#define scrollbar_downarrow_is_pressed() (scrollbar.state & SCROLLBAR_STATE_DOWN_CLICKED)
|
||||
#define scrollbar_arrow_is_pressed() (scrollbar.state & (SCROLLBAR_STATE_UP_CLICKED | SCROLLBAR_STATE_DOWN_CLICKED))
|
||||
#define scrollbar_cancel_motion() (scrollbar.state &= ~(SCROLLBAR_STATE_UP_CLICKED | SCROLLBAR_STATE_DOWN_CLICKED | SCROLLBAR_STATE_MOVING))
|
||||
#define scrollbar_set_visible(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_VISIBLE) : (scrollbar.state &= ~(SCROLLBAR_STATE_VISIBLE)))
|
||||
#define scrollbar_set_motion(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_MOVING) : (scrollbar.state &= ~(SCROLLBAR_STATE_MOVING)))
|
||||
#define scrollbar_set_uparrow_pressed(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_UP_CLICKED) : (scrollbar.state &= ~(SCROLLBAR_STATE_UP_CLICKED)))
|
||||
#define scrollbar_set_downarrow_pressed(bit) ((bit) ? (scrollbar.state |= SCROLLBAR_STATE_DOWN_CLICKED) : (scrollbar.state &= ~(SCROLLBAR_STATE_DOWN_CLICKED)))
|
||||
|
||||
/* The various scrollbar elements */
|
||||
#ifdef PIXMAP_SCROLLBAR
|
||||
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
|
||||
# define scrollbar_win_is_uparrow(w) ((w) == scrollBar.up_win)
|
||||
# define scrollbar_win_is_downarrow(w) ((w) == scrollBar.dn_win)
|
||||
# define scrollbar_win_is_anchor(w) ((w) == scrollBar.sa_win)
|
||||
# define scrollbar_is_pixmapped() (images[image_sb].mode & MODE_MASK)
|
||||
# define scrollbar_uparrow_is_pixmapped() (images[image_up].mode & MODE_MASK)
|
||||
# define scrollbar_downarrow_is_pixmapped() (images[image_down].mode & MODE_MASK)
|
||||
# define scrollbar_anchor_is_pixmapped() (images[image_sa].mode & MODE_MASK)
|
||||
# define scrollbar_upButton(w, y) ( scrollbar_uparrow_is_pixmapped() ? scrollbar_win_is_uparrow(w) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg)))
|
||||
# define scrollbar_dnButton(w, y) ( scrollbar_downarrow_is_pixmapped() ? scrollbar_win_is_downarrow(w) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end)))
|
||||
#else
|
||||
# define scrollbar_win_is_scrollbar(w) (scrollbar_visible() && (w) == scrollBar.win)
|
||||
# define scrollbar_win_is_uparrow(w) (0)
|
||||
# define scrollbar_win_is_downarrow(w) (0)
|
||||
# define scrollbar_win_is_anchor(w) (0)
|
||||
# define scrollbar_is_pixmapped() (0)
|
||||
# define scrollbar_uparrow_is_pixmapped() (0)
|
||||
# define scrollbar_downarrow_is_pixmapped() (0)
|
||||
# define scrollbar_anchor_is_pixmapped() (0)
|
||||
# define scrollbar_upButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollBar.end && (y) <= scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) < scrollBar.beg))
|
||||
# define scrollbar_dnButton(w, y) ((scrollBar.type == SCROLLBAR_NEXT && (y) > scrollbar_dn_loc()) \
|
||||
|| (scrollBar.type != SCROLLBAR_NEXT && (y) > scrollBar.end))
|
||||
#endif
|
||||
#define scrollbar_win_is_trough(w) (scrollbar_is_visible() && (w) == scrollbar.win)
|
||||
#define scrollbar_win_is_uparrow(w) ((w) == scrollbar.up_win)
|
||||
#define scrollbar_win_is_downarrow(w) ((w) == scrollbar.dn_win)
|
||||
#define scrollbar_win_is_anchor(w) ((w) == scrollbar.sa_win)
|
||||
#define scrollbar_is_pixmapped() (images[image_sb].mode & MODE_MASK)
|
||||
#define scrollbar_uparrow_is_pixmapped() (images[image_up].mode & MODE_MASK)
|
||||
#define scrollbar_downarrow_is_pixmapped() (images[image_down].mode & MODE_MASK)
|
||||
#define scrollbar_anchor_is_pixmapped() (images[image_sa].mode & MODE_MASK)
|
||||
|
||||
/* Scrollbar dimensions */
|
||||
#define scrollbar_scrollarea_height() (scrollBar.end - scrollBar.beg)
|
||||
#define scrollbar_anchor_width() (scrollBar.width)
|
||||
#define scrollbar_anchor_height() (scrollBar.bot - scrollBar.top)
|
||||
#define scrollbar_trough_width() (scrollBar.width + 2 * scrollBar.shadow)
|
||||
#define scrollbar_trough_height() (scrollBar.end + ((scrollBar.type == SCROLLBAR_NEXT) ? (2 * (scrollBar.width + 1) + scrollBar.shadow) \
|
||||
: ((scrollBar.width + 1) + scrollBar.shadow)))
|
||||
#define scrollbar_arrow_width() (scrollBar.width)
|
||||
#define scrollbar_arrow_height() (scrollBar.width)
|
||||
#define scrollbar_anchor_max_height() ((menubar_visible()) ? (TermWin.height) : (TermWin.height - ((scrollBar.width + 1) + scrollBar.shadow)))
|
||||
#define scrollbar_scrollarea_height() (scrollbar.scrollarea_end - scrollbar.scrollarea_start)
|
||||
#define scrollbar_anchor_width() ((scrollbar.type == SCROLLBAR_XTERM) ? (scrollbar.win_width) : (scrollbar.width))
|
||||
#define scrollbar_anchor_height() (scrollbar.anchor_bottom - scrollbar.anchor_top)
|
||||
#define scrollbar_trough_width() (scrollbar.win_width)
|
||||
#define scrollbar_trough_height() (scrollbar.win_height)
|
||||
#define scrollbar_arrow_width() (scrollbar.width)
|
||||
#define scrollbar_arrow_height() (scrollbar.width)
|
||||
|
||||
/* Scrollbar positions */
|
||||
#define scrollbar_is_above_anchor(w, y) ((y) < scrollBar.top && !scrollbar_win_is_anchor(w))
|
||||
#define scrollbar_is_below_anchor(w, y) ((y) > scrollBar.bot && !scrollbar_win_is_anchor(w))
|
||||
#define scrollbar_position(y) ((y) - scrollBar.beg)
|
||||
#define scrollbar_up_loc() (scrollbar_uparrow_is_pixmapped() ? ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + 1) : (scrollBar.shadow)) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + 1) : (scrollBar.shadow)))
|
||||
#define scrollbar_dn_loc() (scrollbar_downarrow_is_pixmapped() \
|
||||
? ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + scrollBar.width + 2) : (scrollBar.end + 1)) \
|
||||
: ((scrollBar.type == SCROLLBAR_NEXT) ? (scrollBar.end + scrollBar.width + 2) : (scrollBar.end + 1)))
|
||||
#define scrollbar_is_above_anchor(w, y) (!scrollbar_win_is_anchor(w) && ((y) < scrollbar.anchor_top))
|
||||
#define scrollbar_is_below_anchor(w, y) (!scrollbar_win_is_anchor(w) && ((y) > scrollbar.anchor_bottom))
|
||||
#define scrollbar_position(y) ((y) - scrollbar.scrollarea_start)
|
||||
#define scrollbar_up_loc() (scrollbar.up_arrow_loc)
|
||||
#define scrollbar_dn_loc() (scrollbar.down_arrow_loc)
|
||||
|
||||
/* Scrollbar operations */
|
||||
#define map_scrollbar(show) do {PrivMode(show, PrivMode_scrollBar); if (scrollbar_mapping(show)) {scr_touch(); parent_resize();} } while (0)
|
||||
#define scrollbar_get_shadow() (scrollBar.shadow)
|
||||
#define scrollbar_set_shadow(s) do { scrollBar.shadow = (s); } while (0)
|
||||
#define scrollbar_get_win() (scrollBar.win)
|
||||
#define scrollbar_get_uparrow_win() (scrollBar.up_win)
|
||||
#define scrollbar_get_downarrow_win() (scrollBar.dn_win)
|
||||
#define scrollbar_get_anchor_win() (scrollBar.sa_win)
|
||||
#define map_scrollbar(show) do {PrivMode(show, PrivMode_scrollbar); if (scrollbar_mapping(show)) {scr_touch(); parent_resize();} } while (0)
|
||||
#define scrollbar_map_arrows() do {XMapWindow(Xdisplay, scrollbar.up_win); XMapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
||||
#define scrollbar_unmap_arrows() do {XUnmapWindow(Xdisplay, scrollbar.up_win); XUnmapWindow(Xdisplay, scrollbar.dn_win);} while (0)
|
||||
#define scrollbar_get_shadow() (((scrollbar.type == SCROLLBAR_XTERM) || (Options & Opt_scrollbar_floating)) ? (0) : (scrollbar.shadow))
|
||||
#define scrollbar_set_shadow(s) (scrollbar.shadow = (s))
|
||||
#define scrollbar_get_type() (scrollbar.type)
|
||||
#define scrollbar_set_type(t) (scrollbar.type = (t))
|
||||
#define scrollbar_get_width() (scrollbar.width)
|
||||
#define scrollbar_set_width(w) (scrollbar.width = (w))
|
||||
#define scrollbar_get_win() (scrollbar.win)
|
||||
#define scrollbar_get_uparrow_win() (scrollbar.up_win)
|
||||
#define scrollbar_get_downarrow_win() (scrollbar.dn_win)
|
||||
#define scrollbar_get_anchor_win() (scrollbar.sa_win)
|
||||
|
||||
/************ Structures ************/
|
||||
typedef struct {
|
||||
short beg, end; /* beg/end of slider sub-window */
|
||||
short top, bot; /* top/bot of slider */
|
||||
unsigned char state; /* scrollbar state */
|
||||
unsigned int type:2; /* scrollbar type (see above) */
|
||||
unsigned int init:1; /* has scrollbar been drawn? */
|
||||
unsigned int shadow:5; /* shadow width */
|
||||
unsigned short width, height; /* scrollbar width and height, without the shadow */
|
||||
unsigned short win_width, win_height; /* scrollbar window dimensions */
|
||||
short up_arrow_loc, down_arrow_loc; /* y coordinates for arrows */
|
||||
unsigned short arrow_width, arrow_height; /* scrollbar arrow dimensions */
|
||||
Window win;
|
||||
# ifdef PIXMAP_SCROLLBAR
|
||||
Window up_win;
|
||||
Window dn_win;
|
||||
Window sa_win;
|
||||
# endif
|
||||
Window win, up_win, dn_win, sa_win;
|
||||
short scrollarea_start, scrollarea_end;
|
||||
short anchor_top, anchor_bottom;
|
||||
unsigned char state;
|
||||
unsigned int type:2;
|
||||
unsigned int init:1;
|
||||
unsigned int shadow:5;
|
||||
unsigned short width, height;
|
||||
unsigned short win_width, win_height;
|
||||
short up_arrow_loc, down_arrow_loc;
|
||||
} scrollbar_t;
|
||||
|
||||
/************ Variables ************/
|
||||
extern scrollbar_t scrollBar;
|
||||
extern scrollbar_t scrollbar;
|
||||
#ifdef SCROLLBAR_BUTTON_CONTINUAL_SCROLLING
|
||||
extern short scroll_arrow_delay;
|
||||
#endif
|
||||
|
@ -139,9 +116,6 @@ extern short scroll_arrow_delay;
|
|||
/************ Function Prototypes ************/
|
||||
_XFUNCPROTOBEGIN
|
||||
|
||||
extern void Draw_up_button(int, int, int);
|
||||
extern void Draw_dn_button(int, int, int);
|
||||
extern void scrollbar_init(void);
|
||||
extern void scrollbar_event_init_dispatcher(void);
|
||||
extern unsigned char sb_handle_configure_notify(event_t *);
|
||||
extern unsigned char sb_handle_enter_notify(event_t *);
|
||||
|
@ -153,11 +127,25 @@ extern unsigned char sb_handle_button_press(event_t *);
|
|||
extern unsigned char sb_handle_button_release(event_t *);
|
||||
extern unsigned char sb_handle_motion_notify(event_t *);
|
||||
extern unsigned char scrollbar_dispatch_event(event_t *);
|
||||
extern void scrollbar_draw_uparrow(unsigned char image_state, unsigned char force_modes);
|
||||
extern unsigned char scrollbar_move_uparrow(void);
|
||||
extern void scrollbar_draw_downarrow(unsigned char image_state, unsigned char force_modes);
|
||||
extern unsigned char scrollbar_move_downarrow(void);
|
||||
extern void scrollbar_draw_anchor(unsigned char image_state, unsigned char force_modes);
|
||||
extern unsigned char scrollbar_move_anchor(void);
|
||||
extern void scrollbar_draw_trough(unsigned char image_state, unsigned char force_modes);
|
||||
extern void scrollbar_init(int, int);
|
||||
extern unsigned char scrollbar_mapping(unsigned char);
|
||||
extern void scrollbar_reset(void);
|
||||
extern void scrollbar_calc_size(int width, int height);
|
||||
extern void scrollbar_resize(int, int);
|
||||
extern void scrollbar_change_type(unsigned int);
|
||||
extern void scrollbar_change_width(unsigned short);
|
||||
extern void scrollbar_drawing_init(void);
|
||||
extern unsigned char scrollbar_set_focus(short has_focus);
|
||||
extern unsigned char scrollbar_anchor_update_position(short mouseoffset);
|
||||
extern void scrollbar_draw(unsigned char force_modes);
|
||||
extern void scrollbar_reposition_and_draw(unsigned char force_modes);
|
||||
extern unsigned char scrollbar_show(short);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
|
|
|
@ -205,8 +205,12 @@ eterm_bootstrap(int argc, char *argv[])
|
|||
Create_Windows(argc, argv);
|
||||
scr_reset(); /* initialize screen */
|
||||
|
||||
scrollbar_mapping(Options & Opt_scrollBar);
|
||||
scrollbar_resize(szHint.width, szHint.height);
|
||||
/* Initialize the scrollbar */
|
||||
scrollbar_init(szHint.width, szHint.height);
|
||||
scrollbar_mapping(Options & Opt_scrollbar);
|
||||
|
||||
/* Initialize the menu subsystem. */
|
||||
menu_init();
|
||||
|
||||
#if DEBUG >= DEBUG_X
|
||||
if (debug_level >= DEBUG_X) {
|
||||
|
|
|
@ -64,9 +64,11 @@
|
|||
# define UPPER_BOUND(current, other) (((current) > (other)) ? ((current) = (other)) : (current))
|
||||
# define AT_MOST(current, other) UPPER_BOUND(current, other)
|
||||
# define MIN_IT(current, other) UPPER_BOUND(current, other)
|
||||
# define BOUND(val, min, max) (((val) < (min)) ? ((val) = (min)) : (((val) > (max)) ? ((val) = (max)) : (val)))
|
||||
# define CONTAIN(val, min, max) BOUND(val, min, max)
|
||||
# define SWAP_IT(one, two, tmp) do {(tmp) = (one); (one) = (two); (two) = (tmp);} while (0)
|
||||
|
||||
/* width of scrollBar, menuBar shadow ... don't change! */
|
||||
/* width of scrollbar, menuBar shadow ... don't change! */
|
||||
# define SHADOW 2
|
||||
|
||||
/* convert pixel dimensions to row/column values */
|
||||
|
|
23
src/system.c
23
src/system.c
|
@ -1,5 +1,24 @@
|
|||
/* system.c -- Eterm secure system() replacement
|
||||
* -- 21 August 1997, mej
|
||||
/*
|
||||
* 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$";
|
||||
|
|
23
src/system.h
23
src/system.h
|
@ -1,4 +1,25 @@
|
|||
/* system.h -- Header file for system.c */
|
||||
/*
|
||||
* 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 _SYSTEM_H_
|
||||
#define _SYSTEM_H_
|
||||
|
|
13
src/term.c
13
src/term.c
|
@ -151,6 +151,7 @@ lookup_key(XEvent * ev)
|
|||
valid_keysym = (status_return == XLookupKeySym) || (status_return == XLookupBoth);
|
||||
} else {
|
||||
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(short_buf), &keysym, NULL);
|
||||
valid_keysym = 1;
|
||||
}
|
||||
#else /* USE_XIM */
|
||||
len = XLookupString(&ev->xkey, (char *) kbuf, sizeof(kbuf), &keysym, NULL);
|
||||
|
@ -1181,7 +1182,7 @@ process_window_mode(unsigned int nargs, int args[])
|
|||
y = args[++i];
|
||||
x = args[++i];
|
||||
XResizeWindow(Xdisplay, TermWin.parent,
|
||||
Width2Pixel(x) + 2 * TermWin.internalBorder + (scrollbar_visible()? scrollbar_trough_width() : 0),
|
||||
Width2Pixel(x) + 2 * TermWin.internalBorder + (scrollbar_is_visible()? scrollbar_trough_width() : 0),
|
||||
Height2Pixel(y) + 2 * TermWin.internalBorder);
|
||||
break;
|
||||
case 11:
|
||||
|
@ -1299,9 +1300,9 @@ process_terminal_mode(int mode, int priv, unsigned int nargs, int arg[])
|
|||
PrivateModes &= ~(PrivMode_MouseX11);
|
||||
break;
|
||||
|
||||
#ifdef scrollBar_esc
|
||||
case scrollBar_esc:
|
||||
PrivCases(PrivMode_scrollBar);
|
||||
#ifdef scrollbar_esc
|
||||
case scrollbar_esc:
|
||||
PrivCases(PrivMode_scrollbar);
|
||||
map_scrollbar(state);
|
||||
break;
|
||||
#endif
|
||||
|
@ -1879,7 +1880,7 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
case 11:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_right);
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_right);
|
||||
scrollbar_reset();
|
||||
map_scrollbar(0);
|
||||
map_scrollbar(1);
|
||||
|
@ -1887,7 +1888,7 @@ xterm_seq(int op, const char *str)
|
|||
break;
|
||||
case 12:
|
||||
nstr = (char *) strsep(&tnstr, ";");
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollBar_floating);
|
||||
OPT_SET_OR_TOGGLE(nstr, Options, Opt_scrollbar_floating);
|
||||
scrollbar_reset();
|
||||
map_scrollbar(0);
|
||||
map_scrollbar(1);
|
||||
|
|
39
src/timer.c
39
src/timer.c
|
@ -1,27 +1,24 @@
|
|||
/* timer.c -- Eterm timer module
|
||||
* -- 16 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$";
|
||||
|
|
39
src/timer.h
39
src/timer.h
|
@ -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 _TIMER_H_
|
||||
|
|
|
@ -287,7 +287,7 @@ Create_Windows(int argc, char *argv[])
|
|||
#endif /* NO_BOLDUNDERLINE */
|
||||
|
||||
/*
|
||||
* get scrollBar/menu shadow colors
|
||||
* get scrollbar/menu shadow colors
|
||||
*
|
||||
* The calculations of topShadow/bottomShadow values are adapted
|
||||
* from the fvwm window manager.
|
||||
|
@ -320,7 +320,7 @@ Create_Windows(int argc, char *argv[])
|
|||
PixColors[unfocusedMenuTopShadowColor] = get_top_shadow_color(PixColors[unfocusedMenuColor], "unfocusedMenuTopShadowColor");
|
||||
}
|
||||
|
||||
szHint.base_width = (2 * TermWin.internalBorder + (Options & Opt_scrollBar ? scrollbar_trough_width() : 0));
|
||||
szHint.base_width = (2 * TermWin.internalBorder + ((Options & Opt_scrollbar) ? scrollbar_trough_width() : 0));
|
||||
szHint.base_height = (2 * TermWin.internalBorder);
|
||||
|
||||
flags = (rs_geometry ? XParseGeometry(rs_geometry, &x, &y, &width, &height) : 0);
|
||||
|
@ -416,12 +416,12 @@ Create_Windows(int argc, char *argv[])
|
|||
/* the vt window */
|
||||
if ((!(Options & Opt_borderless)) && (Options & Opt_backing_store)) {
|
||||
D_X11(("Creating term window with save_under = TRUE\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollBar) && !(Options & Opt_scrollBar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWBackingStore | CWColormap, &Attributes);
|
||||
} else {
|
||||
D_X11(("Creating term window with no backing store\n"));
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollBar) && !(Options & Opt_scrollBar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
TermWin.vt = XCreateWindow(Xdisplay, TermWin.parent, (((Options & Opt_scrollbar) && !(Options & Opt_scrollbar_right)) ? scrollbar_trough_width() : 0), 0,
|
||||
szHint.width, szHint.height, 0, Xdepth, InputOutput, CopyFromParent,
|
||||
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWColormap, &Attributes);
|
||||
}
|
||||
|
@ -442,12 +442,6 @@ Create_Windows(int argc, char *argv[])
|
|||
/* We're done creating our windows. Now let's initialize the event subsystem to handle them. */
|
||||
event_init_subsystem((event_dispatcher_t) process_x_event, (event_dispatcher_init_t) event_init_primary_dispatcher);
|
||||
|
||||
/* Time for the scrollbar to create its windows and add itself to the event subsystem. */
|
||||
scrollbar_init();
|
||||
|
||||
/* Same for the menu subsystem. */
|
||||
menu_init();
|
||||
|
||||
XMapWindow(Xdisplay, TermWin.vt);
|
||||
XMapWindow(Xdisplay, TermWin.parent);
|
||||
XSetWindowBackground(Xdisplay, TermWin.vt, PixColors[bgColor]);
|
||||
|
@ -496,7 +490,7 @@ update_size_hints(void)
|
|||
D_X11(("update_size_hints() called.\n"));
|
||||
szHint.base_width = (2 * TermWin.internalBorder);
|
||||
szHint.base_height = (2 * TermWin.internalBorder);
|
||||
szHint.base_width += ((scrollbar_visible()) ? (scrollbar_trough_width()) : (0));
|
||||
szHint.base_width += ((scrollbar_is_visible()) ? (scrollbar_trough_width()) : (0));
|
||||
D_X11(("Size Hints: base width/height == %lux%lu\n", szHint.base_width, szHint.base_height));
|
||||
|
||||
szHint.min_width = szHint.base_width + szHint.width_inc;
|
||||
|
@ -518,7 +512,7 @@ term_resize(int width, int height)
|
|||
TermWin.width = TermWin.ncol * TermWin.fwidth;
|
||||
TermWin.height = TermWin.nrow * TermWin.fheight;
|
||||
D_X11((" -> New TermWin width/height == %lux%lu\n", TermWin.width, TermWin.height));
|
||||
XMoveResizeWindow(Xdisplay, TermWin.vt, ((Options & Opt_scrollBar_right) ? (0) : ((scrollbar_visible()) ? (scrollbar_trough_width()) : (0))), 0, width, height + 1);
|
||||
XMoveResizeWindow(Xdisplay, TermWin.vt, ((Options & Opt_scrollbar_right) ? (0) : ((scrollbar_is_visible()) ? (scrollbar_trough_width()) : (0))), 0, width, height + 1);
|
||||
render_simage(images[image_bg].current, TermWin.vt, TermWin_TotalWidth(), TermWin_TotalHeight(), image_bg, 1);
|
||||
if (image_mode_is(image_bg, MODE_AUTO)) {
|
||||
enl_ipc_sync();
|
||||
|
|
Loading…
Reference in New Issue