Commit 1565149e authored by Behdad Esfahbod's avatar Behdad Esfahbod Committed by Behdad Esfahbod
Browse files

Misc fixes and updates.

2006-04-20  Behdad Esfahbod  <behdad@gnome.org>

        * doc/reference/tmpl/internals.sgml:
        * doc/reference/tmpl/reaper.sgml:
        * doc/reference/tmpl/vte-unused.sgml:
        * doc/reference/tmpl/vte.sgml:
        * doc/reference/tmpl/vteaccess.sgml:
        * doc/reference/vte-sections.txt: Misc fixes and updates.

        * python/vte.defs:
        * python/vte.override: Updates.

        Bug 160134 – mouse events occurring past column 95 are not passed
        through to terminal application
        Based on patch from Sean Estabrooks.

        * src/vte.h:
        * src/vte.c (vte_terminal_feed_child_binary): New public function.

        * src/vte.c (vte_terminal_send_mouse_button_internal),
        (vte_terminal_maybe_send_mouse_drag): Use feed_child_binary.
parent 431eba9f
2006-04-20 Behdad Esfahbod <behdad@gnome.org>
* doc/reference/tmpl/internals.sgml:
* doc/reference/tmpl/reaper.sgml:
* doc/reference/tmpl/vte-unused.sgml:
* doc/reference/tmpl/vte.sgml:
* doc/reference/tmpl/vteaccess.sgml:
* doc/reference/vte-sections.txt: Misc fixes and updates.
* python/vte.defs:
* python/vte.override: Updates.
Bug 160134 mouse events occurring past column 95 are not passed
through to terminal application
Based on patch from Sean Estabrooks.
* src/vte.h:
* src/vte.c (vte_terminal_feed_child_binary): New public function.
* src/vte.c (vte_terminal_send_mouse_button_internal),
(vte_terminal_maybe_send_mouse_drag): Use feed_child_binary.
2006-04-19 Behdad Esfahbod <behdad@gnome.org>
Bug 135230 Feature request to attach VTE to existing pty
......
......@@ -2,10 +2,11 @@
Internals
<!-- ##### SECTION Short_Description ##### -->
Internal stuff.
<!-- ##### SECTION Long_Description ##### -->
<para>
You really shouldn't see this.
</para>
......@@ -14,3 +15,6 @@ Internals
</para>
<!-- ##### SECTION Stability_Level ##### -->
......@@ -20,6 +20,9 @@ a proxy for glib's own functionality.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT VteReaper ##### -->
<para>
This should not be accessed directly.
......@@ -50,7 +53,5 @@ Emitted when the #VteReaper object detects that a child of the current process h
@pid:
@Returns:
<!-- # Unused Parameters # -->
@data:
......@@ -64,10 +64,6 @@ reaper.sgml
VteBg
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO VTE_BG ##### -->
<para>
......
......@@ -14,12 +14,15 @@ A VteTerminal is a terminal emulator implemented as a GTK2 widget.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT VteTerminal ##### -->
<para>
All of these fields should be considered read-only.
</para>
@widget:
@widget: Base #GtkWidget of the terminal widget.
@adjustment: Scroll bar adjustments.
@char_width: Width of a narrow character cell.
@char_height: Height of a character cell.
......@@ -234,7 +237,7 @@ accessibility peer. May not be emitted under certain circumstances.
</para>
@vteterminal: the object which received the signal.
@arg1:
@arg1: the number of lines scrolled.
<!-- ##### SIGNAL VteTerminal::window-title-changed ##### -->
<para>
......@@ -306,8 +309,6 @@ keys.
@terminal:
@pty_master:
<!-- # Unused Parameters # -->
@Returns:
<!-- ##### FUNCTION vte_terminal_feed ##### -->
......@@ -325,6 +326,16 @@ keys.
</para>
@terminal:
@text:
@length:
<!-- ##### FUNCTION vte_terminal_feed_child_binary ##### -->
<para>
</para>
@terminal:
@data:
@length:
......@@ -370,9 +381,6 @@ keys.
@terminal:
@columns:
@rows:
<!-- # Unused Parameters # -->
@Param2:
@Param3:
<!-- ##### FUNCTION vte_terminal_set_audible_bell ##### -->
......@@ -481,8 +489,6 @@ keys.
@terminal:
@dim:
<!-- # Unused Parameters # -->
@bold:
<!-- ##### FUNCTION vte_terminal_set_color_cursor ##### -->
......@@ -593,8 +599,6 @@ keys.
@terminal:
@lines:
<!-- # Unused Parameters # -->
@Param2:
<!-- ##### FUNCTION vte_terminal_set_font ##### -->
......@@ -623,8 +627,6 @@ keys.
@terminal:
@name:
@antialias:
<!-- # Unused Parameters # -->
@anti_alias:
<!-- ##### FUNCTION vte_terminal_set_font_full ##### -->
......@@ -635,8 +637,6 @@ keys.
@terminal:
@font_desc:
@antialias:
<!-- # Unused Parameters # -->
@anti_alias:
<!-- ##### FUNCTION vte_terminal_get_font ##### -->
......@@ -818,9 +818,6 @@ keys.
@row:
@tag:
@Returns:
<!-- # Unused Parameters # -->
@Param2:
@Param3:
<!-- ##### FUNCTION vte_terminal_match_set_cursor ##### -->
......
......@@ -6,6 +6,8 @@ Accessibility peer of #VteTerminal.
<!-- ##### SECTION Long_Description ##### -->
<para>
The accessibility peer of a #VteTerminal, implementing GNOME's accessibility
framework.
</para>
......@@ -14,12 +16,15 @@ Accessibility peer of #VteTerminal.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT VteTerminalAccessible ##### -->
<para>
This should not be accessed directly. Use the #AtkText interface instead.
</para>
@parent:
@parent: The parent #GtkAccessible object.
<!-- ##### FUNCTION vte_terminal_accessible_new ##### -->
<para>
......
......@@ -10,6 +10,7 @@ vte_terminal_forkpty
vte_terminal_set_pty
vte_terminal_feed
vte_terminal_feed_child
vte_terminal_feed_child_binary
vte_terminal_copy_clipboard
vte_terminal_paste_clipboard
vte_terminal_copy_primary
......
......@@ -74,23 +74,22 @@
(define-method forkpty
(of-object "VteTerminal")
(c-name "vte_terminal_forkpty")
(return-type "pid_t")
(parameters
'("pid_t" "pty_master")
'("char**" "envv")
'("const-char*" "directory")
'("gboolean" "lastlog")
'("gboolean" "utmp")
'("gboolean" "wtmp")
)
)
(define-method set_pty
(of-object "VteTerminal")
(c-name "vte_terminal_set_pty")
(return-type "pid_t")
(return-type "none")
(parameters
'("const-char*" "command")
'("char**" "argv")
'("char**" "envv")
'("const-char*" "directory")
'("gboolean" "lastlog")
'("gboolean" "utmp")
'("gboolean" "wtmp")
'("int" "pty_master")
)
)
......@@ -108,6 +107,16 @@
(of-object "VteTerminal")
(c-name "vte_terminal_feed_child")
(return-type "none")
(parameters
'("const-char*" "text")
'("glong" "length" (default "-1"))
)
)
(define-method feed_child_binary
(of-object "VteTerminal")
(c-name "vte_terminal_feed_child_binary")
(return-type "none")
(parameters
'("const-char*" "data")
'("glong" "length" (default "-1"))
......
......@@ -71,6 +71,35 @@ _wrap_vte_terminal_feed_child(PyGObject *self, PyObject *args, PyObject *kwargs)
return Py_None;
}
%%
override vte_terminal_feed_child_binary kwargs
static PyObject *
_wrap_vte_terminal_feed_child_binary(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "data", "length", NULL };
char *data;
int length;
PyObject *length_obj = NULL;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"s#|O:VteTerminal.feed_child_binary",
kwlist, &data, &length, &length_obj)) {
return NULL;
}
if ((length_obj != NULL) && PyNumber_Check(length_obj)) {
PyObject *intobj;
intobj = PyNumber_Int(length_obj);
if (intobj) {
if (PyInt_AsLong(intobj) != -1) {
length = PyInt_AsLong(intobj);
}
Py_DECREF(intobj);
}
}
vte_terminal_feed_child_binary(VTE_TERMINAL(self->obj), data, length);
Py_INCREF(Py_None);
return Py_None;
}
%%
override vte_terminal_fork_command kwargs
static PyObject *
......@@ -505,3 +534,24 @@ _wrap_vte_terminal_set_colors(PyGObject *self, PyObject *args, PyObject *kwargs)
return Py_None;
}
%%
override vte_terminal_match_check kwargs
static PyObject *
_wrap_vte_terminal_match_check(PyGObject *self, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "column", "row", NULL };
gchar *ret;
glong column, row;
int *tag;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ll:VteTerminal.match_check", kwlist, &column, &row))
return NULL;
ret = vte_terminal_match_check(VTE_TERMINAL(self->obj), column, row, &tag);
if (ret) {
PyObject *py_ret = Py_BuildValue("si", ret, tag);
g_free(ret);
return py_ret;
}
Py_INCREF(Py_None);
return Py_None;
}
%%
......@@ -3517,26 +3517,57 @@ vte_terminal_send(VteTerminal *terminal, const char *encoding,
/**
* vte_terminal_feed_child:
* @terminal: a #VteTerminal
* @data: data to send to the child
* @length: length of @text
* @text: data to send to the child
* @length: length of @text in bytes, or -1 if @text is NUL-terminated
*
* Sends a block of UTF-8 text to the child as if it were entered by the user
* at the keyboard.
*
*/
void
vte_terminal_feed_child(VteTerminal *terminal, const char *data, glong length)
vte_terminal_feed_child(VteTerminal *terminal, const char *text, glong length)
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
if (length == ((gssize)-1)) {
length = strlen(data);
length = strlen(text);
}
if (length > 0) {
vte_terminal_send(terminal, "UTF-8", data, length,
vte_terminal_send(terminal, "UTF-8", text, length,
FALSE, FALSE);
}
}
/**
* vte_terminal_feed_child_binary:
* @terminal: a #VteTerminal
* @data: data to send to the child
* @length: length of @data
*
* Sends a block of binary data to the child.
*
* Since: 0.12.1
*/
void
vte_terminal_feed_child_binary(VteTerminal *terminal, const char *data, glong length)
{
g_assert(VTE_IS_TERMINAL(terminal));
/* Tell observers that we're sending this to the child. */
if (length > 0) {
vte_terminal_emit_commit(terminal,
data, length);
}
/* If there's a place for it to go, add the data to the
* outgoing buffer. */
if ((length > 0) && (terminal->pvt->pty_master != -1)) {
_vte_buffer_append(terminal->pvt->outgoing,
data, length);
/* If we need to start waiting for the child pty to
* become available for writing, set that up here. */
_vte_terminal_connect_pty_write(terminal);
}
}
static void
vte_terminal_feed_child_using_modes(VteTerminal *terminal,
const char *data, glong length)
......@@ -4397,9 +4428,9 @@ vte_terminal_send_mouse_button_internal(VteTerminal *terminal,
cy = 32 + CLAMP(1 + (y / terminal->char_height),
1, terminal->row_count);;
/* Send the event to the child. */
/* Send event direct to the child, this is binary not text data */
snprintf(buf, sizeof(buf), _VTE_CAP_CSI "M%c%c%c", cb, cx, cy);
vte_terminal_feed_child(terminal, buf, strlen(buf));
vte_terminal_feed_child_binary(terminal, buf, strlen(buf));
}
/* Send a mouse button click/release notification. */
......@@ -4523,9 +4554,9 @@ vte_terminal_maybe_send_mouse_drag(VteTerminal *terminal, GdkEventMotion *event)
cy = 32 + CLAMP(1 + ((event->y - VTE_PAD_WIDTH) / terminal->char_height),
1, terminal->row_count);;
/* Send the event to the child. */
/* Send event direct to the child, this is binary not text data */
snprintf(buf, sizeof(buf), "%sM%c%c%c", _VTE_CAP_CSI, cb, cx, cy);
vte_terminal_feed_child(terminal, buf, strlen(buf));
vte_terminal_feed_child_binary(terminal, buf, strlen(buf));
}
/* Clear all match hilites. */
......@@ -11094,6 +11125,8 @@ vte_terminal_get_icon_title(VteTerminal *terminal)
*
* Attach an existing PTY master side to the terminal widget. Use
* instead of vte_terminal_fork_command() or vte_terminal_forkpty().
*
* Since: 0.12.1
*/
void
vte_terminal_set_pty(VteTerminal *terminal, int pty_master)
......
......@@ -219,8 +219,8 @@ pid_t vte_terminal_forkpty(VteTerminal *terminal,
/* Send data to the terminal to display, or to the terminal's forked command
* to handle in some way. If it's 'cat', they should be the same. */
void vte_terminal_feed(VteTerminal *terminal, const char *data, glong length);
void vte_terminal_feed_child(VteTerminal *terminal,
const char *data, glong length);
void vte_terminal_feed_child(VteTerminal *terminal, const char *text, glong length);
void vte_terminal_feed_child_binary(VteTerminal *terminal, const char *data, glong length);
/* Copy currently-selected text to the clipboard, or from the clipboard to
* the terminal. */
......
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