/usr/include/root/TQCommand.h is in libroot-core-dev 5.34.14-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | // @(#)root/base:$Id$
// Author: Valeriy Onuchin 04/27/2004
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TQCommand
#define ROOT_TQCommand
//////////////////////////////////////////////////////////////////////////
// //
// TQCommand, TQUndoManager - support for multiple Undo/Redo operations //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TList
#include "TList.h"
#endif
#ifndef ROOT_TQObject
#include "TQObject.h"
#endif
class TQCommand : public TList, public TQObject {
friend class TQUndoManager;
protected:
TQConnection *fRedo; // do/redo action
TQConnection *fUndo; // undo action
Long_t *fRedoArgs; // redo values
Long_t *fUndoArgs; // undo values
Int_t fNRargs; // number of redo arguments
Int_t fNUargs; // number of undo arguments
Int_t fState; // -1 undoing on, 1 redoing on, 0 nothing in progress
Int_t fStatus; // fStatus++ after Redo(), fStatus-- after Undo()
Bool_t fNewDelete; // kTRUE if Redo/Undo methods are new/delete
TString fName; // command name. Default is "ClassName::RedoName(args)"
TString fTitle; // command description
void *fObject; // object to which undo/redo actions applied
virtual void Init(const char *cl, void *object,
const char *redo, const char *undo);
virtual void PrintCollectionHeader(Option_t* option) const;
private:
TQCommand &operator=(const TQCommand &); // Not yet implemented.
public:
TQCommand(const char *cl = 0, void *object = 0,
const char *redo = 0, const char *undo = 0);
TQCommand(TObject *obj, const char *redo = 0, const char *undo = 0);
TQCommand(const TQCommand &com);
virtual ~TQCommand();
virtual void Redo(Option_t *option=""); //*SIGNAL*
virtual void Undo(Option_t *option=""); //*SIGNAL*
virtual void SetArgs(Int_t nargs, ...);
virtual void SetUndoArgs(Int_t nargs, ...);
virtual void SetRedoArgs(Int_t nargs, ...);
virtual Bool_t CanMerge(TQCommand *c) const;
virtual void Merge(TQCommand *c);
virtual Long64_t Merge(TCollection*,TFileMergeInfo*);
virtual Bool_t CanCompress(TQCommand *c) const;
virtual void Compress(TQCommand *c);
virtual Bool_t IsEqual(const TObject* obj) const;
virtual Bool_t IsSetter() const;
virtual Bool_t CanRedo() const;
virtual Bool_t CanUndo() const;
const char *GetRedoName() const;
const char *GetUndoName() const;
TQConnection *GetRedo() const { return fRedo; }
TQConnection *GetUndo() const { return fUndo; }
Long_t *GetRedoArgs() const;
Long_t *GetUndoArgs() const;
Int_t GetNRargs() const;
Int_t GetNUargs() const;
void *GetObject() const;
Int_t GetStatus() const;
Bool_t IsMacro() const;
Bool_t IsUndoing() const;
Bool_t IsRedoing() const;
Bool_t IsExecuting() const;
virtual void SetName(const char *name);
virtual void SetTitle(const char *title);
virtual void ls(Option_t *option="") const;
virtual void Add(TObject *obj, Option_t *opt);
virtual void Add(TObject *obj) { Add(obj, 0); }
virtual void Delete(Option_t *option="");
virtual const char *GetName() const;
virtual const char *GetTitle() const;
static TQCommand *GetCommand();
ClassDef(TQCommand,0) // encapsulates the information for undo/redo a single action.
};
//////////////////////////////////////////////////////////////////////////
class TQUndoManager : public TQCommand {
protected:
TObjLink *fCursor; // current position in history stack
TQCommand *fCurrent; // the latest executed command
UInt_t fLimit; // maximum number of commands can be located in stack
TList *fLogBook; // listing of all actions during execution
Bool_t fLogging; // kTRUE if logging is ON
virtual void PrintCollectionEntry(TObject* entry, Option_t* option, Int_t recurse) const;
public:
TQUndoManager();
virtual ~TQUndoManager();
virtual void Add(TObject *obj, Option_t *opt);
virtual void Add(TObject *obj) { Add(obj, 0); }
virtual void Redo(Option_t *option="");
virtual void Undo(Option_t *option="");
virtual Bool_t CanRedo() const;
virtual Bool_t CanUndo() const;
virtual void SetLogging(Bool_t on = kTRUE);
Bool_t IsLogging() const;
TQCommand *GetCurrent() const;
TQCommand *GetCursor() const;
UInt_t GetLimit() const;
virtual void SetLimit(UInt_t limit);
virtual void CurrentChanged(TQCommand *c); //*SIGNAL*
virtual void ls(Option_t *option="") const;
ClassDef(TQUndoManager,0) // recorder of operations for undo and redo
};
#endif
|