comparison console/libgnt/gnttextview.c @ 13952:841a5ffbfee4

[gaim-migrate @ 16500] uiops for GaimConnections. This only shows an error message for a disconnect. uiops for GaimNotify. I have not done the notifications for searchresults yet. That will require multi-column GntTree's, which will also allow for improved email-notifications. I hope to complete it by next week. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 17 Jul 2006 03:45:24 +0000
parents 25be562aaca8
children df8183b7fa2c
comparison
equal deleted inserted replaced
13951:614c56622453 13952:841a5ffbfee4
176 GList *list = view->list; 176 GList *list = view->list;
177 177
178 if (text == NULL || *text == '\0') 178 if (text == NULL || *text == '\0')
179 return; 179 return;
180 180
181 if (flags & GNT_TEXT_FLAG_BOLD) 181 fl = gnt_text_format_flag_to_chtype(flags);
182 fl |= A_BOLD;
183 if (flags & GNT_TEXT_FLAG_UNDERLINE)
184 fl |= A_UNDERLINE;
185 if (flags & GNT_TEXT_FLAG_BLINK)
186 fl |= A_BLINK;
187
188 if (flags & GNT_TEXT_FLAG_DIM)
189 fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_DISABLED));
190 else if (flags & GNT_TEXT_FLAG_HIGHLIGHT)
191 fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_HIGHLIGHT));
192 else
193 fl |= COLOR_PAIR(GNT_COLOR_NORMAL);
194 182
195 view->list = g_list_first(view->list); 183 view->list = g_list_first(view->list);
196 184
197 split = g_strsplit(text, "\n", 0); 185 split = g_strsplit(text, "\n", 0);
198 for (i = 0; split[i]; i++) 186 for (i = 0; split[i]; i++)
260 view->list = g_list_prepend(g_list_first(view->list), line); 248 view->list = g_list_prepend(g_list_first(view->list), line);
261 view->list = list; 249 view->list = list;
262 gnt_widget_draw(GNT_WIDGET(view)); 250 gnt_widget_draw(GNT_WIDGET(view));
263 } 251 }
264 252
253 chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags)
254 {
255 chtype fl = 0;
256
257 if (flags & GNT_TEXT_FLAG_BOLD)
258 fl |= A_BOLD;
259 if (flags & GNT_TEXT_FLAG_UNDERLINE)
260 fl |= A_UNDERLINE;
261 if (flags & GNT_TEXT_FLAG_BLINK)
262 fl |= A_BLINK;
263
264 if (flags & GNT_TEXT_FLAG_DIM)
265 fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_DISABLED));
266 else if (flags & GNT_TEXT_FLAG_HIGHLIGHT)
267 fl |= (A_DIM | COLOR_PAIR(GNT_COLOR_HIGHLIGHT));
268 else
269 fl |= COLOR_PAIR(GNT_COLOR_NORMAL);
270
271 return fl;
272 }
273