Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TGQuartz.h
Go to the documentation of this file.
1// @(#)root/graf2d:$Id$
2// Author: Olivier Couet and Timur Pocheptsov 23/01/2012
3
4/*************************************************************************
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 *************************************************************************/
11
12#ifndef ROOT_TGQuartz
13#define ROOT_TGQuartz
14
15#include <vector>
16
17#include "TGCocoa.h"
18#include "TPoint.h"
19
20/** \class TGQuartz
21\ingroup cocoa
22
23This is non-GUI part of TVirtualX interface, implemented for
24MacOS X, using CoreGraphics (Quartz).
25*/
26
27class TGQuartz : public TGCocoa {
28public:
29 TGQuartz();
30 TGQuartz(const char *name, const char *title);
31
32 //Final-overriders for TVirtualX.
34 EBoxMode mode) override;
36 Int_t nx, Int_t ny, Int_t *ic) override;
37 void DrawFillArea(Int_t n, TPoint *xy) override;
38
39 using TGCocoa::DrawLine;//There is a GUI version of DrawLine.
40
41 void DrawLine(Int_t x1, Int_t y1, Int_t x2, Int_t y2) override;
42 void DrawPolyLine(Int_t n, TPoint *xy) override;
43 void DrawPolyMarker(Int_t n, TPoint *xy) override;
45 const char *text, ETextMode mode) override;
47 const wchar_t *text, ETextMode mode) override;
48
49 //I have to override these setters, since they are alredy overriden
50 //in TVirtualX (originally, they are declared in TAttXXX classes)
51 //and do nothing in TVirtualX (though, they are implemented
52 //correctly in TAttXXX classes).
53 void SetFillColor(Color_t cindex) override;
54 void SetFillStyle(Style_t style) override;
55 void SetLineColor(Color_t cindex) override;
56 void SetLineStyle(Style_t linestyle) override;
57 void SetLineWidth(Width_t width) override;
58 void SetMarkerColor(Color_t cindex) override;
59 void SetMarkerSize(Float_t markersize) override;
60 void SetMarkerStyle(Style_t markerstyle) override;
61 void SetOpacity(Int_t percent) override;
62 void SetTextAlign(Short_t talign=11) override;
63 void SetTextColor(Color_t cindex) override;
64 void SetTextFont(Font_t fontnumber) override;
66 void SetTextSize(Float_t textsize) override;
67
68 void GetTextExtent(UInt_t &w, UInt_t &h, char *text) override;
69 Int_t GetFontAscent() const override;
70 Int_t GetFontAscent(const char *text) const override;
71 Int_t GetFontDescent() const override;
72 Int_t GetFontDescent(const char *text) const override;
73
74 Float_t GetTextMagnitude() override;
75
76 //---- Methods used for new graphics -----
78 void SetAttFill(WinContext_t wctxt, const TAttFill &att) override;
79 void SetAttLine(WinContext_t wctxt, const TAttLine &att) override;
80 void SetAttMarker(WinContext_t wctxt, const TAttMarker &att) override;
81 void SetAttText(WinContext_t wctxt, const TAttText &att) override;
82
90 void DrawTextW(WinContext_t wctxt, Int_t x, Int_t y, Float_t angle, Float_t mgn, const wchar_t *text, ETextMode mode) override;
92
93 Bool_t GetTextExtentA(Font_t font, Double_t size, UInt_t &w, UInt_t &h, const char *mess) override;
94 Bool_t GetTextExtentA(Font_t font, Double_t size, UInt_t &w, UInt_t &h, const wchar_t *mess) override;
95 Bool_t GetFontAscentDescent(Font_t font, Double_t size, UInt_t &a, UInt_t &d, const char *mess) override;
96
97private:
98
99 //Lines with AA can be quite different
100 //from what we always had with X11.
101 //Now this is a switch in our configuration file (system.rootrc),
102 //so it can be disabled. This flag affects _only_ pad's graphics,
103 //GUI graphics is special and different. AA for fill area has a special
104 // switch because it is better to have it off by default.
105 bool fUseAA;
107
108 void SetAA();
113 void *GetPixmapDrawable(void *drawable0, const char *calledFrom) const;
114
117
118 ClassDefOverride(TGQuartz, 0);//2D non-GUI graphics for Mac OSX.
119};
120
121#endif
Handle_t WinContext_t
Window drawing context.
Definition GuiTypes.h:30
#define d(i)
Definition RSha256.hxx:102
#define a(i)
Definition RSha256.hxx:99
#define h(i)
Definition RSha256.hxx:106
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
short Style_t
Style number (short)
Definition RtypesCore.h:97
short Color_t
Color number (short)
Definition RtypesCore.h:100
short Width_t
Line width (short)
Definition RtypesCore.h:99
float Float_t
Float 4 bytes (float)
Definition RtypesCore.h:72
short Font_t
Font number (short)
Definition RtypesCore.h:96
short Short_t
Signed Short integer 2 bytes (short)
Definition RtypesCore.h:54
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
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:142
Fill Area Attributes class.
Definition TAttFill.h:21
Line Attributes class.
Definition TAttLine.h:21
Marker Attributes class.
Definition TAttMarker.h:22
Text Attributes class.
Definition TAttText.h:21
This class implements TVirtualX interface for MacOS X, using Cocoa and Quartz 2D.
Definition TGCocoa.h:57
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:1794
This is non-GUI part of TVirtualX interface, implemented for MacOS X, using CoreGraphics (Quartz).
Definition TGQuartz.h:27
TAttMarker & GetAttMarker(WinContext_t wctxt)
Definition TGQuartz.mm:1153
bool fUseFAAA
Definition TGQuartz.h:106
void SetAttLine(WinContext_t wctxt, const TAttLine &att) override
Set line attributes for specified window.
Definition TGQuartz.mm:1068
void SetMarkerColor(Color_t cindex) override
Set the marker color.
Definition TGQuartz.mm:962
void DrawPolyLine(Int_t n, TPoint *xy) override
Draws a line through all points in the list.
Definition TGQuartz.mm:365
Float_t GetTextMagnitude() override
Returns the current font magnification factor.
Definition TGQuartz.mm:903
void SetAttText(WinContext_t wctxt, const TAttText &att) override
Set text attributes for specified window.
Definition TGQuartz.mm:1090
void SetAA()
Definition TGQuartz.mm:1108
void DrawTextW(WinContext_t wctxt, Int_t x, Int_t y, Float_t angle, Float_t mgn, const char *text, ETextMode mode) override
Draw text on specified window.
Definition TGQuartz.mm:452
void SetTextColor(Color_t cindex) override
Set the text color.
Definition TGQuartz.mm:1005
Bool_t GetTextExtentA(Font_t font, Double_t size, UInt_t &w, UInt_t &h, const char *mess) override
Returns the size of the specified character string "mess" for font and size.
Definition TGQuartz.mm:771
bool fUseAA
Definition TGQuartz.h:105
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:170
void SetAttFill(WinContext_t wctxt, const TAttFill &att) override
Set fill attributes for specified window.
Definition TGQuartz.mm:1058
void SetTextAlign(Short_t talign=11) override
Set the text alignment.
Definition TGQuartz.mm:995
TAttText & GetAttText(WinContext_t wctxt)
Definition TGQuartz.mm:1163
void SetAttMarker(WinContext_t wctxt, const TAttMarker &att) override
Set marker attributes for specified window.
Definition TGQuartz.mm:1079
void GetTextExtent(UInt_t &w, UInt_t &h, char *text) override
Returns the size of the specified character string "mess".
Definition TGQuartz.mm:744
Int_t GetFontAscent() const override
Returns the ascent of the current font (in pixels).
Definition TGQuartz.mm:804
void SetMarkerSize(Float_t markersize) override
Set the marker size.
Definition TGQuartz.mm:972
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:247
TGQuartz & operator=(const TGQuartz &rhs)
void DrawLinesSegmentsW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw line segments on specified window.
Definition TGQuartz.mm:379
Bool_t GetFontAscentDescent(Font_t font, Double_t size, UInt_t &a, UInt_t &d, const char *mess) override
Returns ascent/descent for specified character string "mess" with font and size.
Definition TGQuartz.mm:876
void DrawPolyMarkerW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw poly marker on specified window.
Definition TGQuartz.mm:386
void DrawLineW(WinContext_t wctxt, Int_t x1, Int_t y1, Int_t x2, Int_t y2) override
Draw line on specified window.
Definition TGQuartz.mm:254
void DrawTTFglyphsW(WinContext_t wctxt, Int_t x, Int_t y, TTFhandle &ttf, ETextMode mode) override
Draw TTFglyphs on specified window Will be invoked only if HasTTFonts method returns true.
Definition TGQuartz.mm:548
void DrawPolyLineW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw poly line on specified window.
Definition TGQuartz.mm:311
void SetLineStyle(Style_t linestyle) override
Set the line style.
Definition TGQuartz.mm:920
TAttFill & GetAttFill(WinContext_t wctxt)
Definition TGQuartz.mm:1133
Int_t GetFontDescent() const override
Returns the descent of the current font (in pixels.
Definition TGQuartz.mm:840
void DrawBoxW(WinContext_t wctxt, Int_t x1, Int_t y1, Int_t x2, Int_t y2, EBoxMode mode) override
Draw box on specified window.
Definition TGQuartz.mm:98
void SetOpacityW(WinContext_t wctxt, Int_t percent) override
Set opactity for specified window.
Definition TGQuartz.mm:1053
void * GetPixmapDrawable(void *drawable0, const char *calledFrom) const
Definition TGQuartz.mm:1173
void DrawFillAreaW(WinContext_t wctxt, Int_t n, TPoint *xy) override
Draw fill area on specified window.
Definition TGQuartz.mm:176
TAttLine & GetAttLine(WinContext_t wctxt)
Definition TGQuartz.mm:1143
Dynamic handle to work with freetype 2 library.
Definition TTFhandle.h:21
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
const Int_t n
Definition legend1.C:16