44 Warning(
"TGGC",
"dash list can have only up to %ld elements",
75 Error(
"TGGC",
"TGClient not yet initialized, should never happen");
95 gClient->GetGCPool()->fList->Add(
this);
104 gClient->GetGCPool()->ForceFreeGC(
this);
119 gClient->GetGCPool()->fList->Add(
this);
149 switch (bit & values->
fMask) {
218 Warning(
"UpdateValues",
"dash list can have only up to %ld elements",
238 gClient->GetGCPool()->fList->Add(
this);
490 Warning(
"SetDashList",
"dash list can have only up to %ld elements",
528 if (mask.
Length() == 0) mask =
"kGCFunction";
529 else mask +=
" | kGCFunction";
532 if (mask.
Length() == 0) mask =
"kGCPlaneMask";
533 else mask +=
" | kGCPlaneMask";
536 if (mask.
Length() == 0) mask =
"kGCForeground";
537 else mask +=
" | kGCForeground";
540 if (mask.
Length() == 0) mask =
"kGCBackground";
541 else mask +=
" | kGCBackground";
544 if (mask.
Length() == 0) mask =
"kGCLineWidth";
545 else mask +=
" | kGCLineWidth";
548 if (mask.
Length() == 0) mask =
"kGCLineStyle";
549 else mask +=
" | kGCLineStyle";
552 if (mask.
Length() == 0) mask =
"kGCCapStyle";
553 else mask +=
" | kGCCapStyle";
556 if (mask.
Length() == 0) mask =
"kGCJoinStyle";
557 else mask +=
" | kGCJoinStyle";
560 if (mask.
Length() == 0) mask =
"kGCFillStyle";
561 else mask +=
" | kGCFillStyle";
564 if (mask.
Length() == 0) mask =
"kGCFillRule";
565 else mask +=
" | kGCFillRule";
568 if (mask.
Length() == 0) mask =
"kGCTile";
569 else mask +=
" | kGCTile";
572 if (mask.
Length() == 0) mask =
"kGCStipple";
573 else mask +=
" | kGCStipple";
576 if (mask.
Length() == 0) mask =
"kGCTileStipXOrigin";
577 else mask +=
" | kGCTileStipXOrigin";
580 if (mask.
Length() == 0) mask =
"kGCTileStipYOrigin";
581 else mask +=
" | kGCTileStipYOrigin";
584 if (mask.
Length() == 0) mask =
"kGCFont";
585 else mask +=
" | kGCFont";
588 if (mask.
Length() == 0) mask =
"kGCSubwindowMode";
589 else mask +=
" | kGCSubwindowMode";
592 if (mask.
Length() == 0) mask =
"kGCGraphicsExposures";
593 else mask +=
" | kGCGraphicsExposures";
596 if (mask.
Length() == 0) mask =
"kGCClipXOrigin";
597 else mask +=
" | kGCClipXOrigin";
600 if (mask.
Length() == 0) mask =
"kGCClipYOrigin";
601 else mask +=
" | kGCClipYOrigin";
604 if (mask.
Length() == 0) mask =
"kGCClipMask";
605 else mask +=
" | kGCClipMask";
608 if (mask.
Length() == 0) mask =
"kGCDashOffset";
609 else mask +=
" | kGCDashOffset";
612 if (mask.
Length() == 0) mask =
"kGCDashList";
613 else mask +=
" | kGCDashList";
616 if (mask.
Length() == 0) mask =
"kGCArcMode";
617 else mask +=
" | kGCArcMode";
632 out <<
" TGGC *uGC; // will reflect user GC changes" << std::endl;
637 const char *colorname;
644 out <<
" // graphics context changes" << std::endl;
646 out <<
" GCValues_t " << valname.
Data() <<
";" << std::endl;
647 out <<
" " << valname.
Data() <<
".fMask = " <<
GetMaskString() <<
";" << std::endl;
649 for (
Mask_t bit = 1; bit <= fmask; bit <<= 1) {
650 switch (bit & fmask) {
655 out <<
" " << valname.
Data() <<
".fFunction = ";
664 out <<
"kGXandReverse";
670 out <<
"kGXandInverted";
691 out <<
"kGXorReverse";
694 out <<
"kGXcopyInverted";
697 out <<
"kGXorInverted";
706 out <<
";" << std::endl;
709 out <<
" " << valname.
Data() <<
".fPlaneMask = " <<
GetPlaneMask() <<
";" << std::endl;
714 out <<
" gClient->GetColorByName(" << quote << colorname << quote
715 <<
"," << valname.
Data() <<
".fForeground);" << std::endl;
720 out <<
" gClient->GetColorByName(" << quote << colorname << quote
721 <<
"," << valname.
Data() <<
".fBackground);" << std::endl;
724 out <<
" " << valname.
Data() <<
".fLineWidth = " <<
GetLineWidth() <<
";" << std::endl;
727 out <<
" " << valname.
Data() <<
".fLineStyle = ";
733 out <<
"kLineOnOffDash";
736 out <<
"kLineDoubleDash";
739 out <<
";" << std::endl;
742 out <<
" " << valname.
Data() <<
".fCapStyle = ";
745 out <<
"kCapNotLast";
754 out <<
"kCapProjecting";
757 out <<
";" << std::endl;
760 out <<
" " << valname.
Data() <<
".fJoinStyle = ";
772 out <<
";" << std::endl;
775 out <<
" " << valname.
Data() <<
".fFillStyle = ";
784 out <<
"kFillStippled";
787 out <<
"kFillOpaqueStippled";
790 out <<
";" << std::endl;
793 out <<
" " << valname.
Data() <<
".fFillRule = ";
796 out <<
"kEvenOddRule";
799 out <<
"kWindingRule";
802 out <<
";" << std::endl;
805 out <<
" " << valname.
Data() <<
".fTile = " <<
GetTile() <<
";" << std::endl;
808 out <<
" " << valname.
Data() <<
".fStipple = " <<
GetStipple() <<
";" << std::endl;
817 out <<
" " << valname.
Data() <<
".fFont = ufont->GetFontHandle();" << std::endl;
820 out <<
" " << valname.
Data() <<
".fSubwindowMode = ";
823 out <<
"kClipByChildren";
826 out <<
"kIncludeInferiors";
829 out <<
";" << std::endl;
832 out <<
" " << valname.
Data() <<
".fGraphicsExposures = ";
837 out <<
";" << std::endl;
840 out <<
" " << valname.
Data() <<
".fClipXOrigin = " <<
GetClipXOrigin() <<
";" << std::endl;
843 out <<
" " << valname.
Data() <<
".fClipYOrigin = " <<
GetClipYOrigin() <<
";" << std::endl;
846 out <<
" " << valname.
Data() <<
".fClipMask = " <<
GetClipMask() <<
";" << std::endl;
849 out <<
" " << valname.
Data() <<
".fDashOffset = " <<
GetDashOffset() <<
";" << std::endl;
853 Warning(
"TGGC::SavePrimitive",
"dash list can have only up to %ld elements",
855 out <<
" " << valname.
Data() <<
".fDashLen = "
857 out <<
" memcpy(GetDashes()," << valname.
Data() <<
".fDashes,"
858 << valname.
Data() <<
".fDashLen);" << std::endl;
861 out <<
" " << valname.
Data() <<
".fArcMode = ";
867 out <<
"kArcPieSlice";
870 out <<
";" << std::endl;
874 out <<
" uGC = gClient->GetGC(&" << valname.
Data() <<
", kTRUE);" << std::endl;
907 Error(
"ForceFreeGC",
"removed a shared graphics context\n"
908 "best to use graphics contexts via the TGGCPool()");
935 while (
TGGC *gc = (
TGGC *) next()) {
936 if (gc->fContext == gct) {
937 if (gc->RemoveReference() == 0) {
962 while (
TGGC *gc = (
TGGC *) next()) {
963 if (gc->fContext == gct)
987 TGGC *gc, *best_match = 0;
988 Int_t matching_bits, best_matching_bits = -1;
1001 while ((gc = (
TGGC *) next())) {
1002 matching_bits =
MatchGC(gc, values);
1003 if (matching_bits > best_matching_bits) {
1004 best_matching_bits = matching_bits;
1015 Printf(
"<TGGCPool::GetGC>: %smatching GC found\n", exact ?
"exact " :
"");
1040 Int_t matching_bits = -1;
1046 if (common_bits == 0)
return 0;
1063 for (bit = 1; bit <= common_bits; bit <<= 1) {
1064 switch (bit & common_bits) {
1145 return matching_bits;
const Mask_t kGCDashOffset
const Mask_t kGCBackground
const Mask_t kGCForeground
const Mask_t kGCLineStyle
const Mask_t kGCSubwindowMode
const Mask_t kGCLineWidth
const Mask_t kGCClipXOrigin
const Mask_t kGCFillStyle
const Mask_t kGCJoinStyle
const Mask_t kGCTileStipXOrigin
const Mask_t kGCPlaneMask
const Mask_t kGCGraphicsExposures
const Mask_t kGCClipYOrigin
const Mask_t kGCTileStipYOrigin
void Printf(const char *fmt,...)
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
static const char * PixelAsHexString(ULong_t pixel)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
virtual ~TGGCPool()
Delete graphics context pool.
Int_t MatchGC(const TGGC *gc, GCValues_t *values)
Try to find matching graphics context.
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
TGGC * FindGC(const TGGC *gc)
Find graphics context. Returns 0 in case gc is not found.
void Print(Option_t *option="") const
List all graphics contexts in the pool.
void ForceFreeGC(const TGGC *gc)
Force remove graphics context from list. Is only called via ~TGGC().
TGGCPool(const TGGCPool &gp)
void UpdateGC(TGGC *gc, GCValues_t *values)
Update graphics context with the values spcified in values->fMask.
void SetArcMode(Int_t v)
Set arc mode (kArcChord, kArcPieSlice).
Int_t GetTileStipYOrigin() const
TGGC(GCValues_t *values, Bool_t calledByGCPool)
Create a graphics context (only called via TGGCPool::GetGC()).
Int_t GetJoinStyle() const
Bool_t GetGraphicsExposures() const
Int_t GetSubwindowMode() const
Int_t GetFillStyle() const
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
void SetLineWidth(Int_t v)
Set line width.
ULong_t GetPlaneMask() const
void SetFont(FontH_t v)
Set font.
void SetPlaneMask(ULong_t v)
Set plane mask.
TGGC & operator=(const TGGC &rhs)
Graphics context assignment operator.
void SetTileStipYOrigin(Int_t v)
Y offset for tile or stipple operations.
Pixmap_t GetClipMask() const
Int_t GetClipXOrigin() const
void SetFillStyle(Int_t v)
Set fill style (kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled).
Pixel_t GetForeground() const
Int_t GetFillRule() const
void SetCapStyle(Int_t v)
Set cap style (kCapNotLast, kCapButt, kCapRound, kCapProjecting).
void Print(Option_t *option="") const
Print graphics contexts info.
const char * GetDashes() const
Int_t GetTileStipXOrigin() const
void SetForeground(Pixel_t v)
Set foreground color.
Int_t GetLineStyle() const
void SetClipMask(Pixmap_t v)
Bitmap for clipping.
void SetFillRule(Int_t v)
Set fill rule (kEvenOddRule, kWindingRule).
GContext_t operator()() const
Not inline due to a bug in g++ 2.96 20000731 (Red Hat Linux 7.0).
void SetDashOffset(Int_t v)
Patterned/dashed line offset.
void SetTileStipXOrigin(Int_t v)
X offset for tile or stipple operations.
void SetAttributes(GCValues_t *values)
Set attributes as specified in the values structure.
void SetDashList(const char v[], Int_t len)
Set dash pattern. First use SetDashOffset() if not 0.
EGraphicsFunction GetFunction() const
void SetJoinStyle(Int_t v)
Set line join style (kJoinMiter, kJoinRound, kJoinBevel).
void SetClipXOrigin(Int_t v)
X origin for clipping.
Int_t GetClipYOrigin() const
Pixel_t GetBackground() const
void SetTile(Pixmap_t v)
Set tile pixmap for tiling operations.
void SetClipYOrigin(Int_t v)
Y origin for clipping.
void UpdateValues(GCValues_t *v)
Update values + mask.
void SetBackground(Pixel_t v)
Set background color.
void SetFunction(EGraphicsFunction v)
Set graphics context drawing function.
void SetStipple(Pixmap_t v)
Set 1 plane pixmap for stippling.
Pixmap_t GetStipple() const
Int_t GetLineWidth() const
void SetGraphicsExposures(Bool_t v)
True if graphics exposure should be generated.
void SetLineStyle(Int_t v)
Set line style (kLineSolid, kLineOnOffDash, kLineDoubleDash).
Int_t GetDashOffset() const
Int_t GetCapStyle() const
virtual ~TGGC()
Delete graphics context.
TString GetMaskString() const
Returns GC mask as a string - used in SavePrimitive().
void SetSubwindowMode(Int_t v)
Set sub window mode (kClipByChildren, kIncludeInferiors).
THashTable implements a hash table to store TObject's.
TObject * Remove(TObject *obj)
Remove object from the hashtable.
void Add(TObject *obj)
Add object to the hash table.
void Print(Option_t *option, Int_t recurse) const
Print the collection header and its elements.
TObject * FindObject(const char *name) const
Find object using its name.
Mother of all ROOT objects.
TObject & operator=(const TObject &rhs)
TObject assignment operator.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definitions for TRefCnt, base class for reference counted objects.
void SetRefCount(UInt_t r)
UInt_t References() const
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Short_t Min(Short_t a, Short_t b)
Bool_t fGraphicsExposures
EGraphicsFunction fFunction