| 1047 case 1: /* short message */ |
1048 case 1: /* short message */ |
| 1048 printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); |
1049 printf(_("Gaim %s. Try `%s -h' for more information.\n"), VERSION, name); |
| 1049 break; |
1050 break; |
| 1050 } |
1051 } |
| 1051 } |
1052 } |
| |
1053 |
| |
1054 void gaim_gtk_find_images(const char *message, GSList **list) { |
| |
1055 GData *attribs; |
| |
1056 const char *tmp, *start, *end; |
| |
1057 |
| |
1058 tmp = message; |
| |
1059 while (gaim_markup_find_tag("img", tmp, &start, &end, &attribs)) { |
| |
1060 GaimStoredImage *image = NULL; |
| |
1061 GdkPixbufLoader *loader = NULL; |
| |
1062 GdkPixbuf *pixbuf = NULL; |
| |
1063 GError *error = NULL; |
| |
1064 char *id = g_datalist_get_data(&attribs, "id"); |
| |
1065 |
| |
1066 tmp = end + 1; |
| |
1067 |
| |
1068 if (id) |
| |
1069 image = gaim_imgstore_get(atoi(id)); |
| |
1070 |
| |
1071 g_datalist_clear(&attribs); |
| |
1072 |
| |
1073 if (!image) { |
| |
1074 *list = g_slist_append(*list, NULL); |
| |
1075 continue; |
| |
1076 } |
| |
1077 |
| |
1078 loader = gdk_pixbuf_loader_new(); |
| |
1079 |
| |
1080 if (gdk_pixbuf_loader_write(loader, image->data, image->size, &error) |
| |
1081 && (pixbuf = gdk_pixbuf_loader_get_pixbuf(loader))) { |
| |
1082 |
| |
1083 if (image->filename) |
| |
1084 g_object_set_data_full(G_OBJECT(pixbuf), "filename", |
| |
1085 g_strdup(image->filename), g_free); |
| |
1086 g_object_ref(G_OBJECT(pixbuf)); |
| |
1087 *list = g_slist_append(*list, pixbuf); |
| |
1088 } else { |
| |
1089 if (error) { |
| |
1090 gaim_debug(GAIM_DEBUG_ERROR, "gtkutils", |
| |
1091 "Failed to make pixbuf from image store: %s\n", |
| |
1092 error->message); |
| |
1093 g_error_free(error); |
| |
1094 } else { |
| |
1095 gaim_debug(GAIM_DEBUG_ERROR, "gtkutils", |
| |
1096 "Failed to make pixbuf from image store: unknown reason\n"); |
| |
1097 } |
| |
1098 *list = g_slist_append(*list, NULL); |
| |
1099 } |
| |
1100 |
| |
1101 gdk_pixbuf_loader_close(loader, NULL); |
| |
1102 } |
| |
1103 } |