WISH: http://www120.pair.com/mccarthy/nextstep/intro.htmld/Workspace.html is the correct nextstep look.
DUMB: support tex fonts
+7.8
TODO: investigate -pe tabbed -g 80x25 being 23 not 24 or 25 lines
TODO: zero scorllback buffer should free memory
-TODO: kuake
- INCOMPATIBLE CHANGE: this version will always read ~/.Xdefaults,
earlier versions only read it if display-resources (usually from
.Xresources) are not set. This avoids the #1 FAQ ("why isn't my
resource used") and seems to be logical behaviour, too. .Xdefaults
resources have a lower priority than display-specific resources.
+ - add "kuake" perl extension that does a similar thing to the kuake
+ terminal emulator (see man urxtvperl).
- use less "correct" color scaling that is compatible with libX11 and
Xft (avoids off-by-one colors resulting in striped backgrounds).
- the "depth" resource is now respected.
src/perl/xim-onthespot
src/perl/readline
src/perl/remote-clipboard
+src/perl/kuake
src/perl/example-refresh-hooks
src/perl/block-graphics-to-ascii
src/perl/digital-clock
#endif
}
-#if TRANSPARENT
+#if TRANSPARENT || ENABLE_PERL
void
rxvt_term::rootwin_cb (XEvent &ev)
{
make_current ();
+ if (SHOULD_INVOKE (HOOK_ROOT_EVENT)
+ && HOOK_INVOKE ((this, HOOK_ROOT_EVENT, DT_XEVENT, &ev, DT_END)))
+ return;
+
+# if TRANSPARENT
switch (ev.type)
{
case PropertyNotify:
want_refresh = want_full_refresh = 1;
break;
}
+# endif
}
#endif
def (USER_COMMAND)
+ def (ROOT_EVENT)
def (X_EVENT)
def (FOCUS_IN)
def (FOCUS_OUT)
rxvt_term::rxvt_term ()
:
-#if TRANSPARENT
+#if TRANSPARENT || ENABLE_PERL
rootwin_ev (this, &rxvt_term::rootwin_cb),
#endif
#ifdef HAVE_SCROLLBARS
#if HAVE_SCROLLBARS
scrollbar_ev.stop (display);
#endif
-#if TRANSPARENT
+#if TRANSPARENT || ENABLE_PERL
rootwin_ev.stop (display);
#endif
incr_ev.stop ();
rootwin_ev.start (display, display->root);
}
#endif
+#if ENABLE_PERL
+ rootwin_ev.start (display, display->root);
+#endif
set_colorfgbg ();
--- /dev/null
+#! perl
+
+sub on_start {
+ my ($self) = @_;
+
+ $self->{key} = $self->{argv}[0] || "F10";
+
+ $self->{keysym} = $self->XStringToKeysym ($self->{key})
+ or urxvt::fatal "cannot convert requested kuake wake-up key '$self->{key}' to keysym, unable to continue.\n";
+
+ $self->{keycode} = $self->XKeysymToKeycode ($self->{keysym})
+ or urxvt::fatal "cannot convert requested kuake wake-up key '$self->{key}' to keycode, unable to continue.\n";
+
+ $self->XGrabKey ($self->{keycode}, urxvt::AnyModifier, $self->DefaultRootWindow);
+
+ $self->XUnmapWindow ($self->parent);
+
+ $self->{unmap_me} = 1;
+
+ ()
+}
+
+sub on_map_notify {
+ my ($self) = @_;
+
+ # suppress initial map event
+ $self->XUnmapWindow ($self->parent)
+ if delete $self->{unmap_me};
+
+ ()
+}
+
+sub on_root_event {
+ my ($self, $event) = @_;
+
+ return unless $event->{type} == urxvt::KeyPress && $event->{keycode} == $self->{keycode};
+
+ $self->mapped
+ ? $self->XUnmapWindow ($self->parent)
+ : $self->XMapWindow ($self->parent);
+
+ 1
+}
+
+sub on_destroy {
+ my ($self) = @_;
+
+ $self->XUngrabKey ($self->XKeysymToKeycode ($self->{keysym}), 0, $self->DefaultRootWindow)
+ if $self->{keysym};
+
+ ()
+}
XSelectInput (dpy, vt, vt_emask | vt_emask_perl | vt_emask_xim);
}
-#if TRANSPARENT
+#if TRANSPARENT || ENABLE_PERL
void rootwin_cb (XEvent &xev);
xevent_watcher rootwin_ev;
#endif
const_iv (Button5Mask),
const_iv (AnyModifier),
+ const_iv (NoSymbol),
+ const_iv (GrabModeSync),
+ const_iv (GrabModeAsync),
+
const_iv (EVENT_NONE),
const_iv (EVENT_READ),
const_iv (EVENT_WRITE),
CODE:
THIS->perl.should_invoke [htype] += inc;
-void
+int
rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
CODE:
- XGrabButton (THIS->dpy, button, modifiers, window, 1,
- ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
- GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
+ RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
+ ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
+ GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
+ OUTPUT: RETVAL
-void
+int
rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt)
CODE:
- XUngrabButton (THIS->dpy, button, modifiers, window);
-
-#if 0
+ RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window);
+ OUTPUT: RETVAL
void
-XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt)
- C_ARGS:
- THIS->dpy, keycode, modifiers, window, 1,
- GrabModeSync, GrabModeSync
+rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \
+ int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync)
+ CODE:
+ XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode);
void
-XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt)
- C_ARGS: THIS->dpy, keycode, modifiers, window
+rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
+ CODE:
+ XUngrabKey (THIS->dpy, keycode, modifiers, window);
-#endif
+void
+rxvt_term::XUngrabKeyboard (Time eventtime)
+ CODE:
+ XUngrabKeyboard (THIS->dpy, eventtime);
bool
rxvt_term::grab (Time eventtime, int sync = 0)
CODE:
ungrab (THIS);
+int
+rxvt_term::XStringToKeysym (char *string)
+ CODE:
+ RETVAL = XStringToKeysym (string);
+ OUTPUT: RETVAL
+
+char *
+rxvt_term::XKeysymToString (int sym)
+ CODE:
+ RETVAL = XKeysymToString (sym);
+ OUTPUT: RETVAL
+
+int
+rxvt_term::XKeysymToKeycode (int sym)
+ CODE:
+ RETVAL = XKeysymToKeycode (THIS->dpy, sym);
+ OUTPUT: RETVAL
+
+int
+rxvt_term::XKeycodeToKeysym (int code, int index)
+ CODE:
+ RETVAL = XKeycodeToKeysym (THIS->dpy, code, index);
+ OUTPUT: RETVAL
+
int
rxvt_term::strwidth (SV *str)
CODE:
@@RXVT_NAME@@ -pt OnTheSpot -pe xim-onthespot
+=item kuake<hotkey>
+
+A very primitive quake-console-like extension. It was inspired by a
+description of how the programs C<kuake> and C<yakuake> work: Whenever the
+user presses a global accelerator key (by default C<F10>), the terminal
+will show or hide itself. Another press of the accelerator key will hide
+or show it again.
+
+Initially, the window will not be shown when using this extension.
+
+This is useful if you need a single terminal thats not using any desktop
+space most of the time but is quickly available at the press of a key.
+
+The accelerator key is grabbed regardless of any modifers, so this
+extension will actually grab a physical key just for this function.
+
+If you want a quake-like animation, tell your window manager to do so
+(fvwm can do it).
+
=item automove-background
This is basically a very small extension that dynamically changes the
windows). Should only be used as a last resort. Most event structure
members are not passed.
+=item on_root_event $term, $event
+
+Like C<on_x_event>, but is called for events on the root window.
+
=item on_focus_in $term
Called whenever the window gets the keyboard focus, before rxvt-unicode