]> cygwin.com Git - cygwin-apps/setup.git/blob - choose.h
2001-11-29 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 class Category;
20 class packagemeta;
21
22 #define CATEGORY_EXPANDED 0
23 #define CATEGORY_COLLAPSED 1
24
25 typedef enum
26 {
27 /* Note that the next four items must be in the same order as the
28 TRUST items in ini.h. */
29 ACTION_UNKNOWN,
30 ACTION_PREV,
31 ACTION_CURR,
32 ACTION_TEST,
33 ACTION_SKIP,
34 ACTION_UNINSTALL,
35 ACTION_REDO,
36 ACTION_SRC_ONLY,
37 ACTION_LAST,
38 ACTION_ERROR,
39 /* Use ACTION_SAME when you want to leve the current version unaltered
40 * even if it that version is not in setup.ini
41 */
42 ACTION_SAME = 100,
43 /* Actions taken when installed version matches the selected version. */
44 ACTION_SAME_PREV = ACTION_PREV + ACTION_SAME,
45 ACTION_SAME_CURR = ACTION_CURR + ACTION_SAME,
46 ACTION_SAME_TEST = ACTION_TEST + ACTION_SAME,
47 /* Last action. */
48 ACTION_SAME_LAST
49 }
50 actions;
51
52 typedef enum
53 {
54 VIEW_UNKNOWN,
55 VIEW_PACKAGE_FULL,
56 VIEW_PACKAGE,
57 VIEW_CATEGORY,
58 NVIEW
59 }
60 views;
61
62 struct _header
63 {
64 const char *text;
65 int slen;
66 int width;
67 int x;
68 };
69
70 #ifdef __cplusplus
71
72 typedef class _view view;
73
74 class pick_line
75 {
76 public:
77 void set_line (packagemeta * _pkg);
78 void set_line (Category * _cat);
79 void paint (HDC hdc, int x, int y, int row, int show_cat);
80 packagemeta *get_pkg (void)
81 {
82 return pkg;
83 };
84 Category *get_category (void)
85 {
86 return cat;
87 };
88 int click (int x);
89 private:
90 packagemeta * pkg;
91 Category *cat;
92 };
93
94 class _view
95 {
96 public:
97 int num_columns;
98 views get_view_mode ()
99 {
100 return view_mode;
101 };
102 void set_view_mode (views _mode);
103 struct _header *headers;
104 _view (views mode, HDC dc);
105 const char *mode_caption ();
106 void insert_pkg (packagemeta &);
107 void insert_category (Category *, int);
108 void clear_view (void);
109 int click (int row, int x);
110 int current_col;
111 int new_col;
112 int src_col;
113 int cat_col;
114 int pkg_col;
115 int last_col;
116 pick_line *lines;
117 int nlines;
118
119 private:
120 views view_mode;
121 void set_headers (void);
122 void init_headers (HDC dc);
123 void insert_at (int, pick_line);
124 void insert_under (int linen, pick_line line);
125
126 };
127 #endif /* __cplusplus */
128 #endif /* _CHOOSE_H_ */
This page took 0.04423 seconds and 6 git commands to generate.