File: MainWindow.h

package info (click to toggle)
ltt 0.9.5pre6-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 3,256 kB
  • ctags: 1,630
  • sloc: ansic: 17,284; sh: 8,010; makefile: 252
file content (260 lines) | stat: -rw-r--r-- 10,407 bytes parent folder | download
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
/*
 * MainWindow.h
 *
 * Copyright (C) 1999 Karim Yaghmour, Jean-Hugues Deschenes.
 *
 * This is distributed under GPL.
 *
 * Header for main window of trace toolkit.
 *
 * History : 
 *    JH.D., 07/08/1999, Added Toolbar to interface
 *    K.Y., 26/06/1999, Renamed file.
 *    K.Y., 02/06/1999, Initial typing.
 */

#ifndef __TRACE_TOOLKIT_MAIN_WINDOW__
#define __TRACE_TOOLKIT_MAIN_WINDOW__

/* Basic includes */
#include <EventOptions.h>
#include <EventDB.h>

/* Includes necessary for graphic front-end */
#if GTK_ENV
#include <gtk/gtk.h>
#include "OpenTrace.h"
#include "EventGraph.h"
#include "ColorSelect.h"
#include "ViewTime.h"
#include "GotoEvent.h"
#include "DumpToFile.h"

/* Strings to identify tree item data */
#define TREE_ITEM_DATA_PROC      "Process pointer"   /* Pointer to a process object */
#define TREE_ITEM_DATA_RTAI_TASK "RTAI task pointer" /* Pointer to a RTAI task object */

#define HELP_CONTENTS_TEXT \
"The help files can be found under\n \
the /Help directory of the LTT source directory."

#define ABOUT_BOX_TEXT \
"Linux Trace Toolkit\n\n \
Version 0.9.5pre6 \n \
(C) 1999, 2000, 2001, 2002 \n\n \
Karim Yaghmour (karym@opersys.com)\n \
Jean-Hugues Deschenes (mr.max@vl.videotron.ca) \n \
Andy Lowe (andy_lowe@mvista.com) \n \
Bob Montgomery (bob_montgomery@hp.com)\n \
Rocky Craig (rocky_craig@hp.com) \n \
Andrea Cisternino (andrea.cisternino@st.com) \n \
Frank Rowand (frowand@mvista.com) \n \
Takuzo O\'Hara (takuzo@sm.sony.co.jp) \n \
Jrg Hermann (joerg.hermann@multilink.de) \n \
Portions contributed by T.Halloran: (C) IBM corp. \n \
\n"

