Add note about reboot before 'make upgrade' step.
[dragonfly.git] / usr.sbin / installer / dfuife_curses / curses_form.h
blob94567736f15e0999c15563757fa3a568a1f61309
1 /*
2 * Copyright (c)2004 Cat's Eye Technologies. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
16 * Neither the name of Cat's Eye Technologies nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
35 * curses_form.h
36 * $Id: curses_form.h,v 1.4 2005/02/08 05:54:44 cpressey Exp $
39 #ifndef __CURSES_FORM_H
40 #define __CURSES_FORM_H
42 #include <ncurses.h>
43 #include <panel.h>
45 #include "curses_widget.h"
47 struct curses_form {
48 struct curses_widget *widget_head; /* chain of widgets in form */
49 struct curses_widget *widget_tail;
50 struct curses_widget *widget_focus; /* currently selected widget */
52 PANEL *pan;
53 WINDOW *win;
55 unsigned int left; /* column of left edge of form, 0-based */
56 unsigned int top; /* row of top edge of form, 0-based */
57 unsigned int height; /* height of form in rows, not incl border */
58 unsigned int width; /* width of form in columns, not incl border */
60 unsigned int x_offset; /* first displayed col (horiz scrolling) */
61 unsigned int y_offset; /* first displayed row (vertical scrolling) */
62 unsigned int int_width; /* internal width (horizontal scrolling) */
63 unsigned int int_height; /* internal height (vertical scrolling) */
65 unsigned int want_x; /* For up/down row: remember where we */
66 unsigned int want_y; /* "want" to be, for natural navigation */
68 char *title; /* text displayed in title bar of form */
70 void *userdata; /* misc pointer */
71 int cleanup; /* are we responsible for freeing userdata? */
73 char *help_text; /* if non-NULL, text shown in help window */
76 struct curses_form *curses_form_new(const char *);
77 void curses_form_free(struct curses_form *);
78 struct curses_widget *curses_form_widget_add(struct curses_form *,
79 unsigned int, unsigned int,
80 unsigned int, widget_t,
81 const char *,
82 unsigned int, unsigned int);
83 struct curses_widget *curses_form_widget_insert_after(struct curses_widget *,
84 unsigned int, unsigned int,
85 unsigned int, widget_t,
86 const char *,
87 unsigned int, unsigned int);
88 void curses_form_widget_remove(struct curses_widget *);
89 struct curses_widget *curses_form_widget_at(struct curses_form *,
90 unsigned int, unsigned int);
91 int curses_form_widget_first_row(struct curses_form *);
92 int curses_form_widget_last_row(struct curses_form *);
93 struct curses_widget *curses_form_widget_first_on_row(struct curses_form *,
94 unsigned int);
95 struct curses_widget *curses_form_widget_closest_on_row(struct curses_form *,
96 unsigned int, unsigned int);
97 int curses_form_widget_count_above(struct curses_form *,
98 struct curses_widget *);
99 int curses_form_widget_count_below(struct curses_form *,
100 struct curses_widget *);
101 int curses_form_descriptive_labels_add(struct curses_form *,
102 const char *, unsigned int, unsigned int, unsigned int);
103 void curses_form_finalize(struct curses_form *);
104 void curses_form_draw(struct curses_form *);
105 void curses_form_refresh(struct curses_form *);
106 void curses_form_focus_skip_forward(struct curses_form *);
107 void curses_form_focus_skip_backward(struct curses_form *);
108 void curses_form_advance(struct curses_form *);
109 void curses_form_retreat(struct curses_form *);
110 void curses_form_advance_row(struct curses_form *);
111 void curses_form_retreat_row(struct curses_form *);
112 void curses_form_scroll_to(struct curses_form *, unsigned int, unsigned int);
113 void curses_form_scroll_delta(struct curses_form *, int, int);
114 int curses_form_widget_is_visible(struct curses_widget *);
115 void curses_form_widget_ensure_visible(struct curses_widget *);
116 struct curses_widget *curses_form_frob(struct curses_form *);
118 int cb_click_close_form(struct curses_widget *);
120 #endif /* !__CURSES_FORM_H */