comparison mcabber/src/screen.c @ 1487:f61ed2466f7c

Minor style upgrade s/getprefixwidth/scr_getprefixwidth/
author Mikael Berthe <mikael@lilotux.net>
date Sun, 20 Apr 2008 17:01:24 +0200
parents f83a51eaa5ed
children b393b8cee171
comparison
equal deleted inserted replaced
1486:f83a51eaa5ed 1487:f61ed2466f7c
841 { 841 {
842 guint n = settings_opt_get_int("time_prefix"); 842 guint n = settings_opt_get_int("time_prefix");
843 return spectimeprefixes[(n < 3 ? n : 0)]; 843 return spectimeprefixes[(n < 3 ? n : 0)];
844 } 844 }
845 845
846 guint getprefixwidth(void) 846 guint scr_getprefixwidth(void)
847 { 847 {
848 guint n = settings_opt_get_int("time_prefix"); 848 guint n = settings_opt_get_int("time_prefix");
849 return timepreflengths[(n < 3 ? n : 0)]; 849 return timepreflengths[(n < 3 ? n : 0)];
850 } 850 }
851 851
976 tmp->bd=wb->bd; 976 tmp->bd=wb->bd;
977 g_free(id); 977 g_free(id);
978 } else { // Load buddy history from file (if enabled) 978 } else { // Load buddy history from file (if enabled)
979 tmp->bd = g_new0(buffdata, 1); 979 tmp->bd = g_new0(buffdata, 1);
980 hlog_read_history(title, &tmp->bd->hbuf, 980 hlog_read_history(title, &tmp->bd->hbuf,
981 maxX - Roster_Width - getprefixwidth()); 981 maxX - Roster_Width - scr_getprefixwidth());
982 } 982 }
983 983
984 id = g_strdup(title); 984 id = g_strdup(title);
985 mc_strtolower(id); 985 mc_strtolower(id);
986 g_hash_table_insert(winbufhash, id, tmp); 986 g_hash_table_insert(winbufhash, id, tmp);
1058 hbb_line **lines, *line; 1058 hbb_line **lines, *line;
1059 GList *hbuf_head; 1059 GList *hbuf_head;
1060 int color; 1060 int color;
1061 1061
1062 width = getmaxx(win_entry->win); 1062 width = getmaxx(win_entry->win);
1063 prefixwidth = getprefixwidth(); 1063 prefixwidth = scr_getprefixwidth();
1064 prefixwidth = MIN(prefixwidth, sizeof pref); 1064 prefixwidth = MIN(prefixwidth, sizeof pref);
1065 1065
1066 // Should the window be empty? 1066 // Should the window be empty?
1067 if (win_entry->bd->cleared) { 1067 if (win_entry->bd->cleared) {
1068 werase(win_entry->win); 1068 werase(win_entry->win);
1325 mucnicklen = strlen(nicklocaltmp); 1325 mucnicklen = strlen(nicklocaltmp);
1326 g_free(nicklocaltmp); 1326 g_free(nicklocaltmp);
1327 g_free(nicktmp); 1327 g_free(nicktmp);
1328 } 1328 }
1329 hbuf_add_line(&win_entry->bd->hbuf, text_locale, timestamp, prefix_flags, 1329 hbuf_add_line(&win_entry->bd->hbuf, text_locale, timestamp, prefix_flags,
1330 maxX - Roster_Width - getprefixwidth(), num_history_blocks, 1330 maxX - Roster_Width - scr_getprefixwidth(), num_history_blocks,
1331 mucnicklen); 1331 mucnicklen);
1332 g_free(text_locale); 1332 g_free(text_locale);
1333 1333
1334 if (win_entry->bd->cleared) { 1334 if (win_entry->bd->cleared) {
1335 win_entry->bd->cleared = FALSE; 1335 win_entry->bd->cleared = FALSE;
1531 // is added 1531 // is added
1532 buddylist_build(); 1532 buddylist_build();
1533 1533
1534 // Init prev_chatwidth; this variable will be used to prevent us 1534 // Init prev_chatwidth; this variable will be used to prevent us
1535 // from rewrapping buffers when the width doesn't change. 1535 // from rewrapping buffers when the width doesn't change.
1536 prev_chatwidth = maxX - Roster_Width - getprefixwidth(); 1536 prev_chatwidth = maxX - Roster_Width - scr_getprefixwidth();
1537 // Wrap existing status buffer lines 1537 // Wrap existing status buffer lines
1538 hbuf_rebuild(&statushbuf, prev_chatwidth); 1538 hbuf_rebuild(&statushbuf, prev_chatwidth);
1539 1539
1540 #ifndef UNICODE 1540 #ifndef UNICODE
1541 if (utf8_mode) 1541 if (utf8_mode)
1585 if (wbp->panel) 1585 if (wbp->panel)
1586 replace_panel(wbp->panel, wbp->win); 1586 replace_panel(wbp->panel, wbp->win);
1587 // Redo line wrapping 1587 // Redo line wrapping
1588 wbp->bd->top = hbuf_previous_persistent(wbp->bd->top); 1588 wbp->bd->top = hbuf_previous_persistent(wbp->bd->top);
1589 1589
1590 new_chatwidth = maxX - Roster_Width - getprefixwidth(); 1590 new_chatwidth = maxX - Roster_Width - scr_getprefixwidth();
1591 if (new_chatwidth != prev_chatwidth) 1591 if (new_chatwidth != prev_chatwidth)
1592 hbuf_rebuild(&wbp->bd->hbuf, new_chatwidth); 1592 hbuf_rebuild(&wbp->bd->hbuf, new_chatwidth);
1593 } 1593 }
1594 1594
1595 // scr_Resize() 1595 // scr_Resize()
1622 // Resize/move special status buffer 1622 // Resize/move special status buffer
1623 if (statusWindow) 1623 if (statusWindow)
1624 resize_win_buffer(NULL, statusWindow, &dim); 1624 resize_win_buffer(NULL, statusWindow, &dim);
1625 1625
1626 // Update prev_chatwidth, now that all buffers have been resized 1626 // Update prev_chatwidth, now that all buffers have been resized
1627 prev_chatwidth = maxX - Roster_Width - getprefixwidth(); 1627 prev_chatwidth = maxX - Roster_Width - scr_getprefixwidth();
1628 1628
1629 // Refresh current buddy window 1629 // Refresh current buddy window
1630 if (chatmode) 1630 if (chatmode)
1631 scr_ShowBuddyWindow(); 1631 scr_ShowBuddyWindow();
1632 } 1632 }