]> cygwin.com Git - cygwin-apps/setup.git/blob - choose.h
2001-11-10 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / choose.h
1 /*
2 * Copyright (c) 2000, Red Hat, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <rbtcollins@hotmail.com>
13 *
14 */
15
16 #ifndef _CHOOSE_H_
17 #define _CHOOSE_H_
18
19 #include "ini.h"
20
21 #define CATEGORY_EXPANDED 0
22 #define CATEGORY_COLLAPSED 1
23
24 typedef enum
25 {
26 /* Note that the next four items must be in the same order as the
27 TRUST items in ini.h. */
28 ACTION_UNKNOWN,
29 ACTION_PREV,
30 ACTION_CURR,
31 ACTION_TEST,
32 ACTION_SKIP,
33 ACTION_UNINSTALL,
34 ACTION_REDO,
35 ACTION_SRC_ONLY,
36 ACTION_LAST,
37 ACTION_ERROR,
38 /* Use ACTION_SAME when you want to leve the current version unaltered
39 * even if it that version is not in setup.ini
40 */
41 ACTION_SAME = 100,
42 /* Actions taken when installed version matches the selected version. */
43 ACTION_SAME_PREV = ACTION_PREV + ACTION_SAME,
44 ACTION_SAME_CURR = ACTION_CURR + ACTION_SAME,
45 ACTION_SAME_TEST = ACTION_TEST + ACTION_SAME,
46 /* Last action. */
47 ACTION_SAME_LAST
48 } actions;
49
50 typedef enum
51 {
52 VIEW_UNKNOWN,
53 VIEW_PACKAGE_FULL,
54 VIEW_PACKAGE,
55 VIEW_CATEGORY,
56 NVIEW
57 } views;
58
59 struct _header
60 {
61 const char *text;
62 int slen;
63 int width;
64 int x;
65 };
66
67 #ifdef __cplusplus
68
69 typedef class _view view;
70
71 class pick_line
72 {
73 public:
74 void set_line (Package *_pkg);
75 void set_line (Category *_cat);
76 void paint (HDC hdc, int x, int y, int row, int show_cat);
77 Package *get_pkg (void) { return pkg; };
78 Category *get_category (void) { return cat; };
79 int click (int x);
80 private:
81 Package *pkg;
82 Category *cat;
83 };
84
85 class _view
86 {
87 public:
88 int num_columns;
89 views get_view_mode () { return view_mode; };
90 void set_view_mode(views _mode);
91 struct _header *headers;
92 _view (views mode, HDC dc);
93 const char *mode_caption ();
94 void insert_pkg (Package *);
95 void insert_category (Category *, int);
96 void clear_view (void);
97 int click (int row, int x);
98 int current_col;
99 int new_col;
100 int src_col;
101 int cat_col;
102 int pkg_col;
103 int last_col;
104 pick_line * lines;
105 int nlines;
106
107 private:
108 views view_mode;
109 void set_headers (void);
110 void init_headers (HDC dc);
111 void insert_at (int, pick_line);
112 void insert_under (int linen, pick_line line);
113
114 };
115 #endif /* __cplusplus */
116 #endif /* _CHOOSE_H_ */
This page took 0.098019 seconds and 6 git commands to generate.