File: treeview.h

package info (click to toggle)
gps 1.1.0.0-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,212 kB
  • ctags: 987
  • sloc: cpp: 11,600; sh: 381; makefile: 319; ansic: 227; perl: 17
file content (88 lines) | stat: -rw-r--r-- 2,360 bytes parent folder | download | duplicates (4)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
/* $Id: treeview.h,v 1.5 2000/02/20 21:45:37 bergo Exp $ */

#ifndef TREEVIEW_H
#define TREEVIEW_H

#include "polling.h"
#include "netpolling.h"
#include <gtk/gtk.h>

void pop_treeview(GtkWidget *gw,gpointer data);
void close_treeview_box(GtkWidget *w, gpointer data);
void destroy_treeview_box(GtkWidget *w,gpointer data);

void expand_treeview_box(GtkWidget *gw,gpointer data);
void collapse_treeview_box(GtkWidget *gw,gpointer data);
void frobnicate_the_tree(GtkTreeItem *gti,gpointer data);
void refresh_treeview(GtkWidget *gw,gpointer data);

void tv_select_item(GtkItem *gi,gpointer data);
void tv_deselect_item(GtkItem *gi,gpointer data);

void tv_details(GtkWidget *gw,gpointer data);

void load_pix();
GtkWidget *host_entry_new(char *hname);

void update_ptree();
void update_local_subtree(GtkWidget *parent);
void update_remote_subtrees(GtkWidget *parent,
			    NetworkListPoller *nlp,
			    NetworkDetailsPoller *ndp,
			    NetworkSystemInfoProvider *nsp);

void reset_tnodes();

void PosixKillOne(GtkWidget *gw,gpointer data);
void PosixKillChildren(GtkWidget *gw,gpointer data);
void PosixKillFamily(GtkWidget *gw,gpointer data);

class ProcessLeaf *findNode(GtkTreeItem *sti);
void               signal_it_friendly(int pid,int zignal);
void               tv_kill_family(class ProcessLeaf *pl,int zignal);
void               tv_kill_children(class ProcessLeaf *pl,int zignal);

/// a leaf in the process tree
class ProcessLeaf {
 public:
  ~ProcessLeaf();

  /// returns the label as it is to appear in the widget
  char *get_tree_label();

  /// polls the given (local) pid and fills object
  void poll_pid(int n);

  /// polls the given pid and net pollers,fills object
  void poll_net_pid(int n,
		    NetworkDetailsPoller *ndp,
		    NetworkSystemInfoProvider *nsp);

  /// builds the sole item (above is a tree)
  void build_item(GtkWidget *above);

  /// calls build on offspring and adds them as subtree
  void compose_item();

  /// a descent into the maelstrom
  void recursive_compose_offspring();

  char machine[GPS_MAXHOSTNAME];
  char process_title[GPS_MAXPROCESSNAME];
  int  pid;
  int  ppid;
  char owner[GPS_MAXOWNER];
  char size[GPS_MAXMEMSTRING];
  char cpu[32];

  GtkWidget *treeitem;
  GtkWidget *thistree;
  GList *sonlist;
  class ProcessLeaf *father;

 private:
  char local_buffer[512];
  guint sigid[4];
};

#endif