22#include "TGLIncludes.h"
26#include "RConfigure.h"
111#elif defined(R__HAS_COCOA)
125 catch (
const std::exception &)
145 fEventHandler(nullptr)
169 Warning(
"~TGLWidget",
"There are some gl-contexts connected to this gl device"
170 "which have longer lifetime than lifetime of gl-device");
304 pfd->cColorBits = 24;
318 Warning(
"TGLContext::SetContext",
"DescribePixelFormat failed");
328 if (
pfd.cStencilBits)
363 Error(
"TGLWidget::SetFormat",
"Sorry, you should not call this function");
367 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->SetFormat()", (
size_t)
this));
377 Error(
"TGLWidget::SetFormat",
"GetWindowDC failed");
378 throw std::runtime_error(
"GetWindowDC failed");
389 Error(
"TGLWidget::SetFormat",
"SetPixelFormat failed");
390 throw std::runtime_error(
"SetPixelFormat failed");
393 Error(
"TGLWidget::SetFormat",
"ChoosePixelFormat failed");
394 throw std::runtime_error(
"ChoosePixelFormat failed");
398#elif defined(R__HAS_COCOA)
407 std::pair<void *, void *>& )
417 if (
format.HasAccumBuffer())
419 if (
format.IsDoubleBuffered())
423 if (
format.HasMultiSampling())
502 std::vector<Int_t>
glxfmt;
505 Display *
dpy =
reinterpret_cast<Display *
>(
gVirtualX->GetDisplay());
507 ::Error(
"TGLWidget::CreateWindow",
"Display is not set!");
508 throw std::runtime_error(
"Display is not set!");
513 ::Error(
"TGLWidget::CreateWindow",
"No good OpenGL visual found!");
514 throw std::runtime_error(
"No good OpenGL visual found!");
521 attr.background_pixel = 0;
523 attr.backing_store = Always;
568 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleCrossing((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
589 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleButton((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
605 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleDoubleClick((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
621 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleConfigureNotify((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
640 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleFocusChange((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
656 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleKey((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
672 gROOT->ProcessLineFast(
Form(
"((TGLWidget *)0x%zx)->HandleMotion((Event_t *)0x%zx)", (
size_t)
this, (
size_t)
ev));
const Mask_t kFocusChangeMask
const Mask_t kButtonPressMask
const Mask_t kExposureMask
Handle_t Window_t
Window handle.
const Mask_t kKeyReleaseMask
const Mask_t kAnyModifier
const Mask_t kKeyPressMask
const Mask_t kPointerMotionMask
const Mask_t kLeaveWindowMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
const Mask_t kEnterWindowMask
int Int_t
Signed integer 4 bytes (int)
long Longptr_t
Integer large enough to hold a pointer (platform-dependent)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
unsigned long ULongptr_t
Unsigned integer large enough to hold a pointer (platform-dependent)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize wid
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t attr
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t format
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
R__EXTERN TVirtualMutex * gROOTMutex
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
#define R__LOCKGUARD(mutex)
virtual Bool_t HandleKey(Event_t *)
virtual Bool_t HandleMotion(Event_t *)
virtual Bool_t HandleCrossing(Event_t *)
virtual Bool_t HandleButton(Event_t *)
virtual Bool_t HandleConfigureNotify(Event_t *)
virtual Bool_t HandleDoubleClick(Event_t *)
virtual Bool_t HandleFocusChange(Event_t *)
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
This class encapsulates window-system specific information about a GL-context and alows their proper ...
void SwapBuffers()
If context is valid (TGLPaintDevice, for which context was created still exists), swap buffers (in ca...
Bool_t MakeCurrent()
If context is valid (TGLPaintDevice, for which context was created still exists), make it current.
Bool_t ClearCurrent()
Reset current context.
static void InitializeIfNeeded()
Initialize globals that require other libraries to be initialized.
ROOT GUI Window base class.
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.
TOneArgGuard< Func, Arg > make_guard(Func f, Arg a)