31 class TGGC :
public TObject,
public TRefCnt {
33 friend class TGGCPool;
36 GCValues_t fValues = {};
39 TGGC(GCValues_t *values, Bool_t calledByGCPool);
40 void UpdateValues(GCValues_t *v);
42 TString GetMaskString()
const;
45 TGGC(GCValues_t *values = 0);
48 TGGC &operator=(
const TGGC &rhs);
50 GContext_t GetGC()
const {
return fContext; }
51 GContext_t operator()()
const;
53 void SetAttributes(GCValues_t *values);
54 void SetFunction(EGraphicsFunction v);
55 void SetPlaneMask(ULong_t v);
56 void SetForeground(Pixel_t v);
57 void SetBackground(Pixel_t v);
58 void SetLineWidth(Int_t v);
59 void SetLineStyle(Int_t v);
60 void SetCapStyle(Int_t v);
61 void SetJoinStyle(Int_t v);
62 void SetFillStyle(Int_t v);
63 void SetFillRule(Int_t v);
64 void SetTile(Pixmap_t v);
65 void SetStipple(Pixmap_t v);
66 void SetTileStipXOrigin(Int_t v);
67 void SetTileStipYOrigin(Int_t v);
68 void SetFont(FontH_t v);
69 void SetSubwindowMode(Int_t v);
70 void SetGraphicsExposures(Bool_t v);
71 void SetClipXOrigin(Int_t v);
72 void SetClipYOrigin(Int_t v);
73 void SetClipMask(Pixmap_t v);
74 void SetDashOffset(Int_t v);
75 void SetDashList(
const char v[], Int_t len);
76 void SetArcMode(Int_t v);
78 const GCValues_t *GetAttributes()
const {
return &fValues; }
79 Mask_t GetMask()
const {
return fValues.fMask; }
80 EGraphicsFunction GetFunction()
const {
return fValues.fFunction; }
81 ULong_t GetPlaneMask()
const {
return fValues.fPlaneMask; }
82 Pixel_t GetForeground()
const {
return fValues.fForeground; }
83 Pixel_t GetBackground()
const {
return fValues.fBackground; }
84 Int_t GetLineWidth()
const {
return fValues.fLineWidth; }
85 Int_t GetLineStyle()
const {
return fValues.fLineStyle; }
86 Pixmap_t GetTile()
const {
return fValues.fTile; }
87 Pixmap_t GetStipple()
const {
return fValues.fStipple; }
88 Int_t GetTileStipXOrigin()
const {
return fValues.fTsXOrigin; }
89 Int_t GetTileStipYOrigin()
const {
return fValues.fTsYOrigin; }
90 Int_t GetSubwindowMode()
const {
return fValues.fSubwindowMode; }
91 FontH_t GetFont()
const {
return fValues.fFont; }
92 Bool_t GetGraphicsExposures()
const {
return fValues.fGraphicsExposures; }
93 Int_t GetClipXOrigin()
const {
return fValues.fClipXOrigin; }
94 Int_t GetClipYOrigin()
const {
return fValues.fClipYOrigin; }
95 Pixmap_t GetClipMask()
const {
return fValues.fClipMask; }
96 Int_t GetCapStyle()
const {
return fValues.fCapStyle; }
97 Int_t GetJoinStyle()
const {
return fValues.fJoinStyle; }
98 Int_t GetFillStyle()
const {
return fValues.fFillStyle; }
99 Int_t GetFillRule()
const {
return fValues.fFillRule; }
100 Int_t GetDashOffset()
const {
return fValues.fDashOffset; }
101 Int_t GetDashLen()
const {
return fValues.fDashLen; }
102 const char *GetDashes()
const {
return fValues.fDashes; }
103 Int_t GetArcMode()
const {
return fValues.fArcMode; }
105 void Print(Option_t *option=
"")
const;
106 void SavePrimitive(std::ostream &out, Option_t *option =
"");
112 class TGGCPool :
public TGObject {
119 void ForceFreeGC(
const TGGC *gc);
120 Int_t MatchGC(
const TGGC *gc, GCValues_t *values);
121 void UpdateGC(TGGC *gc, GCValues_t *values);
124 TGGCPool(
const TGGCPool& gp) : TGObject(gp), fList(gp.fList) { }
125 TGGCPool& operator=(
const TGGCPool& gp)
126 {
if(
this!=&gp) {TGObject::operator=(gp); fList=gp.fList;}
130 TGGCPool(TGClient *client);
133 TGGC *GetGC(GCValues_t *values, Bool_t rw = kFALSE);
134 TGGC *GetGC(GContext_t gct);
135 void FreeGC(
const TGGC *gc);
136 void FreeGC(GContext_t gc);
138 TGGC *FindGC(
const TGGC *gc);
139 TGGC *FindGC(GContext_t gc);
141 void Print(Option_t *option=
"")
const;