comparison src/gtkimhtml.c @ 7371:2ec21bff351b

[gaim-migrate @ 7966] some 64bit goodness committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 29 Oct 2003 20:09:50 +0000
parents 78c1fc730dc4
children dc573236dc8b
comparison
equal deleted inserted replaced
7370:622359a769bc 7371:2ec21bff351b
691 if (!t->values) 691 if (!t->values)
692 break; 692 break;
693 693
694 pos = strchr (t->values->str, *x); 694 pos = strchr (t->values->str, *x);
695 if (pos) 695 if (pos)
696 t = t->children [(int) pos - GPOINTER_TO_INT(t->values->str)]; 696 t = t->children [GPOINTER_TO_INT(pos) - GPOINTER_TO_INT(t->values->str)];
697 else 697 else
698 break; 698 break;
699 699
700 x++; len++; 700 x++; len++;
701 } 701 }
712 GtkIMHtmlSmiley *smiley) 712 GtkIMHtmlSmiley *smiley)
713 { 713 {
714 GtkSmileyTree *tree; 714 GtkSmileyTree *tree;
715 g_return_if_fail (imhtml != NULL); 715 g_return_if_fail (imhtml != NULL);
716 g_return_if_fail (GTK_IS_IMHTML (imhtml)); 716 g_return_if_fail (GTK_IS_IMHTML (imhtml));
717 717
718 if (sml == NULL) 718 if (sml == NULL)
719 tree = imhtml->default_smilies; 719 tree = imhtml->default_smilies;
720 else if ((tree = g_hash_table_lookup(imhtml->smiley_data, sml))) { 720 else if ((tree = g_hash_table_lookup(imhtml->smiley_data, sml))) {
721 } else { 721 } else {
722 tree = gtk_smiley_tree_new(); 722 tree = gtk_smiley_tree_new();
746 else { 746 else {
747 tree = g_hash_table_lookup(imhtml->smiley_data, sml); 747 tree = g_hash_table_lookup(imhtml->smiley_data, sml);
748 } 748 }
749 if (tree == NULL) 749 if (tree == NULL)
750 return FALSE; 750 return FALSE;
751 751
752 *len = gtk_smiley_tree_lookup (tree, text); 752 *len = gtk_smiley_tree_lookup (tree, text);
753 return (*len > 0); 753 return (*len > 0);
754 } 754 }
755 755
756 GdkPixbufAnimation * 756 GdkPixbufAnimation *
760 { 760 {
761 GtkSmileyTree *t; 761 GtkSmileyTree *t;
762 const gchar *x = text; 762 const gchar *x = text;
763 if (sml == NULL) 763 if (sml == NULL)
764 t = imhtml->default_smilies; 764 t = imhtml->default_smilies;
765 else 765 else
766 t = g_hash_table_lookup(imhtml->smiley_data, sml); 766 t = g_hash_table_lookup(imhtml->smiley_data, sml);
767 767
768 768
769 if (t == NULL) 769 if (t == NULL)
770 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; 770 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL;
771 771
772 while (*x) { 772 while (*x) {
773 gchar *pos; 773 gchar *pos;
774 774
775 if (!t->values) { 775 if (!t->values) {
776 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; 776 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL;
777 } 777 }
778 778
779 pos = strchr (t->values->str, *x); 779 pos = strchr (t->values->str, *x);
780 if (pos) { 780 if (pos) {
781 t = t->children [(int) pos - GPOINTER_TO_INT(t->values->str)]; 781 t = t->children [GPOINTER_TO_INT(pos) - GPOINTER_TO_INT(t->values->str)];
782 } else { 782 } else {
783 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL; 783 return sml ? gtk_smiley_tree_image(imhtml, NULL, text) : NULL;
784 } 784 }
785 x++; 785 x++;
786 } 786 }