Mercurial > pidgin
comparison src/themes.c @ 4667:4bf9c6e8e432
[gaim-migrate @ 4978]
protocol-specific smileys in the smiley dialog
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 07 Mar 2003 23:49:10 +0000 |
parents | c4ca37f34130 |
children | 677d3cb193a1 |
comparison
equal
deleted
inserted
replaced
4666:f8895ad921ee | 4667:4bf9c6e8e432 |
---|---|
20 */ | 20 */ |
21 | 21 |
22 #include "gaim.h" | 22 #include "gaim.h" |
23 #include "ui.h" | 23 #include "ui.h" |
24 #include "gtkimhtml.h" | 24 #include "gtkimhtml.h" |
25 #include "prpl.h" | |
25 #include <stdio.h> | 26 #include <stdio.h> |
26 #include <string.h> | 27 #include <string.h> |
27 #include <ctype.h> | 28 #include <ctype.h> |
28 #include <sys/stat.h> | 29 #include <sys/stat.h> |
29 #include "gaim.h" | |
30 | 30 |
31 #ifdef _WIN32 | 31 #ifdef _WIN32 |
32 #include "win32dep.h" | 32 #include "win32dep.h" |
33 #endif | 33 #endif |
34 | 34 |
147 theme->icon[strlen(theme->icon)-1] = 0; | 147 theme->icon[strlen(theme->icon)-1] = 0; |
148 } else if (!g_strncasecmp(i, "Author=", strlen("Author="))) { | 148 } else if (!g_strncasecmp(i, "Author=", strlen("Author="))) { |
149 theme->author = g_strdup(i + strlen("Author=")); | 149 theme->author = g_strdup(i + strlen("Author=")); |
150 theme->author[strlen(theme->author)-1] = 0; | 150 theme->author[strlen(theme->author)-1] = 0; |
151 } else if (load && list) { | 151 } else if (load && list) { |
152 gboolean hidden; | 152 gboolean hidden = FALSE; |
153 char *sfile = NULL; | 153 char *sfile = NULL; |
154 | 154 |
155 if (*i == '!' && *(i + 1) == ' ') { | 155 if (*i == '!' && *(i + 1) == ' ') { |
156 hidden = TRUE; | 156 hidden = TRUE; |
157 i = i + 2; | 157 i = i + 2; |
167 } else { | 167 } else { |
168 GtkIMHtmlSmiley *smiley = g_new0(GtkIMHtmlSmiley, 1); | 168 GtkIMHtmlSmiley *smiley = g_new0(GtkIMHtmlSmiley, 1); |
169 l[li] = 0; | 169 l[li] = 0; |
170 smiley->file = sfile; | 170 smiley->file = sfile; |
171 smiley->smile = g_strdup(l); | 171 smiley->smile = g_strdup(l); |
172 smiley->hidden = hidden; | |
172 list->smileys = g_slist_append(list->smileys, smiley); | 173 list->smileys = g_slist_append(list->smileys, smiley); |
173 } | 174 } |
174 while (isspace(*i)) | 175 while (isspace(*i)) |
175 i++; | 176 i++; |
176 | 177 |
225 mkdir(probedirs[l], S_IRUSR | S_IWUSR | S_IXUSR); | 226 mkdir(probedirs[l], S_IRUSR | S_IWUSR | S_IXUSR); |
226 } | 227 } |
227 g_free(probedirs[l]); | 228 g_free(probedirs[l]); |
228 } | 229 } |
229 } | 230 } |
231 | |
232 GSList *get_proto_smileys(int protocol) { | |
233 struct prpl *proto = find_prpl(protocol); | |
234 struct smiley_list *list, *def; | |
235 | |
236 if(!current_smiley_theme) | |
237 return NULL; | |
238 | |
239 def = list = current_smiley_theme->list; | |
240 | |
241 while(list) { | |
242 if(!strcmp(list->sml, "default")) | |
243 def = list; | |
244 else if(proto && !strcmp(proto->name, list->sml)) | |
245 break; | |
246 | |
247 list = list->next; | |
248 } | |
249 | |
250 return list ? list->smileys : def->smileys; | |
251 } |