<commit_before>// @(#)root/gui:$Id$
// Author: <NAME> & <NAME>   18/10/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.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGImageMap (with TGRegion and TGRegionWithId help classes)           //
//                                                                      //
// A TGImageMap provides the functionality like a clickable image in    //
// a web browser with sensitive regions (MAP HTML tag).                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TGImageMap.h"
#include "TRefCnt.h"
#include "TGMenu.h"
#include "TGToolTip.h"
#include "TList.h"
#include "TArrayS.h"


ClassImp(TGRegion)
ClassImp(TGRegionWithId)
ClassImpQ(TGImageMap)


TGRegionWithId  *gCurrentRegion; // current region

static TGRegion *gEmptyRegion = 0;
static Int_t gPointerX;  // current X mouse position
static Int_t gPointerY;  // current Y mouse position



class TGRegionData : public TRefCnt {

friend class TGRegion;

private:
   Region_t   fRgn;     // region handle
   Bool_t     fIsNull;  // true if null region

public:
   TGRegionData() { fRgn = 0; fIsNull = kTRUE; AddReference(); }
   ~TGRegionData() { }
   TGRegionData &operator=(const TGRegionData &r);
};

//______________________________________________________________________________
TGRegionData &TGRegionData::operator=(const TGRegionData &r)
{
   // Assignemnt of region data object.

   fRefs   = r.fRefs;
   fRgn    = r.fRgn;
   fIsNull = r.fIsNull;

   return *this;
}


////////////////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
TGRegion::TGRegion()
{
   // Create a region object.

   if (!gEmptyRegion)                      // avoid too many allocs<commit_msg>Silent harmless coverity #36373 (unsafe assignment operator)<commit_after>// @(#)root/gui:$Id$
// Author: <NAME> & <NAME>   18/10/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.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGImageMap (with TGRegion and TGRegionWithId help classes)           //
//                                                                      //
// A TGImageMap provides the functionality like a clickable image in    //
// a web browser with sensitive regions (MAP HTML tag).                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TGImageMap.h"
#include "TRefCnt.h"
#include "TGMenu.h"
#include "TGToolTip.h"
#include "TList.h"
#include "TArrayS.h"


ClassImp(TGRegion)
ClassImp(TGRegionWithId)
ClassImpQ(TGImageMap)


TGRegionWithId  *gCurrentRegion; // current region

static TGRegion *gEmptyRegion = 0;
static Int_t gPointerX;  // current X mouse position
static Int_t gPointerY;  // current Y mouse position



class TGRegionData : public TRefCnt {

friend class TGRegion;

private:
   Region_t   fRgn;     // region handle
   Bool_t     fIsNull;  // true if null region

public:
   TGRegionData() { fRgn = 0; fIsNull = kTRUE; AddReference(); }
   ~TGRegionData() { }
   TGRegionData &operator=(const TGRegionData &r);
};

//______________________________________________________________________________
TGRegionData &TGRegionData::operator=(const TGRegionData &r)
{
   // Assignemnt of region data object.

   // coverity [self_assign]
   fRefs   = r.fRefs;
   fRgn    = r.fRgn;
   fIsNull = r.fIsNull;

   return *this;
}


////////////////////////////////////////////////////////////////////////////////
//______________________________________________________________________________
TGRegion::TGRegion()
{
   // Create a region object.

   if (!gEmptyRegion)                      // avoid too many allocs
{'fraction_non_alphanumeric': 0.23004788507581803, 'fraction_numerical': 0.008180367118914605, 'mean_word_length': 1.4561489465948065, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 28, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7289309', 'n_tokens_mistral': 1228, 'n_tokens_neox': 1107, 'n_words': 305}