Amit Arora | 39f2954 | 2010-09-14 12:03:22 +0530 | [diff] [blame] | 1 | /******************************************************************************* |
Amit Kucheria | c0e17fc | 2011-01-17 09:35:52 +0200 | [diff] [blame] | 2 | * Copyright (C) 2010, Linaro Limited. |
Amit Arora | 39f2954 | 2010-09-14 12:03:22 +0530 | [diff] [blame] | 3 | * |
| 4 | * This file is part of PowerDebug. |
| 5 | * |
| 6 | * All rights reserved. This program and the accompanying materials |
| 7 | * are made available under the terms of the Eclipse Public License v1.0 |
| 8 | * which accompanies this distribution, and is available at |
| 9 | * http://www.eclipse.org/legal/epl-v10.html |
| 10 | * |
| 11 | * Contributors: |
| 12 | * Amit Arora <amit.arora@linaro.org> (IBM Corporation) |
| 13 | * - initial API and implementation |
| 14 | *******************************************************************************/ |
| 15 | |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 16 | #include "powerdebug.h" |
Amit Arora | 1755278 | 2010-12-02 12:23:14 +0530 | [diff] [blame] | 17 | #include "regulator.h" |
Amit Arora | ed3e565 | 2010-10-27 12:02:53 +0530 | [diff] [blame] | 18 | #include "display.h" |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 19 | |
| 20 | #define print(w, x, y, fmt, args...) do { mvwprintw(w, y, x, fmt, ##args); } while (0) |
| 21 | #define NUM_FOOTER_ITEMS 5 |
| 22 | |
Daniel Lezcano | eeb1376 | 2011-03-26 22:06:17 +0100 | [diff] [blame] | 23 | enum { PT_COLOR_DEFAULT = 1, |
| 24 | PT_COLOR_HEADER_BAR, |
| 25 | PT_COLOR_ERROR, |
| 26 | PT_COLOR_RED, |
| 27 | PT_COLOR_YELLOW, |
| 28 | PT_COLOR_GREEN, |
| 29 | PT_COLOR_BRIGHT, |
| 30 | PT_COLOR_BLUE, |
| 31 | }; |
| 32 | |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 33 | static WINDOW *header_win; |
| 34 | static WINDOW *regulator_win; |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 35 | static WINDOW *clock_win; |
| 36 | static WINDOW *sensor_win; |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 37 | static WINDOW *selected_win; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 38 | static WINDOW *footer_win; |
| 39 | |
| 40 | int maxx, maxy; |
| 41 | char footer_items[NUM_FOOTER_ITEMS][64]; |
| 42 | |
Daniel Lezcano | d5a2c6d | 2011-03-23 14:37:38 +0100 | [diff] [blame] | 43 | static char *win_names[TOTAL_FEATURE_WINS] = { |
| 44 | "Clocks", |
| 45 | "Regulators", |
| 46 | "Sensors" |
| 47 | }; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 48 | |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 49 | /* "all" : Kill header and footer windows too ? */ |
| 50 | void killall_windows(int all) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 51 | { |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 52 | if (all && header_win) { |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 53 | delwin(header_win); |
| 54 | header_win = NULL; |
| 55 | } |
| 56 | if (regulator_win) { |
| 57 | delwin(regulator_win); |
| 58 | regulator_win = NULL; |
| 59 | } |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 60 | if (clock_win) { |
| 61 | delwin(clock_win); |
| 62 | clock_win = NULL; |
| 63 | } |
| 64 | if (sensor_win) { |
| 65 | delwin(sensor_win); |
| 66 | sensor_win = NULL; |
| 67 | } |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 68 | if (all && footer_win) { |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 69 | delwin(footer_win); |
| 70 | footer_win = NULL; |
| 71 | } |
| 72 | } |
| 73 | |
Daniel Lezcano | 3abd8b1 | 2011-03-26 22:06:15 +0100 | [diff] [blame] | 74 | static void display_fini(void) |
| 75 | { |
| 76 | endwin(); |
| 77 | } |
| 78 | |
Daniel Lezcano | ca17a72 | 2011-03-26 22:06:16 +0100 | [diff] [blame] | 79 | int display_init(void) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 80 | { |
Daniel Lezcano | ca17a72 | 2011-03-26 22:06:16 +0100 | [diff] [blame] | 81 | if (!initscr()) |
| 82 | return -1; |
| 83 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 84 | start_color(); |
Daniel Lezcano | ca17a72 | 2011-03-26 22:06:16 +0100 | [diff] [blame] | 85 | use_default_colors(); |
| 86 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 87 | keypad(stdscr, TRUE); |
| 88 | noecho(); |
| 89 | cbreak(); |
| 90 | curs_set(0); |
| 91 | nonl(); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 92 | |
Daniel Lezcano | ca17a72 | 2011-03-26 22:06:16 +0100 | [diff] [blame] | 93 | if (init_pair(PT_COLOR_DEFAULT, COLOR_WHITE, COLOR_BLACK) || |
| 94 | init_pair(PT_COLOR_ERROR, COLOR_BLACK, COLOR_RED) || |
| 95 | init_pair(PT_COLOR_HEADER_BAR, COLOR_WHITE, COLOR_BLACK) || |
| 96 | init_pair(PT_COLOR_YELLOW, COLOR_WHITE, COLOR_YELLOW) || |
| 97 | init_pair(PT_COLOR_GREEN, COLOR_WHITE, COLOR_GREEN) || |
| 98 | init_pair(PT_COLOR_BRIGHT, COLOR_WHITE, COLOR_BLACK) || |
| 99 | init_pair(PT_COLOR_BLUE, COLOR_WHITE, COLOR_BLUE) || |
| 100 | init_pair(PT_COLOR_RED, COLOR_WHITE, COLOR_RED)) |
| 101 | return -1; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 102 | |
Daniel Lezcano | ca17a72 | 2011-03-26 22:06:16 +0100 | [diff] [blame] | 103 | return atexit(display_fini); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 104 | } |
| 105 | |
Daniel Lezcano | 558a6d5 | 2011-03-23 14:37:41 +0100 | [diff] [blame] | 106 | void create_windows(int selectedwindow) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 107 | { |
| 108 | |
| 109 | getmaxyx(stdscr, maxy, maxx); |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 110 | killall_windows(1); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 111 | |
| 112 | header_win = subwin(stdscr, 1, maxx, 0, 0); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 113 | footer_win = subwin(stdscr, 1, maxx, maxy-1, 0); |
| 114 | |
| 115 | strcpy(footer_items[0], " Q (Quit) "); |
| 116 | strcpy(footer_items[1], " R (Refresh) "); |
| 117 | |
Amit Arora | 83ae6cb | 2010-12-02 12:22:19 +0530 | [diff] [blame] | 118 | if (selectedwindow == CLOCK) |
| 119 | strcpy(footer_items[2], " Other Keys: 'Left', 'Right', 'Up', 'Down', 'enter', " |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 120 | " '/', 'Esc' "); |
Amit Arora | 83ae6cb | 2010-12-02 12:22:19 +0530 | [diff] [blame] | 121 | else |
| 122 | strcpy(footer_items[2], " Other Keys: 'Left', 'Right' "); |
| 123 | |
| 124 | strcpy(footer_items[3], ""); |
| 125 | |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 126 | werase(stdscr); |
| 127 | refresh(); |
| 128 | |
| 129 | } |
| 130 | |
Daniel Lezcano | 558a6d5 | 2011-03-23 14:37:41 +0100 | [diff] [blame] | 131 | void create_selectedwindow(int selectedwindow) |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 132 | { |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 133 | WINDOW *win; |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 134 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 135 | killall_windows(0); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 136 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 137 | getmaxyx(stdscr, maxy, maxx); |
Amit Arora | 24ed7d1 | 2010-09-14 12:12:58 +0530 | [diff] [blame] | 138 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 139 | win = subwin(stdscr, maxy - 2, maxx, 1, 0); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 140 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 141 | switch (selectedwindow) { |
| 142 | case REGULATOR: regulator_win = win; |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 143 | break; |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 144 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 145 | case CLOCK: clock_win = win; |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 146 | break; |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 147 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 148 | case SENSOR: sensor_win = win; |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 149 | break; |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 150 | } |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 151 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 152 | selected_win = win; |
| 153 | |
| 154 | refresh(); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 155 | } |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 156 | |
Daniel Lezcano | 558a6d5 | 2011-03-23 14:37:41 +0100 | [diff] [blame] | 157 | void show_header(int selectedwindow) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 158 | { |
| 159 | int i, j = 0; |
Amit Kucheria | 0a4d019 | 2011-01-12 04:54:37 +0530 | [diff] [blame] | 160 | int curr_pointer = 0; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 161 | |
| 162 | wattrset(header_win, COLOR_PAIR(PT_COLOR_HEADER_BAR)); |
| 163 | wbkgd(header_win, COLOR_PAIR(PT_COLOR_HEADER_BAR)); |
| 164 | werase(header_win); |
| 165 | |
Amit Kucheria | 0a4d019 | 2011-01-12 04:54:37 +0530 | [diff] [blame] | 166 | print(header_win, curr_pointer, 0, "PowerDebug %s", VERSION); |
| 167 | curr_pointer += 20; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 168 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 169 | for (i = 0; i < TOTAL_FEATURE_WINS; i++) { |
| 170 | if (selectedwindow == i) |
| 171 | wattron(header_win, A_REVERSE); |
| 172 | else |
| 173 | wattroff(header_win, A_REVERSE); |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 174 | |
Amit Kucheria | 0a4d019 | 2011-01-12 04:54:37 +0530 | [diff] [blame] | 175 | print(header_win, curr_pointer, 0, " %s ", win_names[i]); |
| 176 | curr_pointer += strlen(win_names[i]) + 2; |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 177 | } |
| 178 | wrefresh(header_win); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 179 | werase(footer_win); |
| 180 | |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 181 | for (i = 0; i < NUM_FOOTER_ITEMS; i++) { |
| 182 | if (strlen(footer_items[i]) == 0) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 183 | continue; |
| 184 | wattron(footer_win, A_REVERSE); |
| 185 | print(footer_win, j, 0, "%s", footer_items[i]); |
| 186 | wattroff(footer_win, A_REVERSE); |
| 187 | j+= strlen(footer_items[i])+1; |
| 188 | } |
| 189 | wrefresh(footer_win); |
| 190 | } |
| 191 | |
| 192 | |
Daniel Lezcano | 833b63a | 2011-03-26 22:06:00 +0100 | [diff] [blame] | 193 | void show_regulator_info(struct regulator_info *reg_info, int nr_reg, int verbose) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 194 | { |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 195 | int i, count = 1; |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 196 | |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 197 | (void)verbose; |
Amit Arora | bf50db9 | 2010-10-07 14:09:05 +0530 | [diff] [blame] | 198 | |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 199 | werase(regulator_win); |
| 200 | wattron(regulator_win, A_BOLD); |
Amit Arora | c93e071 | 2010-10-07 13:51:53 +0530 | [diff] [blame] | 201 | print(regulator_win, 0, 0, "Name"); |
| 202 | print(regulator_win, 12, 0, "Status"); |
| 203 | print(regulator_win, 24, 0, "State"); |
| 204 | print(regulator_win, 36, 0, "Type"); |
| 205 | print(regulator_win, 48, 0, "Users"); |
| 206 | print(regulator_win, 60, 0, "Microvolts"); |
| 207 | print(regulator_win, 72, 0, "Min u-volts"); |
| 208 | print(regulator_win, 84, 0, "Max u-volts"); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 209 | wattroff(regulator_win, A_BOLD); |
| 210 | |
Daniel Lezcano | 833b63a | 2011-03-26 22:06:00 +0100 | [diff] [blame] | 211 | for (i = 0; i < nr_reg; i++) { |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 212 | int col = 0; |
| 213 | |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 214 | if ((i + 2) > (maxy-2)) |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 215 | break; |
| 216 | |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 217 | if (reg_info[i].num_users > 0) |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 218 | wattron(regulator_win, WA_BOLD); |
| 219 | else |
| 220 | wattroff(regulator_win, WA_BOLD); |
| 221 | |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 222 | print(regulator_win, col, count, "%s", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 223 | reg_info[i].name); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 224 | col += 12; |
| 225 | print(regulator_win, col, count, "%s", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 226 | reg_info[i].status); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 227 | col += 12; |
| 228 | print(regulator_win, col, count, "%s", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 229 | reg_info[i].state); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 230 | col += 12; |
| 231 | print(regulator_win, col, count, "%s", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 232 | reg_info[i].type); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 233 | col += 12; |
| 234 | print(regulator_win, col, count, "%d", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 235 | reg_info[i].num_users); |
Amit Arora | 6a943ec | 2010-10-07 11:49:25 +0530 | [diff] [blame] | 236 | col += 12; |
| 237 | print(regulator_win, col, count, "%d", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 238 | reg_info[i].microvolts); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 239 | col += 12; |
| 240 | print(regulator_win, col, count, "%d", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 241 | reg_info[i].min_microvolts); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 242 | col += 12; |
| 243 | print(regulator_win, col, count, "%d", |
Daniel Lezcano | 3bd64f0 | 2011-03-26 22:05:56 +0100 | [diff] [blame] | 244 | reg_info[i].max_microvolts); |
Amit Arora | 47fd918 | 2010-08-24 13:26:06 +0530 | [diff] [blame] | 245 | |
| 246 | count++; |
| 247 | } |
| 248 | wrefresh(regulator_win); |
| 249 | } |
| 250 | |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 251 | |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 252 | void print_clock_header(void) |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 253 | { |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 254 | werase(clock_win); |
| 255 | wattron(clock_win, A_BOLD); |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 256 | print(clock_win, 0, 0, "Name"); |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 257 | print(clock_win, 54, 0, "Flags"); |
| 258 | print(clock_win, 64, 0, "Rate"); |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 259 | print(clock_win, 72, 0, "Usecount"); |
Amit Arora | 04f9774 | 2010-11-16 11:28:57 +0530 | [diff] [blame] | 260 | print(clock_win, 84, 0, "Children"); |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 261 | wattroff(clock_win, A_BOLD); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 262 | wrefresh(clock_win); |
| 263 | } |
| 264 | |
| 265 | void print_sensor_header(void) |
| 266 | { |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 267 | werase(sensor_win); |
| 268 | wattron(sensor_win, A_BOLD); |
| 269 | print(sensor_win, 0, 0, "Name"); |
| 270 | print(sensor_win, 36, 0, "Temperature"); |
| 271 | wattroff(sensor_win, A_BOLD); |
| 272 | wattron(sensor_win, A_BLINK); |
| 273 | print(sensor_win, 0, 1, "Currently Sensor information available" |
Amit Kucheria | a0adae4 | 2011-01-12 10:54:23 -0600 | [diff] [blame] | 274 | " only in Dump mode!"); |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 275 | wattroff(sensor_win, A_BLINK); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 276 | wrefresh(sensor_win); |
| 277 | } |
| 278 | |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 279 | void print_one_clock(int line, char *str, int bold, int highlight) |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 280 | { |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 281 | if (bold) |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 282 | wattron(clock_win, WA_BOLD); |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 283 | if (highlight) |
| 284 | wattron(clock_win, WA_STANDOUT); |
| 285 | |
Amit Arora | 031263a | 2010-11-09 11:12:41 +0530 | [diff] [blame] | 286 | print(clock_win, 0, line + 1, "%s", str); |
| 287 | if (bold) |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 288 | wattroff(clock_win, WA_BOLD); |
Amit Arora | ac4e865 | 2010-11-09 11:16:53 +0530 | [diff] [blame] | 289 | if (highlight) |
| 290 | wattroff(clock_win, WA_STANDOUT); |
Amit Arora | 6e774cd | 2010-10-28 11:31:24 +0530 | [diff] [blame] | 291 | wrefresh(clock_win); |
Amit Arora | 728e0c9 | 2010-09-14 12:06:09 +0530 | [diff] [blame] | 292 | } |