2 * dselect - Debian package maintenance user interface
3 * dselect.h - external definitions for this program
5 * Copyright © 1994,1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
6 * Copyright © 2001 Wichert Akkerman <wakkerma@debian.org>
8 * This is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
32 #include <dpkg/debug.h>
34 #include "dselect-curses.h"
36 #define DSELECT "dselect"
38 #define TOTAL_LIST_WIDTH 180
39 #define MAX_DISPLAY_INFO 120
41 struct helpmenuentry
{
43 const struct helpmessage
*msg
;
66 column(): title(nullptr), x(0), width(0) {}
67 void blank() { title
= nullptr; x
= 0; width
= 0; }
76 // Screen dimensions &c.
78 int title_height
, colheads_height
, list_height
;
79 int thisstate_height
, info_height
, whatinfo_height
;
80 int colheads_row
, thisstate_row
, info_row
, whatinfo_row
, list_row
;
82 int part_attr
[numscreenparts
];
88 void add_column(column
&col
, const char *title
, int width
);
89 void end_column(column
&col
, const char *title
);
90 void draw_column_head(const column
&col
);
91 void draw_column_sep(const column
&col
, int y
);
92 void draw_column_item(const column
&col
, int y
, const char *item
);
95 WINDOW
*listpad
, *infopad
, *colheadspad
, *thisstatepad
;
96 WINDOW
*titlewin
, *whatinfowin
, *querywin
;
97 // If listpad is null, then we have not started to display yet, and
98 // so none of the auto-displaying update routines need to display.
100 // Window resize handling (via SIGWINCH).
101 void resize_window();
103 int nitems
, ldrawnstart
, ldrawnend
, showinfo
;
104 int topofscreen
, leftofscreen
, cursorline
;
105 int infotopofscreen
, infolines
;
107 char searchstring
[128];
109 virtual void setheights();
112 void displayhelp(const struct helpmenuentry
*menu
, int key
);
113 void displayerror(const char *str
);
116 void redrawitemsrange(int start
/*inclusive*/, int end
/*exclusive*/);
117 void redraw1item(int index
);
120 void refreshcolheads();
121 void setcursor(int index
);
125 virtual void redraw1itemsel(int index
, int selected
) =0;
126 virtual void redrawcolheads() =0;
127 virtual void redrawthisstate() =0;
128 virtual void redrawinfo() =0;
129 virtual void redrawtitle() =0;
130 virtual void setwidths() =0;
131 virtual const char *itemname(int index
) =0;
132 virtual const struct helpmenuentry
*helpmenulist() =0;
134 virtual bool checksearch(char *str
);
135 virtual bool matchsearch(int index
);
136 void wordwrapinfo(int offset
, const char *string
);
140 keybindings
*bindings
;
146 void kd_scrollback();
148 void kd_scrollback1();
156 void kd_iscrollback();
157 void kd_iscrollon1();
158 void kd_iscrollback1();
160 void kd_searchagain();
166 explicit baselist(keybindings
*);
170 void displayhelp(const struct helpmenuentry
*menu
, int key
);
172 void mywerase(WINDOW
*win
);
177 extern bool expertmode
;
184 extern colordata color
[];
186 /* Evil recommends flag variable. */
187 extern bool manual_install
;
200 typedef urqresult
urqfunction(void);
201 urqfunction urq_list
, urq_quit
, urq_menu
;
202 urqfunction urq_setup
, urq_update
, urq_install
, urq_config
, urq_remove
;
204 #endif /* DSELECT_H */