Logo ROOT  
Reference Guide
No Matches
Go to the documentation of this file.
1// @(#)root/graf2d:$Id$
2// Author: Olivier Couet and Timur Pocheptsov 23/01/2012
5 * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
12#ifndef ROOT_TGQuartz
13#define ROOT_TGQuartz
15#include <vector>
17#include "TGCocoa.h"
18#include "TPoint.h"
19#include "TTF.h"
21/** \class TGQuartz
22\ingroup cocoa
24This is non-GUI part of TVirtualX interface, implemented for
25MacOS X, using CoreGraphics (Quartz).
28class TGQuartz : public TGCocoa {
33 FT_Vector fAlign; // alignment vector
35 TGQuartz();
36 TGQuartz(const char *name, const char *title);
38 //Final-overriders for TVirtualX.
40 EBoxMode mode) override;
42 Int_t nx, Int_t ny, Int_t *ic) override;
43 void DrawFillArea(Int_t n, TPoint *xy) override;
45 using TGCocoa::DrawLine;//There is a GUI version of DrawLine.
47 void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override;
48 void DrawPolyLine(Int_t n, TPoint *xy) override;
49 void DrawPolyMarker(Int_t n, TPoint *xy) override;
51 const char *text, ETextMode mode) override;
53 const wchar_t *text, ETextMode mode) override;
55 //I have to override these setters, since they are alredy overriden
56 //in TVirtualX (originally, they are declared in TAttXXX classes)
57 //and do nothing in TVirtualX (though, they are implemented
58 //correctly in TAttXXX classes).
59 void SetFillColor(Color_t cindex) override;
60 void SetFillStyle(Style_t style) override;
61 void SetLineColor(Color_t cindex) override;
62 void SetLineStyle(Style_t linestyle) override;
63 void SetLineWidth(Width_t width) override;
64 void SetMarkerColor(Color_t cindex) override;
65 void SetMarkerSize(Float_t markersize) override;
66 void SetMarkerStyle(Style_t markerstyle) override;
67 void SetOpacity(Int_t percent) override;
68 void SetTextAlign(Short_t talign=11) override;
69 void SetTextColor(Color_t cindex) override;
70 void SetTextFont(Font_t fontnumber) override;
72 void SetTextSize(Float_t textsize) override;
74 void GetTextExtent(UInt_t &w, UInt_t &h, char *text) override;
75 Int_t GetFontAscent() const override;
76 Int_t GetFontAscent(const char *text) const override;
77 Int_t GetFontDescent() const override;
78 Int_t GetFontDescent(const char *text) const override;
79 Float_t GetTextMagnitude() override;
83 //Unfortunately, I have to convert from
84 //top-left to bottom-left corner system.
85 std::vector<TPoint> fConvertedPoints;
87 //Lines with AA can be quite different
88 //from what we always had with X11.
89 //Now this is a switch in our configuration file (system.rootrc),
90 //so it can be disabled. This flag affects _only_ pad's graphics,
91 //GUI graphics is special and different. AA for fill area has a special
92 // switch because it is better to have it off by default.
93 bool fUseAA;
96 void AlignTTFString();
99 //I have to use void * instead of QuartzPixmap * because of CINT :(
100 void DrawFTGlyphIntoPixmap(void *pixmap, FT_Bitmap *source, ULong_t fore, ULong_t back, Int_t bx, Int_t by);
102 void SetAA();
103 void *GetSelectedDrawableChecked(const char *calledFrom) const;
105 TGQuartz(const TGQuartz &rhs);
108 ClassDefOverride(TGQuartz, 0);//2D non-GUI graphics for Mac OSX.
#define h(i)
Definition RSha256.hxx:106
short Style_t
Definition RtypesCore.h:89
short Color_t
Definition RtypesCore.h:92
unsigned long ULong_t
Definition RtypesCore.h:55
short Width_t
Definition RtypesCore.h:91
float Float_t
Definition RtypesCore.h:57
short Font_t
Definition RtypesCore.h:88
short Short_t
Definition RtypesCore.h:39
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t cindex
Option_t Option_t SetLineWidth
Option_t Option_t SetFillStyle
Option_t Option_t SetTextSize
Option_t Option_t DrawFillArea
Option_t Option_t mgn
Option_t Option_t fontnumber
Option_t Option_t markerstyle
Option_t Option_t SetLineColor
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t SetTextFont
Option_t Option_t textsize
Option_t Option_t TPoint TPoint angle
Option_t Option_t TPoint xy
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char y2
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char fontname
Option_t Option_t TPoint DrawPolyMarker
Option_t Option_t SetFillColor
Option_t Option_t TPoint TPoint const char DrawLine
Option_t Option_t SetMarkerStyle
Option_t Option_t width
Option_t Option_t TPoint TPoint percent
Option_t Option_t TPoint TPoint DrawText
Option_t Option_t TPoint TPoint SetOpacity
Option_t Option_t style
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char y1
char name[80]
Definition TGX11.cxx:110
This class implements TVirtualX interface for MacOS X, using Cocoa and Quartz 2D.
Definition TGCocoa.h:58
void DrawLine(Drawable_t wid, GContext_t gc, Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Uses the components of the specified GC to draw a line between the specified set of points (x1,...
Definition TGCocoa.mm:1741
This is non-GUI part of TVirtualX interface, implemented for MacOS X, using CoreGraphics (Quartz).
Definition TGQuartz.h:28
bool fUseFAAA
Definition TGQuartz.h:94
Bool_t IsTTFStringVisible(Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition TGQuartz.mm:782
void SetMarkerColor(Color_t cindex) override
Set the marker color.
Definition TGQuartz.mm:641
void DrawPolyLine(Int_t n, TPoint *xy) override
Draws a line through all points in the list.
Definition TGQuartz.mm:300
Float_t GetTextMagnitude() override
Returns the current font magnification factor.
Definition TGQuartz.mm:592
@ kMRight
Definition TGQuartz.h:31
@ kBCenter
Definition TGQuartz.h:31
@ kTCenter
Definition TGQuartz.h:30
@ kMCenter
Definition TGQuartz.h:31
@ kTRight
Definition TGQuartz.h:30
@ kBRight
Definition TGQuartz.h:31
void RenderTTFString(Int_t x, Int_t y, ETextMode mode)
Definition TGQuartz.mm:812
void SetAA()
Definition TGQuartz.mm:1039
void AlignTTFString()
Definition TGQuartz.mm:744
void SetTextColor(Color_t cindex) override
Set the text color.
Definition TGQuartz.mm:679
void * GetSelectedDrawableChecked(const char *calledFrom) const
Definition TGQuartz.mm:1064
bool fUseAA
Definition TGQuartz.h:93
void DrawFTGlyphIntoPixmap(void *pixmap, FT_Bitmap *source, ULong_t fore, ULong_t back, Int_t bx, Int_t by)
Definition TGQuartz.mm:916
void DrawBox(Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draws a box between [x1,y1] and [x2,y2] according to the "mode".
Definition TGQuartz.mm:119
std::vector< TPoint > fConvertedPoints
Definition TGQuartz.h:85
void SetTextAlign(Short_t talign=11) override
Set the text alignment.
Definition TGQuartz.mm:668
void GetTextExtent(UInt_t &w, UInt_t &h, char *text) override
Returns the size of the specified character string "mess".
Definition TGQuartz.mm:478
Int_t GetFontAscent() const override
Returns the ascent of the current font (in pixels).
Definition TGQuartz.mm:509
void SetMarkerSize(Float_t markersize) override
Set the marker size.
Definition TGQuartz.mm:649
TGQuartz(const TGQuartz &rhs)
void DrawCellArray(Int_t x1, Int_t y1, Int_t x2, Int_t y2, Int_t nx, Int_t ny, Int_t *ic) override
Draws a cell array.
Definition TGQuartz.mm:244
TGQuartz & operator=(const TGQuartz &rhs)
void SetLineStyle(Style_t linestyle) override
Set the line style.
Definition TGQuartz.mm:607
Int_t GetFontDescent() const override
Returns the descent of the current font (in pixels.
Definition TGQuartz.mm:550
FT_Vector fAlign
Definition TGQuartz.h:33
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16