annotate console/libgnt/gnttextview.h @ 15435:29e443e0613f

I think this takes care of protocol icons. Note there are still places that ask for a "stauts icon" and expect a protocol icon. I haven't hit those yet.
author Sean Egan <seanegan@gmail.com>
date Sat, 27 Jan 2007 10:15:07 +0000
parents a00712d0522e
children 1c8f1dc50685
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
1 #ifndef GNT_TEXT_VIEW_H
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
2 #define GNT_TEXT_VIEW_H
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
3
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
4 #include "gntwidget.h"
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
5 #include "gnt.h"
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
6 #include "gntcolors.h"
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
7 #include "gntkeys.h"
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
8
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
9 #define GNT_TYPE_TEXTVIEW (gnt_text_view_get_gtype())
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
10 #define GNT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TEXTVIEW, GntTextView))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
11 #define GNT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_TEXTVIEW, GntTextViewClass))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
12 #define GNT_IS_TEXTVIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_TEXTVIEW))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
13 #define GNT_IS_TEXTVIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TEXTVIEW))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
14 #define GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXTVIEW, GntTextViewClass))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
15
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
16 #define GNT_TEXT_VIEW_FLAGS(obj) (GNT_TEXT_VIEW(obj)->priv.flags)
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
17 #define GNT_TEXT_VIEW_SET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) |= flags)
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
18 #define GNT_TEXT_VIEW_UNSET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) &= ~(flags))
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
19
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
20 typedef struct _GnTextView GntTextView;
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
21 typedef struct _GnTextViewPriv GntTextViewPriv;
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
22 typedef struct _GnTextViewClass GntTextViewClass;
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
23
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
24 struct _GnTextView
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
25 {
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
26 GntWidget parent;
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
27
14383
5f3058c7a7df [gaim-migrate @ 17089]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14030
diff changeset
28 GString *string;
13896
a621329e8c85 [gaim-migrate @ 16381]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13882
diff changeset
29 GList *list; /* List of GntTextLine */
15172
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
30
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
31 GList *tags; /* A list of tags */
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
32 };
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
33
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
34 typedef enum
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
35 {
13964
0a0d2a1fd2bc [gaim-migrate @ 16520]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13952
diff changeset
36 GNT_TEXT_FLAG_NORMAL = 0,
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
37 GNT_TEXT_FLAG_BOLD = 1 << 0,
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
38 GNT_TEXT_FLAG_UNDERLINE = 1 << 1,
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
39 GNT_TEXT_FLAG_BLINK = 1 << 2,
13896
a621329e8c85 [gaim-migrate @ 16381]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13882
diff changeset
40 GNT_TEXT_FLAG_DIM = 1 << 3,
a621329e8c85 [gaim-migrate @ 16381]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13882
diff changeset
41 GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4,
13931
917a71dd02eb [gaim-migrate @ 16458]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
42 } GntTextFormatFlags;
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
43
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
44 struct _GnTextViewClass
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
45 {
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
46 GntWidgetClass parent;
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
47
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
48 void (*gnt_reserved1)(void);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
49 void (*gnt_reserved2)(void);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
50 void (*gnt_reserved3)(void);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
51 void (*gnt_reserved4)(void);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
52 };
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
53
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
54 G_BEGIN_DECLS
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
55
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
56 GType gnt_text_view_get_gtype(void);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
57
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
58 /* XXX: For now, don't set a textview to have any border.
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
59 * If you want borders real bad, put it in a box. */
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
60 GntWidget *gnt_text_view_new();
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
61
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
62 /* scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end */
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
63 void gnt_text_view_scroll(GntTextView *view, int scroll);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
64
13931
917a71dd02eb [gaim-migrate @ 16458]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13896
diff changeset
65 void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags);
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
66
15172
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
67 void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag);
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
68
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
69 /* Move the cursor to the beginning of the next line and resets text-attributes.
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
70 * It first completes the current line with the current text-attributes. */
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
71 void gnt_text_view_next_line(GntTextView *view);
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
72
13952
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13931
diff changeset
73 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags);
841a5ffbfee4 [gaim-migrate @ 16500]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13931
diff changeset
74
13971
df8183b7fa2c [gaim-migrate @ 16529]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13964
diff changeset
75 void gnt_text_view_clear(GntTextView *view);
df8183b7fa2c [gaim-migrate @ 16529]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13964
diff changeset
76
14030
0e70bb6d32fd [gaim-migrate @ 16632]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13971
diff changeset
77 int gnt_text_view_get_lines_below(GntTextView *view);
0e70bb6d32fd [gaim-migrate @ 16632]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13971
diff changeset
78
0e70bb6d32fd [gaim-migrate @ 16632]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13971
diff changeset
79 int gnt_text_view_get_lines_above(GntTextView *view);
0e70bb6d32fd [gaim-migrate @ 16632]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 13971
diff changeset
80
15172
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
81 /* If text is NULL, then the tag is removed. */
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
82 int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all);
a00712d0522e [gaim-migrate @ 17957]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 14877
diff changeset
83
13882
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
84 G_END_DECLS
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
85
5c750626eaa5 [gaim-migrate @ 16362]
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
diff changeset
86 #endif /* GNT_TEXT_VIEW_H */