Yattm - unified GTK instant-messaging client | |
[Generated for version 0.2-17 - Mon Jan 6 19:01:23 GMT+1 2003] |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "pixmaps/smile.xpm"
#include "pixmaps/sad.xpm"
#include "pixmaps/wink.xpm"
#include "pixmaps/biglaugh.xpm"
#include "pixmaps/laugh.xpm"
#include "pixmaps/cry.xpm"
#include "pixmaps/tongue.xpm"
#include "pixmaps/cooldude.xpm"
#include "pixmaps/note.xpm"
#include "pixmaps/dude.xpm"
#include "pixmaps/worried.xpm"
#include "pixmaps/confused.xpm"
#include "pixmaps/grin.xpm"
#include "pixmaps/blankface.xpm"
#include "pixmaps/blush.xpm"
#include "pixmaps/oh.xpm"
#include "pixmaps/heyyy.xpm"
#include "pixmaps/lovey.xpm"
#include "pixmaps/angry.xpm"
#include "pixmaps/wine.xpm"
#include "pixmaps/beer.xpm"
#include "globals.h"
#include "service.h"
#include "smileys.h"
Include dependency graph for smileys.c:
Go to the source code of this file.
Functions | |
GList * | eb_smileys (void) |
void | init_smileys (void) |
gchar * | eb_smilify (gchar *text, GList *protocol_smileys) |
GList * | eb_default_smileys (void) |
GList * | add_protocol_smiley (GList *list, char *text, char *name) |
GList * | add_smiley (GList *list, char *name, gchar **data) |
smiley * | get_smiley_by_name (char *name) |
Variables | |
char * | no_smileys [] |
GList * | smileys = NULL |
GList * | default_smileys = NULL |
GList * | _eb_smileys = NULL |
|
Definition at line 187 of file smileys.c. References protocol_smiley_struct::name, and protocol_smiley_struct::text. Referenced by init_smileys().
00188 { 00189 protocol_smiley * psmile; 00190 00191 psmile=g_new0(protocol_smiley, 1); 00192 strcpy(psmile->text, text); 00193 strcpy(psmile->name, name); 00194 return g_list_append(list, psmile); 00195 } |
|
Definition at line 197 of file smileys.c. References smiley_struct::name, and smiley_struct::pixmap. Referenced by init_smileys().
|
|
Definition at line 182 of file smileys.c. References default_smileys.
00183 { 00184 return default_smileys; 00185 } |
|
Definition at line 46 of file smileys.c. References _eb_smileys.
00047 { 00048 return _eb_smileys; 00049 } |
|
Definition at line 112 of file smileys.c. References protocol_smiley_struct::name, no_smileys, and protocol_smiley_struct::text. Referenced by eb_chat_room_show_message(), eb_chat_window_display_remote_message(), and send_message().
00113 { 00114 int ipos=0; 00115 int found; 00116 int i; 00117 GList * l=protocol_smileys; 00118 GString * newstr; 00119 char * result; 00120 00121 if(!do_smiley) 00122 { 00123 return text; 00124 } 00125 00126 newstr=g_string_sized_new(2048); 00127 00128 while(text[ipos]!='\0') 00129 { 00130 /* ignore anything in < > */ 00131 if(text[ipos] == '<') { 00132 while(text[ipos] && text[ipos] != '>') { 00133 g_string_append_c(newstr, text[ipos++]); 00134 } 00135 if(text[ipos] == '>') 00136 g_string_append_c(newstr, text[ipos++]); 00137 else /* text[ipos] is null */ 00138 break; 00139 } 00140 00141 /* ignore anything in the ignore list (http://, ftp://, etc.) */ 00142 for(i=0; no_smileys[i]; i++) { 00143 int len = strlen(no_smileys[i]); 00144 if( !strncmp( text + ipos, no_smileys[i], len ) ) { 00145 g_string_append(newstr, no_smileys[i]); 00146 ipos += len; 00147 } 00148 } 00149 00150 00151 l=protocol_smileys; 00152 00153 found=0; 00154 00155 while(l!=NULL) 00156 { 00157 protocol_smiley * ps=(protocol_smiley *)l->data; 00158 if(!strncmp(text+ipos, ps->text, strlen(ps->text))) 00159 { 00160 g_string_append(newstr, "<smiley name=\""); 00161 g_string_append(newstr, ps->name); 00162 g_string_append(newstr, "\" alt=\""); 00163 g_string_append(newstr, ps->text); 00164 g_string_append(newstr, "\">"); 00165 ipos += strlen(ps->text); 00166 found=1; 00167 break; 00168 } 00169 l=l->next; 00170 } 00171 if(!found) { g_string_append_c(newstr, text[ipos++]); } 00172 } 00173 00174 00175 free(text); 00176 result = newstr->str; 00177 g_string_free(newstr, FALSE); 00178 00179 return result; 00180 } |
|
Definition at line 207 of file smileys.c. References smiley_struct::name, and smileys. Referenced by show_smileys_callback().
|
|
|
Definition at line 43 of file smileys.c. Referenced by eb_smileys(), and init_smileys(). |
|
Definition at line 41 of file smileys.c. Referenced by eb_default_smileys(), and init_smileys(). |
|
Initial value: { "http://", "https://", "ftp://", "mailto:/", NULL } Definition at line 32 of file smileys.c. Referenced by eb_smilify(). |
|
Definition at line 40 of file smileys.c. Referenced by get_smiley_by_name(), and init_smileys(). |