summaryrefslogtreecommitdiff
path: root/src/perl/textui/TextBuffer.xs
blob: 31e7c491744986b0c22237cfa937095d83fde7e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "module.h"

MODULE = Irssi::TextUI::TextBuffer  PACKAGE = Irssi
PROTOTYPES: ENABLE

Irssi::TextUI::TextBuffer
textbuffer_create()

#*******************************
MODULE = Irssi::TextUI::TextBuffer  PACKAGE = Irssi::TextUI::TextBuffer  PREFIX = textbuffer_
#*******************************

void
textbuffer_destroy(buffer)
	Irssi::TextUI::TextBuffer buffer

Irssi::TextUI::Line
textbuffer_append(buffer, data, len, info)
	Irssi::TextUI::TextBuffer buffer
	char *data
	int len
	Irssi::TextUI::LineInfo info

Irssi::TextUI::Line
textbuffer_insert(buffer, insert_after, data, len, info)
	Irssi::TextUI::TextBuffer buffer
	Irssi::TextUI::Line insert_after
	char *data
	int len
	Irssi::TextUI::LineInfo info

void
textbuffer_remove(buffer, line)
	Irssi::TextUI::TextBuffer buffer
	Irssi::TextUI::Line line

void
textbuffer_remove_all_lines(buffer)
	Irssi::TextUI::TextBuffer buffer

#*******************************
MODULE = Irssi::TextUI::TextBuffer  PACKAGE = Irssi::TextUI::Line  PREFIX = textbuffer_line_
#*******************************

Irssi::TextUI::Line
textbuffer_line_prev(line)
	Irssi::TextUI::Line line
CODE:
	RETVAL = line->prev;
OUTPUT:
	RETVAL

Irssi::TextUI::Line
textbuffer_line_next(line)
	Irssi::TextUI::Line line
CODE:
	RETVAL = line->next;
OUTPUT:
	RETVAL

void
textbuffer_line_ref(line)
	Irssi::TextUI::Line line

void
textbuffer_line_unref(line, buffer)
	Irssi::TextUI::Line line
	Irssi::TextUI::TextBuffer buffer
CODE:
	textbuffer_line_unref(buffer, line);

void
textbuffer_line_get_text(line, coloring)
	Irssi::TextUI::Line line
	int coloring
PREINIT:
	GString *str;
	SV *result;
PPCODE:
	str = g_string_new(NULL);
	textbuffer_line2text(line, coloring, str);
	result = new_pv(str->str);
	XPUSHs(sv_2mortal(result));
	g_string_free(str, TRUE);