Commit 12b3f279 authored by Nalin Dahyabhai's avatar Nalin Dahyabhai
Browse files

implement iconify, deiconify, raise, lower, maximize, restore, refresh,

* src/vteapp.c: implement iconify, deiconify, raise, lower, maximize, restore,
	refresh, resize, and move signals.
* src/vte.c: add vte_terminal_match_remove().
* src/vte.c (vte_sequence_handler_cb): clear the current column in addition to
	columns to the left, spotted by Sam Varshavchik.
* src/vte.c:  Use g_array_set_size() to clear arrays instead of removing each
	element.  Properly initialize new columns with just the default colors
	and not other attributes (#96978).
* src/vte.c (vte_sequence_handler_ta): revert to non-overwriting tabs, otherwise
	we got occasional drawing artifacts.
parent 810df74c
2002-10-30 nalin
* src/vteapp.c: implement iconify, deiconify, raise, lower, maximize,
restore, refresh, resize, and move signals.
* src/vte.c: add vte_terminal_match_remove().
* src/vte.c (vte_sequence_handler_cb): clear the current column in
addition to columns to the left, spotted by Sam Varshavchik.
* src/vte.c: Use g_array_set_size() to clear arrays instead of
removing each element. Properly initialize new columns with just the
default colors and not other attributes (#96978).
* src/vte.c (vte_sequence_handler_ta): revert to non-overwriting tabs,
otherwise we got occasional drawing artifacts.
2002-10-30 Abi Brady <morwen@evilmagic.org>
* src/vte.c, src/vte.h : Support dim (halfbright) colours. All the
......
This entire tree is "some highly unsupported crackrock", yet it seems to have
reached some degree of stability. Please contact me directly if you intend to
hack on it.
hack on it, especially if you want to make changes in the development tree.
Thanks,
......
0.10: selection rewrite
0.9: gnome-pty-helper integration, with lastlog/utmp/wtmp logging
0.8: iso-2022 substitutions
0.7: faster rendering
......
......@@ -485,6 +485,15 @@ A VteTerminal is a terminal emulator implemented as a GTK2 widget.
@Returns:
<!-- ##### FUNCTION vte_terminal_match_remove ##### -->
<para>
</para>
@terminal:
@tag:
<!-- ##### FUNCTION vte_terminal_match_check ##### -->
<para>
......
......@@ -50,6 +50,7 @@ vte_terminal_get_text_range
vte_terminal_get_cursor_position
vte_terminal_match_clear_all
vte_terminal_match_add
vte_terminal_match_remove
vte_terminal_match_check
vte_terminal_set_emulation
vte_terminal_get_emulation
......
......@@ -95,9 +95,9 @@ static const struct _vte_iso2022_map _vte_iso2022_map_4[] = {
{'@', GDK_threequarters},
{'[', GDK_ydiaeresis},
{'\\', GDK_onehalf},
{']', GDK_bar},
{']', GDK_bar}, /* FIXME? not in XTerm 170 */
{'{', GDK_diaeresis},
{'|', 0x192}, /* f with hook (florin) */
{'|', 0x192}, /* f with hook (florin) */ /* FIXME? not in XTerm 170 */
{'}', GDK_onequarter},
{'~', GDK_acute}
};
......@@ -335,6 +335,8 @@ _vte_iso2022_map_get(gunichar mapname)
ret = _vte_iso2022_map_init(_vte_iso2022_map_A,
G_N_ELEMENTS(_vte_iso2022_map_A));
break;
case '1':
case '2':
case 'B':
ret = _vte_iso2022_map_init(_vte_iso2022_map_B,
G_N_ELEMENTS(_vte_iso2022_map_B));
......
......@@ -25,5 +25,5 @@ Spanish: [(Z#$@[\]^_{|}~(B] [£$§¡Ñ¿^_°ñç~]
Swedish: [(H#$@[\]^_{|}~(B] [#$ÉÄÖÅÜ_äöåü]
Swiss: [(=#$@[\]^_{|}~(B] [ù$àéçêîèäöüû]
ISO-2022-JP: [(J~(B~] [¥~]
ISO-2022-JP: [(J~\(B~\] [¥‾~\]
ISO-2022-KR: [$)C>o^-] [억嚬]
This diff is collapsed.
......@@ -264,6 +264,8 @@ void vte_terminal_match_clear_all(VteTerminal *terminal);
/* Add a matching expression, returning the tag the widget assigns to that
* expression. */
int vte_terminal_match_add(VteTerminal *terminal, const char *match);
/* Remove a matching expression by tag. */
void vte_terminal_match_remove(VteTerminal *terminal, int tag);
/* Check if a given cell on the screen contains part of a matched string. If
* it does, return the string, and store the match tag in the optional tag
......
......@@ -26,6 +26,9 @@
#include "debug.h"
#include "vte.h"
#define DINGUS1 "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?"
#define DINGUS2 "(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\) ,\\\"]"
static void
window_title_changed(GtkWidget *widget, gpointer win)
{
......@@ -93,6 +96,140 @@ status_line_changed(GtkWidget *widget, gpointer data)
vte_terminal_get_status_line(VTE_TERMINAL(widget)));
}
static int
button_pressed(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
VteTerminal *terminal;
char *match;
int tag;
gint xpad, ypad;
switch (event->button) {
case 3:
terminal = VTE_TERMINAL(widget);
vte_terminal_get_padding(terminal, &xpad, &ypad);
match = vte_terminal_match_check(terminal,
(event->x - ypad) /
terminal->char_width,
(event->y - ypad) /
terminal->char_height,
&tag);
if (match != NULL) {
g_print("Matched `%s' (%d).\n", match, tag);
g_free(match);
if (GPOINTER_TO_INT(data) != 0) {
vte_terminal_match_remove(terminal, tag);
}
}
break;
case 1:
case 2:
default:
break;
}
return FALSE;
}
static void
iconify_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_iconify((GTK_WIDGET(data))->window);
}
}
}
static void
deiconify_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_deiconify((GTK_WIDGET(data))->window);
}
}
}
static void
raise_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_raise((GTK_WIDGET(data))->window);
}
}
}
static void
lower_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_lower((GTK_WIDGET(data))->window);
}
}
}
static void
maximize_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_maximize((GTK_WIDGET(data))->window);
}
}
}
static void
restore_window(GtkWidget *widget, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_unmaximize((GTK_WIDGET(data))->window);
}
}
}
static void
refresh_window(GtkWidget *widget, gpointer data)
{
GdkRectangle rect;
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
rect.x = rect.y = 0;
rect.width = (GTK_WIDGET(data))->allocation.width;
rect.height = (GTK_WIDGET(data))->allocation.height;
gdk_window_invalidate_rect((GTK_WIDGET(data))->window,
&rect, TRUE);
}
}
}
static void
resize_window(GtkWidget *widget, guint width, guint height, gpointer data)
{
VteTerminal *terminal;
gint owidth, oheight;
if ((GTK_IS_WINDOW(data)) && (width >= 2) && (height >= 2)) {
terminal = VTE_TERMINAL(widget);
/* Take into account padding and border overhead. */
gtk_window_get_size(GTK_WINDOW(data), &owidth, &oheight);
owidth -= terminal->char_width * terminal->column_count;
oheight -= terminal->char_height * terminal->row_count;
gtk_window_resize(GTK_WINDOW(data),
width + owidth, height + oheight);
}
}
static void
move_window(GtkWidget *widget, guint x, guint y, gpointer data)
{
if (GTK_IS_WIDGET(data)) {
if ((GTK_WIDGET(data))->window) {
gdk_window_move((GTK_WIDGET(data))->window, x, y);
}
}
}
int
main(int argc, char **argv)
{
......@@ -242,6 +379,30 @@ main(int argc, char **argv)
g_signal_connect(G_OBJECT(widget), "status-line-changed",
G_CALLBACK(status_line_changed), widget);
/* Connect to the "button-press" event. */
g_signal_connect(G_OBJECT(widget), "button-press-event",
G_CALLBACK(button_pressed), widget);
/* Connect to application request signals. */
g_signal_connect(G_OBJECT(widget), "iconify-window",
G_CALLBACK(iconify_window), window);
g_signal_connect(G_OBJECT(widget), "deiconify-window",
G_CALLBACK(deiconify_window), window);
g_signal_connect(G_OBJECT(widget), "raise-window",
G_CALLBACK(raise_window), window);
g_signal_connect(G_OBJECT(widget), "lower-window",
G_CALLBACK(lower_window), window);
g_signal_connect(G_OBJECT(widget), "maximize-window",
G_CALLBACK(maximize_window), window);
g_signal_connect(G_OBJECT(widget), "restore-window",
G_CALLBACK(restore_window), window);
g_signal_connect(G_OBJECT(widget), "refresh-window",
G_CALLBACK(refresh_window), window);
g_signal_connect(G_OBJECT(widget), "resize-window",
G_CALLBACK(resize_window), window);
g_signal_connect(G_OBJECT(widget), "move-window",
G_CALLBACK(move_window), window);
/* Create the scrollbar for the widget. */
scrollbar = gtk_vscrollbar_new((VTE_TERMINAL(widget))->adjustment);
gtk_box_pack_start(GTK_BOX(hbox), scrollbar, FALSE, FALSE, 0);
......@@ -274,10 +435,8 @@ main(int argc, char **argv)
/* Match "abcdefg". */
vte_terminal_match_add(VTE_TERMINAL(widget), "abcdefg");
if (dingus) {
vte_terminal_match_add(VTE_TERMINAL(widget),
"(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?");
vte_terminal_match_add(VTE_TERMINAL(widget),
"(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\) ,\\\"]");
vte_terminal_match_add(VTE_TERMINAL(widget), DINGUS1);
vte_terminal_match_add(VTE_TERMINAL(widget), DINGUS2);
}
/* Launch a shell. */
......
Name: vte
Version: 0.10
Version: 0.10.1
Release: 1
Summary: An experimental terminal emulator.
License: LGPL
......@@ -64,6 +64,9 @@ rm $RPM_BUILD_ROOT/%{_libdir}/lib%{name}.la
%{_libdir}/pkgconfig/*
%changelog
* Tue Oct 29 2002 Nalin Dahyabhai <nalin@redhat.com> 0.10.1-1
- add the ability to remove matching patterns
* Thu Oct 24 2002 Nalin Dahyabhai <nalin@redhat.com> 0.10-1
- allow setting the working directory (#76529)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment