aboutsummaryrefslogtreecommitdiff
path: root/src/hci/mucurses/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/hci/mucurses/widgets')
-rw-r--r--src/hci/mucurses/widgets/editbox.c11
-rw-r--r--src/hci/mucurses/widgets/label.c9
2 files changed, 7 insertions, 13 deletions
diff --git a/src/hci/mucurses/widgets/editbox.c b/src/hci/mucurses/widgets/editbox.c
index 79e7cdd..c024688 100644
--- a/src/hci/mucurses/widgets/editbox.c
+++ b/src/hci/mucurses/widgets/editbox.c
@@ -39,10 +39,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/**
* Draw text box widget
*
- * @v widgets Text widget set
* @v widget Text widget
*/
-static void draw_editbox ( struct widgets *widgets, struct widget *widget ) {
+static void draw_editbox ( struct widget *widget ) {
struct edit_box *box = container_of ( widget, struct edit_box, widget );
const char *content = *(box->string.buf);
size_t width = widget->width;
@@ -79,21 +78,19 @@ static void draw_editbox ( struct widgets *widgets, struct widget *widget ) {
/* Print box content and move cursor */
color_set ( CPAIR_EDIT, NULL );
- mvwprintw ( widgets->win, widget->row, widget->col, "%s", buf );
- wmove ( widgets->win, widget->row, ( widget->col + cursor_offset ) );
+ mvprintw ( widget->row, widget->col, "%s", buf );
+ move ( widget->row, ( widget->col + cursor_offset ) );
color_set ( CPAIR_NORMAL, NULL );
}
/**
* Edit text box widget
*
- * @v widgets Text widget set
* @v widget Text widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
*/
-static int edit_editbox ( struct widgets *widgets __unused,
- struct widget *widget, int key ) {
+static int edit_editbox ( struct widget *widget, int key ) {
struct edit_box *box = container_of ( widget, struct edit_box, widget );
return edit_string ( &box->string, key );
diff --git a/src/hci/mucurses/widgets/label.c b/src/hci/mucurses/widgets/label.c
index 29645a6..29057f0 100644
--- a/src/hci/mucurses/widgets/label.c
+++ b/src/hci/mucurses/widgets/label.c
@@ -36,10 +36,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
/**
* Draw text label widget
*
- * @v widgets Text widget set
* @v widget Text widget
*/
-static void draw_label ( struct widgets *widgets, struct widget *widget ) {
+static void draw_label ( struct widget *widget ) {
struct label *label = container_of ( widget, struct label, widget );
unsigned int width = widget->width;
unsigned int col = widget->col;
@@ -51,20 +50,18 @@ static void draw_label ( struct widgets *widgets, struct widget *widget ) {
/* Print label content */
attron ( A_BOLD );
- mvwprintw ( widgets->win, widget->row, col, "%s", text );
+ mvprintw ( widget->row, col, "%s", text );
attroff ( A_BOLD );
}
/**
* Edit text label widget
*
- * @v widgets Text widget set
* @v widget Text widget
* @v key Key pressed by user
* @ret key Key returned to application, or zero
*/
-static int edit_label ( struct widgets *widgets __unused,
- struct widget *widget __unused, int key ) {
+static int edit_label ( struct widget *widget __unused, int key ) {
/* Cannot be edited */
return key;