/* Structure describing a trace main window */
typedef struct _mainWindow
{
  /* Links to important structures */
  struct _systemView*  SystemView;    /* System view displayed in this window */

  /* Main widgets */
  GtkWidget*      MWindow;            /* Main window */
  GtkWidget*      MVBox;              /* Main VBox */
  GtkWidget*      MMenu;              /* Main menu */
  GtkWidget*      MToolBar;           /* Toolbar */
  GtkWidget*      MNotebook;          /* Main Notebook */
  GtkWidget*      MStatusBarBox;      /* HBox containing the status bars */
  GtkAccelGroup*  MAccelerator;       /* Accelerator */

  /* Menu items on main menu */
  GtkWidget*    FileMenuTitle;      /* File menu */
  GtkWidget*    EditMenuTitle;      /* Edit menu */
  GtkWidget*    ToolsMenuTitle;     /* Tools menu */
  GtkWidget*    OptionsMenuTitle;   /* Options menu */
  GtkWidget*    TraceMenuTitle;     /* Trace menu */
  GtkWidget*    HelpMenuTitle;      /* Help menu */

  /* Submenus */
  GtkWidget*    FileMenu;           /* File menu */
  GtkWidget*    EditMenu;           /* Edit menu */
  GtkWidget*    ToolsMenu;          /* Tools menu */
  GtkWidget*    OptionsMenu;        /* Options menu */
  GtkWidget*    TraceMenu;          /* Trace menu */
  GtkWidget*    HelpMenu;           /* Help menu */

  /* File menu items */
  GtkWidget*    OpenTrace;          /* Open a trace */
  GtkWidget*    CloseTrace;         /* Close current trace trace */
  GtkWidget*    DumpToFile;         /* Dump trace to file */
  GtkWidget*    FileMenuSeparator1; /* Separator */
  GtkWidget*    Quit;               /* Quit trace session */

  /* Edit menu items */

  /* Tools menu items */
  GtkWidget*    ZoomIn;             /* Zoom in */
  GtkWidget*    ZoomOut;            /* Zoom out */
  GtkWidget*    ToolMenuSeparator1; /* Separator */
  GtkWidget*    ShowHorizon;        /* Show the horizon lines */
  GtkWidget*    ToolMenuSeparator2; /* Separator */
  GtkWidget*    ToolGoToEvent;      /* Go to event... */
  GtkWidget*    ToolViewTimeFrame;  /* View time frame */

  /* Options menu items */
  GtkWidget*    Colors;             /* Display colors */
  GtkWidget*    OptMenuSeparator1;  /* Separator */
  GtkWidget*    ConfigureDaemon;    /* Configure trace daemon */

  /* Help menu items */
  GtkWidget*    Contents;           /* Content of help */
  GtkWidget*    HelpMenuSeparator1; /* Separator */
  GtkWidget*    About;              /* About trace toolkit */

  /* Toolbar Buttons */
  GtkWidget*    tlbOpenTrace;       /* Open a trace */
  GtkWidget*    tlbCloseTrace;      /* Close current trace */
  GtkWidget*    tlbDumpFile;        /* Dump to file */
  GtkWidget*    tlbZoomIn;          /* Zoom in */
  GtkWidget*    tlbZoomOut;         /* Zoom out */
  GtkWidget*    tlbGotoEvent;       /* Go to event */
  GtkWidget*    tlbShowHorizon;     /* Show horizon */
  GtkWidget*	tlbHideIconText;    /* Hide icon text */
  GtkWidget*	tlbHideSysCalls;    /* Hide system calls */
  GtkWidget*	tlbHideIRQs;        /* Hide IRQs */
  GtkWidget*	tlbHideTraps;       /* Hide Traps */
  GtkWidget*	tlbHideSoftIRQs;    /* Hide soft IRQs */
  GtkWidget*	tlbHideSchedChange; /* Hide scheduling changes */
  GtkWidget*	tlbHideKernelTimer; /* Hide kernel timer */
  GtkWidget*	tlbSlowH;           /* Draw horizontal lines slowly */
  GtkWidget*	tlbSlowV;           /* Draw vertical lines slowly */
  GtkWidget*	tlbSlowI;           /* Draw icons slowly */

  /* The Notebook thumbnails */
  GtkWidget*    Graph;              /* Graph view of trace */
  GtkWidget*    Process;            /* Per-process specific information */
  GtkWidget*    RawTrace;           /* Raw event trace */

  /* Graph thumbnail */
  GtkWidget*    GTHBox;             /* Horizontal box */
  eventGraph*   GTEventGraph;       /* The event graph*/

  /* Process thumbnail */
  GtkWidget*    PTHPanned;          /* Horizontal panned widget */
  GtkWidget*    PTScrolledTree;     /* Window to contain scrollable tree */
  GtkWidget*    PTProcessTree;      /* Process tree */
  GtkWidget*    PTScrolledText;     /* Window to contain scrollable text */
  GtkWidget*    PTProcessText;      /* Text describing process */
  GdkFont*      PTTextFont;         /* Font used to print process characteristics */

  /* Raw event trace */
#define RTCLIST_NB_COLUMNS 6
#define RTCLIST_NB_ROWS    50
#if 0
  gchar*        RTCListTitles[RTCLIST_NB_COLUMNS] = {"CPU-ID",
                                                     "Event",
						     "Seconds",
						     "Microseconds",
						     "PID",
						     "Entry Length",
						     "Event Description"};
#endif
  GtkWidget*     RTHBox;    /* Columned list horizontal packing box */
  GtkWidget*     RTVScroll; /* The list's scrollbar */
  GtkAdjustment* RTVAdjust; /* The scrollbar's adjustment */
  GtkWidget*     RTCList;   /* Columned list */
  

  /* Event graph popup */
  GtkWidget*    EventGraphPopup;    /* The popup menu associated to the event graph */
  GtkWidget*    EventGotoProcess;   /* Goto process analysis */
  GtkWidget*    EventViewRawEvent;  /* Go to raw event list */

  /* Raw event popup */
  GtkWidget*    RawEventPopup;      /* The popup menu associated to the raw event list */
  GtkWidget*    RawViewEvent;       /* View event in graph */
  GtkWidget*    RawGotoProcess;     /* Goto process analysis */

  /* The status bar components */
  GtkWidget*    MainSBar;           /* Main status bar */
  GtkWidget*    BegTimeSBar;        /* Status bar displaying the time of the first event displayed */
  GtkWidget*    EndTimeSBar;        /* Status bar displayint the time of the last event displayed */

  /* Status bar information */
  guint         MainSBarContextID;    /* Context ID of main status bar */
  guint         BegTimeSBarContextID; /* Context ID of BegTime status bar */
  guint         EndTimeSBarContextID; /* Context ID of EndTime status bar */
 
  /* Child windows */
  openTraceWindow*     OpenTraceWindow;     /* Window used to get a prof and a proc file */
  colorSelectWindow*   ColorSelectWindow;   /* Window used to configure colors and linetypes */
  viewTimeFrameWindow* ViewTimeFrameWindow; /* Window used to select a time frame to be viewed */
  gotoEventWindow*     GotoEventWindow;     /* Window used to search for an event description */
  dumpToFileWindow*    DumpToFileWindow;    /* Window used to set file dumping options */
  GtkWidget*           HelpContents;        /* Window used to display help contents */
  GtkWidget*           AboutBox;            /* Window used for about information */

  /* Last selected event, required by context menus */
  int           EventSelected;
  event         LastSelectedEvent;

} mainWindow;

