Mercurial > pidgin
comparison src/gtkimhtml.c @ 8496:f07fbdfbe2e0
[gaim-migrate @ 9231]
Remove some printfs. Hopefully we'll release Thursday?
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Wed, 24 Mar 2004 01:50:32 +0000 |
parents | 6d0869404696 |
children | d4ed39454347 |
comparison
equal
deleted
inserted
replaced
8495:a88124e46fc6 | 8496:f07fbdfbe2e0 |
---|---|
1408 pre = 0; | 1408 pre = 0; |
1409 | 1409 |
1410 GSList *fonts = NULL; | 1410 GSList *fonts = NULL; |
1411 GtkIMHtmlScalable *scalable = NULL; | 1411 GtkIMHtmlScalable *scalable = NULL; |
1412 int y, height; | 1412 int y, height; |
1413 | |
1414 printf("Appending: %s\n", text); | |
1415 | 1413 |
1416 g_return_val_if_fail (imhtml != NULL, NULL); | 1414 g_return_val_if_fail (imhtml != NULL, NULL); |
1417 g_return_val_if_fail (GTK_IS_IMHTML (imhtml), NULL); | 1415 g_return_val_if_fail (GTK_IS_IMHTML (imhtml), NULL); |
1418 g_return_val_if_fail (text != NULL, NULL); | 1416 g_return_val_if_fail (text != NULL, NULL); |
1419 c = text; | 1417 c = text; |
2556 GtkTextMark *ins_mark; | 2554 GtkTextMark *ins_mark; |
2557 GtkTextIter ins_iter, adj_iter, end_iter; | 2555 GtkTextIter ins_iter, adj_iter, end_iter; |
2558 GSList *tags; | 2556 GSList *tags; |
2559 gint position, length, adjusted; | 2557 gint position, length, adjusted; |
2560 | 2558 |
2561 printf("get_current_format\n"); | |
2562 | |
2563 /* grab the current cursor position compensate for the way that the | 2559 /* grab the current cursor position compensate for the way that the |
2564 * direction that the cursor was moved so that we get all the tags | 2560 * direction that the cursor was moved so that we get all the tags |
2565 * for that current location | 2561 * for that current location |
2566 */ | 2562 */ |
2567 ins_mark = gtk_text_buffer_get_insert(imhtml->text_buffer); | 2563 ins_mark = gtk_text_buffer_get_insert(imhtml->text_buffer); |
2578 } else if(offset > 0) { /* moving right or down */ | 2574 } else if(offset > 0) { /* moving right or down */ |
2579 if(adjusted >= length) | 2575 if(adjusted >= length) |
2580 adjusted = length - 1; | 2576 adjusted = length - 1; |
2581 } | 2577 } |
2582 | 2578 |
2583 printf("position: %d, offset: %d, length: %d, adjusted: %d\n", | |
2584 position, offset, length, adjusted); | |
2585 | |
2586 gtk_text_buffer_get_iter_at_offset(imhtml->text_buffer, &adj_iter, adjusted); | 2579 gtk_text_buffer_get_iter_at_offset(imhtml->text_buffer, &adj_iter, adjusted); |
2587 | 2580 |
2588 /* grab the tags that apply to the cursor location */ | 2581 /* grab the tags that apply to the cursor location */ |
2589 for(tags = gtk_text_iter_get_tags(&adj_iter); | 2582 for(tags = gtk_text_iter_get_tags(&adj_iter); |
2590 tags != NULL; tags = tags->next) | 2583 tags != NULL; tags = tags->next) |
2591 { | 2584 { |
2592 GtkTextTag *tag = GTK_TEXT_TAG(tags->data); | 2585 GtkTextTag *tag = GTK_TEXT_TAG(tags->data); |
2593 if(tag->name) { | 2586 if(tag->name) { |
2594 printf("tag: %s\n", tag->name); | |
2595 if(g_ascii_strcasecmp(tag->name, "BOLD") == 0) | 2587 if(g_ascii_strcasecmp(tag->name, "BOLD") == 0) |
2596 (*bold) = TRUE; | 2588 (*bold) = TRUE; |
2597 if(g_ascii_strcasecmp(tag->name, "ITALICS") == 0) | 2589 if(g_ascii_strcasecmp(tag->name, "ITALICS") == 0) |
2598 (*italic) = TRUE; | 2590 (*italic) = TRUE; |
2599 if(g_ascii_strcasecmp(tag->name, "UNDERLINE") == 0) | 2591 if(g_ascii_strcasecmp(tag->name, "UNDERLINE") == 0) |
3095 GtkIMHtmlFormatSpan *span = (GtkIMHtmlFormatSpan*)closers->data; | 3087 GtkIMHtmlFormatSpan *span = (GtkIMHtmlFormatSpan*)closers->data; |
3096 str = g_string_append(str, span->end_tag); | 3088 str = g_string_append(str, span->end_tag); |
3097 closers = g_list_remove(closers, span); | 3089 closers = g_list_remove(closers, span); |
3098 | 3090 |
3099 } | 3091 } |
3100 printf("gotten: %s\n", str->str); | |
3101 return g_string_free(str, FALSE); | 3092 return g_string_free(str, FALSE); |
3102 } | 3093 } |
3103 | 3094 |
3104 void gtk_imhtml_close_tags(GtkIMHtml *imhtml) | 3095 void gtk_imhtml_close_tags(GtkIMHtml *imhtml) |
3105 { | 3096 { |