annotate finch/libgnt/gnttextview.h @ 23896:4b920b9ea9ca

Fixed an inverted g_return_val_if_fail() which caused gadu-gadu to always set an available status with no status message
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 16 Aug 2008 19:38:45 +0000
parents ae330012956f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
1 /**
18303
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
2 * @file gnttextview.h Textview API
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
3 * @ingroup gnt
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
4 */
5c6f019e48f8 Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17928
diff changeset
5 /*
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
6 * GNT - The GLib Ncurses Toolkit
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
7 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
8 * GNT is the legal property of its developers, whose names are too numerous
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
10 * source distribution.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
11 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
12 * This library is free software; you can redistribute it and/or modify
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
13 * it under the terms of the GNU General Public License as published by
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
15 * (at your option) any later version.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
16 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
17 * This program is distributed in the hope that it will be useful,
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
20 * GNU General Public License for more details.
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
21 *
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
22 * You should have received a copy of the GNU General Public License
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
23 * along with this program; if not, write to the Free Software
19681
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18719
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
25 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
26
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #ifndef GNT_TEXT_VIEW_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #define GNT_TEXT_VIEW_H
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include "gntwidget.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
31 #include "gnt.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32 #include "gntcolors.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
33 #include "gntkeys.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
34
15928
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
35 #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
36 #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
37 #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
38 #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
39 #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
40 #define GNT_TEXT_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_TEXT_VIEW, GntTextViewClass))
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 #define GNT_TEXT_VIEW_FLAGS(obj) (GNT_TEXT_VIEW(obj)->priv.flags)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 #define GNT_TEXT_VIEW_SET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) |= flags)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44 #define GNT_TEXT_VIEW_UNSET_FLAGS(obj, flags) (GNT_TEXT_VIEW_FLAGS(obj) &= ~(flags))
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45
15928
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
46 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
47 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
48 typedef struct _GntTextViewClass GntTextViewClass;
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49
18719
c3d0b51d6c60 New flag to show text top-aligned in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18548
diff changeset
50 typedef enum
c3d0b51d6c60 New flag to show text top-aligned in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18548
diff changeset
51 {
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
52 GNT_TEXT_VIEW_NO_SCROLL = 1 << 0,
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
53 GNT_TEXT_VIEW_WRAP_CHAR = 1 << 1,
18719
c3d0b51d6c60 New flag to show text top-aligned in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18548
diff changeset
54 GNT_TEXT_VIEW_TOP_ALIGN = 1 << 2,
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
55 } GntTextViewFlag;
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
56
15928
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
57 struct _GntTextView
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 GntWidget parent;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
60
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 GString *string;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
62 GList *list; /* List of GntTextLine */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
64 GList *tags; /* A list of tags */
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
65 GntTextViewFlag flags;
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68 typedef enum
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 GNT_TEXT_FLAG_NORMAL = 0,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 GNT_TEXT_FLAG_BOLD = 1 << 0,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 GNT_TEXT_FLAG_UNDERLINE = 1 << 1,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 GNT_TEXT_FLAG_BLINK = 1 << 2,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
74 GNT_TEXT_FLAG_DIM = 1 << 3,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75 GNT_TEXT_FLAG_HIGHLIGHT = 1 << 4,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 } GntTextFormatFlags;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77
15928
f00f2e283ffb Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15817
diff changeset
78 struct _GntTextViewClass
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 GntWidgetClass parent;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
81
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
82 void (*gnt_reserved1)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
83 void (*gnt_reserved2)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
84 void (*gnt_reserved3)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
85 void (*gnt_reserved4)(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
86 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
87
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
88 G_BEGIN_DECLS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
89
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
90 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
91 * @return GType for GntTextView.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
92 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
93 GType gnt_text_view_get_gtype(void);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
94
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
95 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
96 * Create a new textview.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
97 *
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
98 * @return The newly created textview.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
99 */
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
100 GntWidget * gnt_text_view_new(void);
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
102 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
103 * Scroll the textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
104 * @param view The textview to scroll.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
105 * @param scroll scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
106 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 void gnt_text_view_scroll(GntTextView *view, int scroll);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
109 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
110 * Append new text in a textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
111 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
112 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
113 * @param text The text to append to the textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
114 * @param flags The text-flags to apply to the new text.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
115 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116 void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
118 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
119 * Append text in the textview, with some identifier (tag) for the added text.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
120 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
121 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
122 * @param text The text to append.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
123 * @param flags The text-flags to apply to the new text.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
124 * @param tag The tag for the appended text, so it can be changed later (@see gnt_text_view_tag_change)
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
125 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
128 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
129 * Move the cursor to the beginning of the next line and resets text-attributes.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
130 * It first completes the current line with the current text-attributes.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
131 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
132 * @param view The textview.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
133 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 void gnt_text_view_next_line(GntTextView *view);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
135
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
136 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
137 * Convert GNT-text formats to ncurses-text attributes.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
138 *
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
139 * @param flags The GNT text format.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
140 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
141 * @return Nucrses text attribute.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
142 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
145 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
146 * Clear the contents of the textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
147 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
148 * @param view The textview.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
149 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 void gnt_text_view_clear(GntTextView *view);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
152 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
153 * The number of lines below the bottom-most visible line.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
154 *
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
155 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
156 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
157 * @return Number of lines below the bottom-most visible line.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
158 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 int gnt_text_view_get_lines_below(GntTextView *view);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
161 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
162 * The number of lines above the topmost visible line.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
163 *
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
164 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
165 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
166 * @return Number of lines above the topmost visible line.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
167 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 int gnt_text_view_get_lines_above(GntTextView *view);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
170 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
171 * Change the text of a tag.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
172 *
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
173 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
174 * @param name The name of the tag.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
175 * @param text The new text for the text. If 'text' is @c NULL, the tag is removed.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
176 * @param all @c TRUE if all of the instancess of the tag should be changed, @c FALSE if
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
177 * only the first instance should be changed.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
178 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
179 * @return The number of instances changed.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
180 */
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181 int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
183 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
184 * Setup hooks so that pressing up/down/page-up/page-down keys when 'widget' is
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
185 * in focus scrolls the textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
186 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
187 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
188 * @param widget The trigger widget.
17928
8410511f4dbb applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents: 16124
diff changeset
189 */
16124
ab3f93232a2d Add a utility function to assist scrolling in a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 15928
diff changeset
190 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
191
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
192 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
193 * Setup appropriate hooks so that pressing some keys when the 'pager' widget
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
194 * is in focus triggers the PAGER to popup with the contents of the textview
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
195 * in it.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
196 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
197 * The default key-combination to trigger the pager is a-v, and the default
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
198 * PAGER application is $PAGER. Both can be changed in ~/.gntrc like this:
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
199 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
200 * @code
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
201 * [pager]
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
202 * key = a-v
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
203 * path = /path/to/pager
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
204 * @endcode
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
205 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
206 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
207 * @param pager The widget to trigger the PAGER.
18426
841670dd24e1 Utility function to start the pager with the contents of a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18315
diff changeset
208 */
841670dd24e1 Utility function to start the pager with the contents of a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18315
diff changeset
209 void gnt_text_view_attach_pager_widget(GntTextView *view, GntWidget *pager);
841670dd24e1 Utility function to start the pager with the contents of a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18315
diff changeset
210
841670dd24e1 Utility function to start the pager with the contents of a textview.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18315
diff changeset
211 /**
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
212 * Setup appropriate hooks so that pressing some keys when 'widget'
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
213 * is in focus triggers the EDITOR to popup with the contents of the textview
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
214 * in it.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
215 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
216 * The default key-combination to trigger the pager is a-e, and the default
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
217 * EDITOR application is $EDITOR. Both can be changed in ~/.gntrc like this:
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
218 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
219 * @code
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
220 * [editor]
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
221 * key = a-e
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
222 * path = /path/to/editor
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
223 * @endcode
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
224 *
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
225 * @param view The textview.
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
226 * @param widget The widget to trigger the EDITOR.
18539
1148da95ddeb Allow changing the content of a textview using $EDITOR.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18426
diff changeset
227 */
21253
ae330012956f Doxygen for gnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 20874
diff changeset
228 void gnt_text_view_attach_editor_widget(GntTextView *view, GntWidget *widget);
18539
1148da95ddeb Allow changing the content of a textview using $EDITOR.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18426
diff changeset
229
1148da95ddeb Allow changing the content of a textview using $EDITOR.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18426
diff changeset
230 /**
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
231 * Set a GntTextViewFlag for the textview widget.
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
232 *
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
233 * @param view The textview widget
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
234 * @param flag The flag to set
20874
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
235 *
acf284962b40 Add @since doxygen tags for finch/libgnt.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 19681
diff changeset
236 * @since 2.0.0 (gnt), 2.1.0 (pidgin)
18315
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
237 */
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
238 void gnt_text_view_set_flag(GntTextView *view, GntTextViewFlag flag);
e659842fe66d Add flags to a textview to decide whether to show scrollbars, and whether
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18303
diff changeset
239
15817
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240 G_END_DECLS
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
241
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
242 #endif /* GNT_TEXT_VIEW_H */