<commit_before>// @(#)root/gpad:$Id$
// Author: <NAME>   08/01/2000

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TROOT.h"
#include "TGuiFactory.h"
#include "TInspectCanvas.h"
#include "TButton.h"
#include "TClass.h"
#include "TLine.h"
#include "TLink.h"
#include "TDataMember.h"
#include "TDataType.h"
#include "TRealData.h"
#include "TLatex.h"

ClassImp(TInspectCanvas)

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TInspectorObject                                                     //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TInspectorObject : public TObject
{
   // This class is designed to wrap a Foreign object in order to
   // inject it into the Browse sub-system.

public:

   TInspectorObject(void *obj, TClass *cl) : fObj(obj),fClass(cl) {};
   ~TInspectorObject(){;}

   void   *GetObject() const { return fObj; };
   void    Inspect() const {
      gGuiFactory->CreateInspectorImp(this, 400, 200);
   };
   TClass *IsA() const { return fClass; }

private:
   void     *fObj;   //! pointer to the foreign object
   TClass   *fClass; //! pointer to class of the foreign object

};


//______________________________________________________________________________//*-*
//*-*   A InspectCanvas is a canvas specialized to inspect Root objects.
//
//Begin_Html
/*
<img src="gif/InspectCanvas.gif">
*/
//End_Html
//


//______________________________________________________________________________
TInspectCanvas::TInspectCanvas() : TCanvas()
{
   // InspectCanvas default constructor.

   fBackward   = 0;
   fForward    = 0;
   fCurObject  = 0;
   fObjects    = 0;
   fLogx       = kFALSE;
   fLogy       = kFALSE;
}


//_____________________________________________________________________________
TInspectCanvas::TInspectCanvas(UInt_t ww, UInt_t wh)
            : TCanvas("inspect","ROOT Object Inspector",ww,wh)
{
   // InspectCanvas constructor.

   fBackward   = 0;
   fForward    = 0;
   fCurObject  = 0;
   fObjects    = new TList;
   fLogx       = kFALSE;
   fLogy       = kFALSE;
}


//______________________________________________________________________________
TInspectCanvas::~TInspectCanvas()
{
   // InspectCanvas default destructor.

   if (fObjects) {
      fObjects->Clear("nodelete");
      delete fObjects;
   }
}


//______________________________________________________________________________
void TInspectCanvas::InspectObject(TObject *obj)
{
   // Dump contents of obj in a graphics canvas.
   // Same action as TObject::Dump but in a graphical form.
   // In addition pointers to other objects can be followed.
   //<commit_msg>From Bertrand:  - Make sure the inspector canvas background is white.<commit_after>// @(#)root/gpad:$Id$
// Author: <NAME>   08/01/2000

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TROOT.h"
#include "TGuiFactory.h"
#include "TInspectCanvas.h"
#include "TButton.h"
#include "TClass.h"
#include "TLine.h"
#include "TLink.h"
#include "TDataMember.h"
#include "TDataType.h"
#include "TRealData.h"
#include "TLatex.h"

ClassImp(TInspectCanvas)

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TInspectorObject                                                     //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

class TInspectorObject : public TObject
{
   // This class is designed to wrap a Foreign object in order to
   // inject it into the Browse sub-system.

public:

   TInspectorObject(void *obj, TClass *cl) : fObj(obj),fClass(cl) {};
   ~TInspectorObject(){;}

   void   *GetObject() const { return fObj; };
   void    Inspect() const {
      gGuiFactory->CreateInspectorImp(this, 400, 200);
   };
   TClass *IsA() const { return fClass; }

private:
   void     *fObj;   //! pointer to the foreign object
   TClass   *fClass; //! pointer to class of the foreign object

};


//______________________________________________________________________________//*-*
//*-*   A InspectCanvas is a canvas specialized to inspect Root objects.
//
//Begin_Html
/*
<img src="gif/InspectCanvas.gif">
*/
//End_Html
//


//______________________________________________________________________________
TInspectCanvas::TInspectCanvas() : TCanvas()
{
   // InspectCanvas default constructor.

   fBackward   = 0;
   fForward    = 0;
   fCurObject  = 0;
   fObjects    = 0;
   fLogx       = kFALSE;
   fLogy       = kFALSE;
   SetFillColor(0);
}


//_____________________________________________________________________________
TInspectCanvas::TInspectCanvas(UInt_t ww, UInt_t wh)
            : TCanvas("inspect","ROOT Object Inspector",ww,wh)
{
   // InspectCanvas constructor.

   fBackward   = 0;
   fForward    = 0;
   fCurObject  = 0;
   fObjects    = new TList;
   fLogx       = kFALSE;
   fLogy       = kFALSE;
   SetFillColor(0);
}


//______________________________________________________________________________
TInspectCanvas::~TInspectCanvas()
{
   // InspectCanvas default destructor.

   if (fObjects) {
      fObjects->Clear("nodelete");
      delete fObjects;
   }
}


//______________________________________________________________________________
void TInspectCanvas::InspectObject(TObject *obj)
{
   // Dump contents of obj in a graphics canvas.
   // Same action as TObject::Dump but in a graphical form.
   // In addition pointers to other objects can be followed.
   //
{'fraction_non_alphanumeric': 0.18347381095725468, 'fraction_numerical': 0.009030704394942806, 'mean_word_length': 1.9959422903516681, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2344582', 'n_tokens_mistral': 1728, 'n_tokens_neox': 1627, 'n_words': 419}