Mercurial > pidgin
annotate finch/libgnt/gnttextview.h @ 17795:614cba328241
Minor fix
author | Gabriel Schulhof <nix@go-nix.ca> |
---|---|
date | Sat, 26 May 2007 10:19:27 +0000 |
parents | ab3f93232a2d |
children | 8410511f4dbb |
rev | line source |
---|---|
15817 | 1 #ifndef GNT_TEXT_VIEW_H |
2 #define GNT_TEXT_VIEW_H | |
3 | |
4 #include "gntwidget.h" | |
5 #include "gnt.h" | |
6 #include "gntcolors.h" | |
7 #include "gntkeys.h" | |
8 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
9 #define GNT_TYPE_TEXT_VIEW (gnt_text_view_get_gtype()) |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
10 #define GNT_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_TEXT_VIEW, GntTextView)) |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
11 #define GNT_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
12 #define GNT_IS_TEXT_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_TEXT_VIEW)) |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
13 #define GNT_IS_TEXT_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_TEXT_VIEW)) |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
14 #define GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXT_VIEW, GntTextViewClass)) |
15817 | 15 |
16 #define GNT_TEXT_VIEW_FLAGS(obj) (GNT_TEXT_VIEW(obj)->priv.flags) | |
17 #define GNT_TEXT_VIEW_SET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) |= flags) | |
18 #define GNT_TEXT_VIEW_UNSET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) &= ~(flags)) | |
19 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
20 typedef struct _GntTextView GntTextView; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
21 typedef struct _GntTextViewPriv GntTextViewPriv; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
22 typedef struct _GntTextViewClass GntTextViewClass; |
15817 | 23 |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
24 struct _GntTextView |
15817 | 25 { |
26 GntWidget parent; | |
27 | |
28 GString *string; | |
29 GList *list; /* List of GntTextLine */ | |
30 | |
31 GList *tags; /* A list of tags */ | |
32 }; | |
33 | |
34 typedef enum | |
35 { | |
36 GNT_TEXT_FLAG_NORMAL = 0, | |
37 GNT_TEXT_FLAG_BOLD = 1 << 0, | |
38 GNT_TEXT_FLAG_UNDERLINE = 1 << 1, | |
39 GNT_TEXT_FLAG_BLINK = 1 << 2, | |
40 GNT_TEXT_FLAG_DIM = 1 << 3, | |
41 GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4, | |
42 } GntTextFormatFlags; | |
43 | |
15928
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15817
diff
changeset
|
44 struct _GntTextViewClass |
15817 | 45 { |
46 GntWidgetClass parent; | |
47 | |
48 void (*gnt_reserved1)(void); | |
49 void (*gnt_reserved2)(void); | |
50 void (*gnt_reserved3)(void); | |
51 void (*gnt_reserved4)(void); | |
52 }; | |
53 | |
54 G_BEGIN_DECLS | |
55 | |
56 GType gnt_text_view_get_gtype(void); | |
57 | |
58 /* XXX: For now, don't set a textview to have any border. | |
59 * If you want borders real bad, put it in a box. */ | |
60 GntWidget *gnt_text_view_new(void); | |
61 | |
62 /* scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end */ | |
63 void gnt_text_view_scroll(GntTextView *view, int scroll); | |
64 | |
65 void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags); | |
66 | |
67 void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag); | |
68 | |
69 /* Move the cursor to the beginning of the next line and resets text-attributes. | |
70 * It first completes the current line with the current text-attributes. */ | |
71 void gnt_text_view_next_line(GntTextView *view); | |
72 | |
73 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags); | |
74 | |
75 void gnt_text_view_clear(GntTextView *view); | |
76 | |
77 int gnt_text_view_get_lines_below(GntTextView *view); | |
78 | |
79 int gnt_text_view_get_lines_above(GntTextView *view); | |
80 | |
81 /* If text is NULL, then the tag is removed. */ | |
82 int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all); | |
83 | |
16124
ab3f93232a2d
Add a utility function to assist scrolling in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
84 void gnt_text_view_attach_scroll_widget(GntTextView *view, GntWidget *widget); |
ab3f93232a2d
Add a utility function to assist scrolling in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15928
diff
changeset
|
85 |
15817 | 86 G_END_DECLS |
87 | |
88 #endif /* GNT_TEXT_VIEW_H */ |