File: pkgtree.h

package info (click to toggle)
apt 0.3.10slink11
  • links: PTS
  • area: main
  • in suites: slink
  • size: 2,136 kB
  • ctags: 2,891
  • sloc: cpp: 22,235; sh: 1,656; makefile: 338; perl: 209
file content (75 lines) | stat: -rw-r--r-- 1,930 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// -*- mode: cpp; mode: fold -*-
// Description								/*{{{*/
// $Id: pkgtree.h,v 1.1 1998/07/26 23:11:59 jgg Exp $
/* ######################################################################

   PkgTree - A tree class for displaying packages

   The package tree class handles the various item classes and provides
   them with some utility functions. It also handles all of the user 
   interaction for the item classes. 
   
   To speed up the rendering we cache the location data from the column
   bar, it is regenerated each time the Tree's render function is called.
   
   ##################################################################### */
									/*}}}*/
#ifndef PKGTREE_H
#define PKGTREE_H

#include <deity/tree.h>
#include <apt-pkg/pkgcache.h>

class ColumnBar;
class ExtraCache;
class PackageView;

class PkgTree : public Tree
{
   protected:
   
   // Various internal items
   class Item;
   class DepItem;
   class SecItem;
   class Drawer;
   friend Drawer;
   friend Item;
   friend DepItem;
   friend SecItem;
   
   // Usefull lists
   ExtraCache *Cache;
   ColumnBar *Bar;
   PackageView *Owner;
   
   // Draw Cache
   long ColLocs[8];
   bool ColFields[8];
   bool RegenLocs;
   
   virtual void Render(CombinedGC &GC) {RegenLocs = true; Tree::Render(GC);}
   virtual bool Key(const KeyEvent &Key,Widget *Source);
   virtual void ItemMouse(Tree::Item *I,pkgCache::PkgIterator P,
			  const MouseEvent &Event,int Spacer);
   
   // Helper functions
   void GetLocs(CombinedGC &GC,Rect Pos,long *Locs,bool *Fields);
   
   public:

   // Populates the tree
   void MakeList(ExtraCache *Cache);

   // User actions
   bool DeletePkg(Widget *,Notifyer::Tag,void *);
   bool KeepPkg(Widget *,Notifyer::Tag,void *);
   bool InstallPkg(Widget *,Notifyer::Tag,void *);
   
   // Accessors
   pkgCache::PkgIterator CurrentPkg();
   
   PkgTree(PackageView *Owner,ColumnBar *Bar, Widget *Parent = 0);
};

#endif