Mercurial > ~mikael > mcabber > hg
annotate mcabber/src/hbuf.h @ 880:ea983a945eba
/buffer scroll_unlock: Don't always jump to the end of the buffer
If there is no pending message, do not jump to the bottom of the buffer.
For special buffers (e.g. for the status buffer) pending flag is currently
disabled so we jump unconditionally.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 27 May 2006 15:59:05 +0200 |
parents | d0781ca2dd08 |
children | 527d6f234924 |
rev | line source |
---|---|
71 | 1 #ifndef __HBUF_H__ |
2 #define __HBUF_H__ 1 | |
3 | |
184 | 4 #include <time.h> |
71 | 5 #include <glib.h> |
6 | |
106 | 7 // With current implementation a message must fit in a hbuf block, |
8 // so we shouldn't choose a too small size. | |
795
b16acadd7d53
Improve support for long messages
Mikael Berthe <mikael@lilotux.net>
parents:
728
diff
changeset
|
9 #define HBB_BLOCKSIZE 8192 // > 20 please |
71 | 10 |
11 // Flags: | |
12 // - ALLOC: the ptr data has been allocated, it can be freed | |
13 // - PERSISTENT: this is a new history line | |
14 #define HBB_FLAG_ALLOC 1 | |
15 #define HBB_FLAG_PERSISTENT 2 | |
184 | 16 |
847
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
17 #define HBB_PREFIX_IN 1 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
18 #define HBB_PREFIX_OUT 2 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
19 #define HBB_PREFIX_STATUS 4 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
20 #define HBB_PREFIX_AUTH 8 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
21 #define HBB_PREFIX_INFO 16 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
22 #define HBB_PREFIX_ERR 32 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
23 #define HBB_PREFIX_NOFLAG 64 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
24 #define HBB_PREFIX_HLIGHT 128 |
e1b7f71b0b1c
Improve readability for some commands
Mikael Berthe <mikael@lilotux.net>
parents:
795
diff
changeset
|
25 #define HBB_PREFIX_NONE 256 |
850
d0781ca2dd08
Use new status buffer window
Mikael Berthe <mikael@lilotux.net>
parents:
847
diff
changeset
|
26 #define HBB_PREFIX_SPECIAL 512 |
71 | 27 |
184 | 28 typedef struct { |
29 time_t timestamp; | |
850
d0781ca2dd08
Use new status buffer window
Mikael Berthe <mikael@lilotux.net>
parents:
847
diff
changeset
|
30 guint flags; |
184 | 31 char *text; |
32 } hbb_line; | |
33 | |
34 void hbuf_add_line(GList **p_hbuf, const char *text, time_t timestamp, | |
35 guint prefix_flags, guint width); | |
71 | 36 void hbuf_free(GList **p_hbuf); |
37 void hbuf_rebuild(GList **p_hbuf, unsigned int width); | |
189 | 38 GList *hbuf_previous_persistent(GList *l_line); |
71 | 39 |
184 | 40 hbb_line **hbuf_get_lines(GList *hbuf, unsigned int n); |
370
dd9e2eb52916
Add /buffer search_{backward,forward}
Mikael Berthe <mikael@lilotux.net>
parents:
364
diff
changeset
|
41 GList *hbuf_search(GList *hbuf, int direction, const char *string); |
464 | 42 GList *hbuf_jump_date(GList *hbuf, time_t t); |
462 | 43 GList *hbuf_jump_percent(GList *hbuf, int pc); |
71 | 44 |
45 #endif /* __HBUF_H__ */ | |
576 | 46 |
580 | 47 /* vim: set expandtab cindent cinoptions=>2\:2(0: For Vim users... */ |