Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 ClassDefOverride(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 ERecEventType GetType() const override {
112 // Returns what kind of event it stores (commandline event)
114 }
115
116 void ReplayEvent(Bool_t) override {
117 // Stored command is executed again
118 std::cout << GetText() << std::endl;
120 }
121
122 ClassDefOverride(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 ERecEventType GetType() const override {
157 // Returns what kind of event it stores (Especial event)
159 }
160
161 void ReplayEvent(Bool_t) override {
162 // Stored event is executed again
163
165 }
166
167 ClassDefOverride(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 ERecEventType GetType() const override {
224 // Returns what kind of event it stores (GUI event)
226 }
227
228 void ReplayEvent(Bool_t showMouseCursor = kTRUE) override;
229 static Event_t *CreateEvent(TRecGuiEvent *ge);
230
231 ClassDefOverride(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
260
261 ClassDefOverride(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 ~TRecorder() override;
305
306 void Browse(TBrowser *) override;
307
308 // Starts recording of events to the given file
309 void Start(const char *filename, Option_t *option = "RECREATE", Window_t *w = nullptr, 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 ClassDefOverride(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 ~TRecorderReplaying() override;
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 void Pause(TRecorder *r) override;
469 virtual void Continue();
470 void ReplayStop(TRecorder *r) override;
471
472 void RegisterWindow(Window_t w); //SLOT
473 void ReplayRealtime(); //SLOT
474
475 ClassDefOverride(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 ~TRecorderRecording() override;
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 void Stop(TRecorder *r, Bool_t guiCommand) override;
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 ClassDefOverride(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:
570 ~TRecorderInactive() override {}
572
573 void ListCmd(const char *filename) override;
574 void ListGui(const char *filename) override;
575
576 void Start(TRecorder *r, const char *filename, Option_t *option, Window_t *w = nullptr, Int_t winCount = 0) override;
577 Bool_t Replay(TRecorder *r, const char *filename, Bool_t showMouseCursor, TRecorder::EReplayModes mode) override;
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) override;
585
586 ClassDefOverride(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 ~TRecorderPaused() override {}
606
607 TRecorderReplaying *fReplayingState; // Replaying that is paused
608
609protected:
610 friend class TRecorderReplaying;
612
613public:
615
616 void Resume(TRecorder *r) override;
617 void ReplayStop(TRecorder *r) override;
618
619 ClassDefOverride(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 = nullptr, UInt_t w = 230, UInt_t h = 150);
652 ~TGRecorder() override;
653
654 void StartStop();
655 void Update();
656 void Replay();
657
658 ClassDefOverride(TGRecorder,0) // GUI class of the event recorder.
659};
660
661#endif // ROOT_TRecorder
EGEventType
Definition GuiTypes.h:59
Handle_t Window_t
Window handle.
Definition GuiTypes.h:29
ULong_t Time_t
Event time.
Definition GuiTypes.h:42
ULongptr_t Handle_t
Generic resource handle.
Definition GuiTypes.h:26
#define h(i)
Definition RSha256.hxx:106
#define e(i)
Definition RSha256.hxx:103
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
unsigned long long ULong64_t
Definition RtypesCore.h:81
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassDef(name, id)
Definition Rtypes.h:337
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
R__EXTERN TApplication * gApplication
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char text
virtual Longptr_t ProcessLine(const char *line, Bool_t sync=kFALSE, Int_t *error=nullptr)
Process a single command line, either a C++ statement or an interpreter command starting with a "....
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
The Canvas class.
Definition TCanvas.h:23
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
Definition TFile.h:53
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:397
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
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.
TGPictureButton * fReplay
Definition TRecorder.h:636
TRecorder * fRecorder
Definition TRecorder.h:633
void Update()
Called when fTimer timeouts (every 0.025 second) Updates GUI of recorder.
static const Int_t fgWidgetsCount
Definition TRecorder.h:645
TGLabel * fStatus
Definition TRecorder.h:638
~TGRecorder() override
Destructor. Cleanup the GUI.
time_t fElapsed
Definition TRecorder.h:643
void SetDefault()
Sets GUI to the default inactive state.
void Replay()
Handles push of fReplay button according to the current recorder state.
ROOT GUI Window base class.
Definition TGWindow.h:23
A doubly linked list.
Definition TList.h:38
Mother of all ROOT objects.
Definition TObject.h:41
Class used for storing information about 1 commandline event.
Definition TRecorder.h:92
const char * GetText() const
Definition TRecorder.h:106
ERecEventType GetType() const override
Definition TRecorder.h:111
TString fText
Definition TRecorder.h:94
void ReplayEvent(Bool_t) override
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
@ kExtraEvent
Definition TRecorder.h:58
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 ReplayEvent(Bool_t) override
Definition TRecorder.h:161
void SetText(TString text)
Definition TRecorder.h:146
TString GetText() const
Definition TRecorder.h:151
TString fText
Definition TRecorder.h:139
ERecEventType GetType() const override
Definition TRecorder.h:156
class TRecGuiEvent
Definition TRecorder.h:181
EGEventType fType
Definition TRecorder.h:188
UInt_t fCode
Definition TRecorder.h:195
Int_t fFormat
Definition TRecorder.h:202
ERecEventType GetType() const override
Definition TRecorder.h:223
Long_t fUser[5]
Definition TRecorder.h:203
static Event_t * CreateEvent(TRecGuiEvent *ge)
Converts TRecGuiEvent type to Event_t type.
Window_t fMasked
Definition TRecorder.h:207
Handle_t fHandle
Definition TRecorder.h:201
UInt_t fHeight
Definition TRecorder.h:198
UInt_t fWidth
Definition TRecorder.h:197
void ReplayEvent(Bool_t showMouseCursor=kTRUE) override
Replays stored GUI event.
Bool_t fSendEvent
Definition TRecorder.h:200
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
void ListGui(const char *filename) override
Prints out GUI events recorded in given file.
void ListCmd(const char *filename) override
Prints out commandline events recorded in given file.
void Start(TRecorder *r, const char *filename, Option_t *option, Window_t *w=nullptr, Int_t winCount=0) override
Switches from INACTIVE state to RECORDING and starts recording.
TSeqCollection * fCollect
Definition TRecorder.h:567
void PrevCanvases(const char *filename, Option_t *option) override
Save previous canvases in a .root file.
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.
~TRecorderInactive() override
Definition TRecorder.h:570
static long DisplayValid(Long_t n)
Definition TRecorder.h:582
TRecorder::ERecorderState GetState() const override
Definition TRecorder.h:579
Bool_t Replay(TRecorder *r, const char *filename, Bool_t showMouseCursor, TRecorder::EReplayModes mode) override
Switches from INACTIVE state of recorder to REPLAYING Return kTRUE if replaying has started or kFALSE...
Represents state of TRecorder when replaying was paused by a user.
Definition TRecorder.h:603
TRecorder::ERecorderState GetState() const override
Definition TRecorder.h:614
void ReplayStop(TRecorder *r) override
Replaying is cancelled.
TRecorderReplaying * fReplayingState
Definition TRecorder.h:607
~TRecorderPaused() override
Definition TRecorder.h:605
void Resume(TRecorder *r) override
Continues replaying.
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.
TRecorder * fRecorder
Definition TRecorder.h:495
void RecordMousePosition()
Try to record all mouse moves...
TRecorder::ERecorderState GetState() const override
Definition TRecorder.h:532
TRecGuiEvent * fGuiEvent
Definition TRecorder.h:509
~TRecorderRecording() override
Freeing of allocated memory.
Long64_t fBeginPave
Definition TRecorder.h:501
void RegisterWindow(Window_t w)
This method is called when RegisteredWindow(Window_t) is emitted from TGClient.
Bool_t StartRecording()
Connects appropriate signals and slots in order to gain all registered windows and processed events i...
Bool_t fFilterEventPave
Definition TRecorder.h:523
void StartEditing()
Memorize the starting time of editinga TLatex or a TPaveLabel.
void RecordGuiBldEvent(Event_t *e)
Special case for the gui builder, having a timer handling some of the events.
void RecordPave(const TObject *obj)
Records TPaveLabel object created in TCreatePrimitives::Pave()
Bool_t IsFiltered(Window_t id)
Returns kTRUE if passed id belongs to window IDs of recorder GUI itself.
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.
void RecordGuiCNEvent(Event_t *e)
Records GUI Event_t *e of type kConfigureNotify.
void RecordExtraEvent(TString line, TTime extTime)
Records TLatex or TPaveLabel object created in TCreatePrimitives, ExtTime is needed for the correct r...
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...
void RecordText(const TObject *obj)
Records TLatex object created in TCreatePrimitives::Text()
void Stop(TRecorder *r, Bool_t guiCommand) override
Disconnects all slots and stopps recording.
void CopyEvent(Event_t *e, Window_t wid)
Copies all items of given event to fGuiEvent.
void RecordCmdEvent(const char *line)
Records commandline event (text and time) ans saves the previous commandline event This 1 event delay...
Represents state of TRecorder when replaying previously recorded events.
Definition TRecorder.h:396
Bool_t FilterEvent(TRecGuiEvent *e)
TRecEvent * fNextEvent
Definition TRecorder.h:437
TRecGuiEvent * fGuiEvent
Definition TRecorder.h:422
void Pause(TRecorder *r) override
Pauses replaying.
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...
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.
Bool_t CanOverlap()
ButtonPress and ButtonRelease must be sometimes replayed more times Example: pressing of a button ope...
void ReplayStop(TRecorder *r) override
Cancels replaying.
TRecorder::ERecorderState GetState() const override
Definition TRecorder.h:466
~TRecorderReplaying() override
Closes all signal-slot connections Frees all memory allocated in constructor.
Bool_t fShowMouseCursor
Definition TRecorder.h:454
Bool_t PrepareNextEvent()
Finds the next event in log file to replay and sets it to fNextEvent.
TRecorder * fRecorder
Definition TRecorder.h:405
Bool_t Initialize(TRecorder *r, Bool_t showMouseCursor, TRecorder::EReplayModes mode)
Initialization of data structures for replaying.
void RegisterWindow(Window_t w)
Creates mapping for the newly registered window w and adds this mapping to fWindowList.
void ReplayRealtime()
Replays the next event.
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
~TRecorder() override
Destructor.
void Replay()
Definition TRecorder.h:318
void Stop(Bool_t guiCommand=kFALSE)
Stopps recording events.
void ReplayStop()
Cancels replaying.
void Resume()
Resumes replaying.
TRecorderState * fRecorderState
Definition TRecorder.h:268
virtual TRecorder::ERecorderState GetState() const
Get current state of recorder.
TString fFilename
Definition TRecorder.h:280
void ListGui(const char *filename)
Prints out recorded GUI events.
void Start(const char *filename, Option_t *option="RECREATE", Window_t *w=nullptr, Int_t winCount=0)
Starts recording events.
void Pause()
Pauses replaying.
TRecorder & operator=(const TRecorder &)
TRecorder(const TRecorder &)
Current state of recorder.
void Browse(TBrowser *) override
Browse the recorder from a ROOT file.
void ListCmd(const char *filename)
Prints out recorded commandline events.
TRecorder()
Creates initial INACTIVE state for the recorder.
void PrevCanvases(const char *filename, Option_t *option)
Save previous canvases in a .root file.
void ChangeState(TRecorderState *newstate, Bool_t deletePreviousState=kTRUE)
Changes state from the current to the passed one (newstate) Deletes the old state if delPreviousState...
Sequenceable collection abstract base class.
Basic string class.
Definition TString.h:139
const char * Data() const
Definition TString.h:376
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
TLine * line
const Int_t n
Definition legend1.C:16
Event structure.
Definition GuiTypes.h:174