20#include "TGLIncludes.h"
46#include <ApplicationServices/ApplicationServices.h>
47#include <OpenGL/OpenGL.h>
48#include <Cocoa/Cocoa.h>
88#pragma mark - Display configuration management.
91void DisplayReconfigurationCallback(CGDirectDisplayID , CGDisplayChangeSummaryFlags flags,
void * )
93 if (flags & kCGDisplayBeginConfigurationFlag)
96 if (flags & kCGDisplayDesktopShapeChangedFlag) {
97 assert(
dynamic_cast<TGCocoa *
>(
gVirtualX) != 0 &&
"DisplayReconfigurationCallback, gVirtualX"
98 " is either null or has a wrong type");
104#pragma mark - Aux. functions called from GUI-rendering part.
109 assert(ctx != 0 &&
"SetStrokeForegroundColorFromX11Context, parameter 'ctx' is null");
115 ::Warning(
"SetStrokeForegroundColorFromX11Context",
116 "x11 context does not have line color information");
118 CGContextSetRGBStrokeColor(ctx, rgb[0], rgb[1], rgb[2], 1.);
125 assert(ctx != 0 &&
"SetStrokeDashFromX11Context, ctx parameter is null");
127 SetStrokeForegroundColorFromX11Context(ctx, gcVals);
129 static const std::size_t maxLength =
sizeof gcVals.
fDashes /
sizeof gcVals.
fDashes[0];
130 assert(maxLength >= std::size_t(gcVals.
fDashLen) &&
131 "SetStrokeDashFromX11Context, x11 context has bad dash length > sizeof(fDashes)");
133 CGFloat dashes[maxLength] = {};
144 ::Warning(
"SetStrokeDoubleDashFromX11Context",
"Not implemented yet, kick tpochep!");
152 assert(ctx != 0 &&
"SetStrokeParametersFromX11Context, parameter 'ctx' is null");
156 CGContextSetLineWidth(ctx, gcVals.
fLineWidth);
158 CGContextSetLineWidth(ctx, 1.);
160 CGContextSetLineDash(ctx, 0., 0, 0);
164 SetStrokeForegroundColorFromX11Context(ctx, gcVals);
166 SetStrokeDashFromX11Context(ctx, gcVals);
168 SetStrokeDoubleDashFromX11Context(ctx ,gcVals);
170 ::Warning(
"SetStrokeParametersFromX11Context",
"line style bit is set,"
171 " but line style is unknown");
172 SetStrokeForegroundColorFromX11Context(ctx, gcVals);
175 SetStrokeForegroundColorFromX11Context(ctx, gcVals);
183 assert(ctx != 0 &&
"SetFilledAreaColorFromX11Context, parameter 'ctx' is null");
189 ::Warning(
"SetFilledAreaColorFromX11Context",
"no fill color found in x11 context");
191 CGContextSetRGBFillColor(ctx, rgb[0], rgb[1], rgb[2], 1.);
194struct PatternContext {
197 : fMask(mask), fFillStyle(fillStyle), fForeground(foreground), fBackground(background), fPhase(phase)
199 fImage = [image retain];
206 PatternContext(
const PatternContext &) =
delete;
207 PatternContext(PatternContext &&) =
delete;
208 PatternContext &
operator = (
const PatternContext &) =
delete;
209 PatternContext &
operator = (PatternContext &&) =
delete;
213 if (image != fImage) {
215 fImage = [image retain];
220 Int_t fFillStyle = 0;
229bool HasFillTiledStyle(
Mask_t mask,
Int_t fillStyle)
235bool HasFillTiledStyle(
const GCValues_t &gcVals)
241bool HasFillStippledStyle(
Mask_t mask,
Int_t fillStyle)
247bool HasFillStippledStyle(
const GCValues_t &gcVals)
253bool HasFillOpaqueStippledStyle(
Mask_t mask,
Int_t fillStyle)
259bool HasFillOpaqueStippledStyle(
const GCValues_t &gcVals)
267 assert(patternImage != nil &&
"DrawTile, parameter 'patternImage' is nil");
268 assert(ctx != 0 &&
"DrawTile, ctx parameter is null");
270 const CGRect patternRect = CGRectMake(0, 0, patternImage.fWidth, patternImage.fHeight);
271 if ([patternImage isKindOfClass : [
QuartzImage class]]) {
272 CGContextDrawImage(ctx, patternRect, ((
QuartzImage *)patternImage).fImage);
273 }
else if ([patternImage isKindOfClass : [
QuartzPixmap class]]){
275 assert(imageFromPixmap.Get() != 0 &&
"DrawTile, createImageFromPixmap failed");
276 CGContextDrawImage(ctx, patternRect, imageFromPixmap.Get());
278 assert(0 &&
"DrawTile, pattern is neither a QuartzImage, nor a QuartzPixmap");
288 assert(info != 0 &&
"DrawPattern, parameter 'info' is null");
289 assert(ctx != 0 &&
"DrawPattern, parameter 'ctx' is null");
291 const PatternContext *
const patternContext = (PatternContext *)info;
292 const Mask_t mask = patternContext->fMask;
293 const Int_t fillStyle = patternContext->fFillStyle;
296 assert(patternImage != nil &&
"DrawPattern, pattern (stipple) image is nil");
297 const CGRect patternRect = CGRectMake(0, 0, patternImage.fWidth, patternImage.fHeight);
299 if (HasFillTiledStyle(mask, fillStyle)) {
300 DrawTile(patternImage, ctx);
301 }
else if (HasFillStippledStyle(mask, fillStyle) || HasFillOpaqueStippledStyle(mask, fillStyle)) {
302 assert([patternImage isKindOfClass : [
QuartzImage class]] &&
303 "DrawPattern, stipple must be a QuartzImage object");
305 assert(image.
fIsStippleMask == YES &&
"DrawPattern, image is not a stipple mask");
309 if (HasFillOpaqueStippledStyle(mask,fillStyle)) {
312 "DrawPattern, fill style is FillOpaqueStippled, but background color is not set in a context");
314 CGContextSetRGBFillColor(ctx, rgb[0], rgb[1], rgb[2], 1.);
315 CGContextFillRect(ctx, patternRect);
319 assert((mask &
kGCForeground) &&
"DrawPattern, foreground color is not set");
321 CGContextSetRGBFillColor(ctx, rgb[0], rgb[1], rgb[2], 1.);
322 CGContextClipToMask(ctx, patternRect, image.
fImage);
323 CGContextFillRect(ctx, patternRect);
326 DrawTile(patternImage, ctx);
331void PatternRelease(
void *info)
333 delete static_cast<PatternContext *
>(info);
343 assert(ctx != 0 &&
"SetFillPattern, parameter 'ctx' is null");
344 assert(patternContext != 0 &&
"SetFillPattern, parameter 'patternContext' is null");
345 assert(patternContext->fImage != nil &&
"SetFillPattern, pattern image is nil");
348 CGContextSetFillColorSpace(ctx, patternColorSpace.Get());
350 CGPatternCallbacks callbacks = {};
352 callbacks.releaseInfo = PatternRelease;
353 const CGRect patternRect = CGRectMake(0, 0, patternContext->fImage.fWidth, patternContext->fImage.fHeight);
355 patternContext->fImage.fWidth, patternContext->fImage.fHeight,
356 kCGPatternTilingNoDistortion,
true, &callbacks));
357 const CGFloat alpha = 1.;
358 CGContextSetFillPattern(ctx, pattern.Get(), &alpha);
359 CGContextSetPatternPhase(ctx, patternContext->fPhase);
365 assert(child != nil &&
"ParentRendersToChild, parameter 'child' is nil");
369 child.fMapState ==
kIsViewable && child.fParentView.fContext &&
370 !child.fIsOverlapped;
373class ViewFixer final {
378 const auto origin = viewToFix.frame.origin;
380 widToFix = viewToFix.
fID;
381 if ((context = viewToFix.
fContext)) {
382 CGContextSaveGState(context);
383 CGContextTranslateCTM(context, origin.x, origin.y);
390 CGContextRestoreGState(context);
392 ViewFixer(
const ViewFixer &rhs) =
delete;
393 ViewFixer &
operator = (
const ViewFixer &) =
delete;
400bool IsNonPrintableAsciiCharacter(UniChar
c)
402 if (
c == 9 || (
c >= 32 &&
c < 127))
409void FixAscii(std::vector<UniChar> &
text)
426 std::replace(
text.begin(),
text.end(), UniChar(16), UniChar(
' '));
429 text.erase(std::remove_if(
text.begin(),
text.end(), IsNonPrintableAsciiCharacter),
text.end());
440 : fSelectedDrawable(0),
444 fForegroundProcess(false),
446 fDisplayShapeChanged(true)
449 "TGCocoa, gSystem is eihter null or has a wrong type");
460 CGDisplayRegisterReconfigurationCallback (DisplayReconfigurationCallback, 0);
466 fSelectedDrawable(0),
470 fForegroundProcess(false),
472 fDisplayShapeChanged(true)
475 "TGCocoa, gSystem is eihter null or has a wrong type");
486 CGDisplayRegisterReconfigurationCallback (DisplayReconfigurationCallback, 0);
493 CGDisplayRemoveReconfigurationCallback (DisplayReconfigurationCallback, 0);
512 if (CGMainDisplayID() == kCGNullDirectDisplay)
565 return CGDisplayScreenSize(CGMainDisplayID()).width;
576 NSArray *
const screens = [NSScreen screens];
577 assert(screens != nil &&
"screens array is nil");
579 NSScreen *
const mainScreen = [screens objectAtIndex : 0];
580 assert(mainScreen != nil &&
"screen with index 0 is nil");
582 return NSBitsPerPixelFromDepth([mainScreen depth]);
591 assert(
gClient != 0 &&
"Update, gClient is null");
593 }
else if (mode > 0) {
612 NSArray *
const screens = [NSScreen screens];
613 assert(screens != nil && screens.count != 0 &&
"GetDisplayGeometry, no screens found");
615 NSRect frame = [(NSScreen *)[screens objectAtIndex : 0] frame];
616 CGFloat xMin = frame.origin.x, xMax = xMin + frame.size.width;
617 CGFloat yMin = frame.origin.y, yMax = yMin + frame.size.height;
619 for (NSUInteger i = 1,
e = screens.count; i <
e; ++i) {
620 frame = [(NSScreen *)[screens objectAtIndex : i] frame];
621 xMin = std::min(xMin, frame.origin.x);
622 xMax = std::max(xMax, frame.origin.x + frame.size.width);
623 yMin = std::min(yMin, frame.origin.y);
624 yMax = std::max(yMax, frame.origin.y + frame.size.height);
638#pragma mark - Window management part.
644 return fPimpl->GetRootWindowID();
660 assert(parentID != 0 &&
"InitWindow, parameter 'parentID' is 0");
664 if (
fPimpl->IsRootWindow(parentID))
667 [
fPimpl->GetWindow(parentID) getAttributes : &attr];
669 return CreateWindow(parentID, 0, 0, attr.
fWidth, attr.
fHeight, 0, attr.
fDepth, attr.
fClass, 0, 0, 0);
693 "ClearWindow, fSelectedDrawable is invalid");
696 if (drawable.fIsPixmap) {
702 assert(pixmapCtx != 0 &&
"ClearWindow, pixmap's context is null");
707 CGContextClearRect(pixmapCtx, CGRectMake(0, 0, drawable.fWidth, drawable.fHeight));
724 if (windowID < 0 || fPimpl->IsRootWindow(windowID)) {
738 h = drawable.fHeight;
740 if (!drawable.fIsPixmap) {
742 NSPoint srcPoint = {};
745 NSView<X11Window> *
const view = window.fContentView.fParentView ? window.fContentView.fParentView : window.fContentView;
762 assert(!
fPimpl->IsRootWindow(windowID) &&
"MoveWindow, called for root window");
767 [
fPimpl->GetWindow(windowID) setX :
x Y :
y];
787 assert(!
fPimpl->IsRootWindow(windowID) &&
788 "ResizeWindow, parameter 'windowID' is a root window's id");
793 if (window.fBackBuffer) {
813 "UpdateWindow, fSelectedDrawable is not a valid window id");
822 assert([window.fContentView isKindOfClass : [
QuartzView class]] &&
"UpdateWindow, content view is not a QuartzView");
825 if (dstView.fIsOverlapped)
828 if (dstView.fContext) {
830 const X11::Rectangle copyArea(0, 0, pixmap.fWidth, pixmap.fHeight);
831 [dstView copy : pixmap area : copyArea withMask : nil clipOrigin :
X11::Point() toPoint :
X11::Point()];
834 fPimpl->fX11CommandBuffer.AddUpdateWindow(dstView);
880 if (
fPimpl->IsRootWindow(parentID)) {
883 depth, clss, visual, attr, wtype);
888 newWindow.
fID = result;
889 [newWindow setAcceptsMouseMovedEvents : YES];
895 assert([parentWin.fContentView isKindOfClass : [
QuartzView class]] &&
896 "CreateWindow, parent view must be QuartzView");
900 x,
y, w,
h, border, depth, clss, visual, attr, wtype);
903 childView.fID = result;
904 [parentWin addChild : childView];
931 if (
fPimpl->IsRootWindow(wid))
934 BOOL needFocusChange = NO;
939 fPimpl->fX11EventTranslator.CheckUnmappedView(wid);
941 assert(
fPimpl->GetDrawable(wid).fIsPixmap == NO &&
942 "DestroyWindow, can not be called for QuartzPixmap or QuartzImage object");
945 if (
fPimpl->fX11CommandBuffer.BufferSize())
946 fPimpl->fX11CommandBuffer.RemoveOperationsForDrawable(wid);
949 if ((needFocusChange = window == window.fQuartzWindow && window.fQuartzWindow.fHasFocus))
950 window.fHasFocus = NO;
954 fPimpl->fX11EventTranslator.GenerateDestroyNotify(wid);
960 fPimpl->DeleteDrawable(wid);
980 if (
fPimpl->IsRootWindow(wid))
985 assert(
fPimpl->GetDrawable(wid).fIsPixmap == NO &&
986 "DestroySubwindows, can not be called for QuartzPixmap or QuartzImage object");
1007 if (
fPimpl->IsRootWindow(wid))
1010 [
fPimpl->GetWindow(wid) getAttributes : &attr];
1023 assert(!
fPimpl->IsRootWindow(wid) &&
"ChangeWindowAttributes, called for root window");
1024 assert(attr != 0 &&
"ChangeWindowAttributes, parameter 'attr' is null");
1026 [
fPimpl->GetWindow(wid) setAttributes : attr];
1041 if (windowID <= fPimpl->GetRootWindowID())
1046 window.fEventMask = eventMask;
1055 assert(!
fPimpl->IsRootWindow(wid) &&
"ReparentChild, can not re-parent root window");
1060 if (
fPimpl->IsRootWindow(pid)) {
1063 [view removeFromSuperview];
1064 view.fParentView = nil;
1066 NSRect frame = view.frame;
1067 frame.origin = NSPoint();
1069 NSUInteger styleMask = kClosableWindowMask | kMiniaturizableWindowMask | kResizableWindowMask;
1070 if (!view.fOverrideRedirect)
1071 styleMask |= kTitledWindowMask;
1074 styleMask : styleMask
1075 backing : NSBackingStoreBuffered
1077 [view setX :
x Y :
y];
1078 [newTopLevel addChild : view];
1080 fPimpl->ReplaceDrawable(wid, newTopLevel);
1083 [newTopLevel release];
1086 [view removeFromSuperview];
1089 assert(newParent.fIsPixmap == NO &&
"ReparentChild, pixmap can not be a new parent");
1090 [view setX :
x Y :
y];
1091 [newParent addChild : view];
1102 if (
fPimpl->IsRootWindow(pid))
1109 [contentView retain];
1110 [contentView removeFromSuperview];
1111 [topLevel setContentView : nil];
1112 fPimpl->ReplaceDrawable(wid, contentView);
1113 [contentView setX :
x Y :
y];
1114 [
fPimpl->GetWindow(pid) addChild : contentView];
1115 [contentView release];
1126 assert(!
fPimpl->IsRootWindow(wid) &&
"ReparentWindow, can not re-parent root window");
1129 if (view.fParentView)
1142 assert(!
fPimpl->IsRootWindow(wid) &&
"MapWindow, called for root window");
1147 [
fPimpl->GetWindow(wid) mapWindow];
1162 assert(!
fPimpl->IsRootWindow(wid) &&
"MapSubwindows, called for 'root' window");
1167 [
fPimpl->GetWindow(wid) mapSubwindows];
1177 assert(!
fPimpl->IsRootWindow(wid) &&
"MapRaised, called for root window");
1182 [
fPimpl->GetWindow(wid) mapRaised];
1198 assert(!
fPimpl->IsRootWindow(wid) &&
"UnmapWindow, called for root window");
1203 fPimpl->fX11EventTranslator.CheckUnmappedView(wid);
1208 if (win == win.fQuartzWindow && win.fQuartzWindow.fHasFocus)
1230 assert(!
fPimpl->IsRootWindow(wid) &&
"RaiseWindow, called for root window");
1232 if (!
fPimpl->GetWindow(wid).fParentView)
1235 [
fPimpl->GetWindow(wid) raiseWindow];
1247 assert(!
fPimpl->IsRootWindow(wid) &&
"LowerWindow, called for root window");
1249 if (!
fPimpl->GetWindow(wid).fParentView)
1252 [
fPimpl->GetWindow(wid) lowerWindow];
1268 assert(!
fPimpl->IsRootWindow(wid) &&
"MoveWindow, called for root window");
1270 [
fPimpl->GetWindow(wid) setX :
x Y :
y];
1287 assert(!
fPimpl->IsRootWindow(wid) &&
"MoveResizeWindow, called for 'root' window");
1299 assert(!
fPimpl->IsRootWindow(wid) &&
"ResizeWindow, called for 'root' window");
1304 const UInt_t siMax = std::numeric_limits<Int_t>::max();
1305 if (w > siMax ||
h > siMax)
1308 NSSize newSize = {};
1312 [
fPimpl->GetWindow(wid) setDrawableSize : newSize];
1322 assert(!
fPimpl->IsRootWindow(wid) &&
"IconifyWindow, can not iconify the root window");
1323 assert(
fPimpl->GetWindow(wid).fIsPixmap == NO &&
"IconifyWindow, invalid window id");
1326 assert(win.fQuartzWindow == win &&
"IconifyWindow, can be called only for a top level window");
1328 fPimpl->fX11EventTranslator.CheckUnmappedView(wid);
1331 if (
fPimpl->fX11CommandBuffer.BufferSize())
1332 fPimpl->fX11CommandBuffer.RemoveOperationsForDrawable(wid);
1334 if (window.fQuartzWindow.fHasFocus) {
1336 window.fQuartzWindow.fHasFocus = NO;
1339 [win.fQuartzWindow miniaturize : win.fQuartzWindow];
1354 if (!srcWin || !dstWin)
1357 const bool srcIsRoot =
fPimpl->IsRootWindow(srcWin);
1358 const bool dstIsRoot =
fPimpl->IsRootWindow(dstWin);
1360 if (srcIsRoot && dstIsRoot) {
1372 NSPoint srcPoint = {};
1376 NSPoint dstPoint = {};
1382 }
else if (srcIsRoot) {
1386 if ([dstView superview]) {
1390 dstPoint = [[dstView superview] convertPoint : dstPoint fromView : dstView];
1392 if (view != dstView && view.fMapState ==
kIsViewable)
1401 if ([dstView superview]) {
1405 const NSPoint
pt = [[dstView superview] convertPoint : dstPoint fromView : dstView];
1407 if (view != dstView && view.fMapState ==
kIsViewable)
1430 if (
fPimpl->IsRootWindow(wid)) {
1440 if (!window.fIsPixmap) {
1460 assert(!
fPimpl->IsRootWindow(wid) &&
"SetWindowBackground, can not set color for root window");
1462 fPimpl->GetWindow(wid).fBackgroundPixel = color;
1475 assert(!
fPimpl->IsRootWindow(windowID) &&
1476 "SetWindowBackgroundPixmap, can not set background for a root window");
1477 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
1478 "SetWindowBackgroundPixmap, invalid window id");
1481 if (pixmapID ==
kNone) {
1482 window.fBackgroundPixmap = nil;
1486 assert(pixmapID >
fPimpl->GetRootWindowID() &&
1487 "SetWindowBackgroundPixmap, parameter 'pixmapID' is not a valid pixmap id");
1488 assert(
fPimpl->GetDrawable(pixmapID).fIsPixmap == YES &&
1489 "SetWindowBackgroundPixmap, bad drawable");
1496 if ([pixmapOrImage isKindOfClass : [
QuartzPixmap class]]) {
1498 if (backgroundImage.
Get())
1499 window.fBackgroundPixmap = backgroundImage.
Get();
1502 if (backgroundImage.
Get())
1503 window.fBackgroundPixmap = backgroundImage.
Get();
1506 if (!backgroundImage.
Get())
1508 Error(
"SetWindowBackgroundPixmap",
"QuartzImage initialization failed");
1517 if (windowID <= fPimpl->GetRootWindowID())
1521 return view.fParentView ? view.fParentView.fID :
fPimpl->GetRootWindowID();
1535 NSString *
const windowTitle = [NSString stringWithCString :
name encoding : NSASCIIStringEncoding];
1536 [(
NSWindow *)drawable setTitle : windowTitle];
1566 assert(!
fPimpl->IsRootWindow(windowID) &&
1567 "ShapeCombineMask, windowID parameter is a 'root' window");
1568 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
1569 "ShapeCombineMask, windowID parameter is a bad window id");
1571 "ShapeCombineMask, pixmapID parameter must point to QuartzImage object");
1573 if (
fPimpl->GetWindow(windowID).fContentView.fParentView)
1577 assert(srcImage.
fIsStippleMask == YES &&
"ShapeCombineMask, source image is not a stipple mask");
1585 [qw setOpaque : NO];
1586 [qw setBackgroundColor : [NSColor clearColor]];
1590#pragma mark - "Window manager hints" set of functions.
1598 assert(!
fPimpl->IsRootWindow(wid) &&
"SetMWMHints, called for 'root' window");
1601 NSUInteger newMask = 0;
1603 if ([qw styleMask] & kTitledWindowMask) {
1604 newMask |= kTitledWindowMask;
1605 newMask |= kClosableWindowMask;
1609 newMask |= kMiniaturizableWindowMask | kResizableWindowMask;
1612 newMask |= kMiniaturizableWindowMask;
1614 newMask |= kResizableWindowMask;
1617 [qw setStyleMask : newMask];
1621 [[qw standardWindowButton : NSWindowZoomButton] setEnabled : YES];
1622 [[qw standardWindowButton : NSWindowMiniaturizeButton] setEnabled : YES];
1626 [[qw standardWindowButton : NSWindowZoomButton] setEnabled : funcs &
kMWMDecorMaximize];
1627 [[qw standardWindowButton : NSWindowMiniaturizeButton] setEnabled : funcs &
kMWMDecorMinimize];
1649 assert(!
fPimpl->IsRootWindow(wid) &&
"SetWMSizeHints, called for root window");
1651 const NSUInteger styleMask = kTitledWindowMask | kClosableWindowMask | kMiniaturizableWindowMask | kResizableWindowMask;
1652 const NSRect minRect = [
NSWindow frameRectForContentRect : NSMakeRect(0., 0., wMin, hMin) styleMask : styleMask];
1653 const NSRect maxRect = [
NSWindow frameRectForContentRect : NSMakeRect(0., 0., wMax, hMax) styleMask : styleMask];
1656 [qw setMinSize : minRect.size];
1657 [qw setMaxSize : maxRect.size];
1678 assert(wid >
fPimpl->GetRootWindowID() &&
"SetWMTransientHint, wid parameter is not a valid window id");
1680 if (
fPimpl->IsRootWindow(mainWid))
1685 if (![mainWindow isVisible])
1690 if (mainWindow != transientWindow) {
1693 Error(
"SetWMTransientHint",
"window is already transient for other window");
1695 [[transientWindow standardWindowButton : NSWindowZoomButton] setEnabled : NO];
1696 [mainWindow addTransientWindow : transientWindow];
1699 Warning(
"SetWMTransientHint",
"transient and main windows are the same window");
1702#pragma mark - GUI-rendering part.
1708 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawLineAux, called for root window");
1712 assert(ctx != 0 &&
"DrawLineAux, context is null");
1725 CGContextSetAllowsAntialiasing(ctx,
false);
1727 if (!drawable.fIsPixmap)
1728 CGContextTranslateCTM(ctx, 0.5, 0.5);
1735 SetStrokeParametersFromX11Context(ctx, gcVals);
1736 CGContextBeginPath(ctx);
1737 CGContextMoveToPoint(ctx,
x1, y1);
1738 CGContextAddLineToPoint(ctx,
x2, y2);
1739 CGContextStrokePath(ctx);
1741 CGContextSetAllowsAntialiasing(ctx,
true);
1756 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawLine, called for root window");
1757 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"DrawLine, invalid context index");
1762 if (!drawable.fIsPixmap) {
1765 const ViewFixer fixer(view, wid);
1768 fPimpl->fX11CommandBuffer.AddDrawLine(wid, gcVals,
x1, y1,
x2, y2);
1774 fPimpl->fX11CommandBuffer.AddDrawLine(wid, gcVals,
x1, y1,
x2, y2);
1784 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawSegmentsAux, called for root window");
1785 assert(segments != 0 &&
"DrawSegmentsAux, segments parameter is null");
1786 assert(nSegments > 0 &&
"DrawSegmentsAux, nSegments <= 0");
1788 for (
Int_t i = 0; i < nSegments; ++i)
1789 DrawLineAux(wid, gcVals, segments[i].fX1, segments[i].fY1 - 3, segments[i].fX2, segments[i].fY2 - 3);
1801 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawSegments, called for root window");
1802 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"DrawSegments, invalid context index");
1803 assert(segments != 0 &&
"DrawSegments, parameter 'segments' is null");
1804 assert(nSegments > 0 &&
"DrawSegments, number of segments <= 0");
1809 if (!drawable.fIsPixmap) {
1811 const ViewFixer fixer(view, wid);
1815 fPimpl->fX11CommandBuffer.AddDrawSegments(wid, gcVals, segments, nSegments);
1821 fPimpl->fX11CommandBuffer.AddDrawSegments(wid, gcVals, segments, nSegments);
1831 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawRectangleAux, called for root window");
1835 if (!drawable.fIsPixmap) {
1848 assert(ctx &&
"DrawRectangleAux, context is null");
1851 CGContextSetAllowsAntialiasing(ctx,
false);
1853 SetStrokeParametersFromX11Context(ctx, gcVals);
1855 const CGRect rect = CGRectMake(
x,
y, w,
h);
1856 CGContextStrokeRect(ctx, rect);
1858 CGContextSetAllowsAntialiasing(ctx,
true);
1870 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawRectangle, called for root window");
1871 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"DrawRectangle, invalid context index");
1877 if (!drawable.fIsPixmap) {
1880 const ViewFixer fixer(view, wid);
1884 fPimpl->fX11CommandBuffer.AddDrawRectangle(wid, gcVals,
x,
y, w,
h);
1890 fPimpl->fX11CommandBuffer.AddDrawRectangle(wid, gcVals,
x,
y, w,
h);
1906 assert(!
fPimpl->IsRootWindow(wid) &&
"FillRectangleAux, called for root window");
1910 CGSize patternPhase = {};
1912 if (drawable.fIsPixmap) {
1917 const CGRect fillRect = CGRectMake(
x,
y, w,
h);
1919 if (!drawable.fIsPixmap) {
1922 const NSPoint origin = [view.
fParentView convertPoint : view.frame.origin toView : nil];
1923 patternPhase.width = origin.x;
1924 patternPhase.height = origin.y;
1930 if (HasFillStippledStyle(gcVals) || HasFillOpaqueStippledStyle(gcVals) || HasFillTiledStyle(gcVals)) {
1931 std::unique_ptr<PatternContext> patternContext(
new PatternContext(gcVals.
fMask, gcVals.
fFillStyle,
1932 0, 0, nil, patternPhase));
1933 if (HasFillStippledStyle(gcVals) || HasFillOpaqueStippledStyle(gcVals)) {
1935 "FillRectangleAux, fill_style is FillStippled/FillOpaqueStippled,"
1936 " but no stipple is set in a context");
1941 if (HasFillOpaqueStippledStyle(gcVals))
1945 "FillRectangleAux, fill_style is FillTiled, but not tile is set in a context");
1947 patternContext->SetImage(
fPimpl->GetDrawable(gcVals.
fTile));
1950 SetFillPattern(ctx, patternContext.get());
1951 patternContext.release();
1952 CGContextFillRect(ctx, fillRect);
1957 SetFilledAreaColorFromX11Context(ctx, gcVals);
1958 CGContextFillRect(ctx, fillRect);
1971 assert(!
fPimpl->IsRootWindow(wid) &&
"FillRectangle, called for root window");
1972 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"FillRectangle, invalid context index");
1977 if (!drawable.fIsPixmap) {
1980 const ViewFixer fixer(view, wid);
1983 fPimpl->fX11CommandBuffer.AddFillRectangle(wid, gcVals,
x,
y, w,
h);
2000 assert(!
fPimpl->IsRootWindow(wid) &&
"FillPolygonAux, called for root window");
2001 assert(polygon != 0 &&
"FillPolygonAux, parameter 'polygon' is null");
2002 assert(nPoints > 0 &&
"FillPolygonAux, number of points must be positive");
2007 CGSize patternPhase = {};
2009 if (!drawable.fIsPixmap) {
2011 const NSPoint origin = [view convertPoint : view.frame.origin toView : nil];
2012 patternPhase.width = origin.x;
2013 patternPhase.height = origin.y;
2018 CGContextSetAllowsAntialiasing(ctx,
false);
2020 if (HasFillStippledStyle(gcVals) || HasFillOpaqueStippledStyle(gcVals) || HasFillTiledStyle(gcVals)) {
2021 std::unique_ptr<PatternContext> patternContext(
new PatternContext(gcVals.
fMask, gcVals.
fFillStyle, 0, 0, nil, patternPhase));
2023 if (HasFillStippledStyle(gcVals) || HasFillOpaqueStippledStyle(gcVals)) {
2025 "FillRectangleAux, fill style is FillStippled/FillOpaqueStippled,"
2026 " but no stipple is set in a context");
2031 if (HasFillOpaqueStippledStyle(gcVals))
2035 "FillRectangleAux, fill_style is FillTiled, but not tile is set in a context");
2037 patternContext->SetImage(
fPimpl->GetDrawable(gcVals.
fTile));
2040 SetFillPattern(ctx, patternContext.get());
2041 patternContext.release();
2043 SetFilledAreaColorFromX11Context(ctx, gcVals);
2048 CGContextBeginPath(ctx);
2049 if (!drawable.fIsPixmap) {
2050 CGContextMoveToPoint(ctx, polygon[0].fX, polygon[0].fY - 2);
2051 for (
Int_t i = 1; i < nPoints; ++i)
2052 CGContextAddLineToPoint(ctx, polygon[i].fX, polygon[i].fY - 2);
2055 for (
Int_t i = 1; i < nPoints; ++i)
2059 CGContextFillPath(ctx);
2060 CGContextSetAllowsAntialiasing(ctx,
true);
2083 assert(polygon != 0 &&
"FillPolygon, parameter 'polygon' is null");
2084 assert(nPoints > 0 &&
"FillPolygon, number of points must be positive");
2085 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"FillPolygon, invalid context index");
2090 if (!drawable.fIsPixmap) {
2092 const ViewFixer fixer(view, wid);
2096 fPimpl->fX11CommandBuffer.AddFillPolygon(wid, gcVals, polygon, nPoints);
2102 fPimpl->fX11CommandBuffer.AddFillPolygon(wid, gcVals, polygon, nPoints);
2116 assert(!
fPimpl->IsRootWindow(src) &&
"CopyAreaAux, src parameter is root window");
2117 assert(!
fPimpl->IsRootWindow(dst) &&
"CopyAreaAux, dst parameter is root window");
2132 "CopyArea, mask is not a pixmap");
2142 [dstDrawable copy : srcDrawable area : copyArea withMask : mask clipOrigin : clipOrigin toPoint : dstPoint];
2152 assert(!
fPimpl->IsRootWindow(src) &&
"CopyArea, src parameter is root window");
2153 assert(!
fPimpl->IsRootWindow(dst) &&
"CopyArea, dst parameter is root window");
2154 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"CopyArea, invalid context index");
2159 if (!drawable.fIsPixmap) {
2161 const ViewFixer fixer(view, dst);
2165 fPimpl->fX11CommandBuffer.AddCopyArea(src, dst, gcVals, srcX, srcY,
width, height, dstX, dstY);
2170 if (
fPimpl->GetDrawable(src).fIsPixmap) {
2175 fPimpl->fX11CommandBuffer.AddCopyArea(src, dst, gcVals, srcX, srcY,
width, height, dstX, dstY);
2186 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawStringAux, called for root window");
2190 assert(ctx != 0 &&
"DrawStringAux, context is null");
2194 CGContextSetTextMatrix(ctx, CGAffineTransformIdentity);
2197 if (!drawable.fIsPixmap) {
2198 CGContextTranslateCTM(ctx, 0., drawable.fHeight);
2199 CGContextScaleCTM(ctx, 1., -1.);
2203 CGContextSetAllowsAntialiasing(ctx,
true);
2205 assert(gcVals.
fMask &
kGCFont &&
"DrawString, font is not set in a context");
2208 len = std::strlen(
text);
2210 CGFloat textColor[4] = {0., 0., 0., 1.};
2215 CGContextSetRGBFillColor(ctx, textColor[0], textColor[1], textColor[2], textColor[3]);
2220 std::vector<UniChar> unichars((
unsigned char *)
text, (
unsigned char *)
text + len);
2233 assert(!
fPimpl->IsRootWindow(wid) &&
"DrawString, called for root window");
2234 assert(gc > 0 && gc <=
fX11Contexts.size() &&
"DrawString, invalid context index");
2238 assert(gcVals.
fMask &
kGCFont &&
"DrawString, font is not set in a context");
2240 if (!drawable.fIsPixmap) {
2242 const ViewFixer fixer(view, wid);
2246 fPimpl->fX11CommandBuffer.AddDrawString(wid, gcVals,
x,
y,
text, len);
2253 fPimpl->fX11CommandBuffer.AddDrawString(wid, gcVals,
x,
y,
text, len);
2262 assert(!
fPimpl->IsRootWindow(windowID) &&
"ClearAreaAux, called for root window");
2265 assert(view.
fContext != 0 &&
"ClearAreaAux, view.fContext is null");
2275 CGFloat rgb[3] = {};
2279 CGContextSetRGBFillColor(view.
fContext, rgb[0], rgb[1], rgb[2], 1.);
2280 CGContextFillRect(view.
fContext, CGRectMake(
x,
y, w,
h));
2282 const CGRect fillRect = CGRectMake(
x,
y, w,
h);
2284 CGSize patternPhase = {};
2286 const NSPoint origin = [view.
fParentView convertPoint : view.frame.origin toView : nil];
2287 patternPhase.width = origin.x;
2288 patternPhase.height = origin.y;
2292 std::unique_ptr<PatternContext> patternContext(
new PatternContext({}, 0, 0, 0, view.
fBackgroundPixmap, patternPhase));
2293 SetFillPattern(view.
fContext, patternContext.get());
2294 patternContext.release();
2295 CGContextFillRect(view.
fContext, fillRect);
2309 assert(!
fPimpl->IsRootWindow(wid) &&
"ClearArea, called for root window");
2313 if (ParentRendersToChild(view))
2318 fPimpl->fX11CommandBuffer.AddClearArea(wid,
x,
y, w,
h);
2336#pragma mark - Pixmap management.
2342 NSSize newSize = {};
2347 scaleFactor : [[NSScreen mainScreen] backingScaleFactor]]);
2349 pixmap.
Get().fID =
fPimpl->RegisterDrawable(pixmap.
Get());
2353 Error(
"OpenPixmap",
"QuartzPixmap initialization failed");
2361 assert(!
fPimpl->IsRootWindow(wid) &&
"ResizePixmap, called for root window");
2364 assert(drawable.fIsPixmap == YES &&
"ResizePixmap, invalid drawable");
2370 if ([pixmap resizeW : w
H :
h scaleFactor : [[NSScreen mainScreen] backingScaleFactor]])
2379 assert(pixmapID > (
Int_t)
fPimpl->GetRootWindowID() &&
2380 "SelectPixmap, parameter 'pixmapID' is not a valid id");
2388 assert(pixmapID > (
Int_t)
fPimpl->GetRootWindowID() &&
2389 "CopyPixmap, parameter 'pixmapID' is not a valid id");
2391 "CopyPixmap, fSelectedDrawable is not a valid window id");
2394 assert([source isKindOfClass : [
QuartzPixmap class]] &&
2395 "CopyPixmap, source is not a pixmap");
2401 if (drawable.fIsPixmap) {
2402 destination = drawable;
2405 if (window.fBackBuffer) {
2406 destination = window.fBackBuffer;
2408 Warning(
"CopyPixmap",
"Operation skipped, since destination"
2409 " window is not double buffered");
2414 const X11::Rectangle copyArea(0, 0, pixmap.fWidth, pixmap.fHeight);
2417 [destination copy : pixmap area : copyArea withMask : nil clipOrigin :
X11::Point() toPoint : dstPoint];
2425 assert(
fPimpl->GetDrawable(
fSelectedDrawable).fIsPixmap == YES &&
"ClosePixmap, selected drawable is not a pixmap");
2431#pragma mark - Different functions to create pixmap from different data sources. Used by GUI.
2432#pragma mark - These functions implement TVirtualX interface, some of them dupilcate others.
2448 assert(bitmap != 0 &&
"CreatePixmap, parameter 'bitmap' is null");
2449 assert(
width > 0 &&
"CreatePixmap, parameter 'width' is 0");
2450 assert(height > 0 &&
"CreatePixmap, parameter 'height' is 0");
2452 std::vector<unsigned char> imageData (depth > 1 ?
width * height * 4 :
width * height);
2455 backgroundPixel, depth, &imageData[0]);
2466 Error(
"CreatePixmap",
"QuartzImage initialization failed");
2470 image.
Get().fID =
fPimpl->RegisterDrawable(image.
Get());
2471 return image.
Get().fID;
2478 assert(bits != 0 &&
"CreatePixmapFromData, data parameter is null");
2479 assert(
width != 0 &&
"CreatePixmapFromData, width parameter is 0");
2480 assert(height != 0 &&
"CreatePixmapFromData, height parameter is 0");
2484 std::vector<unsigned char> imageData(bits, bits +
width * height * 4);
2487 unsigned char *p = &imageData[0];
2488 for (
unsigned i = 0,
e =
width * height; i <
e; ++i, p += 4)
2489 std::swap(p[0], p[2]);
2493 H : height data : &imageData[0]]);
2497 Error(
"CreatePixmapFromData",
"QuartzImage initialziation failed");
2501 image.
Get().fID =
fPimpl->RegisterDrawable(image.
Get());
2502 return image.
Get().fID;
2509 assert(std::numeric_limits<unsigned char>::digits == 8 &&
"CreateBitmap, ASImage requires octets");
2517 std::vector<unsigned char> imageData(
width * height);
2520 for (
unsigned i = 0, j = 0,
e =
width / 8 * height; i <
e; ++i) {
2521 for(
unsigned bit = 0; bit < 8; ++bit, ++j) {
2522 if (bitmap[i] & (1 << bit))
2531 H : height bitmapMask : &imageData[0]]);
2534 Error(
"CreateBitmap",
"QuartzImage initialization failed");
2538 image.
Get().fID =
fPimpl->RegisterDrawable(image.
Get());
2539 return image.
Get().fID;
2545 fPimpl->DeleteDrawable(pixmapID);
2552 assert(
fPimpl->GetDrawable(pixmapID).fIsPixmap == YES &&
"DeletePixmap, object is not a pixmap");
2553 fPimpl->fX11CommandBuffer.AddDeletePixmap(pixmapID);
2569 if (
fPimpl->IsRootWindow(wid)) {
2570 Warning(
"GetColorBits",
"Called for root window");
2572 assert(
x >= 0 &&
"GetColorBits, parameter 'x' is negative");
2573 assert(
y >= 0 &&
"GetColorBits, parameter 'y' is negative");
2574 assert(w != 0 &&
"GetColorBits, parameter 'w' is 0");
2575 assert(
h != 0 &&
"GetColorBits, parameter 'h' is 0");
2578 return [
fPimpl->GetDrawable(wid) readColorBits : area];
2584#pragma mark - XImage emulation.
2600 assert(wid >
fPimpl->GetRootWindowID() &&
"GetImageSize, parameter 'wid' is invalid");
2603 width = drawable.fWidth;
2604 height = drawable.fHeight;
2618 "PutPixel, parameter 'imageID' is a bad pixmap id");
2619 assert(
x >= 0 &&
"PutPixel, parameter 'x' is negative");
2620 assert(
y >= 0 &&
"PutPixel, parameter 'y' is negative");
2624 unsigned char rgb[3] = {};
2626 [pixmap putPixel : rgb X :
x Y :
y];
2637 CopyArea(imageID, drawableID, gc, srcX, srcY,
width, height, dstX, dstY);
2645 "DeleteImage, imageID parameter is not a valid image id");
2649#pragma mark - Mouse related code.
2667 assert(!
fPimpl->IsRootWindow(wid) &&
"GrabButton, called for 'root' window");
2672 widget.fPassiveGrabOwnerEvents = YES;
2673 widget.fPassiveGrabButton = button;
2674 widget.fPassiveGrabEventMask = eventMask;
2675 widget.fPassiveGrabKeyModifiers = keyModifiers;
2678 widget.fPassiveGrabOwnerEvents = NO;
2679 widget.fPassiveGrabButton = -1;
2680 widget.fPassiveGrabEventMask = 0;
2681 widget.fPassiveGrabKeyModifiers = 0;
2695 assert(!
fPimpl->IsRootWindow(wid) &&
"GrabPointer, called for 'root' window");
2698 fPimpl->fX11EventTranslator.SetPointerGrab(view, eventMask, ownerEvents);
2702 fPimpl->fX11EventTranslator.CancelPointerGrab();
2753 assert(!
fPimpl->IsRootWindow(wid) &&
"GrabKey, called for root window");
2759 [view addPassiveKeyGrab : keyCode modifiers : cocoaKeyModifiers];
2761 [view removePassiveKeyGrab : keyCode modifiers : cocoaKeyModifiers];
2780 return fPimpl->fX11EventTranslator.GetInputFocus();
2787 assert(!
fPimpl->IsRootWindow(wid) &&
"SetInputFocus, called for root window");
2790 fPimpl->fX11EventTranslator.SetInputFocus(nil);
2792 fPimpl->fX11EventTranslator.SetInputFocus(
fPimpl->GetWindow(wid).fContentView);
2808 assert(buf != 0 &&
"LookupString, parameter 'buf' is null");
2809 assert(length >= 2 &&
"LookupString, parameter 'length' - not enough memory to return null-terminated ASCII string");
2814#pragma mark - Font management.
2821 assert(fontName != 0 &&
"LoadQueryFont, fontName is null");
2824 if (ParseXLFDName(fontName, xlfd)) {
2830 return fPimpl->fFontManager.LoadFont(xlfd);
2845 fPimpl->fFontManager.UnloadFont(fs);
2860 return fPimpl->fFontManager.GetTextWidth(font, s, len);
2867 fPimpl->fFontManager.GetFontProperties(font, maxAscent, maxDescent);
2894 if (fontName && fontName[0]) {
2897 return fPimpl->fFontManager.ListFonts(xlfd, maxNames, count);
2910 fPimpl->fFontManager.FreeFontNames(fontList);
2913#pragma mark - Color management.
2921 return fPimpl->fX11ColorParser.ParseColor(colorName, color);
2927 const unsigned red = unsigned(
double(color.
fRed) / 0xFFFF * 0xFF);
2928 const unsigned green = unsigned(
double(color.
fGreen) / 0xFFFF * 0xFF);
2929 const unsigned blue = unsigned(
double(color.
fBlue) / 0xFFFF * 0xFF);
2930 color.
fPixel = red << 16 | green << 8 | blue;
2938 color.
fRed = (color.
fPixel >> 16 & 0xFF) * 0xFFFF / 0xFF;
2939 color.
fGreen = (color.
fPixel >> 8 & 0xFF) * 0xFFFF / 0xFF;
2940 color.
fBlue = (color.
fPixel & 0xFF) * 0xFFFF / 0xFF;
2954 Float_t red = 0.f, green = 0.f, blue = 0.f;
2955 color->GetRGB(red, green, blue);
2956 pixel = unsigned(red * 255) << 16;
2957 pixel |= unsigned(green * 255) << 8;
2958 pixel |= unsigned(blue * 255);
2992#pragma mark - Graphical context management.
3012 assert(gc <=
fX11Contexts.size() && gc > 0 &&
"ChangeGC, invalid context id");
3023 assert(gc <=
fX11Contexts.size() && gc > 0 &&
"ChangeGC, invalid context id");
3024 assert(gval != 0 &&
"ChangeGC, gval parameter is null");
3028 x11Context.
fMask |= mask;
3078 const unsigned nDashes =
sizeof x11Context.
fDashes /
sizeof x11Context.
fDashes[0];
3079 for (
unsigned i = 0; i < nDashes; ++i)
3088 assert(src <=
fX11Contexts.size() && src > 0 &&
"CopyGC, bad source context");
3089 assert(dst <=
fX11Contexts.size() && dst > 0 &&
"CopyGC, bad destination context");
3092 srcContext.
fMask = mask;
3112#pragma mark - Cursor management.
3134 assert(!
fPimpl->IsRootWindow(wid) &&
"SetCursor, called for root window");
3137 view.fCurrentCursor = cursor;
3157 const NSPoint screenPoint = [
NSEvent mouseLocation];
3173 rootWinID =
fPimpl->GetRootWindowID();
3175 NSPoint screenPoint = [
NSEvent mouseLocation];
3178 rootX = screenPoint.x;
3179 rootY = screenPoint.y;
3182 if (winID >
fPimpl->GetRootWindowID()) {
3188 winX = screenPoint.x;
3189 winY = screenPoint.y;
3194 childWinID = childWin.fID;
3202#pragma mark - OpenGL management.
3210 return [[NSScreen mainScreen] backingScaleFactor];
3215 const std::vector<std::pair<UInt_t, Int_t> > &formatComponents)
3219 typedef std::pair<UInt_t, Int_t> component_type;
3220 typedef std::vector<component_type>::size_type size_type;
3223 std::vector<NSOpenGLPixelFormatAttribute> attribs;
3224 for (size_type i = 0,
e = formatComponents.size(); i <
e; ++i) {
3225 const component_type &comp = formatComponents[i];
3228 attribs.push_back(NSOpenGLPFADoubleBuffer);
3230 attribs.push_back(NSOpenGLPFADepthSize);
3231 attribs.push_back(comp.second > 0 ? comp.second : 32);
3233 attribs.push_back(NSOpenGLPFAAccumSize);
3234 attribs.push_back(comp.second > 0 ? comp.second : 1);
3236 attribs.push_back(NSOpenGLPFAStencilSize);
3237 attribs.push_back(comp.second > 0 ? comp.second : 8);
3239 attribs.push_back(NSOpenGLPFAMultisample);
3240 attribs.push_back(NSOpenGLPFASampleBuffers);
3241 attribs.push_back(1);
3242 attribs.push_back(NSOpenGLPFASamples);
3243 attribs.push_back(comp.second ? comp.second : 8);
3247 attribs.push_back(0);
3249 NSOpenGLPixelFormat *
const pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes : &attribs[0]];
3253 if (!
fPimpl->IsRootWindow(parentID)) {
3254 parentView =
fPimpl->GetWindow(parentID).fContentView;
3255 assert([parentView isKindOfClass : [
QuartzView class]] &&
3256 "CreateOpenGLWindow, parent view must be QuartzView");
3259 NSRect viewFrame = {};
3260 viewFrame.size.width =
width;
3261 viewFrame.size.height = height;
3269 [parentView addChild : glView];
3270 glID =
fPimpl->RegisterDrawable(glView);
3280 Error(
"CreateOpenGLWindow",
"QuartzWindow allocation/initialization"
3281 " failed for a top-level GL widget");
3285 glID =
fPimpl->RegisterDrawable(parent);
3295 assert(!
fPimpl->IsRootWindow(windowID) &&
3296 "CreateOpenGLContext, parameter 'windowID' is a root window");
3298 "CreateOpenGLContext, view is not an OpenGL view");
3300 NSOpenGLContext *
const sharedContext =
fPimpl->GetGLContextForHandle(sharedID);
3304 newContext([[NSOpenGLContext alloc] initWithFormat : glView.
pixelFormat shareContext : sharedContext]);
3322 assert(ctxID > 0 &&
"MakeOpenGLContextCurrent, invalid context id");
3324 NSOpenGLContext *
const glContext =
fPimpl->GetGLContextForHandle(ctxID);
3326 Error(
"MakeOpenGLContextCurrent",
"No OpenGL context found for id %d",
int(ctxID));
3334 if ([glContext view] != glView)
3335 [glContext setView : glView];
3343 [glContext makeCurrentContext];
3361 const UInt_t width = std::max(glView.frame.size.width, CGFloat(100));
3362 const UInt_t height = std::max(glView.frame.size.height, CGFloat(100));
3364 NSRect viewFrame = {};
3365 viewFrame.size.width =
width;
3366 viewFrame.size.height = height;
3368 const NSUInteger styleMask = kTitledWindowMask | kClosableWindowMask |
3369 kMiniaturizableWindowMask | kResizableWindowMask;
3372 fakeWindow = [[
QuartzWindow alloc] initWithContentRect : viewFrame styleMask : styleMask
3373 backing : NSBackingStoreBuffered defer : NO windowAttributes : &attr];
3377 [fakeView setHidden : NO];
3379 fPimpl->SetFakeGLWindow(fakeWindow);
3383 [fakeView setHidden : NO];
3387 [glContext setView : fakeView];
3388 [glContext makeCurrentContext];
3397 NSOpenGLContext *
const currentContext = [NSOpenGLContext currentContext];
3398 if (!currentContext) {
3399 Error(
"GetCurrentOpenGLContext",
"The current OpenGL context is null");
3403 const Handle_t contextID =
fPimpl->GetHandleForGLContext(currentContext);
3405 Error(
"GetCurrentOpenGLContext",
"The current OpenGL context was"
3406 " not created/registered by TGCocoa");
3414 assert(ctxID > 0 &&
"FlushOpenGLBuffer, invalid context id");
3416 NSOpenGLContext *
const glContext =
fPimpl->GetGLContextForHandle(ctxID);
3417 assert(glContext != nil &&
"FlushOpenGLBuffer, bad context id");
3419 if (glContext != [NSOpenGLContext currentContext])
3423 [glContext flushBuffer];
3432 NSOpenGLContext *
const glContext =
fPimpl->GetGLContextForHandle(ctxID);
3433 if (
NSView *
const v = [glContext view]) {
3437 [glContext clearDrawable];
3440 if (glContext == [NSOpenGLContext currentContext])
3441 [NSOpenGLContext clearCurrentContext];
3443 fPimpl->DeleteGLContext(ctxID);
3446#pragma mark - Off-screen rendering for TPad/TCanvas.
3452 assert(windowID > (
Int_t)
fPimpl->GetRootWindowID() &&
"SetDoubleBuffer called for root window");
3454 if (windowID == 999) {
3455 Warning(
"SetDoubleBuffer",
"called with wid == 999");
3476 "SetDoubleBufferON, called, but no correct window was selected before");
3480 if (!window)
return;
3482 assert(window.fIsPixmap == NO &&
3483 "SetDoubleBufferON, selected drawable is a pixmap, can not attach pixmap to pixmap");
3485 const unsigned currW = window.fWidth;
3486 const unsigned currH = window.fHeight;
3488 if (
QuartzPixmap *
const currentPixmap = window.fBackBuffer) {
3489 if (currH == currentPixmap.fHeight && currW == currentPixmap.fWidth)
3494 H : currH scaleFactor : [[NSScreen mainScreen] backingScaleFactor]]);
3496 window.fBackBuffer = pixmap.
Get();
3499 Error(
"SetDoubleBufferON",
"QuartzPixmap initialization failed");
3510 auto windows = NSApplication.sharedApplication.windows;
3511 for (
NSWindow *candidate : windows) {
3515 fPimpl->fX11CommandBuffer.ClearXOROperations();
3521#pragma mark - Event management part.
3526 if (
fPimpl->IsRootWindow(wid))
3535 fPimpl->fX11EventTranslator.fEventQueue.push_back(newEvent);
3541 assert(
fPimpl->fX11EventTranslator.fEventQueue.size() > 0 &&
"NextEvent, event queue is empty");
3543 event =
fPimpl->fX11EventTranslator.fEventQueue.front();
3544 fPimpl->fX11EventTranslator.fEventQueue.pop_front();
3550 return (
Int_t)
fPimpl->fX11EventTranslator.fEventQueue.size();
3557 typedef X11::EventQueue_t::iterator iterator_type;
3559 iterator_type it =
fPimpl->fX11EventTranslator.fEventQueue.begin();
3560 iterator_type eIt =
fPimpl->fX11EventTranslator.fEventQueue.end();
3562 for (; it != eIt; ++it) {
3563 const Event_t &queuedEvent = *it;
3565 event = queuedEvent;
3566 fPimpl->fX11EventTranslator.fEventQueue.erase(it);
3582#pragma mark - "Drag and drop", "Copy and paste", X11 properties.
3589 assert(
name != 0 &&
"InternAtom, parameter 'name' is null");
3606 assert(!
fPimpl->IsRootWindow(windowID) &&
3607 "SetPrimarySelectionOwner, windowID parameter is a 'root' window");
3608 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3609 "SetPrimarySelectionOwner, windowID parameter is not a valid window");
3611 const Atom_t primarySelectionAtom =
FindAtom(
"XA_PRIMARY",
false);
3612 assert(primarySelectionAtom !=
kNone &&
3613 "SetPrimarySelectionOwner, predefined XA_PRIMARY atom was not found");
3631 assert(!
fPimpl->IsRootWindow(windowID) &&
3632 "SetSelectionOwner, windowID parameter is a 'root' window'");
3633 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3634 "SetSelectionOwner, windowID parameter is not a valid window");
3649 const Atom_t primarySelectionAtom =
FindAtom(
"XA_PRIMARY",
false);
3650 assert(primarySelectionAtom !=
kNone &&
3651 "GetPrimarySelectionOwner, predefined XA_PRIMARY atom was not found");
3674 assert(!
fPimpl->IsRootWindow(windowID) &&
3675 "ConvertPrimarySelection, parameter 'windowID' is root window");
3676 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3677 "ConvertPrimarySelection, parameter windowID parameter is not a window id");
3680 assert(primarySelectionAtom !=
kNone &&
3681 "ConvertPrimarySelection, XA_PRIMARY predefined atom not found");
3684 assert(stringAtom !=
kNone &&
3685 "ConvertPrimarySelection, XA_STRING predefined atom not found");
3687 ConvertSelection(windowID, primarySelectionAtom, stringAtom, clipboard, when);
3703 assert(!
fPimpl->IsRootWindow(windowID) &&
3704 "ConvertSelection, parameter 'windowID' is root window'");
3705 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3706 "ConvertSelection, parameter 'windowID' is not a window id");
3717 newEvent.
fUser[0] = windowID;
3718 newEvent.
fUser[1] = selection;
3719 newEvent.
fUser[2] = target;
3720 newEvent.
fUser[3] = property;
3728 ULong_t *bytesAfterReturn,
unsigned char **propertyReturn)
3737 if (
fPimpl->IsRootWindow(windowID))
3740 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3741 "GetProperty, parameter 'windowID' is not a valid window id");
3742 assert(propertyID > 0 && propertyID <=
fAtomToName.size() &&
3743 "GetProperty, parameter 'propertyID' is not a valid atom");
3744 assert(actualType != 0 &&
"GetProperty, parameter 'actualType' is null");
3745 assert(actualFormat != 0 &&
"GetProperty, parameter 'actualFormat' is null");
3746 assert(bytesAfterReturn != 0 &&
"GetProperty, parameter 'bytesAfterReturn' is null");
3747 assert(propertyReturn != 0 &&
"GetProperty, parameter 'propertyReturn' is null");
3751 *bytesAfterReturn = 0;
3752 *propertyReturn = 0;
3755 const std::string &atomName =
fAtomToName[propertyID - 1];
3758 if (![window hasProperty : atomName.c_str()]) {
3759 Error(
"GetProperty",
"Unknown property %s requested", atomName.c_str());
3763 unsigned tmpFormat = 0, tmpElements = 0;
3764 *propertyReturn = [window getProperty : atomName.c_str() returnType : actualType
3765 returnFormat : &tmpFormat nElements : &tmpElements];
3766 *actualFormat = (
Int_t)tmpFormat;
3767 *nItems = tmpElements;
3786 assert(!
fPimpl->IsRootWindow(windowID) &&
3787 "GetPasteBuffer, parameter 'windowID' is root window");
3788 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3789 "GetPasteBuffer, parameter 'windowID' is not a valid window");
3790 assert(propertyID && propertyID <=
fAtomToName.size() &&
3791 "GetPasteBuffer, parameter 'propertyID' is not a valid atom");
3795 const std::string &atomString =
fAtomToName[propertyID - 1];
3798 if (![window hasProperty : atomString.c_str()]) {
3799 Error(
"GetPasteBuffer",
"No property %s on a window", atomString.c_str());
3804 unsigned tmpFormat = 0, nElements = 0;
3807 propertyData((
char *)[window getProperty : atomString.c_str()
3808 returnType : &tmpType returnFormat : &tmpFormat
3809 nElements : &nElements]);
3811 assert(tmpFormat == 8 &&
"GetPasteBuffer, property has wrong format");
3813 text.Insert(0, propertyData.
Get(), nElements);
3814 nChars = (
Int_t)nElements;
3819 [window removeProperty : atomString.c_str()];
3850 assert(!
fPimpl->IsRootWindow(windowID) &&
3851 "ChangeProperty, parameter 'windowID' is root window");
3852 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3853 "ChangeProperty, parameter 'windowID' is not a valid window id");
3854 assert(propertyID && propertyID <=
fAtomToName.size() &&
3855 "ChangeProperty, parameter 'propertyID' is not a valid atom");
3859 const std::string &atomString =
fAtomToName[propertyID - 1];
3862 [window setProperty : atomString.c_str() data : data
size : len forType :
type format : 8];
3884 assert(!
fPimpl->IsRootWindow(windowID) &&
3885 "ChangeProperties, parameter 'windowID' is root window");
3886 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3887 "ChangeProperties, parameter 'windowID' is not a valid window id");
3888 assert(propertyID && propertyID <=
fAtomToName.size() &&
3889 "ChangeProperties, parameter 'propertyID' is not a valid atom");
3893 const std::string &atomName =
fAtomToName[propertyID - 1];
3896 [window setProperty : atomName.c_str() data : data
3897 size : len forType :
type format : format];
3914 assert(!
fPimpl->IsRootWindow(windowID) &&
3915 "DeleteProperty, parameter 'windowID' is root window");
3916 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3917 "DeleteProperty, parameter 'windowID' is not a valid window");
3918 assert(propertyID && propertyID <=
fAtomToName.size() &&
3919 "DeleteProperty, parameter 'propertyID' is not a valid atom");
3921 const std::string &atomString =
fAtomToName[propertyID - 1];
3922 [
fPimpl->GetWindow(windowID) removeProperty : atomString.c_str()];
3938 assert(windowID >
fPimpl->GetRootWindowID() &&
3939 "SetDNDAware, parameter 'windowID' is not a valid window id");
3940 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3941 "SetDNDAware, parameter 'windowID' is not a window");
3946 NSArray *
const supportedTypes = [NSArray arrayWithObjects : NSFilenamesPboardType, nil];
3950 [view registerForDraggedTypes : supportedTypes];
3957 assert(xaAtomAtom == 4 &&
"SetDNDAware, XA_ATOM is not defined");
3962 assert(
sizeof(
unsigned) == 4 &&
"SetDNDAware, sizeof(unsigned) must be 4");
3964 std::vector<unsigned> propertyData;
3965 propertyData.push_back(4);
3968 for (
unsigned i = 0; typeList[i]; ++i)
3969 propertyData.push_back(
unsigned(typeList[i]));
3972 [view setProperty :
"XdndAware" data : (
unsigned char *)&propertyData[0]
3973 size : propertyData.size() forType : xaAtomAtom format : 32];
3981 if (windowID <= fPimpl->GetRootWindowID())
3984 assert(
fPimpl->GetDrawable(windowID).fIsPixmap == NO &&
3985 "IsDNDAware, windowID parameter is not a window");
3996 ::Warning(
"SetTypeList",
"Not implemented");
4020 fPimpl->IsRootWindow(winID) ? nil :
fPimpl->GetWindow(winID).fContentView,
4021 dragWinID, inputWinID,
x,
y, maxDepth);
4023 return testView.fID;
4028#pragma mark - Noops.
4048 chupx = chupy = 0.f;
4153 NSPoint newCursorPosition = {};
4154 newCursorPosition.x = ix;
4155 newCursorPosition.y = iy;
4157 if (
fPimpl->GetRootWindowID() == winID) {
4161 assert(
fPimpl->GetDrawable(winID).fIsPixmap == NO &&
4162 "Warp, drawable is not a window");
4167 CGWarpMouseCursorPosition(NSPointToCGPoint(newCursorPosition));
4399#pragma mark - Details and aux. functions.
4404 return &
fPimpl->fX11EventTranslator;
4410 return &
fPimpl->fX11CommandBuffer;
4422 assert(
fCocoaDraw > 0 &&
"CocoaDrawOFF, was already off");
4436 if (!drawable.fIsPixmap) {
4437 Error(
"GetCurrentContext",
"TCanvas/TPad's internal error,"
4438 " selected drawable is not a pixmap!");
4442 return drawable.fContext;
4455 ProcessSerialNumber psn = {0, kCurrentProcess};
4457 const OSStatus res1 = TransformProcessType(&psn, kProcessTransformToForegroundApplication);
4462 if (res1 != noErr && res1 != paramErr) {
4463 Error(
"MakeProcessForeground",
"TransformProcessType failed with code %d",
int(res1));
4466#ifdef MAC_OS_X_VERSION_10_9
4468 [[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
4470 const OSErr res2 = SetFrontProcess(&psn);
4471 if (res2 != noErr) {
4472 Error(
"MakeProcessForeground",
"SetFrontProcess failed with code %d", res2);
4479#ifdef MAC_OS_X_VERSION_10_9
4481 [[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
4483 ProcessSerialNumber psn = {};
4485 OSErr res = GetCurrentProcess(&psn);
4487 Error(
"MakeProcessForeground",
"GetCurrentProcess failed with code %d", res);
4491 res = SetFrontProcess(&psn);
4493 Error(
"MapProcessForeground",
"SetFrontProcess failed with code %d", res);
4505 const std::map<std::string, Atom_t>::const_iterator it =
fNameToAtom.find(atomName);
4509 else if (addIfNotFound) {
4525 if (iconDirectoryPath) {
4527 if (fileName.
Get()) {
4530 NSString *cocoaStr = [NSString stringWithCString : fileName.
Get() encoding : NSASCIIStringEncoding];
4531 NSImage *image = [[[NSImage alloc] initWithContentsOfFile : cocoaStr] autorelease];
4532 [NSApp setApplicationIconImage : image];
const Mask_t kGCDashOffset
const Mask_t kGCBackground
const Mask_t kGCForeground
const Mask_t kGCLineStyle
const Mask_t kGCSubwindowMode
const Mask_t kGCLineWidth
Handle_t Cursor_t
Cursor handle.
const Mask_t kGCClipXOrigin
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
Handle_t Visual_t
Visual handle.
const Mask_t kGCFillStyle
const Mask_t kGCJoinStyle
Handle_t Display_t
Display handle.
Handle_t Pixmap_t
Pixmap handle.
ULong_t Time_t
Event time.
EInitialState
Initial window mapping state.
const Mask_t kGCTileStipXOrigin
Handle_t Drawable_t
Drawable handle.
Handle_t Colormap_t
Colormap handle.
const Mask_t kStructureNotifyMask
Handle_t GContext_t
Graphics context handle.
const Mask_t kGCPlaneMask
const Mask_t kGCGraphicsExposures
const Mask_t kGCClipYOrigin
Handle_t Region_t
Region handle.
Handle_t FontStruct_t
Pointer to font structure.
const Mask_t kGCTileStipYOrigin
EMouseButton
Button names.
Handle_t Window_t
Window handle.
ULongptr_t Handle_t
Generic resource handle.
static void update(gsl_integration_workspace *workspace, double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
static const double x2[5]
static const double x1[5]
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Binding & operator=(OUT(*fun)(void))
R__EXTERN TVirtualMutex * gROOTMutex
R__EXTERN TSystem * gSystem
#define R__LOCKGUARD(mutex)
DerivedType * Get() const
void Reset(NSObject *object)
The color creation and management class.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
This class implements TVirtualX interface for MacOS X, using Cocoa and Quartz 2D.
virtual void SetClipRectangles(GContext_t gc, Int_t x, Int_t y, Rectangle_t *recs, Int_t n)
Sets clipping rectangles in graphics context.
virtual const char * DisplayName(const char *)
Returns hostname on which the display is opened.
virtual void SetRGB(Int_t cindex, Float_t r, Float_t g, Float_t b)
Sets color intensities the specified color index "cindex".
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...
virtual void FlushOpenGLBuffer(Handle_t ctxID)
Flushes OpenGL buffer.
virtual Window_t GetWindowID(Int_t wid)
Returns the X11 window identifier.
virtual Int_t GetDoubleBuffer(Int_t wid)
Queries the double buffer value for the window "wid".
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".
std::vector< GCValues_t > fX11Contexts
virtual void XorRegion(Region_t rega, Region_t regb, Region_t result)
Calculates the difference between the union and intersection of two regions.
void DrawLineAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x1, Int_t y1, Int_t x2, Int_t y2)
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".
virtual Handle_t CreateOpenGLContext(Window_t windowID, Handle_t sharedContext)
Creates OpenGL context for window "windowID".
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.
virtual UInt_t ScreenWidthMM() const
Returns the width of the screen in millimeters.
void ReparentTopLevel(Window_t wid, Window_t pid, Int_t x, Int_t y)
Bool_t IsCocoaDraw() const
void SetApplicationIcon()
bool fDisplayShapeChanged
virtual Bool_t EqualRegion(Region_t rega, Region_t regb)
Returns kTRUE if the two regions have the same offset, size, and shape.
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.
virtual void ClosePixmap()
Deletes current pixmap.
virtual Region_t PolygonRegion(Point_t *points, Int_t np, Bool_t winding)
Returns a region for the polygon defined by the points array.
virtual void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent)
Returns the font properties.
virtual void MapSubwindows(Window_t wid)
Maps all subwindows for the specified window "id" in top-to-bottom stacking order.
virtual Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, UInt_t height)
create pixmap from RGB data.
void FillRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h)
Atom_t FindAtom(const std::string &atomName, bool addIfNotFound)
virtual void SetDoubleBufferON()
Turns double buffer mode on.
ROOT::MacOSX::X11::CommandBuffer * GetCommandBuffer() const
virtual void SubtractRegion(Region_t rega, Region_t regb, Region_t result)
Subtracts regb from rega and stores the results in result.
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...
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)
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.
void DrawRectangleAux(Drawable_t wid, const GCValues_t &gcVals, Int_t x, Int_t y, UInt_t w, UInt_t h)
virtual void GetCharacterUp(Float_t &chupx, Float_t &chupy)
Returns character up vector.
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,...
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...
virtual char ** ListFonts(const char *fontname, Int_t max, Int_t &count)
Returns list of font names matching fontname regexp, like "-*-times-*".
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.
virtual void FreeColor(Colormap_t cmap, ULong_t pixel)
Frees color cell with specified pixel value.
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.
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.
std::unique_ptr< ROOT::MacOSX::Details::CocoaPrivate > fPimpl
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".
virtual void QueryColor(Colormap_t cmap, ColorStruct_t &color)
Returns the current RGB value for the pixel in the "color" structure.
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".
virtual Int_t EventsPending()
Returns the number of events that have been received from the X server but have not been removed from...
void * GetCurrentContext()
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.
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.
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.
virtual Bool_t Init(void *display)
Initializes the X system.
virtual void RaiseWindow(Window_t wid)
Raises the specified window to the top of the stack so that no sibling window obscures it.
virtual ULong_t GetPixel(Color_t cindex)
Returns pixel value associated to specified ROOT color number "cindex".
virtual void SetCharacterUp(Float_t chupx, Float_t chupy)
Sets character up vector.
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...
virtual Int_t OpenPixmap(UInt_t w, UInt_t h)
Creates a pixmap of the width "w" and height "h" you specified.
virtual Int_t GetDepth() const
Returns depth of screen (number of bit planes).
virtual Drawable_t CreateImage(UInt_t width, UInt_t height)
Allocates the memory needed for an drawable.
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...
virtual Bool_t ReadPictureDataFromFile(const char *filename, char ***ret_data)
Reads picture data from file "filename" and store it in "ret_data".
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".
virtual void DeleteFont(FontStruct_t fs)
Explicitly deletes the font structure "fs" obtained via LoadQueryFont().
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.
virtual void MoveWindow(Int_t wid, Int_t x, Int_t y)
Moves the window "wid" to the specified x and y coordinates.
virtual void SetTypeList(Window_t win, Atom_t prop, Atom_t *typelist)
Add the list of drag and drop types to the Window win.
virtual Atom_t InternAtom(const char *atom_name, Bool_t only_if_exist)
Returns the atom identifier associated with the specified "atom_name" string.
virtual Double_t GetOpenGLScalingFactor()
On a HiDPI resolution it can be > 1., this means glViewport should use scaled width and height.
virtual Int_t InitWindow(ULong_t window)
Creates a new window and return window number.
virtual void FreeFontNames(char **fontlist)
Frees the specified the array of strings "fontlist".
std::vector< std::string > fAtomToName
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...
virtual void GetPlanes(Int_t &nplanes)
Returns the maximum number of planes.
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 ...
virtual void UpdateWindow(Int_t mode)
Updates or synchronises client and server once (not permanent).
virtual Int_t RequestLocator(Int_t mode, Int_t ctyp, Int_t &x, Int_t &y)
Requests Locator position.
virtual void MapWindow(Window_t wid)
Maps the window "id" and all of its subwindows that have had map requests.
virtual void GetWindowAttributes(Window_t wid, WindowAttributes_t &attr)
The WindowAttributes_t structure is set to default.
virtual void WritePixmap(Int_t wid, UInt_t w, UInt_t h, char *pxname)
Writes the pixmap "wid" in the bitmap file "pxname".
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.
virtual void DeleteGC(GContext_t gc)
Deletes the specified GC "gc".
virtual Pixmap_t CreateBitmap(Drawable_t wid, const char *bitmap, UInt_t width, UInt_t height)
Creates a bitmap (i.e.
virtual Visual_t GetVisual() const
Returns handle to visual.
virtual void SetWindowName(Window_t wid, char *name)
Sets the window name.
static Atom_t fgDeleteWindowAtom
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...
virtual Bool_t CheckEvent(Window_t wid, EGEventType type, Event_t &ev)
Check if there is for window "id" an event of type "type".
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 ...
virtual void SetTextMagnitude(Float_t mgn)
Sets the current text magnification factor to "mgn".
virtual Window_t GetInputFocus()
Returns the window id of the window having the input focus.
virtual void WMDeleteNotify(Window_t wid)
Tells WM to send message when window is closed via WM.
virtual void SetWMState(Window_t winID, EInitialState state)
Sets the initial state of the window "id": either kNormalState or kIconicState.
virtual Int_t ResizePixmap(Int_t wid, UInt_t w, UInt_t h)
Resizes the specified pixmap "wid".
virtual void NextEvent(Event_t &event)
The "event" is set to default event.
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.
virtual void FreeFontStruct(FontStruct_t fs)
Frees the font structure "fs".
void DrawStringAux(Drawable_t wid, const GCValues_t &gc, Int_t x, Int_t y, const char *s, Int_t len)
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.
virtual void Bell(Int_t percent)
Sets the sound bell. Percent is loudness from -100% to 100%.
virtual Int_t GetScreen() const
Returns screen number.
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).
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:
virtual Window_t GetParent(Window_t wid) const
Returns the parent of the window "id".
virtual void SetCursor(Window_t wid, Cursor_t curid)
Sets the cursor "curid" to be used when the pointer is in the window "id".
void ClearAreaAux(Window_t wid, Int_t x, Int_t y, UInt_t w, UInt_t h)
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.
void ReconfigureDisplay()
virtual void SetPrimarySelectionOwner(Window_t wid)
Makes the window "id" the current owner of the primary selection.
ROOT::MacOSX::X11::Rectangle GetDisplayGeometry() const
virtual UInt_t ExecCommand(TGWin32Command *code)
Executes the command "code" coming from the other threads (Win32)
virtual void SetDoubleBufferOFF()
Turns double buffer mode off.
virtual void SetDrawMode(EDrawMode mode)
Sets the drawing mode.
virtual void UnmapWindow(Window_t wid)
Unmaps the specified window "id".
virtual Bool_t NeedRedraw(ULong_t tgwindow, Bool_t force)
Notify the low level GUI layer ROOT requires "tgwindow" to be updated.
virtual Region_t CreateRegion()
Creates a new empty region.
virtual void Sync(Int_t mode)
Set synchronisation on or off.
virtual Colormap_t GetColormap() const
Returns handle to colormap.
virtual void SetClipOFF(Int_t wid)
Turns off the clipping for the window "wid".
virtual void GrabKey(Window_t wid, Int_t keycode, UInt_t modifier, Bool_t grab=kTRUE)
Establishes a passive grab on the keyboard.
virtual void SetDNDAware(Window_t, Atom_t *)
Add XdndAware property and the list of drag and drop types to the Window win.
virtual void SetClassHints(Window_t wid, char *className, char *resourceName)
Sets the windows class and resource name.
virtual FontStruct_t GetFontStruct(FontH_t fh)
Retrieves the associated font structure of the font specified font handle "fh".
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].
ROOT::MacOSX::X11::EventTranslator * GetEventTranslator() const
virtual void GetRGB(Int_t index, Float_t &r, Float_t &g, Float_t &b)
Returns RGB values for color "index".
void ReparentChild(Window_t wid, Window_t pid, Int_t x, Int_t y)
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.
void DrawSegmentsAux(Drawable_t wid, const GCValues_t &gcVals, const Segment_t *segments, Int_t nSegments)
virtual void SetDoubleBuffer(Int_t wid, Int_t mode)
Sets the double buffer on/off on the window "wid".
virtual void SetIconPixmap(Window_t wid, Pixmap_t pix)
Sets the icon name pixmap.
virtual void DestroySubwindows(Window_t wid)
The DestroySubwindows function destroys all inferior windows of the specified window,...
virtual FontH_t GetFontHandle(FontStruct_t fs)
Returns the font handle of the specified font structure "fs".
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.
virtual void SetWMPosition(Window_t winID, Int_t x, Int_t y)
Tells the window manager the desired position [x,y] of window "id".
virtual Window_t GetDefaultRootWindow() const
Returns handle to the default root window created when calling XOpenDisplay().
virtual Window_t GetCurrentWindow() const
pointer to the current internal window used in canvas graphics
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 ...
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...
virtual void IconifyWindow(Window_t wid)
Iconifies the window "id".
virtual void ChangeWindowAttributes(Window_t wid, SetWindowAttributes_t *attr)
Changes the attributes of the specified window "id" according the values provided in "attr".
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.
virtual void RescaleWindow(Int_t wid, UInt_t w, UInt_t h)
Rescales the window "wid".
virtual void CloseDisplay()
Closes connection to display server and destroys all windows.
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...
virtual void DeletePictureData(void *data)
Delete picture data created by the function ReadPictureDataFromFile.
virtual Bool_t MakeOpenGLContextCurrent(Handle_t ctx, Window_t windowID)
Makes context ctx current OpenGL context.
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.
void DeletePixmapAux(Pixmap_t pixmapID)
virtual GContext_t CreateGC(Drawable_t wid, GCValues_t *gval)
Creates a graphics context using the provided GCValues_t *gval structure.
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".
virtual void CloseWindow()
Deletes current window.
virtual void DeleteImage(Drawable_t img)
Deallocates the memory associated with the image img.
virtual Int_t WriteGIF(char *name)
Writes the current window into GIF file.
virtual void QueryPointer(Int_t &x, Int_t &y)
Returns the pointer position.
virtual void ChangeGC(GContext_t gc, GCValues_t *gval)
Changes the components specified by the mask in gval for the specified GC.
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...
virtual Int_t AddWindow(ULong_t qwid, UInt_t w, UInt_t h)
Registers a window created by Qt as a ROOT window.
virtual void DestroyRegion(Region_t reg)
Destroys the region "reg".
virtual Handle_t GetNativeEvent() const
Returns the current native event handle.
virtual void SetWindowBackgroundPixmap(Window_t wid, Pixmap_t pxm)
Sets the background pixmap of the window "id" to the specified pixmap "pxm".
virtual void SetMWMHints(Window_t winID, UInt_t value, UInt_t decorators, UInt_t inputMode)
Sets decoration style.
virtual void SelectInput(Window_t wid, UInt_t evmask)
Defines which input events the window is interested in.
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,...
ROOT::MacOSX::X11::name_to_atom_map fNameToAtom
virtual void GetRegionBox(Region_t reg, Rectangle_t *rect)
Returns smallest enclosing rectangle.
virtual void Update(Int_t mode)
Flushes (mode = 0, default) or synchronizes (mode = 1) X output buffer.
virtual void UnionRegion(Region_t rega, Region_t regb, Region_t result)
Computes the union of two regions.
virtual Handle_t GetCurrentOpenGLContext()
Asks OpenGL subsystem about the current OpenGL context.
virtual void RemoveWindow(ULong_t qwid)
Removes the created by Qt window "qwid".
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".
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.
virtual void SetInputFocus(Window_t wid)
Changes the input focus to specified window "id".
virtual void ResizeWindow(Int_t wid)
Resizes the window "wid" if necessary.
virtual Bool_t HasTTFonts() const
Returns True when TrueType fonts are used.
virtual void GetImageSize(Drawable_t wid, UInt_t &width, UInt_t &height)
Returns the width and height of the image id.
virtual Int_t OpenDisplay(const char *displayName)
Opens connection to display server (if such a thing exist on the current platform).
virtual void DeletePixmap(Pixmap_t pixmapID)
Explicitly deletes the pixmap resource "pmap".
virtual void SetWMSize(Window_t winID, UInt_t w, UInt_t h)
Tells window manager the desired size of window "id".
virtual void SendEvent(Window_t wid, Event_t *ev)
Specifies the event "ev" is to be sent to the window "id".
virtual void SetKeyAutoRepeat(Bool_t on=kTRUE)
Turns key auto repeat on (kTRUE) or off (kFALSE).
virtual Bool_t EmptyRegion(Region_t reg)
Returns kTRUE if the region reg is empty.
virtual void FillPolygon(Window_t wid, GContext_t gc, Point_t *polygon, Int_t nPoints)
Fills the region closed by the specified path.
virtual void SetWindowBackground(Window_t wid, ULong_t color)
Sets the background of the window "id" to the specified color value "color".
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...
virtual Cursor_t CreateCursor(ECursor cursor)
Creates the specified cursor.
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...
void FillPolygonAux(Window_t wid, const GCValues_t &gcVals, const Point_t *polygon, Int_t nPoints)
virtual Int_t AddPixmap(ULong_t pixid, UInt_t w, UInt_t h)
Registers a pixmap created by TGLManager as a ROOT pixmap.
virtual void DeleteOpenGLContext(Int_t ctxID)
Deletes OpenGL context for window "wid".
bool MakeProcessForeground()
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.
virtual Bool_t SetSelectionOwner(Window_t windowID, Atom_t &selectionID)
Changes the owner and last-change time for the specified selection.
std::map< Atom_t, Window_t > fSelectionOwners
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".
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,...
virtual void SelectWindow(Int_t wid)
Selects the window "wid" to which subsequent output is directed.
virtual void DrawSegments(Drawable_t wid, GContext_t gc, Segment_t *segments, Int_t nSegments)
Draws multiple line segments.
virtual void ClearWindow()
Clears the entire area of the current window.
virtual void SetIconName(Window_t wid, char *name)
Sets the window icon name.
Drawable_t fSelectedDrawable
virtual void DestroyWindow(Window_t wid)
Destroys the window "id" as well as all of its subwindows.
virtual Window_t GetPrimarySelectionOwner()
Returns the window id of the current owner of the primary selection.
ROOT::MacOSX::X11::Rectangle fDisplayRect
virtual void DeleteProperty(Window_t, Atom_t &)
Deletes the specified property only if the property was defined on the specified window and causes th...
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].
virtual void SelectPixmap(Int_t qpixid)
Selects the pixmap "qpixid".
virtual void Warp(Int_t ix, Int_t iy, Window_t wid)
Sets the pointer position.
std::map< Atom_t, Window_t >::iterator selection_iterator
virtual void IntersectRegion(Region_t rega, Region_t regb, Region_t result)
Computes the intersection of two regions.
virtual Display_t GetDisplay() const
Returns handle to display (might be useful in some cases where direct X11 manipulation outside of TVi...
virtual Int_t KeysymToKeycode(UInt_t keysym)
Converts the "keysym" to the appropriate keycode.
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...
bool CocoaInitialized() const
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.
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Semi-Abstract base class defining a generic interface to the underlying, low level,...
ROOT::MacOSX::Util::CFScopeGuard< CGImageRef > fImage
QuartzImage * fBackgroundPixmap
unsigned long fBackgroundPixel
NSView< X11Window > * fContentView
QuartzWindow * fQuartzWindow
QuartzWindow * fMainWindow
QuartzView * fContentView
QuartzImage * fShapeCombineMask
NSOpenGLContext * fOpenGLContext
NSOpenGLPixelFormat * pixelFormat()
bool GLViewIsValidDrawable(ROOTOpenGLView *glView)
Int_t MapKeySymToKeyCode(Int_t keySym)
bool ViewIsHtmlViewFrame(NSView< X11Window > *view, bool checkParent)
int GlobalYCocoaToROOT(CGFloat yCocoa)
void PixelToRGB(Pixel_t pixelColor, CGFloat *rgb)
void MapUnicharToKeySym(unichar key, char *buf, Int_t len, UInt_t &rootKeySym)
void FillPixmapBuffer(const unsigned char *bitmap, unsigned width, unsigned height, ULong_t foregroundPixel, ULong_t backgroundPixel, unsigned depth, unsigned char *imageData)
NSPoint TranslateToScreen(NSView< X11Window > *from, NSPoint point)
NSView< X11Window > * FindDNDAwareViewInPoint(NSView *parentView, Window_t dragWinID, Window_t inputWinID, Int_t x, Int_t y, Int_t maxDepth)
QuartzWindow * FindWindowInPoint(Int_t x, Int_t y)
int GlobalXCocoaToROOT(CGFloat xCocoa)
void WindowLostFocus(Window_t winID)
int LocalYROOTToCocoa(NSView< X11Window > *parentView, CGFloat yROOT)
bool ParseXLFDName(const std::string &xlfdName, XLFDName &dst)
NSPoint TranslateCoordinates(NSView< X11Window > *fromView, NSView< X11Window > *toView, NSPoint sourcePoint)
QuartzWindow * CreateTopLevelWindow(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)
int GlobalXROOTToCocoa(CGFloat xROOT)
QuartzView * CreateChildView(QuartzView *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)
void GetRootWindowAttributes(WindowAttributes_t *attr)
bool ViewIsTextViewFrame(NSView< X11Window > *view, bool checkParent)
NSPoint TranslateFromScreen(NSPoint point, NSView< X11Window > *to)
NSUInteger GetCocoaKeyModifiersFromROOTKeyModifiers(UInt_t rootKeyModifiers)
void InitWithPredefinedAtoms(name_to_atom_map &nameToAtom, std::vector< std::string > &atomNames)
void DrawTextLineNoKerning(CGContextRef ctx, CTFontRef font, const std::vector< UniChar > &text, Int_t x, Int_t y)
void DrawPattern(void *data, CGContextRef ctx)
bool SetFillPattern(CGContextRef ctx, const unsigned *patternIndex)
ULong_t fPixel
color pixel value (index in color table)
UShort_t fRed
red component (0..65535)
UShort_t fGreen
green component (0..65535)
UShort_t fBlue
blue component (0..65535)
EGEventType fType
of event (see EGEventType)
Window_t fWindow
window reported event is relative to
Longptr_t fUser[5]
5 longs can be used by client message events NOTE: only [0], [1] and [2] may be used.
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
Point structure (maps to the X11 XPoint structure)
Rectangle structure (maps to the X11 XRectangle structure)
Used for drawing line segments (maps to the X11 XSegments structure)
Attributes that can be used when creating or changing a window.
Window attributes that can be inquired.
Int_t fHeight
width and height of window
Int_t fClass
kInputOutput, kInputOnly
Int_t fY
location of window
Int_t fDepth
depth of window