45 Warning(
"TGGC",
"dash list can have only up to %ld elements",
76 Error(
"TGGC",
"TGClient not yet initialized, should never happen");
96 gClient->GetGCPool()->fList->Add(
this);
105 gClient->GetGCPool()->ForceFreeGC(
this);
120 gClient->GetGCPool()->fList->Add(
this);
150 switch (bit & values->
fMask) {
219 Warning(
"UpdateValues",
"dash list can have only up to %ld elements",
239 gClient->GetGCPool()->fList->Add(
this);
491 Warning(
"SetDashList",
"dash list can have only up to %ld elements",
529 if (mask.
Length() == 0) mask =
"kGCFunction";
530 else mask +=
" | kGCFunction";
533 if (mask.
Length() == 0) mask =
"kGCPlaneMask";
534 else mask +=
" | kGCPlaneMask";
537 if (mask.
Length() == 0) mask =
"kGCForeground";
538 else mask +=
" | kGCForeground";
541 if (mask.
Length() == 0) mask =
"kGCBackground";
542 else mask +=
" | kGCBackground";
545 if (mask.
Length() == 0) mask =
"kGCLineWidth";
546 else mask +=
" | kGCLineWidth";
549 if (mask.
Length() == 0) mask =
"kGCLineStyle";
550 else mask +=
" | kGCLineStyle";
553 if (mask.
Length() == 0) mask =
"kGCCapStyle";
554 else mask +=
" | kGCCapStyle";
557 if (mask.
Length() == 0) mask =
"kGCJoinStyle";
558 else mask +=
" | kGCJoinStyle";
561 if (mask.
Length() == 0) mask =
"kGCFillStyle";
562 else mask +=
" | kGCFillStyle";
565 if (mask.
Length() == 0) mask =
"kGCFillRule";
566 else mask +=
" | kGCFillRule";
569 if (mask.
Length() == 0) mask =
"kGCTile";
570 else mask +=
" | kGCTile";
573 if (mask.
Length() == 0) mask =
"kGCStipple";
574 else mask +=
" | kGCStipple";
577 if (mask.
Length() == 0) mask =
"kGCTileStipXOrigin";
578 else mask +=
" | kGCTileStipXOrigin";
581 if (mask.
Length() == 0) mask =
"kGCTileStipYOrigin";
582 else mask +=
" | kGCTileStipYOrigin";
585 if (mask.
Length() == 0) mask =
"kGCFont";
586 else mask +=
" | kGCFont";
589 if (mask.
Length() == 0) mask =
"kGCSubwindowMode";
590 else mask +=
" | kGCSubwindowMode";
593 if (mask.
Length() == 0) mask =
"kGCGraphicsExposures";
594 else mask +=
" | kGCGraphicsExposures";
597 if (mask.
Length() == 0) mask =
"kGCClipXOrigin";
598 else mask +=
" | kGCClipXOrigin";
601 if (mask.
Length() == 0) mask =
"kGCClipYOrigin";
602 else mask +=
" | kGCClipYOrigin";
605 if (mask.
Length() == 0) mask =
"kGCClipMask";
606 else mask +=
" | kGCClipMask";
609 if (mask.
Length() == 0) mask =
"kGCDashOffset";
610 else mask +=
" | kGCDashOffset";
613 if (mask.
Length() == 0) mask =
"kGCDashList";
614 else mask +=
" | kGCDashList";
617 if (mask.
Length() == 0) mask =
"kGCArcMode";
618 else mask +=
" | kGCArcMode";
628 if (
gROOT->ClassSaved(TGGC::Class())) {
633 out <<
" TGGC *uGC; // will reflect user GC changes" << std::endl;
638 const char *colorname;
645 out <<
" // graphics context changes" << std::endl;
647 out <<
" GCValues_t " << valname.
Data() <<
";" << std::endl;
648 out <<
" " << valname.
Data() <<
".fMask = " <<
GetMaskString() <<
";" << std::endl;
650 for (
Mask_t bit = 1; bit <= fmask; bit <<= 1) {
651 switch (bit & fmask) {
656 out <<
" " << valname.
Data() <<
".fFunction = ";
665 out <<
"kGXandReverse";
671 out <<
"kGXandInverted";
692 out <<
"kGXorReverse";
695 out <<
"kGXcopyInverted";
698 out <<
"kGXorInverted";
707 out <<
";" << std::endl;
710 out <<
" " << valname.
Data() <<
".fPlaneMask = " <<
GetPlaneMask() <<
";" << std::endl;
715 out <<
" gClient->GetColorByName(" << quote << colorname << quote
716 <<
"," << valname.
Data() <<
".fForeground);" << std::endl;
721 out <<
" gClient->GetColorByName(" << quote << colorname << quote
722 <<
"," << valname.
Data() <<
".fBackground);" << std::endl;
725 out <<
" " << valname.
Data() <<
".fLineWidth = " <<
GetLineWidth() <<
";" << std::endl;
728 out <<
" " << valname.
Data() <<
".fLineStyle = ";
734 out <<
"kLineOnOffDash";
737 out <<
"kLineDoubleDash";
740 out <<
";" << std::endl;
743 out <<
" " << valname.
Data() <<
".fCapStyle = ";
746 out <<
"kCapNotLast";
755 out <<
"kCapProjecting";
758 out <<
";" << std::endl;
761 out <<
" " << valname.
Data() <<
".fJoinStyle = ";
773 out <<
";" << std::endl;
776 out <<
" " << valname.
Data() <<
".fFillStyle = ";
785 out <<
"kFillStippled";
788 out <<
"kFillOpaqueStippled";
791 out <<
";" << std::endl;
794 out <<
" " << valname.
Data() <<
".fFillRule = ";
797 out <<
"kEvenOddRule";
800 out <<
"kWindingRule";
803 out <<
";" << std::endl;
806 out <<
" " << valname.
Data() <<
".fTile = " <<
GetTile() <<
";" << std::endl;
809 out <<
" " << valname.
Data() <<
".fStipple = " <<
GetStipple() <<
";" << std::endl;
818 out <<
" " << valname.
Data() <<
".fFont = ufont->GetFontHandle();" << std::endl;
821 out <<
" " << valname.
Data() <<
".fSubwindowMode = ";
824 out <<
"kClipByChildren";
827 out <<
"kIncludeInferiors";
830 out <<
";" << std::endl;
833 out <<
" " << valname.
Data() <<
".fGraphicsExposures = ";
838 out <<
";" << std::endl;
841 out <<
" " << valname.
Data() <<
".fClipXOrigin = " <<
GetClipXOrigin() <<
";" << std::endl;
844 out <<
" " << valname.
Data() <<
".fClipYOrigin = " <<
GetClipYOrigin() <<
";" << std::endl;
847 out <<
" " << valname.
Data() <<
".fClipMask = " <<
GetClipMask() <<
";" << std::endl;
850 out <<
" " << valname.
Data() <<
".fDashOffset = " <<
GetDashOffset() <<
";" << std::endl;
854 Warning(
"TGGC::SavePrimitive",
"dash list can have only up to %ld elements",
856 out <<
" " << valname.
Data() <<
".fDashLen = "
858 out <<
" memcpy(GetDashes()," << valname.
Data() <<
".fDashes,"
859 << valname.
Data() <<
".fDashLen);" << std::endl;
862 out <<
" " << valname.
Data() <<
".fArcMode = ";
868 out <<
"kArcPieSlice";
871 out <<
";" << std::endl;
875 out <<
" uGC = gClient->GetGC(&" << valname.
Data() <<
", kTRUE);" << std::endl;
908 Error(
"ForceFreeGC",
"removed a shared graphics context\n"
909 "best to use graphics contexts via the TGGCPool()");
936 while (
TGGC *gc = (
TGGC *) next()) {
937 if (gc->fContext == gct) {
938 if (gc->RemoveReference() == 0) {
963 while (
TGGC *gc = (
TGGC *) next()) {
964 if (gc->fContext == gct)
988 TGGC *gc, *best_match = 0;
989 Int_t matching_bits, best_matching_bits = -1;
1002 while ((gc = (
TGGC *) next())) {
1003 matching_bits =
MatchGC(gc, values);
1004 if (matching_bits > best_matching_bits) {
1005 best_matching_bits = matching_bits;
1016 Printf(
"<TGGCPool::GetGC>: %smatching GC found\n", exact ?
"exact " :
"");
1041 Int_t matching_bits = -1;
1047 if (common_bits == 0)
return 0;
1064 for (bit = 1; bit <= common_bits; bit <<= 1) {
1065 switch (bit & common_bits) {
1146 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
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
const Mask_t kGCFillStyle
const Mask_t kGCJoinStyle
@ kGXorReverse
src OR NOT dst
@ kGXnand
NOT src OR NOT dst.
@ kGXandReverse
src AND NOT dst
@ kGXorInverted
NOT src OR dst.
@ kGXandInverted
NOT src AND dst.
@ kGXequiv
NOT src XOR dst.
@ kGXnor
NOT src AND NOT dst.
@ kGXcopyInverted
NOT src.
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kGCTileStipXOrigin
Handle_t GContext_t
Graphics context handle.
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)
Graphics context structure.
ULong_t fBackground
background pixel
Int_t fFillRule
kEvenOddRule, kWindingRule
Pixmap_t fClipMask
bitmap clipping; other calls for rects
Int_t fDashOffset
patterned/dashed line information
Int_t fClipXOrigin
origin for clipping
Int_t fLineWidth
line width
Pixmap_t fStipple
stipple 1 plane pixmap for stippling
Mask_t fMask
bit mask specifying which fields are valid
Int_t fLineStyle
kLineSolid, kLineOnOffDash, kLineDoubleDash
Pixmap_t fTile
tile pixmap for tiling operations
Bool_t fGraphicsExposures
boolean, should exposures be generated
Int_t fJoinStyle
kJoinMiter, kJoinRound, kJoinBevel
Char_t fDashes[8]
dash pattern list (dash length per byte)
ULong_t fForeground
foreground pixel
ULong_t fPlaneMask
plane mask
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
FontH_t fFont
default text font for text operations
Int_t fTsXOrigin
offset for tile or stipple operations
EGraphicsFunction fFunction
logical operation
Int_t fDashLen
number of dashes in fDashes
Int_t fCapStyle
kCapNotLast, kCapButt, kCapRound, kCapProjecting
Int_t fArcMode
kArcChord, kArcPieSlice
Int_t fSubwindowMode
kClipByChildren, kIncludeInferiors