/* Structure linking a trace toolkit window with a system description */
typedef struct _systemView
{
  db*                 EventDB;           /* Database of events */
  systemInfo*         System;            /* System description */
  options*            Options;           /* The system options */
  mainWindow*         Window;            /* Window where information is displayed */
  struct _systemView* Next;              /* Next system view in list */
} systemView;

/* The trace window functions */
void        WDConnectSignals
                 (systemView*  /* The system view who's signals are to be connected*/);

void        WDShowMainWindow
                 (systemView*  /* Main window to be shown */);

void        WDFillEventList
                 (GtkWidget*  /* The CList to be filled */,
		  db*         /* The event database */,
		  systemInfo* /* The system */,
		  event*      /* The first event to display in the raw event list */,
		  event*      /* Last selected event, if any */);

mainWindow* WDCreateMainWindow
                 (systemView*  /* The system view to be displayed in the window */);

void        WDDisplayTrace
                 (systemView*  /* The system view to be displayed */);

systemView* WDCreateSystemView
                 (systemInfo*  /* System description */,
		  db*          /* Event database */,
		  options*     /* The options for this view */);

void        WDDestroySystemView
                 (systemView*  /* The system view to destroy*/);

void        WDStatusBarDisplay
                 (gpointer     /* Main window */,
                  gchar*       /* String to be displayed */);

void        WDTimeSBarDisplay
                 (gpointer     /* Main window */,
		  gdouble      /* Start time */,
		  gdouble      /* End time */);

void        WDSetMenusSensitivity
                 (systemView*  /* The System view containing the menus to set */,
		  gboolean     /* sensitivity value to be set */);

void        WDToolBarPopulate
                 (systemView*  /* The system view to be displayed */);

#endif /* GTK_ENV */
#endif /* __TRACE_TOOLKIT_MAIN_WINDOW__ */