Logo ROOT  
Reference Guide
TRecorder.h
Go to the documentation of this file.
1// @(#)root/gui:$Id$
2// Author: Katerina Opocenska 11/09/2008
3
4/*************************************************************************
5* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
6* All rights reserved. *
7* *
8* For the licensing terms see $ROOTSYS/LICENSE. *
9* For the list of contributors see $ROOTSYS/README/CREDITS. *
10*************************************************************************/
11
12#ifndef ROOT_TRecorder
13#define ROOT_TRecorder
14
15
16#include "TApplication.h"
17#include "TError.h"
18#include "TTimer.h"
19#include "TGClient.h"
20#include "TGFrame.h"
21#include "TCanvas.h"
22#include "THashList.h"
23
24#include <ctime>
25#include <iostream>
26
27class TMutex;
28class TTree;
29class TFile;
30class TGPictureButton;
31class TGCheckButton;
32class TGLabel;
33class TRecorderState;
34
35
36/** \class TRecEvent
37 \ingroup guirecorder
38
39Abstract class that defines interface for a class storing
40information about 1 ROOT event.
41Time of event is stored and this event can be replayed.
42Classes TRecCmdEvent and TRecGuiEvent implements this interface
43for command line and GUI events respectively.
44
45*/
46
47
48class TRecEvent : public TObject
49{
50private:
51 TTime fEventTime; // Time of original event execution
52
53public:
54 //---- Types of events recorded in ROOT.
56 kCmdEvent, // Commandline event
57 kGuiEvent, // GUI event
59 };
60
61 // Replays (executes) the stored event again
62 virtual void ReplayEvent(Bool_t showMouseCursor = kTRUE) = 0;
63
64 // Returns what kind of event it stores
65 virtual ERecEventType GetType() const = 0;
66
67 virtual TTime GetTime() const {
68 // Returns time of original execution of stored event
69 return fEventTime;
70 }
71
72 virtual void SetTime(TTime t) {
73 // Sets time of event execution
74 fEventTime = t;
75 }
76
77 ClassDef(TRecEvent,1) // Abstract class. Defines basic interface for storing information about ROOT events
78};
79
80
81/** \class TRecCmdEvent
82 \ingroup guirecorder
83
84Class used for storing information about 1 commandline event.
85It means 1 command typed in by user in the commandline,
86e.g 'new TCanvas'.
87
88*/
89
90
91class TRecCmdEvent : public TRecEvent
92{
93private:
94 TString fText; // Text of stored command
95
96public:
98 // Creates new empty TRecCmdEvent
99 }
100
101 void SetText(const char *text) {
102 // Saves text of a command
103 fText = text;
104 }
105
106 const char *GetText() const {
107 // Returns stored text of the command
108 return fText.Data();
109 }
110
111 virtual ERecEventType GetType() const {
112 // Returns what kind of event it stores (commandline event)
114 }
115
116 virtual void ReplayEvent(Bool_t) {
117 // Stored command is executed again
118 std::cout << GetText() << std::endl;
120 }
121
122 ClassDef(TRecCmdEvent,1) // Class stores information about 1 commandline event (= 1 command typed by user in commandline)
123};
124
125
126
127/** class TRecExtraEvent
128 \ingroup guirecorder
129
130Class used for storing information about 1 extra event.
131It means 1 TPaveLabel or 1 TLatex event produced in the Canvas
132
133*/
134
135
137{
138private:
139 TString fText; // Text of stored command
140
141public:
143 // Creates new empty TRecExtraEvent
144 }
145
147 // Saves text of a command (PaveLabel or Text)
148 fText = text;
149 }
150
151 TString GetText() const {
152 // Returns stored text of the command
153 return fText;
154 }
155
156 virtual ERecEventType GetType() const {
157 // Returns what kind of event it stores (Especial event)
159 }
160
161 virtual void ReplayEvent(Bool_t) {
162 // Stored event is executed again
163
165 }
166
167 ClassDef(TRecExtraEvent,1) // Class stores information about extra events
168};
169
170
171/** class TRecGuiEvent
172 \ingroup guirecorder
173
174Class used for storing information about 1 GUI event in ROOT.
175For list of possible GUI events see EGEventType.
176
177*/
178
179
181{
182protected:
183 friend class TRecorderInactive;
184 friend class TRecorderPaused;
185 friend class TRecorderRecording;
186 friend class TRecorderReplaying;
187
188 EGEventType fType; // Type of event (see EGEventType)
189 Window_t fWindow; // Window ID which reported event is relative to
190 Time_t fTime; // Time event occured in ms
191 Int_t fX; // Pointer x coordinate in event window
192 Int_t fY; // Pointer y coordinate in event window
193 Int_t fXRoot; // x coordinate relative to root
194 Int_t fYRoot; // y coordinate relative to root
195 UInt_t fCode; // Key or button code
196 UInt_t fState; // Key or button mask
197 UInt_t fWidth; // Width of exposed area
198 UInt_t fHeight; // Height of exposed area
199 Int_t fCount; // If non-zero, at least this many more exposes
200 Bool_t fSendEvent; // True if event came from SendEvent
201 Handle_t fHandle; // General resource handle (used for atoms or windows)
202 Int_t fFormat; // Next fields only used by kClientMessageEvent
203 Long_t fUser[5]; // 5 longs can be used by client message events
204 // NOTE: only [0], [1] and [2] may be used.
205 // [1] and [2] may contain > 32 bit quantities
206 // (i.e. pointers on 64 bit machines)
207 Window_t fMasked; // If non-zero, event recorded in HandleMaskEvent()
208
209public:
210 //---- Types of kConfigureNotify GUI event
212 kCNMove = 0, // Movement of a window (Linux)
213 kCNResize = 1, // Resize of a window (Linux)
214 kCNMoveResize = 2, // Movement, resize or both (Windows)
215 kCNFilter = 3 // Not replaybale (filtered event).
216 };
217 //---- Aliases for non cross-platform atoms.
220 kROOT_MESSAGE = 10002
221 };
222
223 virtual ERecEventType GetType() const {
224 // Returns what kind of event it stores (GUI event)
226 }
227
228 virtual void ReplayEvent(Bool_t showMouseCursor = kTRUE);
229 static Event_t *CreateEvent(TRecGuiEvent *ge);
230
231 ClassDef(TRecGuiEvent,1) // Class stores information about 1 GUI event in ROOT
232};
233
234
235/** \class TRecWinPair
236 \ingroup guirecorder
237
238Class used for storing of window IDs mapping.
239Remapping of window IDs is needed for replaying events.
240 - ID of original window is stored in fKey.
241 - ID of a new window is stored in fValue.
242
243Whenever an event is replayed, its referenced window ID is changed
244from original to a new one according to the appropriate mapping.
245
246*/
247
248
249class TRecWinPair : public TObject
250{
251protected:
252 friend class TRecorderReplaying;
253
254 Window_t fKey; // ID of original window (for which an event was originally recorded)
255 Window_t fValue; // ID of a new window (for which an event is being replayed)
256
257public:
258 // Creates a new key-value mapping of window IDs
259 TRecWinPair(Window_t key, Window_t value): fKey(key), fValue(value) {}
260
261 ClassDef(TRecWinPair,1) // Class used for storing of window IDs mapping. Needed for replaying events.
262};
263
264
265class TRecorder : public TObject
266{
267private:
268 TRecorderState *fRecorderState; //! Current state of recorder
269
270 TRecorder(const TRecorder&); // Not implemented.
271 TRecorder &operator=(const TRecorder&); // Not implemented.
272
273protected:
274 friend class TRecorderState;
275 friend class TRecorderInactive;
276 friend class TRecorderPaused;
277 friend class TRecorderRecording;
278 friend class TRecorderReplaying;
279
280 TString fFilename; // Events file name
281 // Changes state to the new one.
282 // See class documentation for information about state changing.
283 void ChangeState(TRecorderState *newstate, Bool_t deletePreviousState = kTRUE);
284
285public:
286 //---- Modes of replaying. Only kRealtime implemented so far
289 };
290 //---- States of recorder. In every moment, recorder is in right
291 // one of these states.
297 };
298
299 // Creates recorder and sets its state as INACTIVE
300 TRecorder();
301 TRecorder(const char *filename, Option_t *option = "READ");
302
303 // Deletes recorder together with its current state
304 virtual ~TRecorder();
305
306 void Browse(TBrowser *);
307
308 // Starts recording of events to the given file
309 void Start(const char *filename, Option_t *option = "RECREATE", Window_t *w = 0, Int_t winCount = 0);
310
311 // Stops recording of events
312 void Stop(Bool_t guiCommand = kFALSE);
313
314 // Replays recorded events from given file
315 Bool_t Replay(const char *filename, Bool_t showMouseCursor = kTRUE, TRecorder::EReplayModes mode = kRealtime);
316
317 // Replays recorded events from current file
318 void Replay() { Replay(fFilename); } // *MENU*
319
320 // Pauses replaying
321 void Pause();
322
323 // Resumes paused replaying
324 void Resume();
325
326 // Stops (cancels) replaying
327 void ReplayStop();
328
329 // Prints out the list of recorded commandline events
330 void ListCmd(const char *filename);
331
332 // Prints out the list of recorded GUI events
333 void ListGui(const char *filename);
334
335 // Gets current state of recorder
336 virtual TRecorder::ERecorderState GetState() const;
337
338 // Saves all the canvases previous to the TRecorder
339 void PrevCanvases(const char *filename, Option_t *option);
340
341 ClassDef(TRecorder,2) // Class provides direct recorder/replayer interface for a user.
342};
343
344/** \class TRecorderState
345 \ingroup guirecorder
346
347Abstract class that defines interface for a state of recorder.
348Inherited classes are:
349 - TRecorderInactive
350 - TRecorderRecording
351 - TRecorderReplaying
352 - TRecorderPaused
353
354See TRecorder for more information about creating, using,
355changing and deleting states.
356
357*/
358
359
361{
362protected:
363 friend class TRecorder;
364 void ChangeState(TRecorder *r, TRecorderState *s, Bool_t deletePreviousState) { r->ChangeState(s, deletePreviousState); }
365
366public:
367 virtual ~TRecorderState() {}
368 virtual void Start(TRecorder *, const char *, Option_t *, Window_t *, Int_t) {}
369 virtual void Stop(TRecorder *, Bool_t ) {}
370 virtual Bool_t Replay(TRecorder *, const char *, Bool_t, TRecorder::EReplayModes) { return false; }
371 virtual void Pause(TRecorder *) {}
372 virtual void Resume(TRecorder *) {}
373 virtual void ReplayStop(TRecorder *) {}
374
375 virtual void ListCmd(const char *) {}
376 virtual void ListGui(const char *) {}
377
378 virtual void PrevCanvases(const char *, Option_t *) {}
379
381
382 ClassDef(TRecorderState, 0) // Abstract class that defines interface for a state of recorder
383};
384
385/** \class TRecorderReplaying
386 \ingroup guirecorder
387Represents state of TRecorder when replaying previously recorded
388events.
389
390Not intended to be used by a user directly.
391
392*/
393
394
396{
397private:
398 virtual ~TRecorderReplaying();
402
404
405 TRecorder *fRecorder; // Reference to recorder (owner of this state) is kept in order to switch
406 // recorder to INACTIVE state after replaying is finished
407
408 TFile *fFile; // ROOT file which the recorded events are being read from
409
410
411 TCanvas *fCanv; // Used to record the previous canvases
412
413
414 TTimer *fTimer; // Timer used for replaying
415
416 TTree *fWinTree; // TTree with recorded windows (=registered during recording)
417 TTree *fGuiTree; // TTree with recorded GUI events
418 TTree *fCmdTree; // TTree with recorded commandline events
419 TTree *fExtraTree; // TTree with recorded extra events (PaveLabels and Texts)
420
421 ULong64_t fWin; // Window ID being currently mapped
422 TRecGuiEvent *fGuiEvent; // GUI event being currently replayed
423 TRecCmdEvent *fCmdEvent; // Commandline event being currently replayed
424 TRecExtraEvent *fExtraEvent; // Extra event being currently replayed
425
426 Int_t fRegWinCounter; // Counter of registered windows when replaying
427 Int_t fGuiTreeCounter; // Counter of GUI events that have been replayed
428 Int_t fCmdTreeCounter; // Counter of commandline events that have been replayed
429 Int_t fExtraTreeCounter; // Counter of extra events that have been replayed
430
431 Int_t fWinTreeEntries; // Number of registered windows during _recording_
432
434
435 TList *fWindowList; // List of TRecWinPair objects. Mapping of window IDs is stored here.
436
437 TRecEvent *fNextEvent; // The next event that is going to be replayed (GUI event or commandline)
438
439 TTime fPreviousEventTime; // Execution time of the previously replayed event.
440 // It is used for computing time difference between two events.
441
442 Bool_t fWaitingForWindow; // Signalizes that we wait for a window to be registered in order
443 // to replay the next event fNextEvent.
444 // Registration of windows can last different time when recording and replaying.
445 // If there is an event ready to be replayed but the corresponding windows has not been yet
446 // registered, we wait (postopone fNextEvent) until it is registered.
447
448 Bool_t fEventReplayed; // Signalizes that the last event sent to the replaying has been already replayed.
449 // Sometimes an execution of an event can take more time than during recording.
450 // This ensures that the next event is sent to replaying AFTER
451 // the replaying of the previous one finishes and not earlier.
452 // Exceptions: ButtonPress and ButtonRelease events (See TRecorderReplaying::CanBeOverlapped)
453
454 Bool_t fShowMouseCursor; // Specifies if mouse cursor should be also replayed
455
456 Bool_t fFilterStatusBar; // Special flag to filter status bar element
457
458protected:
459 friend class TRecorderInactive;
460 friend class TRecorderPaused;
461
462 TRecorderReplaying(const char *filename);
464
465public:
467
468 virtual void Pause(TRecorder *r);
469 virtual void Continue();
470 virtual void ReplayStop(TRecorder *r);
471
472 void RegisterWindow(Window_t w); //SLOT
473 void ReplayRealtime(); //SLOT
474
475 ClassDef(TRecorderReplaying, 0) // Represents state of TRecorder when replaying
476};
477
478/** \class TRecorderRecording
479 \ingroup guirecorder
480Represents state of TRecorder when recording events.
481
482Not intended to be used by a user directly.
483
484*/
485
486
488{
489private:
490 virtual ~TRecorderRecording();
493 void CopyEvent(Event_t *e, Window_t wid);
494
495 TRecorder *fRecorder; // Reference to recorder (owner of this state) is kept in order to switch
496 // recorder back to INACTIVE state after recording is finished
497
498 TFile *fFile; // ROOT file to store recorded events in
499 TTimer *fTimer; // Timer used for recording
500 TTimer *fMouseTimer; // Timer used for recording mouse position
501 Long64_t fBeginPave; // TLatex/TPaveLabel edition starting time
502
503 TTree *fWinTree; // TTree with registered windows
504 TTree *fGuiTree; // TTree with recorded GUI events
505 TTree *fCmdTree; // TTree with recorded commandline events
506 TTree *fExtraTree; // TTree with recorded extra events (PaveLabels and Texts)
507
508 ULong64_t fWin; // The newest registered window to be stored in TTree
509 TRecGuiEvent *fGuiEvent; // The newest GUI event to be stored in TTree
510 TRecCmdEvent *fCmdEvent; // The newest commandline event to be stored in TTree
511 TRecExtraEvent *fExtraEvent; // The newest extra event to be stored in TTree
512
513 Bool_t fCmdEventPending; // Indication if there is a still pending commandline event that should be stored.
514 // Commandline events are stored with 1 event delay to ensure skipping
515 // the last event 'TRecorder::Stop' that is not supposed to be recorded
516
517 Int_t fRegWinCounter; // Counter of registered ROOT windows.
518 // It is increased every time when a new window is registered
519
520 Int_t fFilteredIdsCount; // Only when GUI for recorder is used: Count of windows in GUI recorder
521 Window_t *fFilteredIds; // Only when GUI for recorder is used: IDs of windows that creates that GUI.
522 // Events for GUI recorder are not recorded.
523 Bool_t fFilterEventPave; // Special flag to filter events during the pave recording
524
525protected:
526 friend class TRecorderInactive;
527 TRecorderRecording(TRecorder *r, const char *filename, Option_t *option, Window_t *w, Int_t winCount);
528
530
531public:
533
534 virtual void Stop(TRecorder *r, Bool_t guiCommand);
535
536 void RegisterWindow(Window_t w); //SLOT
537 void RecordCmdEvent(const char *line); //SLOT
538 void RecordGuiEvent(Event_t *e, Window_t wid); //SLOT
539 void RecordGuiBldEvent(Event_t *e); //SLOT
540 void RecordGuiCNEvent(Event_t *e); //SLOT
541 void RecordMousePosition();
542 void RecordPave(const TObject *obj); //SLOT
543 void RecordText(const TObject *obj); //SLOT
544 void FilterEventPave(); //SLOT
545 void StartEditing(); //SLOT
546
547 void RecordExtraEvent(TString line, TTime extTime);
548
549 ClassDef(TRecorderRecording, 0) // Represents state of TRecorder when recording events
550};
551
552/** \class TRecorderInactive
553 \ingroup guirecorder
554
555Represents state of TRecorder just after its creation.
556Nor recording neither replaying is being executed in this state.
557
558Not intended to be used by a user directly.
559
560*/
561
562
564{
565
566private:
568
569public:
572
573 virtual void ListCmd(const char *filename);
574 virtual void ListGui(const char *filename);
575
576 virtual void Start(TRecorder *r, const char *filename, Option_t *option, Window_t *w = 0, Int_t winCount = 0);
577 virtual Bool_t Replay(TRecorder *r, const char *filename, Bool_t showMouseCursor, TRecorder::EReplayModes mode);
578
580
581 static void DumpRootEvent(TRecGuiEvent *e, Int_t n);
582 static long DisplayValid(Long_t n) { return ( n < 0 ? -1 : n); }
583
584 void PrevCanvases(const char *filename, Option_t *option);
585
586 ClassDef(TRecorderInactive, 0) // Represents state of TRecorder after its creation
587};
588
589/** \class TRecorderPaused
590 \ingroup guirecorder
591
592Represents state of TRecorder when replaying was paused
593by a user.
594The paused replaying is remembered and after Resume call can
595be continued again.
596
597Not intended to be used by a user directly.
598
599*/
600
601
603{
604private:
605 virtual ~TRecorderPaused() {}
606
607 TRecorderReplaying *fReplayingState; // Replaying that is paused
608
609protected:
610 friend class TRecorderReplaying;
612
613public:
615
616 virtual void Resume(TRecorder *r);
617 virtual void ReplayStop(TRecorder *r);
618
619 ClassDef(TRecorderPaused, 0) // Represents state of TRecorder when paused
620};
621
622
623/** \class TGRecorder
624 \ingroup guirecorder
625
626Provides GUI for TRecorder class.
627
628*/
629
631{
632private:
633 TRecorder *fRecorder; // Recorder
634
635 TGPictureButton *fStartStop; // Button for start and stop of recording
636 TGPictureButton *fReplay; // Button for start of replaying
637
638 TGLabel *fStatus; // Label with actual status
639 TGLabel *fTimeDisplay; // Label with time counter
640 TGCheckButton *fCursorCheckBox; // Check box "Show mouse cursor" for replaying
641
642 TTimer *fTimer; // Timer for handling GUI of recorder
643 time_t fStart, fElapsed; // playing/recording time
644
645 static const Int_t fgWidgetsCount = 12; // Number of windows in GUI recorder
646 Window_t fFilteredIds[fgWidgetsCount]; // IDs of these windows in GUI recorder
647
648 void SetDefault();
649
650public:
651 TGRecorder(const TGWindow *p = 0, UInt_t w = 230, UInt_t h = 150);
652 virtual ~TGRecorder();
653
654 void StartStop();
655 void Update();
656 void Replay();
657
658 ClassDef(TGRecorder,0) // GUI class of the event recorder.
659};
660
661#endif // ROOT_TRecorder
EGEventType
Definition: GuiTypes.h:59
ULong_t Time_t
Event time.
Definition: GuiTypes.h:42
Handle_t Window_t
Window handle.
Definition: GuiTypes.h:29
ULongptr_t Handle_t
Generic resource handle.
Definition: GuiTypes.h:26
ROOT::R::TRInterface & r
Definition: Object.C:4
#define h(i)
Definition: RSha256.hxx:106
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
const Bool_t kFALSE
Definition: RtypesCore.h:101
long Long_t
Definition: RtypesCore.h:54
bool Bool_t
Definition: RtypesCore.h:63
long long Long64_t
Definition: RtypesCore.h:80
unsigned long long ULong64_t
Definition: RtypesCore.h:81
const Bool_t kTRUE
Definition: RtypesCore.h:100
const char Option_t
Definition: RtypesCore.h:66
#define ClassDef(name, id)
Definition: Rtypes.h:325
R__EXTERN TApplication * gApplication
Definition: TApplication.h:165
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=0)
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
The Canvas class.
Definition: TCanvas.h:23
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
Selects different options.
Definition: TGButton.h:264
This class handles GUI labels.
Definition: TGLabel.h:24
Defines top level windows that interact with the system Window Manager.
Definition: TGFrame.h:398
Yield an action as soon as it is clicked.
Definition: TGButton.h:228
Provides GUI for TRecorder class.
Definition: TRecorder.h:631
Window_t fFilteredIds[fgWidgetsCount]
Definition: TRecorder.h:646
time_t fStart
Definition: TRecorder.h:643
TGPictureButton * fStartStop
Definition: TRecorder.h:635
virtual ~TGRecorder()
Destructor. Cleanup the GUI.
Definition: TRecorder.cxx:2024
TGLabel * fTimeDisplay
Definition: TRecorder.h:639
TGCheckButton * fCursorCheckBox
Definition: TRecorder.h:640
TTimer * fTimer
Definition: TRecorder.h:642
void StartStop()
Handles push of the fStartStop button according to the current recorder state.
Definition: TRecorder.cxx:1915
TGPictureButton * fReplay
Definition: TRecorder.h:636
TRecorder * fRecorder
Definition: TRecorder.h:633
TGRecorder(const TGWindow *p=0, UInt_t w=230, UInt_t h=150)
The GUI for the recorder.
Definition: TRecorder.cxx:1731
void Update()
Called when fTimer timeouts (every 0.025 second) Updates GUI of recorder.
Definition: TRecorder.cxx:1853
static const Int_t fgWidgetsCount
Definition: TRecorder.h:645
TGLabel * fStatus
Definition: TRecorder.h:638
time_t fElapsed
Definition: TRecorder.h:643
void SetDefault()
Sets GUI to the default inactive state.
Definition: TRecorder.cxx:1835
void Replay()
Handles push of fReplay button according to the current recorder state.
Definition: TRecorder.cxx:1979
ROOT GUI Window base class.
Definition: TGWindow.h:23
A doubly linked list.
Definition: TList.h:44
Definition: TMutex.h:30
Mother of all ROOT objects.
Definition: TObject.h:37
Class used for storing information about 1 commandline event.
Definition: TRecorder.h:92
virtual ERecEventType GetType() const
Definition: TRecorder.h:111
const char * GetText() const
Definition: TRecorder.h:106
TString fText
Definition: TRecorder.h:94
virtual void ReplayEvent(Bool_t)
Definition: TRecorder.h:116
void SetText(const char *text)
Definition: TRecorder.h:101
Abstract class that defines interface for a class storing information about 1 ROOT event.
Definition: TRecorder.h:49
@ kGuiEvent
Definition: TRecorder.h:57
@ kExtraEvent
Definition: TRecorder.h:58
@ kCmdEvent
Definition: TRecorder.h:56
TTime fEventTime
Definition: TRecorder.h:51
virtual void ReplayEvent(Bool_t showMouseCursor=kTRUE)=0
virtual void SetTime(TTime t)
Definition: TRecorder.h:72
virtual TTime GetTime() const
Definition: TRecorder.h:67
virtual ERecEventType GetType() const =0
class TRecExtraEvent
Definition: TRecorder.h:137
void SetText(TString text)
Definition: TRecorder.h:146
TString GetText() const
Definition: TRecorder.h:151
TString fText
Definition: TRecorder.h:139
virtual void ReplayEvent(Bool_t)
Definition: TRecorder.h:161
virtual ERecEventType GetType() const
Definition: TRecorder.h:156
class TRecGuiEvent
Definition: TRecorder.h:181
EGEventType fType
Definition: TRecorder.h:188
UInt_t fCode
Definition: TRecorder.h:195
virtual void ReplayEvent(Bool_t showMouseCursor=kTRUE)
Replays stored GUI event.
Definition: TRecorder.cxx:2040
Int_t fFormat
Definition: TRecorder.h:202
Long_t fUser[5]
Definition: TRecorder.h:203
static Event_t * CreateEvent(TRecGuiEvent *ge)
Converts TRecGuiEvent type to Event_t type.
Definition: TRecorder.cxx:2150
Window_t fMasked
Definition: TRecorder.h:207
Handle_t fHandle
Definition: TRecorder.h:201
UInt_t fHeight
Definition: TRecorder.h:198
virtual ERecEventType GetType() const
Definition: TRecorder.h:223
Int_t fCount
Definition: TRecorder.h:199
@ kWM_DELETE_WINDOW
Definition: TRecorder.h:219
UInt_t fWidth
Definition: TRecorder.h:197
Int_t fXRoot
Definition: TRecorder.h:193
Bool_t fSendEvent
Definition: TRecorder.h:200
Int_t fYRoot
Definition: TRecorder.h:194
UInt_t fState
Definition: TRecorder.h:196
Window_t fWindow
Definition: TRecorder.h:189
Time_t fTime
Definition: TRecorder.h:190
Class used for storing of window IDs mapping.
Definition: TRecorder.h:250
Window_t fValue
Definition: TRecorder.h:255
Window_t fKey
Definition: TRecorder.h:254
TRecWinPair(Window_t key, Window_t value)
Definition: TRecorder.h:259
Represents state of TRecorder just after its creation.
Definition: TRecorder.h:564
virtual ~TRecorderInactive()
Definition: TRecorder.h:570
virtual void ListCmd(const char *filename)
Prints out commandline events recorded in given file.
Definition: TRecorder.cxx:982
virtual void Start(TRecorder *r, const char *filename, Option_t *option, Window_t *w=0, Int_t winCount=0)
Switches from INACTIVE state to RECORDING and starts recording.
Definition: TRecorder.cxx:935
void PrevCanvases(const char *filename, Option_t *option)
Save previous canvases in a .root file.
Definition: TRecorder.cxx:1101
virtual TRecorder::ERecorderState GetState() const
Definition: TRecorder.h:579
TSeqCollection * fCollect
Definition: TRecorder.h:567
virtual Bool_t Replay(TRecorder *r, const char *filename, Bool_t showMouseCursor, TRecorder::EReplayModes mode)
Switches from INACTIVE state of recorder to REPLAYING Return kTRUE if replaying has started or kFALSE...
Definition: TRecorder.cxx:958
static void DumpRootEvent(TRecGuiEvent *e, Int_t n)
Prints out attributes of one GUI event TRecGuiEvent *e Int_n n is number of event if called in cycle.
Definition: TRecorder.cxx:1066
static long DisplayValid(Long_t n)
Definition: TRecorder.h:582
virtual void ListGui(const char *filename)
Prints out GUI events recorded in given file.
Definition: TRecorder.cxx:1024
Represents state of TRecorder when replaying was paused by a user.
Definition: TRecorder.h:603
virtual TRecorder::ERecorderState GetState() const
Definition: TRecorder.h:614
TRecorderReplaying * fReplayingState
Definition: TRecorder.h:607
virtual void Resume(TRecorder *r)
Continues replaying.
Definition: TRecorder.cxx:1128
virtual ~TRecorderPaused()
Definition: TRecorder.h:605
TRecorderPaused(TRecorderReplaying *state)
Remember the recorder state that is paused.
Definition: TRecorder.cxx:1120
virtual void ReplayStop(TRecorder *r)
Replaying is cancelled.
Definition: TRecorder.cxx:1140
Represents state of TRecorder when recording events.
Definition: TRecorder.h:488
TRecExtraEvent * fExtraEvent
Definition: TRecorder.h:511
TRecCmdEvent * fCmdEvent
Definition: TRecorder.h:510
void FilterEventPave()
Change the state of the flag to kTRUE when you are recording a pavelabel.
Definition: TRecorder.cxx:1590
ULong64_t fWin
Definition: TRecorder.h:508
TRecorder * fRecorder
Definition: TRecorder.h:495
void RecordMousePosition()
Try to record all mouse moves...
Definition: TRecorder.cxx:1450
TRecGuiEvent * fGuiEvent
Definition: TRecorder.h:509
virtual TRecorder::ERecorderState GetState() const
Definition: TRecorder.h:532
Long64_t fBeginPave
Definition: TRecorder.h:501
TRecorderRecording(TRecorder *r, const char *filename, Option_t *option, Window_t *w, Int_t winCount)
Initializes TRecorderRecording for recording What is allocated here is deleted in destructor.
Definition: TRecorder.cxx:1158
void RegisterWindow(Window_t w)
This method is called when RegisteredWindow(Window_t) is emitted from TGClient.
Definition: TRecorder.cxx:1357
virtual void Stop(TRecorder *r, Bool_t guiCommand)
Disconnects all slots and stopps recording.
Definition: TRecorder.cxx:1317
Bool_t StartRecording()
Connects appropriate signals and slots in order to gain all registered windows and processed events i...
Definition: TRecorder.cxx:1223
Bool_t fFilterEventPave
Definition: TRecorder.h:523
void StartEditing()
Memorize the starting time of editinga TLatex or a TPaveLabel.
Definition: TRecorder.cxx:1598
void RecordGuiBldEvent(Event_t *e)
Special case for the gui builder, having a timer handling some of the events.
Definition: TRecorder.cxx:1432
TTree * fExtraTree
Definition: TRecorder.h:506
void RecordPave(const TObject *obj)
Records TPaveLabel object created in TCreatePrimitives::Pave()
Definition: TRecorder.cxx:1504
virtual ~TRecorderRecording()
Freeing of allocated memory.
Definition: TRecorder.cxx:1206
Bool_t IsFiltered(Window_t id)
Returns kTRUE if passed id belongs to window IDs of recorder GUI itself.
Definition: TRecorder.cxx:1661
Window_t * fFilteredIds
Definition: TRecorder.h:521
TTimer * fMouseTimer
Definition: TRecorder.h:500
void SetTypeOfConfigureNotify(Event_t *e)
Sets type of kConfigureNotify event to one of EConfigureNotify.
Definition: TRecorder.cxx:1679
void RecordGuiCNEvent(Event_t *e)
Records GUI Event_t *e of type kConfigureNotify.
Definition: TRecorder.cxx:1481
void RecordExtraEvent(TString line, TTime extTime)
Records TLatex or TPaveLabel object created in TCreatePrimitives, ExtTime is needed for the correct r...
Definition: TRecorder.cxx:1607
Bool_t fCmdEventPending
Definition: TRecorder.h:513
void RecordGuiEvent(Event_t *e, Window_t wid)
Records GUI Event_t *e different from kConfigureNotify (they are recorded in TRecorderRecording::Reco...
Definition: TRecorder.cxx:1398
Int_t fFilteredIdsCount
Definition: TRecorder.h:520
void RecordText(const TObject *obj)
Records TLatex object created in TCreatePrimitives::Text()
Definition: TRecorder.cxx:1548
void CopyEvent(Event_t *e, Window_t wid)
Copies all items of given event to fGuiEvent.
Definition: TRecorder.cxx:1617
void RecordCmdEvent(const char *line)
Records commandline event (text and time) ans saves the previous commandline event This 1 event delay...
Definition: TRecorder.cxx:1370
Represents state of TRecorder when replaying previously recorded events.
Definition: TRecorder.h:396
TTree * fExtraTree
Definition: TRecorder.h:419
Bool_t FilterEvent(TRecGuiEvent *e)
Definition: TRecorder.cxx:621
Bool_t fEventReplayed
Definition: TRecorder.h:448
TCanvas * fCanv
Definition: TRecorder.h:411
TRecEvent * fNextEvent
Definition: TRecorder.h:437
TRecGuiEvent * fGuiEvent
Definition: TRecorder.h:422
virtual void ReplayStop(TRecorder *r)
Cancels replaying.
Definition: TRecorder.cxx:912
virtual ~TRecorderReplaying()
Closes all signal-slot connections Frees all memory allocated in constructor.
Definition: TRecorder.cxx:356
virtual TRecorder::ERecorderState GetState() const
Definition: TRecorder.h:466
TTime fPreviousEventTime
Definition: TRecorder.h:439
TList * fWindowList
Definition: TRecorder.h:435
TRecCmdEvent * fCmdEvent
Definition: TRecorder.h:423
Bool_t RemapWindowReferences()
All references to the old windows (IDs) in fNextEvent are replaced by new ones according to the mappi...
Definition: TRecorder.cxx:561
Bool_t fFilterStatusBar
Definition: TRecorder.h:456
Bool_t fWaitingForWindow
Definition: TRecorder.h:442
TRecExtraEvent * fExtraEvent
Definition: TRecorder.h:424
virtual void Continue()
Continues previously paused replaying.
Definition: TRecorder.cxx:921
Bool_t CanOverlap()
ButtonPress and ButtonRelease must be sometimes replayed more times Example: pressing of a button ope...
Definition: TRecorder.cxx:781
Int_t fExtraTreeCounter
Definition: TRecorder.h:429
virtual void Pause(TRecorder *r)
Pauses replaying.
Definition: TRecorder.cxx:902
Bool_t fShowMouseCursor
Definition: TRecorder.h:454
TRecorderReplaying(const char *filename)
Allocates all necessary data structures used for replaying What is allocated here is deleted in destr...
Definition: TRecorder.cxx:322
Bool_t PrepareNextEvent()
Finds the next event in log file to replay and sets it to fNextEvent.
Definition: TRecorder.cxx:676
TRecorder * fRecorder
Definition: TRecorder.h:405
Bool_t Initialize(TRecorder *r, Bool_t showMouseCursor, TRecorder::EReplayModes mode)
Initialization of data structures for replaying.
Definition: TRecorder.cxx:388
ULong64_t fWin
Definition: TRecorder.h:421
void RegisterWindow(Window_t w)
Creates mapping for the newly registered window w and adds this mapping to fWindowList.
Definition: TRecorder.cxx:493
void ReplayRealtime()
Replays the next event.
Definition: TRecorder.cxx:825
Abstract class that defines interface for a state of recorder.
Definition: TRecorder.h:361
virtual void PrevCanvases(const char *, Option_t *)
Definition: TRecorder.h:378
virtual void Resume(TRecorder *)
Definition: TRecorder.h:372
virtual ~TRecorderState()
Definition: TRecorder.h:367
virtual void Start(TRecorder *, const char *, Option_t *, Window_t *, Int_t)
Definition: TRecorder.h:368
virtual void ListCmd(const char *)
Definition: TRecorder.h:375
virtual void ReplayStop(TRecorder *)
Definition: TRecorder.h:373
void ChangeState(TRecorder *r, TRecorderState *s, Bool_t deletePreviousState)
Definition: TRecorder.h:364
virtual void Pause(TRecorder *)
Definition: TRecorder.h:371
virtual void ListGui(const char *)
Definition: TRecorder.h:376
virtual TRecorder::ERecorderState GetState() const =0
virtual Bool_t Replay(TRecorder *, const char *, Bool_t, TRecorder::EReplayModes)
Definition: TRecorder.h:370
virtual void Stop(TRecorder *, Bool_t)
Definition: TRecorder.h:369
Class provides direct recorder/replayer interface for a user.
Definition: TRecorder.h:266
void Replay()
Definition: TRecorder.h:318
void Stop(Bool_t guiCommand=kFALSE)
Stopps recording events.
Definition: TRecorder.cxx:230
void ReplayStop()
Cancels replaying.
Definition: TRecorder.cxx:263
void Resume()
Resumes replaying.
Definition: TRecorder.cxx:255
TRecorderState * fRecorderState
Definition: TRecorder.h:268
virtual TRecorder::ERecorderState GetState() const
Get current state of recorder.
Definition: TRecorder.cxx:299
TString fFilename
Definition: TRecorder.h:280
void Start(const char *filename, Option_t *option="RECREATE", Window_t *w=0, Int_t winCount=0)
Starts recording events.
Definition: TRecorder.cxx:221
void ListGui(const char *filename)
Prints out recorded GUI events.
Definition: TRecorder.cxx:279
void Pause()
Pauses replaying.
Definition: TRecorder.cxx:247
TRecorder & operator=(const TRecorder &)
@ kRecording
Definition: TRecorder.h:294
@ kReplaying
Definition: TRecorder.h:296
void Browse(TBrowser *)
Browse the recorder from a ROOT file.
Definition: TRecorder.cxx:213
TRecorder(const TRecorder &)
Current state of recorder.
void ListCmd(const char *filename)
Prints out recorded commandline events.
Definition: TRecorder.cxx:271
virtual ~TRecorder()
Destructor.
Definition: TRecorder.cxx:204
TRecorder()
Creates initial INACTIVE state for the recorder.
Definition: TRecorder.cxx:179
void PrevCanvases(const char *filename, Option_t *option)
Save previous canvases in a .root file.
Definition: TRecorder.cxx:308
void ChangeState(TRecorderState *newstate, Bool_t deletePreviousState=kTRUE)
Changes state from the current to the passed one (newstate) Deletes the old state if delPreviousState...
Definition: TRecorder.cxx:288
Sequenceable collection abstract base class.
Basic string class.
Definition: TString.h:136
const char * Data() const
Definition: TString.h:369
Basic time type with millisecond precision.
Definition: TTime.h:27
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
A TTree represents a columnar dataset.
Definition: TTree.h:79
TText * text
TLine * line
const Int_t n
Definition: legend1.C:16
static constexpr double s
Event structure.
Definition: GuiTypes.h:174