ROOT  6.06/09
Reference Guide
TGCocoa.h
Go to the documentation of this file.
1 // @(#)root/graf2d:$Id$
2 // Author: Timur Pocheptsov 22/11/2011
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2012, 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 
13 #ifndef ROOT_TGCocoa
14 #define ROOT_TGCocoa
15 
16 #include <utility>
17 #include <vector>
18 #include <memory>
19 #include <string>
20 #include <map>
21 
22 #ifndef ROOT_CocoaGuiTypes
23 #include "CocoaGuiTypes.h"
24 #endif
25 #ifndef ROOT_TVirtualX
26 #include "TVirtualX.h"
27 #endif
28 #ifndef ROOT_X11Atoms
29 #include "X11Atoms.h"
30 #endif
31 
32 /// \defgroup cocoa Cocoa backend
33 /// \brief Interface to MacOS native graphics system.
34 /// \ingroup GraphicsBackends
35 
36 /** \class TGCocoa
37 \ingroup cocoa
38 
39 This class implements TVirtualX interface for MacOS X, using Cocoa and Quartz 2D.
40 
41 TVirtualX is a typical fat interface, it's a "C++ wrapper" for
42 X11 library. It's a union of several orthogonal interfaces like:
43 color management, window management, pixmap management, cursors,
44 events, images, drag and drop, font management, gui-rendering,
45 non-gui graphics, etc. etc.
46 */
47 
48 namespace ROOT {
49 namespace MacOSX {
50 
51 namespace X11 {
52 class EventTranslator;
53 class CommandBuffer;
54 
55 }
56 
57 namespace Details {
58 class CocoaPrivate;
59 }
60 
61 }
62 }
63 
64 class TGCocoa : public TVirtualX {
65 public:
66  TGCocoa();
67  TGCocoa(const char *name, const char *title);
68 
69  ~TGCocoa();
70 
71  //TVirtualX final overriders.
72  //I split them in a group not to get lost in this fat interface.
73 
74  ///////////////////////////////////////
75  //General.
76  virtual Bool_t Init(void *display);
77  virtual Int_t OpenDisplay(const char *displayName);
78  virtual const char *DisplayName(const char *);
79  virtual Int_t SupportsExtension(const char *extensionName)const;
80  virtual void CloseDisplay();
81  virtual Display_t GetDisplay()const;
82  virtual Visual_t GetVisual()const;
83  virtual Int_t GetScreen()const;
84  virtual UInt_t ScreenWidthMM()const;
85  virtual Int_t GetDepth()const;
86  virtual void Update(Int_t mode);
87 
88  //Non-virtual functions.
89  void ReconfigureDisplay();
91  //End of general.
92  ///////////////////////////////////////
93 
94  ///////////////////////////////////////
95  //Window management part:
96  virtual Window_t GetDefaultRootWindow()const;
97  //-Functions used by TCanvas/TPad (work with window, selected by SelectWindow).
98  virtual Int_t InitWindow(ULong_t window);
99  virtual Window_t GetWindowID(Int_t wid);//TGCocoa simply returns wid.
100  virtual void SelectWindow(Int_t wid);
101  virtual void ClearWindow();
102  virtual void GetGeometry(Int_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
103  virtual void MoveWindow(Int_t wid, Int_t x, Int_t y);
104  virtual void RescaleWindow(Int_t wid, UInt_t w, UInt_t h);
105  virtual void ResizeWindow(Int_t wid);
106  virtual void UpdateWindow(Int_t mode);
107  virtual Window_t GetCurrentWindow()const;
108  virtual void CloseWindow();
109  virtual Int_t AddWindow(ULong_t qwid, UInt_t w, UInt_t h); //-"Qt ROOT".
110  virtual void RemoveWindow(ULong_t qwid); //-"Qt ROOT".
111 
112 
113  //-Functions used by GUI.
114  virtual Window_t CreateWindow(Window_t parent, Int_t x, Int_t y,
115  UInt_t w, UInt_t h, UInt_t border,
116  Int_t depth, UInt_t clss,
117  void *visual, SetWindowAttributes_t *attr,
118  UInt_t wtype);
119 
120 
121  virtual void DestroyWindow(Window_t wid);
122  virtual void DestroySubwindows(Window_t wid);
123 
124  virtual void GetWindowAttributes(Window_t wid, WindowAttributes_t &attr);
125  virtual void ChangeWindowAttributes(Window_t wid, SetWindowAttributes_t *attr);
126  virtual void SelectInput(Window_t wid, UInt_t evmask);//Can also be in events-related part.
127 
128  void ReparentChild(Window_t wid, Window_t pid, Int_t x, Int_t y);//Non-overrider.
129  void ReparentTopLevel(Window_t wid, Window_t pid, Int_t x, Int_t y);//Non-overrider.
130  virtual void ReparentWindow(Window_t wid, Window_t pid, Int_t x, Int_t y);
131 
132  virtual void MapWindow(Window_t wid);
133  virtual void MapSubwindows(Window_t wid);
134  virtual void MapRaised(Window_t wid);
135  virtual void UnmapWindow(Window_t wid);
136  virtual void RaiseWindow(Window_t wid);
137  virtual void LowerWindow(Window_t wid);
138 
139  virtual void MoveWindow(Window_t wid, Int_t x, Int_t y);
140  virtual void MoveResizeWindow(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);
141  virtual void ResizeWindow(Window_t wid, UInt_t w, UInt_t h);
142  virtual void IconifyWindow(Window_t wid);
143  virtual void TranslateCoordinates(Window_t src, Window_t dest, Int_t src_x,Int_t src_y,
144  Int_t &dest_x, Int_t &dest_y, Window_t &child);
145  virtual void GetWindowSize(Drawable_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h);
146 
147 
148  virtual void SetWindowBackground(Window_t wid, ULong_t color);
149  virtual void SetWindowBackgroundPixmap(Window_t wid, Pixmap_t pxm);
150 
151  virtual Window_t GetParent(Window_t wid)const;
152 
153  virtual void SetWindowName(Window_t wid, char *name);
154  virtual void SetIconName(Window_t wid, char *name);
155  virtual void SetIconPixmap(Window_t wid, Pixmap_t pix);
156  virtual void SetClassHints(Window_t wid, char *className, char *resourceName);
157  //Non-rectangular window:
158  virtual void ShapeCombineMask(Window_t wid, Int_t x, Int_t y, Pixmap_t mask);
159 
160  //End window-management part.
161  ///////////////////////////////////////
162 
163  /////////////////////////////
164  //Set of "Window manager hints".
165  virtual void SetMWMHints(Window_t winID, UInt_t value, UInt_t decorators, UInt_t inputMode);
166  virtual void SetWMPosition(Window_t winID, Int_t x, Int_t y);
167  virtual void SetWMSize(Window_t winID, UInt_t w, UInt_t h);
168  virtual void SetWMSizeHints(Window_t winID, UInt_t wMin, UInt_t hMin, UInt_t wMax, UInt_t hMax, UInt_t wInc, UInt_t hInc);
169  virtual void SetWMState(Window_t winID, EInitialState state);
170  virtual void SetWMTransientHint(Window_t winID, Window_t mainWinID);
171  //"Window manager hints".
172  /////////////////////////////
173 
174 
175  ///////////////////////////////////////
176  //GUI-rendering part.
177  void DrawLineAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x1, Int_t y1, Int_t x2, Int_t y2);//Non-overrider.
178  virtual void DrawLine(Drawable_t wid, GContext_t gc, Int_t x1, Int_t y1, Int_t x2, Int_t y2);
179  void DrawSegmentsAux(Drawable_t wid, const GCValues_t &gcVals, const Segment_t *segments, Int_t nSegments);//Non-overrider.
180  virtual void DrawSegments(Drawable_t wid, GContext_t gc, Segment_t *segments, Int_t nSegments);
181  void DrawRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h);//Non-overrider.
182  virtual void DrawRectangle(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h);
183  void FillRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h);//Non-overrider.
184  virtual void FillRectangle(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h);
185  void FillPolygonAux(Window_t wid, const GCValues_t &gcVals, const Point_t *polygon, Int_t nPoints) ;//Non-overrider.
186  virtual void FillPolygon(Window_t wid, GContext_t gc, Point_t *polygon, Int_t nPoints);
187  void CopyAreaAux(Drawable_t src, Drawable_t dst, const GCValues_t &gc, Int_t srcX, Int_t srcY, UInt_t width,
188  UInt_t height, Int_t dstX, Int_t dstY);//Non-overrider.
189  virtual void CopyArea(Drawable_t src, Drawable_t dst, GContext_t gc, Int_t srcX, Int_t srcY, UInt_t width,
190  UInt_t height, Int_t dstX, Int_t dstY);
191  void DrawStringAux(Drawable_t wid, const GCValues_t &gc, Int_t x, Int_t y, const char *s, Int_t len);//Non-overrider.
192  virtual void DrawString(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len);
193  void ClearAreaAux(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);//Non-overrider.
194  virtual void ClearArea(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);
195  virtual void ClearWindow(Window_t wid);
196  //End of GUI-rendering part.
197  ///////////////////////////////////////
198 
199 
200  ///////////////////////////////////////
201  //Pixmap management.
202  //-Used by TCanvas/TPad classes:
203  virtual Int_t OpenPixmap(UInt_t w, UInt_t h);
204  virtual Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h);
205  virtual void SelectPixmap(Int_t qpixid);
206  virtual void CopyPixmap(Int_t wid, Int_t xpos, Int_t ypos);
207  virtual void ClosePixmap();
208  //Used by GUI.
209  virtual Pixmap_t CreatePixmap(Drawable_t wid, UInt_t w, UInt_t h);
210  virtual Pixmap_t CreatePixmap(Drawable_t wid, const char *bitmap, UInt_t width, UInt_t height,
211  ULong_t foregroundColor, ULong_t backgroundColor,
212  Int_t depth);
213  virtual Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height);
214  virtual Pixmap_t CreateBitmap(Drawable_t wid, const char *bitmap,
215  UInt_t width, UInt_t height);
216  void DeletePixmapAux(Pixmap_t pixmapID);//Non-overrider.
217  virtual void DeletePixmap(Pixmap_t pixmapID);
218 
219  //-"Qt ROOT".
220  virtual Int_t AddPixmap(ULong_t pixid, UInt_t w, UInt_t h);
221  virtual unsigned char *GetColorBits(Drawable_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);
222  //End of pixmap management.
223  /////////////////////////////
224 
225 
226  /////////////////////////////
227  //"Images" - emulation of XCreateImage/XPutImage etc.
228  virtual Drawable_t CreateImage(UInt_t width, UInt_t height);
229  virtual void GetImageSize(Drawable_t wid, UInt_t &width, UInt_t &height);
230  virtual void PutPixel(Drawable_t wid, Int_t x, Int_t y, ULong_t pixel);
231  virtual void PutImage(Drawable_t wid, GContext_t gc, Drawable_t img, Int_t dx, Int_t dy,
232  Int_t x, Int_t y, UInt_t w, UInt_t h);
233  virtual void DeleteImage(Drawable_t img);
234  //"Images".
235  /////////////////////////////
236 
237  /////////////////////////////
238  //Mouse (cursor, events, etc.)
239  virtual void GrabButton(Window_t wid, EMouseButton button, UInt_t modifier,
240  UInt_t evmask, Window_t confine, Cursor_t cursor,
241  Bool_t grab = kTRUE);
242  virtual void GrabPointer(Window_t wid, UInt_t evmask, Window_t confine,
243  Cursor_t cursor, Bool_t grab = kTRUE,
244  Bool_t owner_events = kTRUE);
245  virtual void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t);//Noop.
246  //End of mouse related part.
247  /////////////////////////////
248 
249  /////////////////////////////
250  //Keyboard management.
251  virtual void SetKeyAutoRepeat(Bool_t on = kTRUE);
252  virtual void GrabKey(Window_t wid, Int_t keycode, UInt_t modifier, Bool_t grab = kTRUE);
253  virtual Int_t KeysymToKeycode(UInt_t keysym);
254  virtual Window_t GetInputFocus();
255  virtual void SetInputFocus(Window_t wid);
256  virtual void LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym);
257  //End of keyboard management.
258  /////////////////////////////
259 
260  /////////////////////////////
261  //Font management.
262  virtual FontStruct_t LoadQueryFont(const char *font_name);
263  virtual FontH_t GetFontHandle(FontStruct_t fs);
264  virtual void DeleteFont(FontStruct_t fs);
265  virtual Bool_t HasTTFonts() const;
266  virtual Int_t TextWidth(FontStruct_t font, const char *s, Int_t len);
267  virtual void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent);
268  virtual FontStruct_t GetFontStruct(FontH_t fh);
269  virtual void FreeFontStruct(FontStruct_t fs);
270  virtual char **ListFonts(const char *fontname, Int_t max, Int_t &count);
271  virtual void FreeFontNames(char **fontlist);
272  //End of font management.
273  /////////////////////////////
274 
275  /////////////////////////////
276  //Color management.
277  virtual Bool_t ParseColor(Colormap_t cmap, const char *cname, ColorStruct_t &color);
278  virtual Bool_t AllocColor(Colormap_t cmap, ColorStruct_t &color);
279  virtual void QueryColor(Colormap_t cmap, ColorStruct_t &color);
280  virtual void FreeColor(Colormap_t cmap, ULong_t pixel);
281  virtual ULong_t GetPixel(Color_t cindex);
282  virtual void GetPlanes(Int_t &nplanes);
283  virtual void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b);
284  virtual void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b);
285  virtual Colormap_t GetColormap() const;
286 
287  //End of color management.
288  /////////////////////////////
289 
290  /////////////////////////////
291  //Context management.
292  virtual GContext_t CreateGC(Drawable_t wid, GCValues_t *gval);
293  virtual void SetForeground(GContext_t gc, ULong_t foreground);
294  virtual void ChangeGC(GContext_t gc, GCValues_t *gval);
295  virtual void CopyGC(GContext_t org, GContext_t dest, Mask_t mask);
296  virtual void GetGCValues(GContext_t gc, GCValues_t &gval);
297  virtual void DeleteGC(GContext_t gc);
298  //Context management.
299  /////////////////////////////
300 
301  /////////////////////////////
302  //Cursors.
303  virtual Cursor_t CreateCursor(ECursor cursor);
304  virtual void SetCursor(Window_t wid, Cursor_t curid);
305  virtual void SetCursor(Int_t win, ECursor cursor);
306  virtual void QueryPointer(Int_t &x, Int_t &y);
307  virtual void QueryPointer(Window_t wid, Window_t &rootw, Window_t &childw,
308  Int_t &root_x, Int_t &root_y, Int_t &win_x,
309  Int_t &win_y, UInt_t &mask);
310  //Cursors.
311  /////////////////////////////
312 
313 
314  /////////////////////////////
315  //OpenGL.
316  //We have a mix of Handle_t, Window_t (both are long) and Int_t (this is an obsolete version).
318  virtual Window_t CreateOpenGLWindow(Window_t parentID, UInt_t width, UInt_t height, const std::vector<std::pair<UInt_t, Int_t> > &format);
319  virtual Handle_t CreateOpenGLContext(Window_t windowID, Handle_t sharedContext);
320  virtual void CreateOpenGLContext(Int_t wid);
321  virtual Bool_t MakeOpenGLContextCurrent(Handle_t ctx, Window_t windowID);
323  virtual void FlushOpenGLBuffer(Handle_t ctxID);
324 
325  virtual void DeleteOpenGLContext(Int_t ctxID);
326  //OpenGL.
327  /////////////////////////////
328 
329  /////////////////////////////
330  //TPad's/TCanvas' specific - "double buffer" (off-screen rendering) + 'xor' mode.
331  virtual void SetDoubleBuffer(Int_t wid, Int_t mode);
332  virtual void SetDoubleBufferOFF();
333  virtual void SetDoubleBufferON();
334  virtual void SetDrawMode(EDrawMode mode);
335  //TPad's/TCanvas'.
336  /////////////////////////////
337 
338  /////////////////////////////
339  //Event management.
340  virtual void SendEvent(Window_t wid, Event_t *ev);
341  virtual void NextEvent(Event_t &event);
342  virtual Int_t EventsPending();
343  virtual Bool_t CheckEvent(Window_t wid, EGEventType type, Event_t &ev);
344  virtual Handle_t GetNativeEvent() const;
345  //Event management.
346  /////////////////////////////
347 
348  /////////////////////////////
349  //"Drag and drop" and "Copy and paste" (quotes are intentional :)).
350 
351  //Names here are total mess, but this comes from TVirtualX interface.
352  virtual Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist);
353 
354  virtual void SetPrimarySelectionOwner(Window_t wid);
355  virtual Bool_t SetSelectionOwner(Window_t windowID, Atom_t &selectionID);
357 
358  virtual void ConvertPrimarySelection(Window_t wid, Atom_t clipboard, Time_t when);
359  virtual void ConvertSelection(Window_t, Atom_t&, Atom_t&, Atom_t&, Time_t&);
361  Atom_t*, Int_t*, ULong_t*, ULong_t*, unsigned char**);
362  virtual void GetPasteBuffer(Window_t wid, Atom_t atom, TString &text, Int_t &nchar,
363  Bool_t del);
364 
365  virtual void ChangeProperty(Window_t wid, Atom_t property, Atom_t type,
366  UChar_t *data, Int_t len);
367  virtual void ChangeProperties(Window_t wid, Atom_t property, Atom_t type,
368  Int_t format, UChar_t *data, Int_t len);
369  virtual void DeleteProperty(Window_t, Atom_t&);
370 
371  virtual void SetDNDAware(Window_t, Atom_t *);
372  virtual Bool_t IsDNDAware(Window_t win, Atom_t *typelist);
373 
374  virtual void SetTypeList(Window_t win, Atom_t prop, Atom_t *typelist);
375  //FindRWindow is in DND part, since it looks for a DND aware window.
376  virtual Window_t FindRWindow(Window_t win, Window_t dragwin, Window_t input, int x, int y, int maxd);
377  //"Drag and drop" and "Copy and paste".
378  /////////////////////////////
379 
380  //The remaining bunch of functions is not sorted yet (and not implemented at the moment).
381 
382  virtual UInt_t ExecCommand(TGWin32Command *code);
383  virtual void GetCharacterUp(Float_t &chupx, Float_t &chupy);
384 
385  virtual Int_t GetDoubleBuffer(Int_t wid);
386 
387  virtual Pixmap_t ReadGIF(Int_t x0, Int_t y0, const char *file, Window_t wid);
388  virtual Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y);
389  virtual Int_t RequestString(Int_t x, Int_t y, char *text);
390 
391  virtual void SetCharacterUp(Float_t chupx, Float_t chupy);
392  virtual void SetClipOFF(Int_t wid);
393  virtual void SetClipRegion(Int_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h);
394 
395  virtual void SetTextMagnitude(Float_t mgn);
396 
397  virtual void Sync(Int_t mode);
398  virtual void Warp(Int_t ix, Int_t iy, Window_t wid);
399  virtual Int_t WriteGIF(char *name);
400  virtual void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname);
401 
402  virtual Bool_t NeedRedraw(ULong_t tgwindow, Bool_t force);
403 
404 
405  virtual Bool_t CreatePictureFromFile(Drawable_t wid, const char *filename,
406  Pixmap_t &pict, Pixmap_t &pict_mask,
407  PictureAttributes_t &attr);
408  virtual Bool_t CreatePictureFromData(Drawable_t wid, char **data,
409  Pixmap_t &pict, Pixmap_t &pict_mask,
410  PictureAttributes_t &attr);
411  virtual Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data);
412  virtual void DeletePictureData(void *data);
413  virtual void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n);
414 
415 
416  virtual void Bell(Int_t percent);
417 
418  virtual void WMDeleteNotify(Window_t wid);
419 
420  virtual void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n);
421  virtual Region_t CreateRegion();
422  virtual void DestroyRegion(Region_t reg);
423  virtual void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest);
424  virtual Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding);
425  virtual void UnionRegion(Region_t rega, Region_t regb, Region_t result);
426  virtual void IntersectRegion(Region_t rega, Region_t regb, Region_t result);
427  virtual void SubtractRegion(Region_t rega, Region_t regb, Region_t result);
428  virtual void XorRegion(Region_t rega, Region_t regb, Region_t result);
429  virtual Bool_t EmptyRegion(Region_t reg);
430  virtual Bool_t PointInRegion(Int_t x, Int_t y, Region_t reg);
431  virtual Bool_t EqualRegion(Region_t rega, Region_t regb);
432  virtual void GetRegionBox(Region_t reg, Rectangle_t *rect);
433  //
434 
435  virtual Bool_t IsCmdThread()const { return kTRUE; }
436 
437  //Non virtual, non-overriding functions.
439  ROOT::MacOSX::X11::CommandBuffer *GetCommandBuffer()const;
440 
441  void CocoaDrawON();
442  void CocoaDrawOFF();
443  Bool_t IsCocoaDraw()const;
444 
445 protected:
446  void *GetCurrentContext();
447 
449 
450  std::auto_ptr<ROOT::MacOSX::Details::CocoaPrivate> fPimpl; //!
452 
454  bool fDirectDraw;//Primitive in canvas tries to draw into window directly.
455 
456 private:
457  bool MakeProcessForeground();
458  Atom_t FindAtom(const std::string &atomName, bool addIfNotFound);
459  void SetApplicationIcon();
460 
462  std::vector<GCValues_t> fX11Contexts;
463  //
465  std::vector<std::string> fAtomToName;
466 
467  std::map<Atom_t, Window_t> fSelectionOwners;
468  typedef std::map<Atom_t, Window_t>::iterator selection_iterator;
469 
470  bool fSetApp;
471  mutable bool fDisplayShapeChanged;
473 
474 public:
476 
477 private:
478  //I'd prefer to use = delete syntax from C++0x11, but this file is processed by CINT.
479  TGCocoa(const TGCocoa &rhs);
480  TGCocoa &operator = (const TGCocoa &rhs);
481 
482  ClassDef(TGCocoa, 0); //TVirtualX for MacOS X.
483 };
484 
485 #endif
virtual void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n)
Sets clipping rectangles in graphics context.
Definition: TGCocoa.mm:4275
virtual void GetGCValues(GContext_t gc, GCValues_t &gval)
Returns the components specified by the mask in "gval" for the specified GC "gc" (see also the GCValu...
Definition: TGCocoa.mm:3092
Handle_t FontStruct_t
Definition: GuiTypes.h:40
virtual Window_t GetInputFocus()
Returns the window id of the window having the input focus.
Definition: TGCocoa.mm:2770
virtual Pixmap_t CreatePixmap(Drawable_t wid, UInt_t w, UInt_t h)
Creates a pixmap of the specified width and height and returns a pixmap ID that identifies it...
Definition: TGCocoa.mm:2429
virtual void SetTextMagnitude(Float_t mgn)
Sets the current text magnification factor to "mgn".
virtual void MoveResizeWindow(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
Changes the size and location of the specified window "id" without raising it.
Definition: TGCocoa.mm:1205
virtual void DeletePixmap(Pixmap_t pixmapID)
Explicitly deletes the pixmap resource "pmap".
Definition: TGCocoa.mm:2543
virtual Int_t KeysymToKeycode(UInt_t keysym)
Converts the "keysym" to the appropriate keycode.
Definition: TGCocoa.mm:2759
virtual void SetWindowBackground(Window_t wid, ULong_t color)
Sets the background of the window "id" to the specified color value "color".
Definition: TGCocoa.mm:1385
virtual Drawable_t CreateImage(UInt_t width, UInt_t height)
Allocates the memory needed for an drawable.
Definition: TGCocoa.mm:2581
Semi-Abstract base class defining a generic interface to the underlying, low level, native graphics backend (X11, Win32, MacOS, OpenGL...).
Definition: TVirtualX.h:70
virtual GContext_t CreateGC(Drawable_t wid, GCValues_t *gval)
Creates a graphics context using the provided GCValues_t *gval structure.
Definition: TGCocoa.mm:2989
virtual Display_t GetDisplay() const
Returns handle to display (might be useful in some cases where direct X11 manipulation outside of TVi...
Definition: TGCocoa.mm:470
virtual void ChangeWindowAttributes(Window_t wid, SetWindowAttributes_t *attr)
Changes the attributes of the specified window "id" according the values provided in "attr"...
Definition: TGCocoa.mm:946
bool fDisplayShapeChanged
Definition: TGCocoa.h:471
std::vector< GCValues_t > fX11Contexts
Definition: TGCocoa.h:462
EInitialState
Definition: GuiTypes.h:346
virtual void GrabPointer(Window_t wid, UInt_t evmask, Window_t confine, Cursor_t cursor, Bool_t grab=kTRUE, Bool_t owner_events=kTRUE)
Establishes an active pointer grab.
Definition: TGCocoa.mm:2680
void DrawSegmentsAux(Drawable_t wid, const GCValues_t &gcVals, const Segment_t *segments, Int_t nSegments)
Definition: TGCocoa.mm:1724
void ReparentTopLevel(Window_t wid, Window_t pid, Int_t x, Int_t y)
Definition: TGCocoa.mm:1028
virtual void GetRegionBox(Region_t reg, Rectangle_t *rect)
Returns smallest enclosing rectangle.
Definition: TGCocoa.mm:4385
virtual Int_t AddWindow(ULong_t qwid, UInt_t w, UInt_t h)
Registers a window created by Qt as a ROOT window.
Definition: TGCocoa.mm:786
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
virtual void Bell(Int_t percent)
Sets the sound bell. Percent is loudness from -100% to 100%.
bool fSetApp
Definition: TGCocoa.h:470
virtual Window_t GetDefaultRootWindow() const
Returns handle to the default root window created when calling XOpenDisplay().
Definition: TGCocoa.mm:573
virtual void CopyArea(Drawable_t src, Drawable_t dst, GContext_t gc, Int_t srcX, Int_t srcY, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY)
Combines the specified rectangle of "src" with the specified rectangle of "dest" according to the "gc...
Definition: TGCocoa.mm:2117
float Float_t
Definition: RtypesCore.h:53
virtual FontStruct_t GetFontStruct(FontH_t fh)
Retrieves the associated font structure of the font specified font handle "fh".
Definition: TGCocoa.mm:2865
UInt_t Mask_t
Definition: GuiTypes.h:42
std::auto_ptr< ROOT::MacOSX::Details::CocoaPrivate > fPimpl
Definition: TGCocoa.h:450
virtual Int_t AddPixmap(ULong_t pixid, UInt_t w, UInt_t h)
Registers a pixmap created by TGLManager as a ROOT pixmap.
Definition: TGCocoa.mm:2551
virtual void MapRaised(Window_t wid)
Maps the window "id" and all of its subwindows that have had map requests on the screen and put this ...
Definition: TGCocoa.mm:1102
virtual Handle_t CreateOpenGLContext(Window_t windowID, Handle_t sharedContext)
Creates OpenGL context for window "windowID".
Definition: TGCocoa.mm:3288
virtual Window_t GetParent(Window_t wid) const
Returns the parent of the window "id".
Definition: TGCocoa.mm:1443
ULong_t Time_t
Definition: GuiTypes.h:43
virtual Region_t CreateRegion()
Creates a new empty region.
Definition: TGCocoa.mm:4285
virtual void SetWMSize(Window_t winID, UInt_t w, UInt_t h)
Tells window manager the desired size of window "id".
Definition: TGCocoa.mm:1573
TH1 * h
Definition: legend2.C:5
virtual void SetDrawMode(EDrawMode mode)
Sets the drawing mode.
Definition: TGCocoa.mm:3497
virtual Window_t FindRWindow(Window_t win, Window_t dragwin, Window_t input, int x, int y, int maxd)
Recursively search in the children of Window for a Window which is at location x, y and is DND aware...
Definition: TGCocoa.mm:3991
virtual void SetIconPixmap(Window_t wid, Pixmap_t pix)
Sets the icon name pixmap.
Definition: TGCocoa.mm:1478
EGEventType
Definition: GuiTypes.h:60
Handle_t Cursor_t
Definition: GuiTypes.h:35
void DrawRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGCocoa.mm:1777
virtual Bool_t SetSelectionOwner(Window_t windowID, Atom_t &selectionID)
Changes the owner and last-change time for the specified selection.
Definition: TGCocoa.mm:3607
virtual void DrawLine(Drawable_t wid, GContext_t gc, Int_t x1, Int_t y1, Int_t x2, Int_t y2)
Uses the components of the specified GC to draw a line between the specified set of points (x1...
Definition: TGCocoa.mm:1679
virtual Window_t GetWindowID(Int_t wid)
Returns the X11 window identifier.
Definition: TGCocoa.mm:605
ROOT::MacOSX::X11::CommandBuffer * GetCommandBuffer() const
Definition: TGCocoa.mm:4399
virtual void CloseDisplay()
Closes connection to display server and destroys all windows.
Definition: TGCocoa.mm:464
Int_t fCocoaDraw
Definition: TGCocoa.h:451
virtual Bool_t EmptyRegion(Region_t reg)
Returns kTRUE if the region reg is empty.
virtual void DeleteOpenGLContext(Int_t ctxID)
Deletes OpenGL context for window "wid".
Definition: TGCocoa.mm:3422
static const char * filename()
virtual void SetDoubleBufferON()
Turns double buffer mode on.
Definition: TGCocoa.mm:3465
void DeletePixmapAux(Pixmap_t pixmapID)
Definition: TGCocoa.mm:2537
Handle_t GContext_t
Definition: GuiTypes.h:39
Basic string class.
Definition: TString.h:137
virtual void FreeFontNames(char **fontlist)
Frees the specified the array of strings "fontlist".
Definition: TGCocoa.mm:2898
virtual void GetPlanes(Int_t &nplanes)
Returns the maximum number of planes.
Definition: TGCocoa.mm:2959
virtual Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y)
Requests Locator position.
Definition: TGCocoa.mm:4052
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual Visual_t GetVisual() const
Returns handle to visual.
Definition: TGCocoa.mm:477
virtual Bool_t ParseColor(Colormap_t cmap, const char *cname, ColorStruct_t &color)
Looks up the string name of a color "cname" with respect to the screen associated with the specified ...
Definition: TGCocoa.mm:2910
std::map< Atom_t, Window_t >::iterator selection_iterator
Definition: TGCocoa.h:468
virtual void RaiseWindow(Window_t wid)
Raises the specified window to the top of the stack so that no sibling window obscures it...
Definition: TGCocoa.mm:1153
Handle_t Drawable_t
Definition: GuiTypes.h:32
Atom_t FindAtom(const std::string &atomName, bool addIfNotFound)
Definition: TGCocoa.mm:4494
virtual void IconifyWindow(Window_t wid)
Iconifies the window "id".
Definition: TGCocoa.mm:1247
virtual void ConvertPrimarySelection(Window_t wid, Atom_t clipboard, Time_t when)
Causes a SelectionRequest event to be sent to the current primary selection owner.
Definition: TGCocoa.mm:3644
virtual void FreeFontStruct(FontStruct_t fs)
Frees the font structure "fs".
static std::string format(double x, double y, int digits, int width)
ECursor
Definition: TVirtualX.h:56
virtual Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist)
Returns the atom identifier associated with the specified "atom_name" string.
Definition: TGCocoa.mm:3569
virtual void QueryColor(Colormap_t cmap, ColorStruct_t &color)
Returns the current RGB value for the pixel in the "color" structure.
Definition: TGCocoa.mm:2929
ROOT::MacOSX::X11::name_to_atom_map fNameToAtom
Definition: TGCocoa.h:464
virtual void SetTypeList(Window_t win, Atom_t prop, Atom_t *typelist)
Add the list of drag and drop types to the Window win.
Definition: TGCocoa.mm:3983
virtual void SetIconName(Window_t wid, char *name)
Sets the window icon name.
Definition: TGCocoa.mm:1472
Handle_t Display_t
Definition: GuiTypes.h:28
virtual void GrabKey(Window_t wid, Int_t keycode, UInt_t modifier, Bool_t grab=kTRUE)
Establishes a passive grab on the keyboard.
Definition: TGCocoa.mm:2717
void SetApplicationIcon()
Definition: TGCocoa.mm:4512
virtual void SetWMState(Window_t winID, EInitialState state)
Sets the initial state of the window "id": either kNormalState or kIconicState.
Definition: TGCocoa.mm:1594
void ClearAreaAux(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGCocoa.mm:2252
virtual void SelectWindow(Int_t wid)
Selects the window "wid" to which subsequent output is directed.
Definition: TGCocoa.mm:614
Handle_t FontH_t
Definition: GuiTypes.h:36
virtual void SetCursor(Window_t wid, Cursor_t curid)
Sets the cursor "curid" to be used when the pointer is in the window "id".
Definition: TGCocoa.mm:3135
Bool_t IsCocoaDraw() const
Definition: TGCocoa.mm:4418
virtual void GetImageSize(Drawable_t wid, UInt_t &width, UInt_t &height)
Returns the width and height of the image id.
Definition: TGCocoa.mm:2591
virtual void UnmapWindow(Window_t wid)
Unmaps the specified window "id".
Definition: TGCocoa.mm:1123
virtual void DrawRectangle(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h)
Draws rectangle outlines of [x,y] [x+w,y] [x+w,y+h] [x,y+h].
Definition: TGCocoa.mm:1812
virtual void SetDashes(GContext_t gc, Int_t offset, const char *dash_list, Int_t n)
Sets the dash-offset and dash-list attributes for dashed line styles in the specified GC...
Definition: TGCocoa.mm:4244
virtual void MapSubwindows(Window_t wid)
Maps all subwindows for the specified window "id" in top-to-bottom stacking order.
Definition: TGCocoa.mm:1088
virtual void CopyGC(GContext_t org, GContext_t dest, Mask_t mask)
Copies the specified components from the source GC "org" to the destination GC "dest".
Definition: TGCocoa.mm:3080
static const double x2[5]
virtual Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data)
Reads picture data from file "filename" and store it in "ret_data".
Definition: TGCocoa.mm:4229
Double_t x[n]
Definition: legend1.C:17
virtual void ResizeWindow(Int_t wid)
Resizes the window "wid" if necessary.
Definition: TGCocoa.mm:711
virtual Bool_t CreatePictureFromFile(Drawable_t wid, const char *filename, Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr)
Creates a picture pict from data in file "filename".
Definition: TGCocoa.mm:4201
virtual void SetWMSizeHints(Window_t winID, UInt_t wMin, UInt_t hMin, UInt_t wMax, UInt_t hMax, UInt_t wInc, UInt_t hInc)
Gives the window manager minimum and maximum size hints of the window "id".
Definition: TGCocoa.mm:1579
virtual void MapWindow(Window_t wid)
Maps the window "id" and all of its subwindows that have had map requests.
Definition: TGCocoa.mm:1068
virtual void MoveWindow(Int_t wid, Int_t x, Int_t y)
Moves the window "wid" to the specified x and y coordinates.
Definition: TGCocoa.mm:689
virtual Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h)
Resizes the specified pixmap "wid".
Definition: TGCocoa.mm:2357
virtual void GetPasteBuffer(Window_t wid, Atom_t atom, TString &text, Int_t &nchar, Bool_t del)
Gets contents of the paste buffer "atom" into the string "text".
Definition: TGCocoa.mm:3762
virtual void FillPolygon(Window_t wid, GContext_t gc, Point_t *polygon, Int_t nPoints)
Fills the region closed by the specified path.
Definition: TGCocoa.mm:2028
virtual void ClearWindow()
Clears the entire area of the current window.
Definition: TGCocoa.mm:621
virtual Bool_t NeedRedraw(ULong_t tgwindow, Bool_t force)
Notify the low level GUI layer ROOT requires "tgwindow" to be updated.
Definition: TGCocoa.mm:4181
void DrawLineAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x1, Int_t y1, Int_t x2, Int_t y2)
Definition: TGCocoa.mm:1638
virtual void ConvertSelection(Window_t, Atom_t &, Atom_t &, Atom_t &, Time_t &)
Requests that the specified selection be converted to the specified target type.
Definition: TGCocoa.mm:3678
Handle_t Atom_t
Definition: GuiTypes.h:38
virtual void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t)
Changes the specified dynamic parameters if the pointer is actively grabbed by the client and if the ...
Definition: TGCocoa.mm:2701
virtual void DestroyWindow(Window_t wid)
Destroys the window "id" as well as all of its subwindows.
Definition: TGCocoa.mm:843
virtual Bool_t CheckEvent(Window_t wid, EGEventType type, Event_t &ev)
Check if there is for window "id" an event of type "type".
Definition: TGCocoa.mm:3539
virtual Int_t GetDoubleBuffer(Int_t wid)
Queries the double buffer value for the window "wid".
virtual Int_t GetDepth() const
Returns depth of screen (number of bit planes).
Definition: TGCocoa.mm:501
virtual Double_t GetOpenGLScalingFactor()
On a HiDPI resolution it can be > 1., this means glViewport should use scaled width and height...
Definition: TGCocoa.mm:3199
void FillRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h)
Definition: TGCocoa.mm:1854
virtual void DeleteProperty(Window_t, Atom_t &)
Deletes the specified property only if the property was defined on the specified window and causes th...
Definition: TGCocoa.mm:3891
virtual Int_t EventsPending()
Returns the number of events that have been received from the X server but have not been removed from...
Definition: TGCocoa.mm:3532
virtual void DeleteImage(Drawable_t img)
Deallocates the memory associated with the image img.
Definition: TGCocoa.mm:2635
virtual Int_t OpenDisplay(const char *displayName)
Opens connection to display server (if such a thing exist on the current platform).
Definition: TGCocoa.mm:443
void ReconfigureDisplay()
Definition: TGCocoa.mm:535
virtual void SelectInput(Window_t wid, UInt_t evmask)
Defines which input events the window is interested in.
Definition: TGCocoa.mm:962
virtual void ReparentWindow(Window_t wid, Window_t pid, Int_t x, Int_t y)
If the specified window is mapped, ReparentWindow automatically performs an UnmapWindow request on it...
Definition: TGCocoa.mm:1050
virtual void UnionRegion(Region_t rega, Region_t regb, Region_t result)
Computes the union of two regions.
Definition: TGCocoa.mm:4322
virtual Bool_t EqualRegion(Region_t rega, Region_t regb)
Returns kTRUE if the two regions have the same offset, size, and shape.
Definition: TGCocoa.mm:4377
virtual unsigned char * GetColorBits(Drawable_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
Returns an array of pixels created from a part of drawable (defined by x, y, w, h) in format: ...
Definition: TGCocoa.mm:2560
void CocoaDrawOFF()
Definition: TGCocoa.mm:4411
ClassDef(TGCocoa, 0)
virtual Bool_t AllocColor(Colormap_t cmap, ColorStruct_t &color)
Allocates a read-only colormap entry corresponding to the closest RGB value supported by the hardware...
Definition: TGCocoa.mm:2919
virtual Int_t GetScreen() const
Returns screen number.
Definition: TGCocoa.mm:484
virtual Window_t GetCurrentWindow() const
pointer to the current internal window used in canvas graphics
Definition: TGCocoa.mm:773
short Color_t
Definition: RtypesCore.h:79
virtual void XorRegion(Region_t rega, Region_t regb, Region_t result)
Calculates the difference between the union and intersection of two regions.
Definition: TGCocoa.mm:4349
virtual void SetDNDAware(Window_t, Atom_t *)
Add XdndAware property and the list of drag and drop types to the Window win.
Definition: TGCocoa.mm:3916
Drawable_t fSelectedDrawable
Definition: TGCocoa.h:448
void CopyAreaAux(Drawable_t src, Drawable_t dst, const GCValues_t &gc, Int_t srcX, Int_t srcY, UInt_t width, UInt_t height, Int_t dstX, Int_t dstY)
Definition: TGCocoa.mm:2080
point * points
Definition: X3DBuffer.c:20
virtual void NextEvent(Event_t &event)
The "event" is set to default event.
Definition: TGCocoa.mm:3523
virtual Int_t TextWidth(FontStruct_t font, const char *s, Int_t len)
Return length of the string "s" in pixels. Size depends on font.
Definition: TGCocoa.mm:2851
ROOT::MacOSX::X11::Rectangle GetDisplayGeometry() const
Definition: TGCocoa.mm:541
virtual void Sync(Int_t mode)
Set synchronisation on or off.
EMouseButton
Definition: GuiTypes.h:215
~TGCocoa()
Definition: TGCocoa.mm:425
TGCocoa()
Definition: TGCocoa.mm:374
virtual Bool_t Init(void *display)
Initializes the X system.
Definition: TGCocoa.mm:434
virtual void SetCharacterUp(Float_t chupx, Float_t chupy)
Sets character up vector.
Definition: TGCocoa.mm:4095
virtual void SetInputFocus(Window_t wid)
Changes the input focus to specified window "id".
Definition: TGCocoa.mm:2778
ROOT::R::TRInterface & r
Definition: Object.C:4
void DrawStringAux(Drawable_t wid, const GCValues_t &gc, Int_t x, Int_t y, const char *s, Int_t len)
Definition: TGCocoa.mm:2161
static Atom_t fgDeleteWindowAtom
Definition: TGCocoa.h:475
bool fDirectDraw
Definition: TGCocoa.h:454
virtual void GetWindowAttributes(Window_t wid, WindowAttributes_t &attr)
The WindowAttributes_t structure is set to default.
Definition: TGCocoa.mm:932
virtual void DestroyRegion(Region_t reg)
Destroys the region "reg".
virtual FontH_t GetFontHandle(FontStruct_t fs)
Returns the font handle of the specified font structure "fs".
Definition: TGCocoa.mm:2831
Handle_t Visual_t
Definition: GuiTypes.h:29
virtual void SubtractRegion(Region_t rega, Region_t regb, Region_t result)
Subtracts regb from rega and stores the results in result.
Definition: TGCocoa.mm:4343
bool MakeProcessForeground()
Definition: TGCocoa.mm:4437
virtual char ** ListFonts(const char *fontname, Int_t max, Int_t &count)
Returns list of font names matching fontname regexp, like "-*-times-*".
Definition: TGCocoa.mm:2884
std::map< Atom_t, Window_t > fSelectionOwners
Definition: TGCocoa.h:467
virtual Bool_t IsDNDAware(Window_t win, Atom_t *typelist)
Checks if the Window is DND aware, and knows any of the DND formats passed in argument.
Definition: TGCocoa.mm:3968
virtual void UpdateWindow(Int_t mode)
Updates or synchronises client and server once (not permanent).
void ReparentChild(Window_t wid, Window_t pid, Int_t x, Int_t y)
Definition: TGCocoa.mm:982
virtual void SetClassHints(Window_t wid, char *className, char *resourceName)
Sets the windows class and resource name.
Definition: TGCocoa.mm:1484
virtual Int_t WriteGIF(char *name)
Writes the current window into GIF file.
Definition: TGCocoa.mm:4162
virtual void QueryPointer(Int_t &x, Int_t &y)
Returns the pointer position.
Definition: TGCocoa.mm:3146
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual void SetKeyAutoRepeat(Bool_t on=kTRUE)
Turns key auto repeat on (kTRUE) or off (kFALSE).
TGCocoa & operator=(const TGCocoa &rhs)
virtual void DeleteGC(GContext_t gc)
Deletes the specified GC "gc".
virtual Colormap_t GetColormap() const
Returns handle to colormap.
Definition: TGCocoa.mm:2981
virtual Window_t CreateOpenGLWindow(Window_t parentID, UInt_t width, UInt_t height, const std::vector< std::pair< UInt_t, Int_t > > &format)
Create window with special pixel format. Noop everywhere except Cocoa.
Definition: TGCocoa.mm:3209
ROOT::MacOSX::X11::Rectangle fDisplayRect
Definition: TGCocoa.h:472
virtual void SetMWMHints(Window_t winID, UInt_t value, UInt_t decorators, UInt_t inputMode)
Sets decoration style.
Definition: TGCocoa.mm:1529
virtual void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent)
Returns the font properties.
Definition: TGCocoa.mm:2858
virtual Int_t RequestString(Int_t x, Int_t y, char *text)
Requests string: text is displayed and can be edited with Emacs-like keybinding.
Definition: TGCocoa.mm:4084
virtual void IntersectRegion(Region_t rega, Region_t regb, Region_t result)
Computes the intersection of two regions.
Definition: TGCocoa.mm:4333
virtual void Update(Int_t mode)
Flushes (mode = 0, default) or synchronizes (mode = 1) X output buffer.
Definition: TGCocoa.mm:518
virtual void GetCharacterUp(Float_t &chupx, Float_t &chupy)
Returns character up vector.
Definition: TGCocoa.mm:4036
virtual void FreeColor(Colormap_t cmap, ULong_t pixel)
Frees color cell with specified pixel value.
Definition: TGCocoa.mm:2938
virtual void PutImage(Drawable_t wid, GContext_t gc, Drawable_t img, Int_t dx, Int_t dy, Int_t x, Int_t y, UInt_t w, UInt_t h)
Combines an image with a rectangle of the specified drawable.
Definition: TGCocoa.mm:2624
Handle_t Colormap_t
Definition: GuiTypes.h:34
virtual Bool_t IsCmdThread() const
Definition: TGCocoa.h:435
virtual void FillRectangle(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, UInt_t w, UInt_t h)
Fills the specified rectangle defined by [x,y] [x+w,y] [x+w,y+h] [x,y+h].
Definition: TGCocoa.mm:1919
virtual void SetDoubleBufferOFF()
Turns double buffer mode off.
Definition: TGCocoa.mm:3459
long Long_t
Definition: RtypesCore.h:50
virtual void CloseWindow()
Deletes current window.
Definition: TGCocoa.mm:780
virtual FontStruct_t LoadQueryFont(const char *font_name)
Provides the most common way for accessing a font: opens (loads) the specified font and returns a poi...
Definition: TGCocoa.mm:2811
virtual void SetClipRegion(Int_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
Sets clipping region for the window "wid".
Definition: TGCocoa.mm:4107
bool fForegroundProcess
Definition: TGCocoa.h:461
virtual void ChangeGC(GContext_t gc, GCValues_t *gval)
Changes the components specified by the mask in gval for the specified GC.
Definition: TGCocoa.mm:3014
static const double x1[5]
virtual ULong_t GetPixel(Color_t cindex)
Returns pixel value associated to specified ROOT color number "cindex".
Definition: TGCocoa.mm:2944
virtual Window_t CreateWindow(Window_t parent, Int_t x, Int_t y, UInt_t w, UInt_t h, UInt_t border, Int_t depth, UInt_t clss, void *visual, SetWindowAttributes_t *attr, UInt_t wtype)
Creates an unmapped subwindow for a specified parent window and returns the created window...
Definition: TGCocoa.mm:802
virtual void SetWindowName(Window_t wid, char *name)
Sets the window name.
Definition: TGCocoa.mm:1456
virtual void ClosePixmap()
Deletes current pixmap.
Definition: TGCocoa.mm:2420
double Double_t
Definition: RtypesCore.h:55
TText * text
virtual Bool_t PointInRegion(Int_t x, Int_t y, Region_t reg)
Returns kTRUE if the point [x, y] is contained in the region reg.
Definition: TGCocoa.mm:4369
virtual void ClearArea(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
Paints a rectangular area in the specified window "id" according to the specified dimensions with the...
Definition: TGCocoa.mm:2291
int type
Definition: TGX11.cxx:120
virtual void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname)
Writes the pixmap "wid" in the bitmap file "pxname".
Definition: TGCocoa.mm:4171
unsigned long ULong_t
Definition: RtypesCore.h:51
Double_t y[n]
Definition: legend1.C:17
virtual void PutPixel(Drawable_t wid, Int_t x, Int_t y, ULong_t pixel)
Overwrites the pixel in the image with the specified pixel value.
Definition: TGCocoa.mm:2602
virtual Pixmap_t ReadGIF(Int_t x0, Int_t y0, const char *file, Window_t wid)
If id is NULL - loads the specified gif file at position [x0,y0] in the current window.
Definition: TGCocoa.mm:4043
virtual const char * DisplayName(const char *)
Returns hostname on which the display is opened.
Definition: TGCocoa.mm:450
virtual Int_t GetProperty(Window_t, Atom_t, Long_t, Long_t, Bool_t, Atom_t, Atom_t *, Int_t *, ULong_t *, ULong_t *, unsigned char **)
Returns the actual type of the property; the actual format of the property; the number of 8-bit...
Definition: TGCocoa.mm:3713
virtual void SetWMPosition(Window_t winID, Int_t x, Int_t y)
Tells the window manager the desired position [x,y] of window "id".
Definition: TGCocoa.mm:1567
virtual Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height)
create pixmap from RGB data.
Definition: TGCocoa.mm:2469
virtual void SetDoubleBuffer(Int_t wid, Int_t mode)
Sets the double buffer on/off on the window "wid".
Definition: TGCocoa.mm:3444
virtual Int_t SupportsExtension(const char *extensionName) const
Returns 1 if window system server supports extension given by the argument, returns 0 in case extensi...
Definition: TGCocoa.mm:457
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
virtual void RescaleWindow(Int_t wid, UInt_t w, UInt_t h)
Rescales the window "wid".
Definition: TGCocoa.mm:703
virtual void ShapeCombineMask(Window_t wid, Int_t x, Int_t y, Pixmap_t mask)
The Non-rectangular Window Shape Extension adds non-rectangular windows to the System.
Definition: TGCocoa.mm:1490
virtual void GrabButton(Window_t wid, EMouseButton button, UInt_t modifier, UInt_t evmask, Window_t confine, Cursor_t cursor, Bool_t grab=kTRUE)
Establishes a passive grab on a certain mouse button.
Definition: TGCocoa.mm:2646
virtual void GetWindowSize(Drawable_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h)
Returns the location and the size of window "id".
Definition: TGCocoa.mm:1349
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void RemoveWindow(ULong_t qwid)
Removes the created by Qt window "qwid".
EDrawMode fDrawMode
Definition: TGCocoa.h:453
virtual void ChangeProperty(Window_t wid, Atom_t property, Atom_t type, UChar_t *data, Int_t len)
Alters the property for the specified window and causes the X server to generate a PropertyNotify eve...
Definition: TGCocoa.mm:3813
#define org(otri, vertexptr)
Definition: triangle.c:1037
virtual void SetWindowBackgroundPixmap(Window_t wid, Pixmap_t pxm)
Sets the background pixmap of the window "id" to the specified pixmap "pxm".
Definition: TGCocoa.mm:1397
virtual void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b)
Sets color intensities the specified color index "cindex".
Definition: TGCocoa.mm:2972
Handle_t Window_t
Definition: GuiTypes.h:30
virtual Int_t OpenPixmap(UInt_t w, UInt_t h)
Creates a pixmap of the width "w" and height "h" you specified.
Definition: TGCocoa.mm:2336
virtual void SelectPixmap(Int_t qpixid)
Selects the pixmap "qpixid".
Definition: TGCocoa.mm:2376
virtual void DeleteFont(FontStruct_t fs)
Explicitly deletes the font structure "fs" obtained via LoadQueryFont().
Definition: TGCocoa.mm:2837
virtual void CopyPixmap(Int_t wid, Int_t xpos, Int_t ypos)
Copies the pixmap "wid" at the position [xpos,ypos] in the current window.
Definition: TGCocoa.mm:2385
This class implements TVirtualX interface for MacOS X, using Cocoa and Quartz 2D. ...
Definition: TGCocoa.h:64
virtual Bool_t MakeOpenGLContextCurrent(Handle_t ctx, Window_t windowID)
Makes context ctx current OpenGL context.
Definition: TGCocoa.mm:3313
virtual void UnionRectWithRegion(Rectangle_t *rect, Region_t src, Region_t dest)
Updates the destination region from a union of the specified rectangle and the specified source regio...
Definition: TGCocoa.mm:4299
virtual void TranslateCoordinates(Window_t src, Window_t dest, Int_t src_x, Int_t src_y, Int_t &dest_x, Int_t &dest_y, Window_t &child)
Translates coordinates in one window to the coordinate space of another window.
Definition: TGCocoa.mm:1274
virtual void ChangeProperties(Window_t wid, Atom_t property, Atom_t type, Int_t format, UChar_t *data, Int_t len)
Alters the property for the specified window and causes the X server to generate a PropertyNotify eve...
Definition: TGCocoa.mm:3856
#define dest(otri, vertexptr)
Definition: triangle.c:1040
virtual void LowerWindow(Window_t wid)
Lowers the specified window "id" to the bottom of the stack so that it does not obscure any sibling w...
Definition: TGCocoa.mm:1170
Handle_t Region_t
Definition: GuiTypes.h:33
virtual void DrawSegments(Drawable_t wid, GContext_t gc, Segment_t *segments, Int_t nSegments)
Draws multiple line segments.
Definition: TGCocoa.mm:1735
virtual void SetWMTransientHint(Window_t winID, Window_t mainWinID)
Tells window manager that the window "id" is a transient window of the window "main_id".
Definition: TGCocoa.mm:1600
Handle_t Pixmap_t
Definition: GuiTypes.h:31
virtual void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b)
Returns RGB values for color "index".
Definition: TGCocoa.mm:2966
virtual void DestroySubwindows(Window_t wid)
The DestroySubwindows function destroys all inferior windows of the specified window, in bottom-to-top stacking order.
Definition: TGCocoa.mm:901
virtual void WMDeleteNotify(Window_t wid)
Tells WM to send message when window is closed via WM.
std::vector< std::string > fAtomToName
Definition: TGCocoa.h:465
virtual UInt_t ScreenWidthMM() const
Returns the width of the screen in millimeters.
Definition: TGCocoa.mm:491
virtual Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding)
Returns a region for the polygon defined by the points array.
Definition: TGCocoa.mm:4310
virtual Cursor_t CreateCursor(ECursor cursor)
Creates the specified cursor.
Definition: TGCocoa.mm:3109
virtual void FlushOpenGLBuffer(Handle_t ctxID)
Flushes OpenGL buffer.
Definition: TGCocoa.mm:3407
double result[121]
virtual void LookupString(Event_t *event, char *buf, Int_t buflen, UInt_t &keysym)
Converts the keycode from the event structure to a key symbol (according to the modifiers specified i...
Definition: TGCocoa.mm:2790
virtual void SetPrimarySelectionOwner(Window_t wid)
Makes the window "id" the current owner of the primary selection.
Definition: TGCocoa.mm:3580
unsigned char UChar_t
Definition: RtypesCore.h:34
virtual Bool_t HasTTFonts() const
Returns True when TrueType fonts are used.
Definition: TGCocoa.mm:2843
virtual void SendEvent(Window_t wid, Event_t *ev)
Specifies the event "ev" is to be sent to the window "id".
Definition: TGCocoa.mm:3508
std::map< std::string, Atom_t > name_to_atom_map
Definition: X11Atoms.h:16
void FillPolygonAux(Window_t wid, const GCValues_t &gcVals, const Point_t *polygon, Int_t nPoints)
Definition: TGCocoa.mm:1957
virtual void DeletePictureData(void *data)
Delete picture data created by the function ReadPictureDataFromFile.
Definition: TGCocoa.mm:4238
ROOT::MacOSX::X11::EventTranslator * GetEventTranslator() const
Definition: TGCocoa.mm:4393
virtual void DrawString(Drawable_t wid, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len)
Each character image, as defined by the font in the GC, is treated as an additional mask for a fill o...
Definition: TGCocoa.mm:2205
virtual void Warp(Int_t ix, Int_t iy, Window_t wid)
Sets the pointer position.
Definition: TGCocoa.mm:4133
virtual void SetClipOFF(Int_t wid)
Turns off the clipping for the window "wid".
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Window_t GetPrimarySelectionOwner()
Returns the window id of the current owner of the primary selection.
Definition: TGCocoa.mm:3630
float value
Definition: math.cpp:443
void CocoaDrawON()
Definition: TGCocoa.mm:4405
virtual Int_t InitWindow(ULong_t window)
Creates a new window and return window number.
Definition: TGCocoa.mm:580
virtual void GetGeometry(Int_t wid, Int_t &x, Int_t &y, UInt_t &w, UInt_t &h)
Returns position and size of window "wid".
Definition: TGCocoa.mm:647
virtual Handle_t GetCurrentOpenGLContext()
Asks OpenGL subsystem about the current OpenGL context.
Definition: TGCocoa.mm:3390
const Int_t n
Definition: legend1.C:16
virtual UInt_t ExecCommand(TGWin32Command *code)
Executes the command "code" coming from the other threads (Win32)
Definition: TGCocoa.mm:4022
void * GetCurrentContext()
Definition: TGCocoa.mm:4424
virtual Handle_t GetNativeEvent() const
Returns the current native event handle.
Definition: TGCocoa.mm:3559
virtual Bool_t CreatePictureFromData(Drawable_t wid, char **data, Pixmap_t &pict, Pixmap_t &pict_mask, PictureAttributes_t &attr)
Creates a picture pict from data in bitmap format.
Definition: TGCocoa.mm:4216
virtual void SetForeground(GContext_t gc, ULong_t foreground)
Sets the foreground color for the specified GC (shortcut for ChangeGC with only foreground mask set)...
Definition: TGCocoa.mm:2997
virtual Pixmap_t CreateBitmap(Drawable_t wid, const char *bitmap, UInt_t width, UInt_t height)
Creates a bitmap (i.e.
Definition: TGCocoa.mm:2500
ULong_t Handle_t
Definition: GuiTypes.h:27