summaryrefslogtreecommitdiff
path: root/testing/toxic/main.c
diff options
context:
space:
mode:
authorSean Qureshi <stqism@risingstormgames.com>2013-08-07 10:36:32 -0700
committerSean Qureshi <stqism@risingstormgames.com>2013-08-07 10:36:32 -0700
commitece3407c55c4616401e06272c06ae253cec3f615 (patch)
tree506fad7683a16ce6939183ef501c57d4ec7ecbc2 /testing/toxic/main.c
parent2b916b96bd46823afe28ff0a798a4995d0e99067 (diff)
Moved main.c to maaster
Diffstat (limited to 'testing/toxic/main.c')
-rw-r--r--testing/toxic/main.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/testing/toxic/main.c b/testing/toxic/main.c
index 2bf16769..27e3d858 100644
--- a/testing/toxic/main.c
+++ b/testing/toxic/main.c
@@ -22,7 +22,7 @@ extern int add_req(uint8_t *public_key); // XXX
22 22
23/* Holds status of chat windows */ 23/* Holds status of chat windows */
24char WINDOW_STATUS[MAX_WINDOW_SLOTS]; 24char WINDOW_STATUS[MAX_WINDOW_SLOTS];
25#define TOXICVER "0.1.0" //Will be moved to a -D flag later 25#define TOXICVER "0.1.0" //Will be moved to a -D flag later
26 26
27static ToxWindow windows[MAX_WINDOW_SLOTS]; 27static ToxWindow windows[MAX_WINDOW_SLOTS];
28static ToxWindow* prompt; 28static ToxWindow* prompt;
@@ -250,6 +250,7 @@ static void load_data(char *path)
250static void draw_bar() 250static void draw_bar()
251{ 251{
252 static int odd = 0; 252 static int odd = 0;
253 int blinkrate = 30;
253 254
254 attron(COLOR_PAIR(4)); 255 attron(COLOR_PAIR(4));
255 mvhline(LINES - 2, 0, '_', COLS); 256 mvhline(LINES - 2, 0, '_', COLS);
@@ -258,7 +259,7 @@ static void draw_bar()
258 move(LINES - 1, 0); 259 move(LINES - 1, 0);
259 260
260 attron(COLOR_PAIR(4) | A_BOLD); 261 attron(COLOR_PAIR(4) | A_BOLD);
261 printw(" TOXIC " TOXICVER " |"); 262 printw(" TOXIC " TOXICVER " |");
262 attroff(COLOR_PAIR(4) | A_BOLD); 263 attroff(COLOR_PAIR(4) | A_BOLD);
263 264
264 int i; 265 int i;
@@ -267,14 +268,13 @@ static void draw_bar()
267 if (i == active_window) 268 if (i == active_window)
268 attron(A_BOLD); 269 attron(A_BOLD);
269 270
270 odd = (odd+1) % 10; 271 odd = (odd+1) % blinkrate;
271 if (windows[i].blink && (odd < 5)) { 272 if (windows[i].blink && (odd < (blinkrate/2))) {
272 attron(COLOR_PAIR(3)); 273 attron(COLOR_PAIR(3));
273 } 274 }
274
275 printw(" %s", windows[i].title); 275 printw(" %s", windows[i].title);
276 if (windows[i].blink && (odd < 5)) { 276 if (windows[i].blink && (odd < (blinkrate/2))) {
277 attron(COLOR_PAIR(3)); 277 attroff(COLOR_PAIR(3));
278 } 278 }
279 if (i == active_window) { 279 if (i == active_window) {
280 attroff(A_BOLD); 280 attroff(A_BOLD);
@@ -376,9 +376,8 @@ int main(int argc, char *argv[])
376 ch = getch(); 376 ch = getch();
377 if (ch == '\t' || ch == KEY_BTAB) 377 if (ch == '\t' || ch == KEY_BTAB)
378 set_active_window(ch); 378 set_active_window(ch);
379 else if (ch != ERR) { 379 else if (ch != ERR)
380 a->onKey(a, ch); 380 a->onKey(a, ch);
381 }
382 } 381 }
383 return 0; 382 return 0;
384} 383}