1999-11-18 20:05:24 -08:00
|
|
|
/*
|
2009-10-25 11:35:54 -07:00
|
|
|
* Copyright (C) 1997-2009, Michael Jennings
|
1999-08-17 18:12:47 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08:00
|
|
|
* 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:
|
1999-08-17 18:12:47 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08:00
|
|
|
* 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.
|
1999-08-17 18:12:47 -07:00
|
|
|
*
|
1999-11-18 20:05:24 -08:00
|
|
|
* 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.
|
1999-08-17 18:12:47 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
static const char cvs_ident[] = "$Id$";
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "feature.h"
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <limits.h>
|
|
|
|
|
1999-10-07 15:18:14 -07:00
|
|
|
#include "startup.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "actions.h"
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
#include "buttons.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "command.h"
|
|
|
|
#include "e.h"
|
|
|
|
#include "events.h"
|
1999-10-28 07:02:35 -07:00
|
|
|
#include "font.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "menus.h"
|
|
|
|
#include "options.h"
|
|
|
|
#include "pixmap.h"
|
2000-03-14 19:17:45 -08:00
|
|
|
#include "profile.h"
|
1999-08-17 18:12:47 -07:00
|
|
|
#include "screen.h"
|
|
|
|
#include "scrollbar.h"
|
|
|
|
#include "term.h"
|
|
|
|
#include "windows.h"
|
2002-06-02 17:24:22 -07:00
|
|
|
#ifdef ESCREEN
|
|
|
|
# include "screamcfg.h"
|
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2000-05-31 22:24:47 -07:00
|
|
|
unsigned char paused = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
event_master_t event_master;
|
|
|
|
event_dispatcher_data_t primary_data;
|
2002-05-04 07:25:30 -07:00
|
|
|
mouse_button_state_t button_state = { 0, 0, 0, 0, 0, 0, 0, 0 };
|
1999-08-17 18:12:47 -07:00
|
|
|
|
|
|
|
/********** The Event Handling Subsystem **********/
|
|
|
|
void
|
|
|
|
event_init_subsystem(event_dispatcher_t primary_dispatcher, event_dispatcher_init_t init)
|
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* Initialize the subsystem with the main event dispatcher */
|
|
|
|
event_master.num_dispatchers = 1;
|
|
|
|
event_master.dispatchers = (event_dispatcher_t *) MALLOC(sizeof(event_dispatcher_t));
|
|
|
|
event_master.dispatchers[0] = (event_dispatcher_t) primary_dispatcher;
|
|
|
|
(init) (); /* Initialize the dispatcher's data */
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
event_register_dispatcher(event_dispatcher_t func, event_dispatcher_init_t init)
|
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* Add a secondary event dispatcher */
|
|
|
|
event_master.num_dispatchers++;
|
2005-04-18 18:57:24 -07:00
|
|
|
event_master.dispatchers =
|
|
|
|
(event_dispatcher_t *) REALLOC(event_master.dispatchers, sizeof(event_dispatcher_t) * event_master.num_dispatchers);
|
2002-05-04 07:25:30 -07:00
|
|
|
event_master.dispatchers[event_master.num_dispatchers - 1] = (event_dispatcher_t) func;
|
|
|
|
(init) (); /* Initialize the dispatcher's data */
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-09-01 21:12:16 -07:00
|
|
|
event_dispatch(event_t *event)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
register unsigned char i;
|
|
|
|
register unsigned char handled;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
/* No debugging stuff here. If you need it, take it out when done. This should be ultra-fast. -- mej */
|
|
|
|
for (i = 0; i < event_master.num_dispatchers; i++) {
|
|
|
|
handled = (event_master.dispatchers[i]) (event);
|
|
|
|
if (handled) {
|
|
|
|
break;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-09-01 21:12:16 -07:00
|
|
|
event_data_add_mywin(event_dispatcher_data_t *data, Window win)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
ASSERT(data != NULL);
|
|
|
|
|
|
|
|
if (data->num_my_windows > 0) {
|
|
|
|
(data->num_my_windows)++;
|
|
|
|
data->my_windows = (Window *) REALLOC(data->my_windows, sizeof(Window) * data->num_my_windows);
|
|
|
|
data->my_windows[data->num_my_windows - 1] = win;
|
|
|
|
} else {
|
|
|
|
data->num_my_windows = 1;
|
|
|
|
data->my_windows = (Window *) MALLOC(sizeof(Window));
|
|
|
|
data->my_windows[0] = win;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2000-09-01 21:12:16 -07:00
|
|
|
event_data_add_parent(event_dispatcher_data_t *data, Window win)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
ASSERT(data != NULL);
|
|
|
|
|
|
|
|
if (data->num_my_parents > 0) {
|
|
|
|
(data->num_my_parents)++;
|
|
|
|
data->my_parents = (Window *) REALLOC(data->my_parents, sizeof(Window) * data->num_my_parents);
|
|
|
|
data->my_parents[data->num_my_parents - 1] = win;
|
|
|
|
} else {
|
|
|
|
data->num_my_parents = 1;
|
|
|
|
data->my_parents = (Window *) MALLOC(sizeof(Window));
|
|
|
|
data->my_parents[0] = win;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
event_init_primary_dispatcher(void)
|
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
MEMSET(&primary_data, 0, sizeof(event_dispatcher_data_t));
|
|
|
|
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, KeyPress, handle_key_press);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, PropertyNotify, handle_property_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, DestroyNotify, handle_destroy_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, ClientMessage, handle_client_message);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, MappingNotify, handle_mapping_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, VisibilityNotify, handle_visibility_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, EnterNotify, handle_enter_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, LeaveNotify, handle_leave_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, FocusIn, handle_focus_in);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, FocusOut, handle_focus_out);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, ConfigureNotify, handle_configure_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, SelectionClear, handle_selection_clear);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, SelectionNotify, handle_selection_notify);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, SelectionRequest, handle_selection_request);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, GraphicsExpose, handle_expose);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, Expose, handle_expose);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, ButtonPress, handle_button_press);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, ButtonRelease, handle_button_release);
|
|
|
|
EVENT_DATA_ADD_HANDLER(primary_data, MotionNotify, handle_motion_notify);
|
|
|
|
|
|
|
|
event_data_add_mywin(&primary_data, TermWin.parent);
|
|
|
|
event_data_add_mywin(&primary_data, TermWin.vt);
|
1999-11-18 20:05:24 -08:00
|
|
|
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
if (desktop_window != None) {
|
|
|
|
event_data_add_parent(&primary_data, desktop_window);
|
|
|
|
}
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
event_win_is_mywin(register event_dispatcher_data_t *data, Window win)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
register unsigned short i;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
ASSERT_RVAL(data != NULL, 0);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < data->num_my_windows; i++) {
|
|
|
|
if (data->my_windows[i] == win) {
|
|
|
|
return 1;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
event_win_is_parent(register event_dispatcher_data_t *data, Window win)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
register unsigned short i;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-10-04 18:19:41 -07:00
|
|
|
ASSERT_RVAL(data != NULL, 0);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < data->num_my_parents; i++) {
|
|
|
|
if (data->my_parents[i] == win) {
|
|
|
|
return 1;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_key_press(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2009-10-25 11:35:54 -07:00
|
|
|
XWMHints *wm_hints;
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef COUNT_X_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
static unsigned long keypress_cnt = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
PROF_INIT(handle_key_press);
|
|
|
|
D_EVENTS(("handle_key_press(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
|
|
|
|
COUNT_EVENT(keypress_cnt);
|
2003-08-24 08:09:32 -07:00
|
|
|
if (!(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_NO_INPUT))) {
|
2002-05-04 07:25:30 -07:00
|
|
|
lookup_key(ev);
|
|
|
|
}
|
2009-10-25 11:35:54 -07:00
|
|
|
if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT)) {
|
|
|
|
wm_hints = XGetWMHints(Xdisplay, TermWin.parent);
|
|
|
|
wm_hints->flags &= ~XUrgencyHint;
|
|
|
|
XSetWMHints(Xdisplay, TermWin.parent, wm_hints);
|
|
|
|
XFree(wm_hints);
|
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
PROF_DONE(handle_key_press);
|
|
|
|
PROF_TIME(handle_key_press);
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_property_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_property_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_OFFSET
|
2002-05-04 07:25:30 -07:00
|
|
|
if (background_is_trans()) {
|
|
|
|
Window win;
|
|
|
|
Pixmap pmap;
|
|
|
|
|
|
|
|
if ((ev->xany.window == TermWin.parent) || (ev->xany.window == Xroot)) {
|
|
|
|
D_EVENTS(("On %s. prop (_WIN_WORKSPACE) == 0x%08x, ev->xproperty.atom == 0x%08x\n",
|
2005-04-18 18:57:24 -07:00
|
|
|
((ev->xany.window == Xroot) ? "the root window" : "TermWin.parent"), (int) props[PROP_DESKTOP],
|
|
|
|
(int) ev->xproperty.atom));
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xproperty.atom == props[PROP_DESKTOP]) {
|
|
|
|
win = get_desktop_window();
|
|
|
|
if (win == (Window) 1) {
|
|
|
|
/* The desktop window is unchanged. Ignore this event. */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
/* The desktop window has changed somehow. */
|
|
|
|
if (desktop_window == None) {
|
|
|
|
free_desktop_pixmap();
|
|
|
|
FOREACH_IMAGE(if (image_mode_is(idx, MODE_TRANS)) {
|
|
|
|
image_set_mode(idx, MODE_IMAGE); image_allow_mode(idx, ALLOW_IMAGE);}
|
|
|
|
);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
pmap = get_desktop_pixmap();
|
|
|
|
if (pmap == (Pixmap) 1) {
|
|
|
|
/* Pixmap is unchanged */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
|
|
|
return 1;
|
|
|
|
}
|
1999-10-28 07:02:35 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == desktop_window) {
|
|
|
|
D_EVENTS(("On desktop_window [0x%08x]. prop (_XROOTPMAP_ID) == %d, ev->xproperty.atom == %d\n",
|
|
|
|
(int) desktop_window, (int) props[PROP_TRANS_PIXMAP], (int) ev->xproperty.atom));
|
|
|
|
if (ev->xproperty.atom == props[PROP_TRANS_PIXMAP]) {
|
|
|
|
pmap = get_desktop_pixmap();
|
|
|
|
if (pmap == (Pixmap) 1) {
|
|
|
|
/* Pixmap is unchanged */
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
redraw_images_by_mode(MODE_TRANS | MODE_VIEWPORT);
|
|
|
|
return 1;
|
|
|
|
}
|
1999-09-24 12:08:37 -07:00
|
|
|
}
|
|
|
|
}
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((ev->xany.window == Xroot) && (image_mode_any(MODE_AUTO))) {
|
2005-04-18 18:57:24 -07:00
|
|
|
D_EVENTS(("On the root window. prop (ENLIGHTENMENT_COMMS) == %d, ev->xproperty.atom == %d\n", (int) props[PROP_ENL_COMMS],
|
|
|
|
(int) ev->xproperty.atom));
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((props[PROP_ENL_COMMS] != None) && (ev->xproperty.atom == props[PROP_ENL_COMMS])) {
|
|
|
|
if ((enl_ipc_get_win()) != None) {
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
redraw_images_by_mode(MODE_AUTO);
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
1999-11-15 16:55:07 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
D_EVENTS(("PropertyNotify on term window for atom %d, state %d. Selection atoms are %d and %d.\n", ev->xproperty.atom,
|
|
|
|
ev->xproperty.state, props[PROP_SELECTION_DEST], props[PROP_SELECTION_INCR]));
|
|
|
|
if (ev->xproperty.atom == props[PROP_SELECTION_DEST] && ev->xproperty.state == PropertyNewValue) {
|
|
|
|
D_SELECT(("Fetching next part of incremental selection.\n"));
|
|
|
|
selection_fetch(ev->xproperty.window, ev->xproperty.atom, True);
|
|
|
|
}
|
2001-05-24 00:17:03 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
1999-09-23 16:27:16 -07:00
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_destroy_notify(event_t *ev)
|
1999-09-23 16:27:16 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_destroy_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
|
|
|
|
|
|
|
if (ev->xdestroywindow.window == ipc_win) {
|
|
|
|
D_EVENTS((" -> IPC window 0x%08x changed/destroyed. Clearing ipc_win.\n", ipc_win));
|
|
|
|
XSelectInput(Xdisplay, ipc_win, None);
|
|
|
|
ipc_win = None;
|
|
|
|
(void) check_image_ipc(1);
|
2002-10-12 22:03:47 -07:00
|
|
|
return 1;
|
|
|
|
} else if (XEVENT_IS_MYWIN(ev, &primary_data)) {
|
|
|
|
/* One of our main windows was deleted. Exit cleanly. */
|
|
|
|
D_EVENTS((" -> Primary window destroyed. Terminating.\n"));
|
|
|
|
exit(0);
|
|
|
|
ASSERT_NOTREACHED_RVAL(1);
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
2002-10-12 22:03:47 -07:00
|
|
|
return 0;
|
1999-09-23 16:27:16 -07:00
|
|
|
}
|
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_client_message(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_client_message(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xclient.format == 32 && ev->xclient.data.l[0] == (signed) props[PROP_DELETE_WINDOW])
|
|
|
|
exit(EXIT_SUCCESS);
|
|
|
|
if (ev->xclient.format == 8 && ev->xclient.message_type == props[PROP_ENL_MSG]) {
|
|
|
|
char buff[13];
|
|
|
|
unsigned char i;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
for (i = 0; i < 12; i++) {
|
|
|
|
buff[i] = ev->xclient.data.b[i + 8];
|
|
|
|
}
|
|
|
|
buff[12] = 0;
|
|
|
|
D_ENL(("Discarding unexpected Enlightenment IPC message: \"%s\"\n", buff));
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
#ifdef OFFIX_DND
|
2002-05-04 07:25:30 -07:00
|
|
|
/* OffiX Dnd (drag 'n' drop) protocol */
|
|
|
|
if (ev->xclient.message_type == props[PROP_DND_PROTOCOL]
|
|
|
|
&& ((ev->xclient.data.l[0] == DndFile) || (ev->xclient.data.l[0] == DndDir) || (ev->xclient.data.l[0] == DndLink))) {
|
|
|
|
/* Get DnD data */
|
|
|
|
Atom ActualType;
|
|
|
|
int ActualFormat;
|
|
|
|
unsigned char *data;
|
|
|
|
unsigned long Size, RemainingBytes;
|
|
|
|
|
2005-04-18 18:57:24 -07:00
|
|
|
XGetWindowProperty(Xdisplay, Xroot, props[PROP_DND_SELECTION], 0L, 1000000L, False, AnyPropertyType, &ActualType,
|
|
|
|
&ActualFormat, &Size, &RemainingBytes, &data);
|
2010-09-12 23:20:10 -07:00
|
|
|
if (data) {
|
2002-05-04 07:25:30 -07:00
|
|
|
XChangeProperty(Xdisplay, Xroot, XA_CUT_BUFFER0, XA_STRING, 8, PropModeReplace, data, strlen(data));
|
2004-11-03 15:18:45 -08:00
|
|
|
selection_paste(XA_CUT_BUFFER0);
|
2002-05-04 07:25:30 -07:00
|
|
|
XSetInputFocus(Xdisplay, Xroot, RevertToNone, CurrentTime);
|
|
|
|
XFree(data);
|
|
|
|
}
|
|
|
|
return 1;
|
2000-11-09 19:26:04 -08:00
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif /* OFFIX_DND */
|
2002-05-04 07:25:30 -07:00
|
|
|
if ((XInternAtom(Xdisplay, "_FVWM_COLORTUNER", True) == ev->xclient.message_type) && ev->xclient.send_event) {
|
|
|
|
if (ev->xclient.data.l[0] >= 0 && ev->xclient.data.l[0] <= 31) {
|
|
|
|
PixColors[(int) ev->xclient.data.l[0]] = ev->xclient.data.l[1];
|
|
|
|
|
|
|
|
if ((int) ev->xclient.data.l[0] == bgColor) {
|
|
|
|
XFocusChangeEvent fev;
|
|
|
|
event_t *pfev;
|
|
|
|
|
|
|
|
fev.type = FocusIn;
|
|
|
|
fev.send_event = 1;
|
|
|
|
fev.display = Xdisplay;
|
|
|
|
fev.window = ev->xany.window;
|
|
|
|
pfev = (event_t *) & fev;
|
|
|
|
handle_focus_in(pfev);
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
|
|
|
scr_touch();
|
|
|
|
scr_refresh(refresh_type);
|
|
|
|
}
|
|
|
|
return 1;
|
2001-08-05 16:18:48 -07:00
|
|
|
}
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_mapping_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_mapping_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
XRefreshKeyboardMapping(&(ev->xmapping));
|
|
|
|
get_modifiers();
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_visibility_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_visibility_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
|
|
|
|
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
switch (ev->xvisibility.state) {
|
2005-04-18 18:57:24 -07:00
|
|
|
case VisibilityUnobscured:
|
|
|
|
D_X11(("Window completely visible. Using FAST_REFRESH.\n"));
|
|
|
|
refresh_type = FAST_REFRESH;
|
|
|
|
break;
|
|
|
|
case VisibilityPartiallyObscured:
|
|
|
|
D_X11(("Window partially hidden. Using SLOW_REFRESH.\n"));
|
|
|
|
refresh_type = SLOW_REFRESH;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
D_X11(("Window completely hidden. Using NO_REFRESH.\n"));
|
|
|
|
refresh_type = NO_REFRESH;
|
|
|
|
break;
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_enter_notify(event_t *ev)
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_enter_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
if (images[image_bg].norm != images[image_bg].selected) {
|
|
|
|
images[image_bg].current = images[image_bg].selected;
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
|
|
|
return 1;
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_leave_notify(event_t *ev)
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_leave_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
if (images[image_bg].norm != images[image_bg].selected) {
|
|
|
|
images[image_bg].current = images[image_bg].norm;
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
|
|
|
return 1;
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
}
|
|
|
|
|
1999-08-17 18:12:47 -07:00
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_focus_in(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2009-10-25 11:35:54 -07:00
|
|
|
XWMHints *wm_hints;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_focus_in(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (!TermWin.focus) {
|
|
|
|
Window unused_root, child;
|
|
|
|
int unused_root_x, unused_root_y;
|
|
|
|
unsigned int unused_mask;
|
Thu Feb 10 15:10:01 PST 2000 Michael Jennings <mej@eterm.org>
This is the first public availability of the work thus far on Eterm
0.9.1. There's quite a bit of new stuff here.
* Added scrollbar thumb support.
* Completely redid the terminfo/termcap stuff. The terminfo file is
now compiled (by tic) and installed by default (unless you specify
--without-terminfo). The config files still say xterm, though,
because some programs (like SLang and GNU mc) use the silly algorithm
of "Is $TERM set to xterm?" to detect mouse reporting support in a
terminal. =P But if you don't ever use xterm, you can use Eterm's
termcap and just name it "xterm" instead. Thanks to Marius Gedminas
<mgedmin@takas.lt> for his patch that started this whole revamp.
* Added the kEsetroot script for KDE users from Dax Games
<dgames@isoc.net>.
* You can now configure the Home and End emulation via --with-home=
and --with-end= options to configure. The --with-terminfo option is
also new, and --enable-xim is now the default.
* Added a new image state, disabled, for when Eterm loses focus. This
is supported by all widgets (well, all those that could possibly be
on screen when Eterm lost focus), even the background image. So you
could actually have all your images darken on focus out and restore
to normal on focus in.
* Widget colors formerly dealt with as colors (menu text color,
scrollbar color, etc.) are now handled by the imageclasses. Each
image state can have a foreground and background color defined. The
current exception is the background image; I hope to add that later.
The foreground is the text color and the background is the object
color (for solid color mode). So menu text color is set by the menu
imageclass. And again, for unfocused colors, use the disabled state
of the imageclass.
* Proportionally-spaced fonts are now handled much better. They are
still forced into evenly-spaced columns (it's a terminal for crying
out loud!) but at least you don't end up with Eterm's wider than your
screen. :-)
* Home on refresh is gone, as is home on echo. It's now much simpler.
There are two options: home on output, and home on input, the former
being a combination of echo and refresh. Also, keypresses that don't
necessarily have corresonding output can trigger a home on input,
like Ctrl-End or whatever...ones that don't have special meaning.
Credit to Darren Stuart Embry <dse@louisville.edu> for pointing out
this issue and the one with "m-" in font names.
* I finally got around to re-merging the new parser stuff from my
work on the Not Game. Closed up some old potential behavior quirks
with theme parsing.
* Added a new escape sequence to fork-and-exec a program. Also added
a scrollback search capability to highlight all occurances of a string
in your scrollback buffer. Use the new "Etsearch" utility to access
it. "Etsearch string" to search for a string, then "Etsearch" by
itself to reset the highlighting.
* And of course, the biggie. Eterm now supports a completely-
customizeable buttonbar. Not a menubar, a buttonbar. It can have an
arbitrary number of buttons, and each button can perform an action,
just like a menuitem. So a button could bring up a menu (like a
menubar) or launch a program (like a launchbar) or perform an
operation (like a toolbar). Each button can have an icon, text, or
both. And you can have buttons left- or right-justified in the
buttonbar. You will eventually be able to have an arbitrary number
of buttonbars, but I'm still working on that.
As with any change this big, things could very easily be broken. So
beware. :-) I have tested this myself, and everything seems to work,
but I can't test every possibility. Let me know if you find anything
that's broken, and enjoy!
SVN revision: 2048
2000-02-10 16:25:07 -08:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
TermWin.focus = 1;
|
2005-04-18 18:57:24 -07:00
|
|
|
XQueryPointer(Xdisplay, TermWin.parent, &unused_root, &child, &unused_root_x, &unused_root_y, &(ev->xbutton.x),
|
|
|
|
&(ev->xbutton.y), &unused_mask);
|
2002-05-04 07:25:30 -07:00
|
|
|
if (child == TermWin.vt) {
|
|
|
|
if (images[image_bg].current != images[image_bg].selected) {
|
|
|
|
images[image_bg].current = images[image_bg].selected;
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (images[image_bg].current != images[image_bg].norm) {
|
|
|
|
images[image_bg].current = images[image_bg].norm;
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
|
|
|
}
|
2003-08-24 08:09:32 -07:00
|
|
|
if (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP)) {
|
|
|
|
map_scrollbar(BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR));
|
2002-05-04 07:25:30 -07:00
|
|
|
} else {
|
|
|
|
scrollbar_set_focus(TermWin.focus);
|
|
|
|
scrollbar_draw(IMAGE_STATE_NORMAL, MODE_SOLID);
|
|
|
|
}
|
|
|
|
bbar_draw_all(IMAGE_STATE_NORMAL, MODE_SOLID);
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
2010-09-12 23:20:10 -07:00
|
|
|
if (xim_input_context)
|
2002-05-04 07:25:30 -07:00
|
|
|
XSetICFocus(xim_input_context);
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2009-10-25 11:35:54 -07:00
|
|
|
if (BITFIELD_IS_SET(vt_options, VT_OPTIONS_URG_ALERT)) {
|
|
|
|
wm_hints = XGetWMHints(Xdisplay, TermWin.parent);
|
|
|
|
wm_hints->flags &= ~XUrgencyHint;
|
|
|
|
XSetWMHints(Xdisplay, TermWin.parent, wm_hints);
|
|
|
|
XFree(wm_hints);
|
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_focus_out(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_focus_out(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
if (TermWin.focus) {
|
|
|
|
TermWin.focus = 0;
|
|
|
|
if (images[image_bg].current != images[image_bg].disabled) {
|
|
|
|
images[image_bg].current = images[image_bg].disabled;
|
|
|
|
redraw_image(image_bg);
|
|
|
|
}
|
2003-08-24 08:09:32 -07:00
|
|
|
if (BITFIELD_IS_SET(eterm_options, ETERM_OPTIONS_SCROLLBAR_POPUP)) {
|
2002-05-04 07:25:30 -07:00
|
|
|
map_scrollbar(0);
|
|
|
|
} else {
|
|
|
|
scrollbar_set_focus(TermWin.focus);
|
|
|
|
scrollbar_draw(IMAGE_STATE_DISABLED, MODE_SOLID);
|
|
|
|
}
|
|
|
|
bbar_draw_all(IMAGE_STATE_DISABLED, MODE_SOLID);
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
2010-09-12 23:20:10 -07:00
|
|
|
if (xim_input_context)
|
2002-05-04 07:25:30 -07:00
|
|
|
XUnsetICFocus(xim_input_context);
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_configure_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_configure_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
|
|
|
|
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
|
|
|
|
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, ConfigureNotify, ev)) {
|
2005-04-18 18:57:24 -07:00
|
|
|
D_EVENTS(("New event: Window 0x%08x, %dx%d at %d, %d\n", ev->xany.window, ev->xconfigure.width, ev->xconfigure.height,
|
|
|
|
ev->xconfigure.x, ev->xconfigure.y));
|
1999-10-28 07:02:35 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == TermWin.parent) {
|
|
|
|
int x = ev->xconfigure.x, y = ev->xconfigure.y;
|
|
|
|
unsigned int width = ev->xconfigure.width, height = ev->xconfigure.height;
|
|
|
|
|
|
|
|
D_EVENTS((" -> TermWin.parent is %ldx%ld at (%d, %d). Internal cache data shows %dx%d at (%hd, %hd). send_event is %d\n",
|
|
|
|
width, height, x, y, szHint.width, szHint.height, TermWin.x, TermWin.y, ev->xconfigure.send_event));
|
|
|
|
/* If the font change count is non-zero, this event is telling us we resized ourselves. */
|
|
|
|
if (font_chg > 0) {
|
|
|
|
font_chg--;
|
|
|
|
}
|
|
|
|
if ((width != (unsigned int) szHint.width) || (height != (unsigned int) szHint.height)) {
|
|
|
|
/* We were resized externally. Handle the resize. */
|
|
|
|
D_EVENTS((" -> External resize detected.\n"));
|
|
|
|
handle_resize(width, height);
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef USE_XIM
|
2002-05-04 07:25:30 -07:00
|
|
|
xim_set_status_position();
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
/* A resize requires the additional handling of a move */
|
|
|
|
if (ev->xconfigure.send_event) {
|
|
|
|
handle_move(x, y);
|
|
|
|
}
|
|
|
|
} else if (((x != TermWin.x) || (y != TermWin.y)) && (ev->xconfigure.send_event)) {
|
|
|
|
/* There was an external move, but no resize. Handle the move. */
|
|
|
|
D_EVENTS((" -> External move detected.\n"));
|
|
|
|
handle_move(x, y);
|
|
|
|
} else {
|
|
|
|
D_EVENTS((" -> Bogus ConfigureNotify detected, ignoring.\n"));
|
|
|
|
}
|
1999-10-28 07:02:35 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_selection_clear(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_selection_clear(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
selection_clear();
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_selection_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_selection_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
selection_fetch(ev->xselection.requestor, ev->xselection.property, True);
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_selection_request(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_selection_request(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
selection_send(&(ev->xselectionrequest));
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_expose(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
PROF_INIT(handle_expose);
|
|
|
|
D_EVENTS(("handle_expose(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
if (ev->xany.window == TermWin.vt
|
2000-05-02 16:46:08 -07:00
|
|
|
#ifdef PIXMAP_SUPPORT
|
2002-05-04 07:25:30 -07:00
|
|
|
&& buffer_pixmap == None
|
2000-05-02 16:46:08 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
) {
|
|
|
|
if (refresh_type == NO_REFRESH) {
|
|
|
|
refresh_type = FAST_REFRESH;
|
|
|
|
}
|
|
|
|
scr_expose(ev->xexpose.x, ev->xexpose.y, ev->xexpose.width, ev->xexpose.height);
|
|
|
|
} else {
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
XEvent unused_xevent;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, Expose, &unused_xevent));
|
|
|
|
while (XCheckTypedWindowEvent(Xdisplay, ev->xany.window, GraphicsExpose, &unused_xevent));
|
|
|
|
}
|
|
|
|
PROF_DONE(handle_expose);
|
|
|
|
PROF_TIME(handle_expose);
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_button_press(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_button_press(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
2001-09-26 23:21:28 -07:00
|
|
|
|
2009-10-07 20:47:32 -07:00
|
|
|
if (eterm_action_dispatch(ev)) {
|
2002-05-04 07:25:30 -07:00
|
|
|
button_state.ignore_release = 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
button_state.bypass_keystate = (ev->xbutton.state & (Mod1Mask | ShiftMask));
|
|
|
|
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
|
|
|
|
|
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
if (ev->xbutton.subwindow == None) {
|
|
|
|
if (button_state.report_mode) {
|
|
|
|
if (PrivateModes & PrivMode_MouseX10) {
|
|
|
|
/* no state info allowed */
|
|
|
|
ev->xbutton.state = 0;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MOUSE_REPORT_DOUBLECLICK
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xbutton.button == Button1) {
|
|
|
|
if (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME)
|
|
|
|
button_state.clicks++;
|
|
|
|
else
|
|
|
|
button_state.clicks = 1;
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
#else
|
2002-05-04 07:25:30 -07:00
|
|
|
button_state.clicks = 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif /* MOUSE_REPORT_DOUBLECLICK */
|
2002-05-04 07:25:30 -07:00
|
|
|
mouse_report(&(ev->xbutton));
|
Mon Jun 11 17:49:55 PDT 2001 Michael Jennings <mej@eterm.org>
Okay, first off, I removed 3 scaled backgrounds. See www.kainx.org or
my post to enlightenment-devel for details.
Second, I redid the default bindings for the mouse wheel. Basically,
the wheel alone will scroll by pages. Ctrl+wheel will scroll by pages
in groups of 5. Shift+wheel will scroll by a single line. If you
hold down the Alt key, the same combinations will work the same way,
but instead of scrolling within Eterm, they'll scroll the application
in the terminal (by sending PgUp/PgDn and up/down arrows). This works
in less, bash, and any other application which groks those keys.
I also added a --without-mousewheel option to configure that will turn
off the default scrollwheel bindings. Of course, you can always use
action bindings in the config file to bind/rebind these any way you
like.
While I was at it, I found and fixed a bug in the handling of the
Alt and Meta keys.
I added a scroll() function to the script stuff which allows you to
bind keys/buttons to scroll up and down. While I was at it, I added
comments to script.c for each function you can use.
And finally, the config file parser was moved to libast.
SVN revision: 4806
2001-06-11 18:04:45 -07:00
|
|
|
} else {
|
2002-05-04 07:25:30 -07:00
|
|
|
switch (ev->xbutton.button) {
|
2005-04-18 18:57:24 -07:00
|
|
|
case Button1:
|
|
|
|
if ((button_state.last_button_press == 1)
|
|
|
|
&& (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME)) {
|
|
|
|
button_state.clicks++;
|
|
|
|
} else {
|
|
|
|
button_state.clicks = 1;
|
|
|
|
}
|
|
|
|
selection_click(button_state.clicks, ev->xbutton.x, ev->xbutton.y);
|
|
|
|
button_state.last_button_press = 1;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Button3:
|
|
|
|
if ((button_state.last_button_press == 3)
|
|
|
|
&& (ev->xbutton.time - button_state.button_press < MULTICLICK_TIME)) {
|
|
|
|
selection_rotate(ev->xbutton.x, ev->xbutton.y);
|
|
|
|
} else {
|
|
|
|
selection_extend(ev->xbutton.x, ev->xbutton.y, 1);
|
|
|
|
}
|
|
|
|
button_state.last_button_press = 3;
|
|
|
|
break;
|
2002-05-04 07:25:30 -07:00
|
|
|
#ifdef MOUSEWHEEL
|
2005-04-18 18:57:24 -07:00
|
|
|
/* This section activates the following bindings:
|
|
|
|
*
|
|
|
|
* Mousewheel Up -- Scroll up 1 page
|
|
|
|
* Ctrl + Mousewheel Up -- Scroll up 5 pages
|
|
|
|
* Shift + Mousewheel Up -- Scroll up 1 line
|
|
|
|
* Alt + Mousewheel Up -- Send PgUp to tty
|
|
|
|
* Alt + Ctrl + Mousewheel Up -- Send 5 PgUp's to tty
|
|
|
|
* Alt + Shift + Mousewheel Up -- Send Up Arrow to tty
|
|
|
|
*
|
|
|
|
* Mousewheel Down -- Scroll down 1 page
|
|
|
|
* Ctrl + Mousewheel Down -- Scroll down 5 pages
|
|
|
|
* Shift + Mousewheel Down -- Scroll down 1 line
|
|
|
|
* Alt + Mousewheel Down -- Send PgDn to tty
|
|
|
|
* Alt + Ctrl + Mousewheel Down -- Send 5 PgDn's to tty
|
|
|
|
* Alt + Shift + Mousewheel Down -- Send Down Arrow to tty
|
|
|
|
*
|
|
|
|
* Note that the number of lines which constitute a "page" is equal to the number
|
|
|
|
* of text rows in the terminal window. The context lines are subtracted out *after*
|
|
|
|
* the conversion is done. In other words, scrolling 5 pages means scrolling
|
|
|
|
* (5 * LINES_PER_PAGE) - CONTEXT_LINES
|
|
|
|
* _not_
|
|
|
|
* (LINES_PER_PAGE - CONTEXT_LINES) * 5
|
|
|
|
*
|
|
|
|
* This is also true for the scroll() function in script.c.
|
|
|
|
*/
|
|
|
|
case Button4:
|
2009-10-07 20:47:32 -07:00
|
|
|
if (ev->xbutton.state & ETERM_MOD_CTRL) {
|
2005-04-18 18:57:24 -07:00
|
|
|
scr_page(UP, (TermWin.nrow * 5) - CONTEXT_LINES);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & ETERM_MOD_SHIFT) {
|
2005-04-18 18:57:24 -07:00
|
|
|
scr_page(UP, 1);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & ETERM_MOD_ALT) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[5~", 4);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & (ETERM_MOD_ALT | ETERM_MOD_SHIFT)) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[A", 3);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & (ETERM_MOD_ALT | ETERM_MOD_CTRL)) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[5~\033[5~\033[5~\033[5~\033[5~", 20);
|
|
|
|
} else {
|
|
|
|
scr_page(UP, TermWin.nrow - CONTEXT_LINES);
|
|
|
|
}
|
|
|
|
button_state.last_button_press = 4;
|
|
|
|
break;
|
|
|
|
case Button5:
|
2009-10-07 20:47:32 -07:00
|
|
|
if (ev->xbutton.state & ETERM_MOD_CTRL) {
|
2005-04-18 18:57:24 -07:00
|
|
|
scr_page(DN, (TermWin.nrow * 5) - CONTEXT_LINES);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & ETERM_MOD_SHIFT) {
|
2005-04-18 18:57:24 -07:00
|
|
|
scr_page(DN, 1);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & ETERM_MOD_ALT) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[6~", 4);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & (ETERM_MOD_ALT | ETERM_MOD_SHIFT)) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[B", 3);
|
2009-10-07 20:47:32 -07:00
|
|
|
} else if (ev->xbutton.state & (ETERM_MOD_ALT | ETERM_MOD_CTRL)) {
|
2005-04-18 18:57:24 -07:00
|
|
|
tt_write("\033[6~\033[6~\033[6~\033[6~\033[6~", 20);
|
|
|
|
} else {
|
|
|
|
scr_page(DN, TermWin.nrow - CONTEXT_LINES);
|
|
|
|
}
|
|
|
|
button_state.last_button_press = 5;
|
|
|
|
break;
|
Mon Jun 11 17:49:55 PDT 2001 Michael Jennings <mej@eterm.org>
Okay, first off, I removed 3 scaled backgrounds. See www.kainx.org or
my post to enlightenment-devel for details.
Second, I redid the default bindings for the mouse wheel. Basically,
the wheel alone will scroll by pages. Ctrl+wheel will scroll by pages
in groups of 5. Shift+wheel will scroll by a single line. If you
hold down the Alt key, the same combinations will work the same way,
but instead of scrolling within Eterm, they'll scroll the application
in the terminal (by sending PgUp/PgDn and up/down arrows). This works
in less, bash, and any other application which groks those keys.
I also added a --without-mousewheel option to configure that will turn
off the default scrollwheel bindings. Of course, you can always use
action bindings in the config file to bind/rebind these any way you
like.
While I was at it, I found and fixed a bug in the handling of the
Alt and Meta keys.
I added a scroll() function to the script stuff which allows you to
bind keys/buttons to scroll up and down. While I was at it, I added
comments to script.c for each function you can use.
And finally, the config file parser was moved to libast.
SVN revision: 4806
2001-06-11 18:04:45 -07:00
|
|
|
#endif
|
2005-04-18 18:57:24 -07:00
|
|
|
default:
|
|
|
|
break;
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
button_state.button_press = ev->xbutton.time;
|
|
|
|
return (1);
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_button_release(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("handle_button_release(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (button_state.ignore_release == 1) {
|
|
|
|
button_state.ignore_release = 0;
|
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2002-05-04 07:25:30 -07:00
|
|
|
|
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
|
|
|
button_state.mouse_offset = 0;
|
|
|
|
button_state.report_mode = (button_state.bypass_keystate ? 0 : ((PrivateModes & PrivMode_mouse_report) ? 1 : 0));
|
|
|
|
|
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
if (ev->xbutton.subwindow == None) {
|
|
|
|
if (button_state.report_mode) {
|
|
|
|
switch (PrivateModes & PrivMode_mouse_report) {
|
2005-04-18 18:57:24 -07:00
|
|
|
case PrivMode_MouseX10:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PrivMode_MouseX11:
|
|
|
|
ev->xbutton.state = button_state.bypass_keystate;
|
|
|
|
ev->xbutton.button = AnyButton;
|
|
|
|
mouse_report(&(ev->xbutton));
|
|
|
|
break;
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
return (1);
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
* dumb hack to compensate for the failure of click-and-drag
|
|
|
|
* when overriding mouse reporting
|
|
|
|
*/
|
|
|
|
if ((PrivateModes & PrivMode_mouse_report) && (button_state.bypass_keystate) && (ev->xbutton.button == Button1)
|
|
|
|
&& (clickOnce())) {
|
|
|
|
selection_extend(ev->xbutton.x, ev->xbutton.y, 0);
|
|
|
|
}
|
|
|
|
switch (ev->xbutton.button) {
|
2005-04-18 18:57:24 -07:00
|
|
|
case Button1:
|
|
|
|
case Button3:
|
|
|
|
selection_make(ev->xbutton.time);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case Button2:
|
|
|
|
selection_paste(XA_PRIMARY);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2002-05-04 07:25:30 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
handle_motion_notify(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
#ifdef COUNT_X_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
static unsigned long motion_cnt = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
PROF_INIT(handle_motion_notify);
|
|
|
|
D_EVENTS(("handle_motion_notify(ev [%8p] on window 0x%08x)\n", ev, ev->xany.window));
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
COUNT_EVENT(motion_cnt);
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
REQUIRE_RVAL(XEVENT_IS_MYWIN(ev, &primary_data), 0);
|
2002-06-02 17:24:22 -07:00
|
|
|
|
2003-02-19 08:42:27 -08:00
|
|
|
#ifdef HAVE_TWIN
|
|
|
|
/* It's really silly that Twin uses mouse drag codes that are
|
|
|
|
* different from the ones that xterm uses.
|
|
|
|
*/
|
2002-06-02 17:24:22 -07:00
|
|
|
if ((PrivateModes & PrivMode_mouse_report) && !(button_state.bypass_keystate)) {
|
2003-02-19 08:42:27 -08:00
|
|
|
twin_mouse_drag_report(&(ev->xbutton));
|
2002-05-04 07:25:30 -07:00
|
|
|
return 1;
|
2002-06-02 17:24:22 -07:00
|
|
|
}
|
2003-02-19 08:42:27 -08:00
|
|
|
#endif
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
if (ev->xany.window == TermWin.vt) {
|
|
|
|
if (ev->xbutton.state & (Button1Mask | Button3Mask)) {
|
|
|
|
Window unused_root, unused_child;
|
|
|
|
int unused_root_x, unused_root_y;
|
|
|
|
unsigned int unused_mask;
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
while (XCheckTypedWindowEvent(Xdisplay, TermWin.vt, MotionNotify, ev));
|
2005-04-18 18:57:24 -07:00
|
|
|
XQueryPointer(Xdisplay, TermWin.vt, &unused_root, &unused_child, &unused_root_x, &unused_root_y, &(ev->xbutton.x),
|
|
|
|
&(ev->xbutton.y), &unused_mask);
|
1999-08-17 18:12:47 -07:00
|
|
|
#ifdef MOUSE_THRESHOLD
|
2002-05-04 07:25:30 -07:00
|
|
|
/* deal with a `jumpy' mouse */
|
|
|
|
if ((ev->xmotion.time - button_state.button_press) > MOUSE_THRESHOLD)
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2002-05-04 07:25:30 -07:00
|
|
|
selection_extend((ev->xbutton.x), (ev->xbutton.y), (ev->xbutton.state & Button3Mask));
|
|
|
|
}
|
|
|
|
PROF_DONE(handle_motion_notify);
|
|
|
|
PROF_TIME(handle_motion_notify);
|
|
|
|
return 1;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
2000-03-14 19:17:45 -08:00
|
|
|
PROF_DONE(handle_motion_notify);
|
|
|
|
PROF_TIME(handle_motion_notify);
|
1999-08-17 18:12:47 -07:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned char
|
2000-09-01 21:12:16 -07:00
|
|
|
process_x_event(event_t *ev)
|
1999-08-17 18:12:47 -07:00
|
|
|
{
|
|
|
|
#ifdef COUNT_X_EVENTS
|
2002-05-04 07:25:30 -07:00
|
|
|
static unsigned long event_cnt = 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
COUNT_EVENT(event_cnt);
|
1999-10-28 07:02:35 -07:00
|
|
|
#if 0
|
2002-05-04 07:25:30 -07:00
|
|
|
D_EVENTS(("process_x_event(ev [%8p] %s on window 0x%08x)\n", ev, event_type_to_name(ev->xany.type), ev->xany.window));
|
1999-10-28 07:02:35 -07:00
|
|
|
#endif
|
2010-09-12 23:20:10 -07:00
|
|
|
if (primary_data.handlers[ev->type]) {
|
2002-05-04 07:25:30 -07:00
|
|
|
return ((primary_data.handlers[ev->type]) (ev));
|
|
|
|
}
|
|
|
|
return (0);
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
XErrorHandler
|
|
|
|
xerror_handler(Display * display, XErrorEvent * event)
|
|
|
|
{
|
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
char err_string[2048];
|
1999-08-17 18:12:47 -07:00
|
|
|
|
2002-05-04 07:25:30 -07:00
|
|
|
strcpy(err_string, "");
|
|
|
|
XGetErrorText(display, event->error_code, err_string, sizeof(err_string));
|
2009-10-25 11:35:54 -07:00
|
|
|
libast_print_error("XError in function %s, resource 0x%08x (request %d.%d): %s (error %d)\n",
|
2005-04-18 18:57:24 -07:00
|
|
|
request_code_to_name(event->request_code), (int) event->resourceid, event->request_code, event->minor_code,
|
|
|
|
err_string, event->error_code);
|
1999-08-17 18:12:47 -07:00
|
|
|
#if DEBUG > DEBUG_X11
|
2002-05-04 07:25:30 -07:00
|
|
|
if (DEBUG_LEVEL >= DEBUG_X11) {
|
|
|
|
dump_stack_trace();
|
|
|
|
}
|
1999-08-17 18:12:47 -07:00
|
|
|
#endif
|
2009-10-25 11:35:54 -07:00
|
|
|
libast_print_error("Attempting to continue...\n");
|
2002-05-04 07:25:30 -07:00
|
|
|
return 0;
|
1999-08-17 18:12:47 -07:00
|
|
|
}
|