1 /*
2  * Copyright (c) 2010, 2011 Ryan Flannery <ryan.flannery@gmail.com>
3  *
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef PAINT_H
18 #define PAINT_H
19 
20 #include <curses.h>
21 #include <math.h>
22 #include <string.h>
23 #include <stdarg.h>
24 #include <stdio.h>
25 #include <time.h>
26 
27 #include "enums.h"
28 #include "meta_info.h"
29 #include "player.h"
30 #include "playlist.h"
31 #include "uinterface.h"
32 #include "vitunes.h"
33 
34 #include "compat.h"
35 
36 /* colors used by paint - each of these will be a number for a COLOR_PAIR */
37 typedef struct {
38    /* visual dividers of windows */
39    int   bars;
40 
41    /* individual windows */
42    int   player;
43    int   status;
44    int   library;
45    int   playlist;
46 
47    /* error/info messages */
48    int   errors;
49    int   messages;
50 
51    /* empty rows in library and playlist window */
52    int   tildas_library;
53    int   tildas_playlist;
54 
55    /* currently playing rows in the library & playlist windows */
56    int   playing_library;
57    int   playing_playlist;
58 
59    /* current row in inactive window */
60    int   current_inactive;
61 
62    /* individual fields in the playlist window */
63    int   cinfos[MI_NUM_CINFO];
64    bool  cinfos_set[MI_NUM_CINFO];
65 
66 } _colors;
67 extern _colors colors;
68 
69 /* routines for painting each window */
70 void paint_status_bar();
71 void paint_player();
72 void paint_library();
73 void paint_playlist();
74 void paint_borders();
75 void paint_all();
76 
77 extern bool showing_file_info;
78 void paint_playlist_file_info(const meta_info *m);
79 
80 /* routines for painting errors/messages in the command/status window */
81 void paint_error(char *fmt, ...);
82 void paint_message(char *fmt, ...);
83 
84 /* for setting up and working with the colors */
85 void paint_setup_colors();
86 int  paint_str2item(const char *str);
87 int  paint_str2color(const char *str);
88 
89 #endif
90