file names mod part 2
[lttv.git] / ltt / branches / poly / lttv / modules / gui / ControlFlow / processlist.h
1 #ifndef _PROCESS_LIST_H
2 #define _PROCESS_LIST_H
3
4 #include <gtk/gtk.h>
5 #include <lttv/state.h>
6 #include <ltt/ltt.h>
7
8 #include "drawitem.h"
9
10 /* The process list
11 *
12 * Tasks :
13 * Create a process list
14 * contains the data for the process list
15 * tells the height of the process list widget
16 * provides methods to add/remove process from the list
17 * note : the sync with drawing is left to the caller.
18 * provides helper function to convert a process unique identifier to
19 * pixels (in height).
20 *
21 * //FIXME : connect the scrolled window adjustment with the list.
22 */
23
24 typedef struct _ProcessInfo {
25
26 guint pid;
27 LttTime birth;
28
29 } ProcessInfo;
30
31 typedef struct _HashedProcessData {
32
33 GtkTreeRowReference *row_ref;
34 DrawContext *draw_context;
35
36 } HashedProcessData;
37
38 struct _ProcessList {
39
40 GtkWidget *process_list_widget;
41 GtkListStore *list_store;
42
43 /* A hash table by PID to speed up process position find in the list */
44 GHashTable *process_hash;
45
46 guint number_of_process;
47 };
48
49
50 typedef struct _ProcessList ProcessList;
51
52 ProcessList *processlist_construct(void);
53 void processlist_destroy(ProcessList *process_list);
54 GtkWidget *processlist_get_widget(ProcessList *process_list);
55
56 // out : success (0) and height
57 int processlist_add(ProcessList *process_list, guint pid, LttTime *birth,
58 gchar *name, guint *height, HashedProcessData **hashed_process_data);
59 // out : success (0) and height
60 int processlist_remove(ProcessList *process_list, guint pid, LttTime *birth);
61
62 guint processlist_get_height(ProcessList *process_list);
63
64 // Returns 0 on success
65 gint processlist_get_process_pixels(ProcessList *process_list,
66 guint pid, LttTime *birth,
67 guint *y, guint *height,
68 HashedProcessData **hashed_process_data);
69
70 gint processlist_get_pixels_from_data( ProcessList *process_list,
71 ProcessInfo *process_info,
72 HashedProcessData *hashed_process_data,
73 guint *y,
74 guint *height);
75
76 #endif // _PROCESS_LIST_H
This page took 0.030171 seconds and 4 git commands to generate.