]> cygwin.com Git - cygwin-apps/setup.git/blobdiff - choose.h
Use solver to check for problems and produce a list of package transactions
[cygwin-apps/setup.git] / choose.h
index 34477dc85fa6488271009cb2f86b069239914db7..46f0f359da743f01172002226c6032af46359142 100644 (file)
--- a/choose.h
+++ b/choose.h
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2000, Red Hat, Inc.
+ * Copyright (c) 2003 Robert Collins <rbtcollins@hotmail.com>
  *
  *     This program is free software; you can redistribute it and/or modify
  *     it under the terms of the GNU General Public License as published by
  *
  */
 
-#ifndef _CHOOSE_H_
-#define _CHOOSE_H_
+#ifndef SETUP_CHOOSE_H
+#define SETUP_CHOOSE_H
 
-class Category;
-class packagemeta;
+#include "proppage.h"
+#include "package_meta.h"
+#include "PickView.h"
 
-#define CATEGORY_EXPANDED  0
-#define CATEGORY_COLLAPSED 1
+#define DEFAULT_TIMER_ID   5   //value doesn't matter, as long as it's unique
+#define SEARCH_TIMER_DELAY 500 //in milliseconds
 
-typedef enum
-{
-  /* Note that the next four items must be in the same order as the
-     TRUST items in ini.h. */
-  ACTION_UNKNOWN,
-  ACTION_PREV,
-  ACTION_CURR,
-  ACTION_TEST,
-  ACTION_SKIP,
-  ACTION_UNINSTALL,
-  ACTION_REDO,
-  ACTION_SRC_ONLY,
-  ACTION_LAST,
-  ACTION_ERROR,
-  /* Use ACTION_SAME when you want to leve the current version unaltered
-   * even if it that version is not in setup.ini
-   */
-  ACTION_SAME = 100,
-  /* Actions taken when installed version matches the selected version. */
-  ACTION_SAME_PREV = ACTION_PREV + ACTION_SAME,
-  ACTION_SAME_CURR = ACTION_CURR + ACTION_SAME,
-  ACTION_SAME_TEST = ACTION_TEST + ACTION_SAME,
-  /* Last action. */
-  ACTION_SAME_LAST
-}
-actions;
-
-typedef enum
-{
-  VIEW_UNKNOWN,
-  VIEW_PACKAGE_FULL,
-  VIEW_PACKAGE,
-  VIEW_CATEGORY,
-  NVIEW
-}
-views;
+extern bool hasManualSelections;
 
-struct _header
+class ChooserPage:public PropertyPage
 {
-  const char *text;
-  int slen;
-  int width;
-  int x;
-};
+public:
+  ChooserPage ();
+  ~ChooserPage ();
 
-#ifdef __cplusplus
+  virtual bool OnMessageCmd (int id, HWND hwndctl, UINT code);
+  virtual INT_PTR CALLBACK OnMouseWheel (UINT message, WPARAM wParam,
+                                        LPARAM lParam);
+  virtual INT_PTR CALLBACK OnTimerMessage (UINT message, WPARAM wParam,
+                                                                                  LPARAM lparam);
 
-typedef class _view view;
+  bool Create ();
+  virtual void OnInit ();
+  virtual long OnNext ();
+  virtual long OnBack ();
+  virtual void OnActivate ();
+  virtual long OnUnattended ();
 
-class pick_line
-{
-public:
-  void set_line (packagemeta * _pkg);
-  void set_line (Category * _cat);
-  void paint (HDC hdc, int x, int y, int row, int show_cat);
-  packagemeta *get_pkg (void)
-  {
-    return pkg;
-  };
-  Category *get_category (void)
+  static void SetHwndDialog (HWND h)
   {
-    return cat;
-  };
-  int click (int x);
+    ins_dialog = h;
+  }
 private:
-    packagemeta * pkg;
-  Category *cat;
-};
+  void createListview ();
+  RECT getDefaultListViewSize();
+  void getParentRect (HWND parent, HWND child, RECT * r);
+  void keepClicked();
+  void changeTrust(trusts aTrust);
+  void logOnePackageResult(packagemeta const *aPkg);
+  void logResults();
+  void setPrompt(char const *aPrompt);
+  void PlaceDialog (bool);
 
-class _view
-{
-public:
-  int num_columns;
-  views get_view_mode ()
+  PickView *chooser;
+  static HWND ins_dialog;
+  bool cmd_show_set;
+  bool saved_geom;
+  bool saw_geom_change;
+  WINDOWPLACEMENT window_placement;
+  WINDOWPLACEMENT pre_chooser_placement;
+  UINT_PTR timer_id;
+  union writer
   {
-    return view_mode;
+    WINDOWPLACEMENT wp;
+    UINT wpi[sizeof (WINDOWPLACEMENT) / sizeof (UINT)];
   };
-  void set_view_mode (views _mode);
-  struct _header *headers;
-    _view (views mode, HDC dc);
-  const char *mode_caption ();
-  void insert_pkg (packagemeta &);
-  void insert_category (Category *, int);
-  void clear_view (void);
-  int click (int row, int x);
-  int current_col;
-  int new_col;
-  int src_col;
-  int cat_col;
-  int pkg_col;
-  int last_col;
-  pick_line *lines;
-  int nlines;
 
-private:
-    views view_mode;
-  void set_headers (void);
-  void init_headers (HDC dc);
-  void insert_at (int, pick_line);
-  void insert_under (int linen, pick_line line);
+
+
 
 };
-#endif /* __cplusplus */
-#endif /* _CHOOSE_H_ */
+
+#endif /* SETUP_CHOOSE_H */
This page took 0.028941 seconds and 5 git commands to generate.