summaryrefslogtreecommitdiff
path: root/src/fe-text/textbuffer-view.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-10-24 22:52:15 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-10-24 22:52:15 +0000
commit2a75c88f99e1aa24fbac81deac007ceca313b993 (patch)
tree5267820ea1eab3c7061056f2e7dbb92f2ace729b /src/fe-text/textbuffer-view.h
parentf7683c0423277dec3ec939cf33c3044658ee48a5 (diff)
downloadirssi-2a75c88f99e1aa24fbac81deac007ceca313b993.zip
Added support for changing indentation behaviour with modules.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1912 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/textbuffer-view.h')
-rw-r--r--src/fe-text/textbuffer-view.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/fe-text/textbuffer-view.h b/src/fe-text/textbuffer-view.h
index d49798df..c5fc7ba2 100644
--- a/src/fe-text/textbuffer-view.h
+++ b/src/fe-text/textbuffer-view.h
@@ -4,9 +4,16 @@
#include "textbuffer.h"
#include "screen.h"
+typedef struct _TEXT_BUFFER_VIEW_REC TEXT_BUFFER_VIEW_REC;
+
+/* if ypos == -1, don't print anything, just return the indent size */
+typedef int (*INDENT_FUNC) (TEXT_BUFFER_VIEW_REC *view,
+ LINE_REC *line, int ypos);
+
typedef struct {
unsigned char *start;
int indent;
+ INDENT_FUNC indent_func;
int color;
/* first word in line belong to the end of the last word in
@@ -37,7 +44,7 @@ typedef struct {
int last_linecount;
} TEXT_BUFFER_CACHE_REC;
-typedef struct {
+struct _TEXT_BUFFER_VIEW_REC {
TEXT_BUFFER_REC *buffer;
GSList *siblings; /* other views that use the same buffer */
@@ -45,6 +52,7 @@ typedef struct {
int width, height;
int default_indent;
+ INDENT_FUNC default_indent_func;
unsigned int longword_noindent:1;
unsigned int scroll:1; /* scroll down automatically when at bottom */
@@ -67,20 +75,21 @@ typedef struct {
/* Bookmarks to the lines in the buffer - removed automatically
when the line gets removed from buffer */
GHashTable *bookmarks;
-} TEXT_BUFFER_VIEW_REC;
+};
/* Create new view. */
TEXT_BUFFER_VIEW_REC *textbuffer_view_create(TEXT_BUFFER_REC *buffer,
int width, int height,
- int default_indent,
- int longword_noindent,
int scroll);
/* Destroy the view. */
void textbuffer_view_destroy(TEXT_BUFFER_VIEW_REC *view);
/* Change the default indent position */
void textbuffer_view_set_default_indent(TEXT_BUFFER_VIEW_REC *view,
int default_indent,
- int longword_noindent);
+ int longword_noindent,
+ INDENT_FUNC indent_func);
+void textbuffer_views_unregister_indent_func(INDENT_FUNC indent_func);
+
void textbuffer_view_set_scroll(TEXT_BUFFER_VIEW_REC *view, int scroll);
/* Resize the view. */