comparison mcabber/src/screen.c @ 142:bb6fe91589b9

[/trunk] Changeset 154 by mikael * Improve cursor/panel handling. * Add a note to the TODO about this, we should try to set up a policy...
author mikael
date Fri, 29 Apr 2005 05:53:24 +0000
parents 3b480b73df19
children 300bb88f631f
comparison
equal deleted inserted replaced
141:6533a231a65e 142:bb6fe91589b9
298 doupdate(); 298 doupdate();
299 } else { 299 } else {
300 top_panel(chatPanel); 300 top_panel(chatPanel);
301 currentWindow = win_entry; // == NULL (current window empty) 301 currentWindow = win_entry; // == NULL (current window empty)
302 } 302 }
303
304 top_panel(inputPanel);
303 } 305 }
304 306
305 void scr_ShowBuddyWindow(void) 307 void scr_ShowBuddyWindow(void)
306 { 308 {
307 const gchar *jid; 309 const gchar *jid;
316 currentWindow = NULL; 318 currentWindow = NULL;
317 return; 319 return;
318 } 320 }
319 321
320 scr_ShowWindow(jid); 322 scr_ShowWindow(jid);
321 top_panel(inputPanel);
322 } 323 }
323 324
324 325
325 void scr_WriteInWindow(const char *winId, const char *text, int TimeStamp, 326 void scr_WriteInWindow(const char *winId, const char *text, int TimeStamp,
326 const char *prefix, int force_show) 327 const char *prefix, int force_show)
368 369
369 if (!dont_show) { 370 if (!dont_show) {
370 // Show and refresh the window 371 // Show and refresh the window
371 top_panel(win_entry->panel); 372 top_panel(win_entry->panel);
372 scr_UpdateWindow(win_entry); 373 scr_UpdateWindow(win_entry);
374 top_panel(inputPanel);
373 update_panels(); 375 update_panels();
374 doupdate(); 376 doupdate();
375 } else { 377 } else {
376 roster_setflags(winId, ROSTER_FLAG_MSG, TRUE); 378 roster_setflags(winId, ROSTER_FLAG_MSG, TRUE);
377 update_roster = TRUE; 379 update_roster = TRUE;
436 438
437 inputWnd = newwin(1, maxX, maxY-1, 0); 439 inputWnd = newwin(1, maxX, maxY-1, 0);
438 inputPanel = new_panel(inputWnd); 440 inputPanel = new_panel(inputWnd);
439 441
440 scr_DrawRoster(); 442 scr_DrawRoster();
441 update_panels();
442 doupdate();
443 return; 443 return;
444 } 444 }
445 445
446 void scr_DrawRoster(void) 446 void scr_DrawRoster(void)
447 { 447 {
535 mvwprintw(rosterWnd, i, 0, " %c[%c] %s", pending, status, name); 535 mvwprintw(rosterWnd, i, 0, " %c[%c] %s", pending, status, name);
536 536
537 i++; 537 i++;
538 } 538 }
539 539
540 update_panels();
541 doupdate();
542 }
543
544 void scr_WriteMessage(const char *jid, const char *text, char *prefix)
545 {
546 scr_WriteInWindow(jid, text, TRUE, prefix, FALSE);
547 }
548
549 void scr_WriteIncomingMessage(const char *jidfrom, const char *text)
550 {
551 // FIXME expand tabs / filter out special chars...
552 scr_WriteMessage(jidfrom, text, "<== ");
553 top_panel(inputPanel); 540 top_panel(inputPanel);
554 update_panels(); 541 update_panels();
555 doupdate(); 542 doupdate();
556 } 543 }
557 544
545 void scr_WriteMessage(const char *jid, const char *text, char *prefix)
546 {
547 scr_WriteInWindow(jid, text, TRUE, prefix, FALSE);
548 }
549
550 void scr_WriteIncomingMessage(const char *jidfrom, const char *text)
551 {
552 // FIXME expand tabs / filter out special chars...
553 scr_WriteMessage(jidfrom, text, "<== ");
554 update_panels();
555 doupdate();
556 }
557
558 void scr_WriteOutgoingMessage(const char *jidto, const char *text) 558 void scr_WriteOutgoingMessage(const char *jidto, const char *text)
559 { 559 {
560 scr_WriteMessage(jidto, text, "--> "); 560 scr_WriteMessage(jidto, text, "--> ");
561 scr_ShowWindow(jidto); 561 scr_ShowWindow(jidto);
562 top_panel(inputPanel);
563 } 562 }
564 563
565 int scr_Getch(void) 564 int scr_Getch(void)
566 { 565 {
567 int ch; 566 int ch;