summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/display.h18
-rw-r--r--src/main.c6
-rw-r--r--src/ui.c (renamed from src/display.c)22
-rw-r--r--src/ui.h18
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
diff --git a/src/main.c b/src/main.c
index 35673d6..c12dfd9 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}
diff --git a/src/display.c b/src/ui.c
index 78b40f2..6b80763 100644
--- a/src/display.c
+++ b/src/ui.c
@@ -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