diff options
| author | Mario Kilies <MarioKilies@GMX.net> | 2011-01-13 22:14:28 +0100 |
|---|---|---|
| committer | Mario Kilies <MarioKilies@GMX.net> | 2011-01-13 22:14:28 +0100 |
| commit | 1cf0350c2bc286e56b3b71d19fb03e080e2e67cf (patch) | |
| tree | 39b14a08d4bff79ebf5e86fa489e0cad99c5d5f0 /src | |
| parent | bd75e455a55c6e14c3f6eaf92308f4df0ce3bd2c (diff) | |
Moved display.[ch] to ui.[ch].
Diffstat (limited to 'src')
| -rw-r--r-- | src/display.h | 18 | ||||
| -rw-r--r-- | src/main.c | 6 | ||||
| -rw-r--r-- | src/ui.c (renamed from src/display.c) | 22 | ||||
| -rw-r--r-- | src/ui.h | 18 |
4 files changed, 32 insertions, 32 deletions
diff --git a/src/display.h b/src/display.h deleted file mode 100644 index 5f31a63..0000000 --- a/src/display.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef OXEN_DISPLAY_H -#define OXEN_DISPLAY_H - -#include <curses.h> -#include "card.h" -#include "cardstack.h" -#include "tablestacks.h" -#include "hand.h" -#include "player_name_open_card_tuple.h" - -void display_window_table_cards(const tablestacks ts, const bool highlight, const uint8_t highlighted_stack); -void display_window_stack_points(const tablestacks ts); -void display_window_current_state(const player_name_open_card_tuple pnoc[], const uint8_t num_players, const uint8_t active_player, const uint32_t score); -void display_window_hand_cards(const hand h, const bool highlight, const uint8_t highlighted_card); -void display_init(void); -void display_fini(void); - -#endif // OXEN_DISPLAY_H @@ -2,12 +2,12 @@ #include <stdlib.h> #include <unistd.h> #include <curses.h> -#include "display.h" +#include "ui.h" int main(int argc, char **argv) { - display_init(); - display_fini(); + ui_init(); + ui_fini(); return EXIT_SUCCESS; } @@ -1,4 +1,4 @@ -#include "display.h" +#include "ui.h" #include "cardstack.h" // Definition of ncurses color pair identifiers @@ -121,7 +121,7 @@ static void draw_cardstack(WINDOW *w, const uint8_t row, const uint8_t col, cons * @param[in] highlight If true, a stack will be highlighted * @param[in] highlighted_stack The stack to highlight. Only used, if highlight is true */ -void display_window_table_cards(const tablestacks ts, const bool highlight, const uint8_t highlighted_stack) +void ui_display_wnd_table_cards(const tablestacks ts, const bool highlight, const uint8_t highlighted_stack) { wattron(w_table_cards, A_BOLD); mvwprintw(w_table_cards, 0, 2, "Table Cards:"); @@ -148,7 +148,7 @@ void display_window_table_cards(const tablestacks ts, const bool highlight, cons * Displays the stack points window. * @param[in] ts The table stacks used for calculation of stack points */ -void display_window_stack_points(const tablestacks ts) +void ui_display_wnd_stack_points(const tablestacks ts) { wattron(w_stack_points, A_BOLD); mvwprintw(w_stack_points, 0, 0, "Pts:"); @@ -169,7 +169,7 @@ void display_window_stack_points(const tablestacks ts) * @param[in] active_players The currently active player * @param[in] score The players score */ -void display_window_current_state(const player_name_open_card_tuple pnoc[], const uint8_t num_players, const uint8_t active_player, const uint32_t score) +void ui_display_wnd_current_state(const player_name_open_card_tuple pnoc[], const uint8_t num_players, const uint8_t active_player, const uint32_t score) { wattron(w_current_state, A_BOLD); mvwprintw(w_current_state, 0, 0, "Current state:"); @@ -208,7 +208,7 @@ void display_window_current_state(const player_name_open_card_tuple pnoc[], cons * @param[in] highlight If true, a card will be highlighted * @param[in] highlighted_card The card to highlight. Only used, if highlight is true */ -void display_window_hand_cards(const hand h, const bool highlight, const uint8_t highlighted_card) +void ui_display_wnd_hand_cards(const hand h, const bool highlight, const uint8_t highlighted_card) { wattron(w_hand_cards, A_BOLD); mvwprintw(w_hand_cards, 0, 0, "Hand Cards:"); @@ -237,7 +237,7 @@ void display_window_hand_cards(const hand h, const bool highlight, const uint8_t /** * Initializes ncurses. */ -void display_init(void) +void ui_init(void) { initscr(); // Start curses mode if (TRUE == has_colors()) @@ -293,10 +293,10 @@ void display_init(void) // Draw user interface mvvline(0, 22, ACS_VLINE, 21); // Vertical line refresh(); - display_window_table_cards(ts, true, 1); - display_window_stack_points(ts); - display_window_current_state(pnoc, num_players, 2, score); - display_window_hand_cards(h, true, 8); + ui_display_wnd_table_cards(ts, true, 1); + ui_display_wnd_stack_points(ts); + ui_display_wnd_current_state(pnoc, num_players, 2, score); + ui_display_wnd_hand_cards(h, true, 8); sleep(4); } @@ -304,7 +304,7 @@ void display_init(void) /** * Finalizes ncurses. */ -void display_fini(void) +void ui_fini(void) { delwin(w_table_cards); delwin(w_stack_points); diff --git a/src/ui.h b/src/ui.h new file mode 100644 index 0000000..3a63ddb --- /dev/null +++ b/src/ui.h @@ -0,0 +1,18 @@ +#ifndef OXEN_UI_H +#define OXEN_UI_H + +#include <curses.h> +#include "card.h" +#include "cardstack.h" +#include "tablestacks.h" +#include "hand.h" +#include "player_name_open_card_tuple.h" + +void ui_display_wnd_table_cards(const tablestacks ts, const bool highlight, const uint8_t highlighted_stack); +void ui_display_wnd_stack_points(const tablestacks ts); +void ui_display_wnd_current_state(const player_name_open_card_tuple pnoc[], const uint8_t num_players, const uint8_t active_player, const uint32_t score); +void ui_display_wnd_hand_cards(const hand h, const bool highlight, const uint8_t highlighted_card); +void ui_init(void); +void ui_fini(void); + +#endif // OXEN_UI_H |
