Yattm - unified GTK instant-messaging client | |
[Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003] |
#include <gdk/gdk.h>
#include <gtk/gtkadjustment.h>
#include <gtk/gtkeditable.h>
Include dependency graph for extgtktext.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Data Structures | |
struct | _ExtGtkPropertyMark |
struct | _ExtGtkText |
struct | _ExtGtkTextClass |
Defines | |
#define | VFont GdkFont |
#define | EXT_GTK_TYPE_TEXT (ext_gtk_text_get_type ()) |
#define | GTK_SCTEXT(obj) (GTK_CHECK_CAST ((obj), EXT_GTK_TYPE_TEXT, ExtGtkText)) |
#define | EXT_GTK_TEXT(obj) (GTK_CHECK_CAST ((obj), EXT_GTK_TYPE_TEXT, ExtGtkText)) |
#define | EXT_GTK_TEXT_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), EXT_GTK_TYPE_TEXT, ExtGtkTextClass)) |
#define | EXT_GTK_IS_TEXT(obj) (GTK_CHECK_TYPE ((obj), EXT_GTK_TYPE_TEXT)) |
#define | EXT_GTK_IS_TEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), EXT_GTK_TYPE_TEXT)) |
#define | EXT_GTK_TEXT_INDEX(t, index) |
Typedefs | |
typedef _ExtGtkTextFont | ExtGtkTextFont |
typedef _ExtGtkPropertyMark | ExtGtkPropertyMark |
typedef _ExtGtkText | ExtGtkText |
typedef _ExtGtkTextClass | ExtGtkTextClass |
typedef void | DataFunc (GdkWindow *window, gpointer info) |
Functions | |
GtkType | ext_gtk_text_get_type (void) |
GtkWidget * | ext_gtk_text_new (GtkAdjustment *hadj, GtkAdjustment *vadj) |
void | ext_gtk_text_set_editable (ExtGtkText *text, gboolean editable) |
void | ext_gtk_text_set_word_wrap (ExtGtkText *text, gint word_wrap) |
void | ext_gtk_text_set_line_wrap (ExtGtkText *text, gint line_wrap) |
void | ext_gtk_text_set_adjustments (ExtGtkText *text, GtkAdjustment *hadj, GtkAdjustment *vadj) |
void | ext_gtk_text_set_point (ExtGtkText *text, guint index) |
guint | ext_gtk_text_get_point (ExtGtkText *text) |
guint | ext_gtk_text_get_length (ExtGtkText *text) |
void | ext_gtk_text_freeze (ExtGtkText *text) |
void | ext_gtk_text_thaw (ExtGtkText *text) |
void | ext_gtk_text_insert (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, const char *chars, gint length) |
void | ext_gtk_text_insert_underlined (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, const char *chars, gint length) |
void | ext_gtk_text_insert_divider (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, const char *chars, gint nchars) |
void | ext_gtk_text_insert_pixmap (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, GdkDrawable *image, GdkBitmap *mask, const char *chars, gint length) |
void | ext_gtk_text_insert_data_underlined (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, gpointer user_data, guint user_data_length, DataFunc *user_data_func, const char *chars, gint length) |
void | ext_gtk_text_insert_data (ExtGtkText *text, VFont *font, GdkColor *fore, GdkColor *back, gpointer user_data, guint user_data_length, DataFunc *user_data_func, const char *chars, gint length) |
gint | ext_gtk_text_backward_delete (ExtGtkText *text, guint nchars) |
gint | ext_gtk_text_forward_delete (ExtGtkText *text, guint nchars) |
|
|
Definition at line 65 of file extgtktext.h. |
|
|
Definition at line 63 of file extgtktext.h. |
|
Value: (((t)->use_wchar) \ ? ((index) < (t)->gap_position ? (t)->text.wc[index] : \ (t)->text.wc[(index)+(t)->gap_size]) \ : ((index) < (t)->gap_position ? (t)->text.ch[index] : \ (t)->text.ch[(index)+(t)->gap_size])) Definition at line 268 of file extgtktext.h. Referenced by draw_line(), ext_gtk_text_forward_delete(), find_char_width(), find_cursor_at_line(), find_line_params(), find_mouse_cursor_at_line(), find_this_line_start_mark(), gtk_text_move_backward_word(), gtk_text_move_forward_word(), gtk_text_move_to_column(), move_cursor_ver(), and recompute_geometry(). |
|
Definition at line 60 of file extgtktext.h. Referenced by ext_gtk_text_new(). |
|
Definition at line 61 of file extgtktext.h. |
|
|
Definition at line 72 of file extgtktext.h. Referenced by ext_gtk_text_insert_alltypes(), ext_gtk_text_insert_data(), ext_gtk_text_insert_data_underlined(), ext_gtk_text_insert_text(), gtk_text_button_press(), insert_text_property(), new_text_property(), and text_properties_equal(). |
|
Definition at line 68 of file extgtktext.h. |
|
Definition at line 69 of file extgtktext.h. |
|
Definition at line 70 of file extgtktext.h. |
|
Definition at line 67 of file extgtktext.h. |
|
Definition at line 1279 of file extgtktext.c. References EXT_GTK_IS_TEXT, ext_gtk_text_forward_delete(), ext_gtk_text_set_point(), _ExtGtkPropertyMark::index, and _ExtGtkText::point.
01281 { 01282 g_return_val_if_fail (text != NULL, 0); 01283 g_return_val_if_fail (EXT_GTK_IS_TEXT (text), 0); 01284 01285 if (nchars > text->point.index || nchars <= 0) 01286 return FALSE; 01287 01288 ext_gtk_text_set_point (text, text->point.index - nchars); 01289 01290 return ext_gtk_text_forward_delete (text, nchars); 01291 } |
|
Definition at line 1294 of file extgtktext.c. References compute_lines_pixels(), _ExtGtkText::cursor_mark, delete_expose(), delete_text_property(), draw_cursor(), EXT_GTK_IS_TEXT, ext_gtk_text_freeze(), EXT_GTK_TEXT_INDEX, ext_gtk_text_thaw(), find_line_containing_point(), _ExtGtkText::first_line_start_index, _ExtGtkText::freeze_count, FREEZE_LENGTH, _ExtGtkText::gap_size, _ExtGtkPropertyMark::index, LINE_DELIM, _ExtGtkText::line_start_cache, MIN, move_gap(), move_mark_n(), _ExtGtkText::point, TEXT_LENGTH, and undraw_cursor(). Referenced by ext_gtk_text_backward_delete(), and gtk_text_delete_text().
01296 { 01297 guint old_lines, old_height; 01298 GtkEditable *editable = GTK_EDITABLE (text); 01299 gboolean frozen = FALSE; 01300 01301 g_return_val_if_fail (text != NULL, 0); 01302 g_return_val_if_fail (EXT_GTK_IS_TEXT (text), 0); 01303 01304 if (text->point.index + nchars > TEXT_LENGTH (text) || nchars <= 0) 01305 return FALSE; 01306 01307 if (!text->freeze_count && nchars > FREEZE_LENGTH) 01308 { 01309 ext_gtk_text_freeze (text); 01310 frozen = TRUE; 01311 } 01312 01313 if (!text->freeze_count && text->line_start_cache != NULL) 01314 { 01315 /* We need to undraw the cursor here, since we may later 01316 * delete the cursor's property 01317 */ 01318 undraw_cursor (text, FALSE); 01319 find_line_containing_point (text, text->point.index, TRUE); 01320 compute_lines_pixels (text, nchars, &old_lines, &old_height); 01321 } 01322 01323 /* FIXME, or resizing after deleting will be odd */ 01324 if (text->point.index < text->first_line_start_index) 01325 { 01326 if (text->point.index + nchars >= text->first_line_start_index) 01327 { 01328 text->first_line_start_index = text->point.index; 01329 while ((text->first_line_start_index > 0) && 01330 (EXT_GTK_TEXT_INDEX (text, text->first_line_start_index - 1) 01331 != LINE_DELIM)) 01332 text->first_line_start_index -= 1; 01333 01334 } 01335 else 01336 text->first_line_start_index -= nchars; 01337 } 01338 01339 if (text->point.index < editable->selection_start_pos) 01340 editable->selection_start_pos -= 01341 MIN(nchars, editable->selection_start_pos - text->point.index); 01342 if (text->point.index < editable->selection_end_pos) 01343 editable->selection_end_pos -= 01344 MIN(nchars, editable->selection_end_pos - text->point.index); 01345 /* We'll reset the cursor later anyways if we aren't frozen */ 01346 if (text->point.index < text->cursor_mark.index) 01347 move_mark_n (&text->cursor_mark, 01348 -MIN(nchars, text->cursor_mark.index - text->point.index)); 01349 01350 move_gap (text, text->point.index); 01351 01352 text->gap_size += nchars; 01353 01354 delete_text_property (text, nchars); 01355 01356 if (!text->freeze_count && (text->line_start_cache != NULL)) 01357 { 01358 delete_expose (text, nchars, old_lines, old_height); 01359 draw_cursor (text, FALSE); 01360 } 01361 01362 if (frozen) 01363 ext_gtk_text_thaw (text); 01364 01365 return TRUE; 01366 } |
|
Definition at line 1041 of file extgtktext.c. References EXT_GTK_IS_TEXT, _ExtGtkText::freeze_count, and undraw_cursor(). Referenced by ext_gtk_text_forward_delete(), ext_gtk_text_insert_alltypes(), and set_html_text().
01042 { 01043 g_return_if_fail (text != NULL); 01044 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 01045 01046 text->freeze_count++; 01047 undraw_cursor (text, FALSE); 01048 } |
|
Definition at line 1032 of file extgtktext.c. References EXT_GTK_IS_TEXT, and TEXT_LENGTH.
01033 { 01034 g_return_val_if_fail (text != NULL, 0); 01035 g_return_val_if_fail (EXT_GTK_IS_TEXT (text), 0); 01036 01037 return TEXT_LENGTH (text); 01038 } |
|
Definition at line 1023 of file extgtktext.c. References EXT_GTK_IS_TEXT, _ExtGtkPropertyMark::index, and _ExtGtkText::point.
01024 { 01025 g_return_val_if_fail (text != NULL, 0); 01026 g_return_val_if_fail (EXT_GTK_IS_TEXT (text), 0); 01027 01028 return text->point.index; 01029 } |
|
Definition at line 641 of file extgtktext.c. References gtk_text_class_init(), and gtk_text_init().
00642 { 00643 static GtkType text_type = 0; 00644 00645 if (!text_type) 00646 { 00647 static const GtkTypeInfo text_info = 00648 { 00649 "ExtGtkText", 00650 sizeof (ExtGtkText), 00651 sizeof (ExtGtkTextClass), 00652 (GtkClassInitFunc) gtk_text_class_init, 00653 (GtkObjectInitFunc) gtk_text_init, 00654 /* reserved_1 */ NULL, 00655 /* reserved_2 */ NULL, 00656 (GtkClassInitFunc) NULL, 00657 }; 00658 00659 text_type = gtk_type_unique (GTK_TYPE_EDITABLE, &text_info); 00660 } 00661 00662 return text_type; 00663 } |
|
Definition at line 1201 of file extgtktext.c. References ext_gtk_text_insert_alltypes(), and VFont. Referenced by gtk_eb_html_add().
01207 { 01208 ext_gtk_text_insert_alltypes(text, font, fore, back, FALSE, FALSE, NULL, NULL, NULL,0,NULL, chars, nchars); 01209 } |
|
Definition at line 1263 of file extgtktext.c. References DataFunc, ext_gtk_text_insert_alltypes(), and VFont.
01272 { 01273 gpointer user_data=g_malloc(user_data_length); 01274 memcpy(user_data,user_data_n, user_data_length); 01275 ext_gtk_text_insert_alltypes(text, font, fore, back, FALSE, FALSE, NULL, NULL, user_data, user_data_length, user_data_func, chars, nchars); 01276 } |
|
Definition at line 1247 of file extgtktext.c. References DataFunc, ext_gtk_text_insert_alltypes(), and VFont. Referenced by gtk_eb_html_add().
01256 { 01257 gpointer user_data=g_malloc(user_data_length); 01258 memcpy(user_data,user_data_n, user_data_length); 01259 ext_gtk_text_insert_alltypes(text, font, fore, back, TRUE, FALSE, NULL, NULL, user_data, user_data_length, user_data_func, chars, nchars); 01260 } |
|
Definition at line 1223 of file extgtktext.c. References ext_gtk_text_insert_alltypes(), and VFont. Referenced by gtk_eb_html_add().
01229 { 01230 ext_gtk_text_insert_alltypes(text, font, fore, back, FALSE, TRUE, NULL, NULL, NULL,0, NULL, " \n", 2); 01231 } |
|
Definition at line 1234 of file extgtktext.c. References ext_gtk_text_insert_alltypes(), and VFont. Referenced by gtk_eb_html_add().
01242 { 01243 ext_gtk_text_insert_alltypes(text, font, fore, back, FALSE, FALSE, image, mask, NULL,0,NULL, " ", 1); 01244 } |
|
Definition at line 1212 of file extgtktext.c. References ext_gtk_text_insert_alltypes(), and VFont.
01218 { 01219 ext_gtk_text_insert_alltypes(text, font, fore, back, TRUE, FALSE, NULL, NULL, NULL,0, NULL, chars, nchars); 01220 } |
|
Definition at line 858 of file extgtktext.c. References EXT_GTK_TYPE_TEXT. Referenced by create_html_widget(), eb_chat_window_new(), eb_info_window_new(), and eb_join_chat_room().
00860 { 00861 GtkWidget *text; 00862 #ifdef HAVE_LIBXFT 00863 if(!default_font) 00864 { 00865 default_font = XftFontOpen(gdk_display, DefaultScreen(gdk_display),XFT_FAMILY, XftTypeString, 00866 "Helvetica",XFT_FAMILY, XftTypeString, 00867 "Arial",XFT_SIZE, XftTypeInteger, 10,0); 00868 } 00869 #endif 00870 00871 if (hadj) 00872 g_return_val_if_fail (GTK_IS_ADJUSTMENT (hadj), NULL); 00873 if (vadj) 00874 g_return_val_if_fail (GTK_IS_ADJUSTMENT (vadj), NULL); 00875 00876 text = gtk_widget_new (EXT_GTK_TYPE_TEXT, 00877 "hadjustment", hadj, 00878 "vadjustment", vadj, 00879 NULL); 00880 00881 return text; 00882 } |
|
Definition at line 947 of file extgtktext.c. References EXT_GTK_IS_TEXT, gtk_text_adjustment(), gtk_text_disconnect(), _ExtGtkText::hadj, and _ExtGtkText::vadj. Referenced by gtk_text_class_init(), gtk_text_disconnect(), and gtk_text_set_arg().
00950 { 00951 g_return_if_fail (text != NULL); 00952 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 00953 if (hadj) 00954 g_return_if_fail (GTK_IS_ADJUSTMENT (hadj)); 00955 else 00956 hadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); 00957 if (vadj) 00958 g_return_if_fail (GTK_IS_ADJUSTMENT (vadj)); 00959 else 00960 vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); 00961 00962 if (text->hadj && (text->hadj != hadj)) 00963 { 00964 gtk_signal_disconnect_by_data (GTK_OBJECT (text->hadj), text); 00965 gtk_object_unref (GTK_OBJECT (text->hadj)); 00966 } 00967 00968 if (text->vadj && (text->vadj != vadj)) 00969 { 00970 gtk_signal_disconnect_by_data (GTK_OBJECT (text->vadj), text); 00971 gtk_object_unref (GTK_OBJECT (text->vadj)); 00972 } 00973 00974 if (text->hadj != hadj) 00975 { 00976 text->hadj = hadj; 00977 gtk_object_ref (GTK_OBJECT (text->hadj)); 00978 gtk_object_sink (GTK_OBJECT (text->hadj)); 00979 00980 gtk_signal_connect (GTK_OBJECT (text->hadj), "changed", 00981 (GtkSignalFunc) gtk_text_adjustment, 00982 text); 00983 gtk_signal_connect (GTK_OBJECT (text->hadj), "value_changed", 00984 (GtkSignalFunc) gtk_text_adjustment, 00985 text); 00986 gtk_signal_connect (GTK_OBJECT (text->hadj), "disconnect", 00987 (GtkSignalFunc) gtk_text_disconnect, 00988 text); 00989 gtk_text_adjustment (hadj, text); 00990 } 00991 00992 if (text->vadj != vadj) 00993 { 00994 text->vadj = vadj; 00995 gtk_object_ref (GTK_OBJECT (text->vadj)); 00996 gtk_object_sink (GTK_OBJECT (text->vadj)); 00997 00998 gtk_signal_connect (GTK_OBJECT (text->vadj), "changed", 00999 (GtkSignalFunc) gtk_text_adjustment, 01000 text); 01001 gtk_signal_connect (GTK_OBJECT (text->vadj), "value_changed", 01002 (GtkSignalFunc) gtk_text_adjustment, 01003 text); 01004 gtk_signal_connect (GTK_OBJECT (text->vadj), "disconnect", 01005 (GtkSignalFunc) gtk_text_disconnect, 01006 text); 01007 gtk_text_adjustment (vadj, text); 01008 } 01009 } |
|
Definition at line 917 of file extgtktext.c. References EXT_GTK_IS_TEXT. Referenced by gtk_eb_html_init().
00919 { 00920 g_return_if_fail (text != NULL); 00921 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 00922 00923 gtk_editable_set_editable (GTK_EDITABLE (text), is_editable); 00924 } |
|
Definition at line 901 of file extgtktext.c. References EXT_GTK_IS_TEXT, _ExtGtkText::line_wrap, and recompute_geometry(). Referenced by gtk_eb_html_init(), and gtk_text_set_arg().
00903 { 00904 g_return_if_fail (text != NULL); 00905 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 00906 00907 text->line_wrap = (line_wrap != FALSE); 00908 00909 if (GTK_WIDGET_REALIZED (text)) 00910 { 00911 recompute_geometry (text); 00912 gtk_widget_queue_draw (GTK_WIDGET (text)); 00913 } 00914 } |
|
Definition at line 1012 of file extgtktext.c. References EXT_GTK_IS_TEXT, find_mark(), _ExtGtkText::point, and TEXT_LENGTH. Referenced by ext_gtk_text_backward_delete(), ext_gtk_text_insert_text(), and gtk_text_delete_text().
01014 { 01015 g_return_if_fail (text != NULL); 01016 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 01017 g_return_if_fail (index <= TEXT_LENGTH (text)); 01018 01019 text->point = find_mark (text, index); 01020 } |
|
Definition at line 885 of file extgtktext.c. References EXT_GTK_IS_TEXT, recompute_geometry(), and _ExtGtkText::word_wrap. Referenced by gtk_eb_html_init(), and gtk_text_set_arg().
00887 { 00888 g_return_if_fail (text != NULL); 00889 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 00890 00891 text->word_wrap = (word_wrap != FALSE); 00892 00893 if (GTK_WIDGET_REALIZED (text)) 00894 { 00895 recompute_geometry (text); 00896 gtk_widget_queue_draw (GTK_WIDGET (text)); 00897 } 00898 } |
|
Definition at line 1051 of file extgtktext.c. References draw_cursor(), EXT_GTK_IS_TEXT, _ExtGtkText::freeze_count, and recompute_geometry(). Referenced by ext_gtk_text_forward_delete(), ext_gtk_text_insert_alltypes(), and set_html_text().
01052 { 01053 g_return_if_fail (text != NULL); 01054 g_return_if_fail (EXT_GTK_IS_TEXT (text)); 01055 01056 if (text->freeze_count) 01057 if (!(--text->freeze_count) && GTK_WIDGET_REALIZED (text)) 01058 { 01059 recompute_geometry (text); 01060 gtk_widget_queue_draw (GTK_WIDGET (text)); 01061 } 01062 draw_cursor (text, FALSE); 01063 } |