/*
 * curses_xlat.h
 * $Id: curses_xlat.h,v 1.1 2004/07/09 23:25:41 cpressey Exp $
 */

#ifndef __CURSES_XLAT_H
#define __CURSES_XLAT_H

/*
 * Miscellaneous container for information that we must pass to callbacks.
 */
struct callback_data {
	struct curses_form *cf;
	struct dfui_form *f;
	struct curses_widget *row_start;
	int is_menu;
	int max_label_width;
	int total_label_width;
	int max_button_width;
	int total_button_width;
	int left_acc;
	int top_acc;
	int button_rows;
};

/*
 * Info structure attached to each curses form's userdata pointer.
 * Lets us get back to the underlying dfui form and track columns widths.
 */
struct curses_form_userdata {
	struct dfui_form *f;
	int widths[256];
};

int			 curses_form_create_widget_row(struct curses_form *,
				struct curses_widget *, struct dfui_dataset *,
				int, int, int);
struct curses_form	*curses_form_construct_from_dfui_form(struct dfui_form *);
struct curses_form	*curses_form_construct_from_dfui_progress(struct dfui_progress *,
								  struct curses_widget **,
								  struct curses_widget **,
								  struct curses_widget **);
void			 curses_widgets_update_from_dfui_progress(struct dfui_progress *,
								  struct curses_widget *,
								  struct curses_widget *,
								  struct curses_widget *);
struct dfui_response	*response_construct_from_curses_form(struct dfui_form *,
							     struct curses_form *,
							     struct curses_widget *);

#endif /* !__CURSES_XLAT_H */
