comparison src/gtkimhtml.c @ 11485:16b0da1f376f

[gaim-migrate @ 13727] Fix the /nick weirdness bug I introduced. Also, patch 1283539, from Peter Lawler (two changes) 1. When in a chat where Gaim can tell which users are buddies (i.e. non-Jabber chats), only the names of buddies are bolded. I'm not sure if I'll like this, but I'm committing it so we can all try it out. 2. "remove bold, underline, and italics when we're ignoring formatting, as well" committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Fri, 09 Sep 2005 20:14:32 +0000
parents 78cd70f4834c
children b47708f46a38
comparison
equal deleted inserted replaced
11484:4539174a88bd 11485:16b0da1f376f
2365 switch (type) 2365 switch (type)
2366 { 2366 {
2367 case 1: /* B */ 2367 case 1: /* B */
2368 case 2: /* BOLD */ 2368 case 2: /* BOLD */
2369 case 54: /* STRONG */ 2369 case 54: /* STRONG */
2370 2370 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2371 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2371 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2372 2372
2373 if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD)) 2373 if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD))
2374 gtk_imhtml_toggle_bold(imhtml); 2374 gtk_imhtml_toggle_bold(imhtml);
2375 bold++; 2375 bold++;
2376 ws[0] = '\0'; wpos = 0; 2376 ws[0] = '\0'; wpos = 0;
2377 }
2377 break; 2378 break;
2378 case 3: /* /B */ 2379 case 3: /* /B */
2379 case 4: /* /BOLD */ 2380 case 4: /* /BOLD */
2380 case 55: /* /STRONG */ 2381 case 55: /* /STRONG */
2381 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2382 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2382 ws[0] = '\0'; wpos = 0; 2383 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2383 2384 ws[0] = '\0'; wpos = 0;
2384 if (bold) 2385
2385 bold--; 2386 if (bold)
2386 if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD) && !imhtml->wbfo) 2387 bold--;
2387 gtk_imhtml_toggle_bold(imhtml); 2388 if ((bold == 0) && (imhtml->format_functions & GTK_IMHTML_BOLD) && !imhtml->wbfo)
2389 gtk_imhtml_toggle_bold(imhtml);
2390 }
2388 break; 2391 break;
2389 case 5: /* I */ 2392 case 5: /* I */
2390 case 6: /* ITALIC */ 2393 case 6: /* ITALIC */
2391 case 52: /* EM */ 2394 case 52: /* EM */
2392 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2395 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2393 ws[0] = '\0'; wpos = 0; 2396 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2394 if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC)) 2397 ws[0] = '\0'; wpos = 0;
2395 gtk_imhtml_toggle_italic(imhtml); 2398 if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC))
2396 italics++; 2399 gtk_imhtml_toggle_italic(imhtml);
2400 italics++;
2401 }
2397 break; 2402 break;
2398 case 7: /* /I */ 2403 case 7: /* /I */
2399 case 8: /* /ITALIC */ 2404 case 8: /* /ITALIC */
2400 case 53: /* /EM */ 2405 case 53: /* /EM */
2401 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2406 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2402 ws[0] = '\0'; wpos = 0; 2407 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2403 if (italics) 2408 ws[0] = '\0'; wpos = 0;
2404 italics--; 2409 if (italics)
2405 if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC) && !imhtml->wbfo) 2410 italics--;
2406 gtk_imhtml_toggle_italic(imhtml); 2411 if ((italics == 0) && (imhtml->format_functions & GTK_IMHTML_ITALIC) && !imhtml->wbfo)
2412 gtk_imhtml_toggle_italic(imhtml);
2413 }
2407 break; 2414 break;
2408 case 9: /* U */ 2415 case 9: /* U */
2409 case 10: /* UNDERLINE */ 2416 case 10: /* UNDERLINE */
2410 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2417 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2411 ws[0] = '\0'; wpos = 0; 2418 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2412 if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE)) 2419 ws[0] = '\0'; wpos = 0;
2413 gtk_imhtml_toggle_underline(imhtml); 2420 if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE))
2414 underline++; 2421 gtk_imhtml_toggle_underline(imhtml);
2422 underline++;
2423 }
2415 break; 2424 break;
2416 case 11: /* /U */ 2425 case 11: /* /U */
2417 case 12: /* /UNDERLINE */ 2426 case 12: /* /UNDERLINE */
2418 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2427 if (!(options & GTK_IMHTML_NO_FORMATTING)) {
2419 ws[0] = '\0'; wpos = 0; 2428 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2420 if (underline) 2429 ws[0] = '\0'; wpos = 0;
2421 underline--; 2430 if (underline)
2422 if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE) && !imhtml->wbfo) 2431 underline--;
2423 gtk_imhtml_toggle_underline(imhtml); 2432 if ((underline == 0) && (imhtml->format_functions & GTK_IMHTML_UNDERLINE) && !imhtml->wbfo)
2433 gtk_imhtml_toggle_underline(imhtml);
2434 }
2424 break; 2435 break;
2425 case 13: /* S */ 2436 case 13: /* S */
2426 case 14: /* STRIKE */ 2437 case 14: /* STRIKE */
2427 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos); 2438 gtk_text_buffer_insert(imhtml->text_buffer, iter, ws, wpos);
2428 ws[0] = '\0'; wpos = 0; 2439 ws[0] = '\0'; wpos = 0;