122 else if (
gVirtualX->InheritsFrom(
"TGCocoa"))
130 "Cannot load GL, will use default canvas imp instead\n");
146 fCanvasContainer =
new TRootEmbeddedContainer(
this, win, GetViewPort());
147 SetContainer(fCanvasContainer);
150 if (name) cname =
name;
163 fCanvas->SetBorderMode(0);
176 delete fCanvasContainer;
196 if (!fCanvas)
return kTRUE;
198 Int_t button =
event->fCode;
240 if (!fCanvas)
return kTRUE;
242 Int_t button =
event->fCode;
261 if (fAutoFit && fCanvas) {
274 static UInt_t previous_keysym = 0;
276 if (!fCanvas)
return kTRUE;
279 fButton =
event->fCode;
282 gVirtualX->LookupString(event, str,
sizeof(str), keysym);
292 gROOT->SetInterrupt();
295 if (keysym > 0x1011 && keysym < 0x1016) {
298 Int_t mx, my, tx, ty;
300 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
302 fCanvasContainer->GetId(),
303 mx, my, tx, ty, dum1);
307 if ((previous_keysym == keysym) && (previous_event ==
kGKeyPress)) {
326 previous_keysym = keysym;
329 fCanvas->HandleInput(
kKeyPress, str[0], keysym);
334 gVirtualX->LookupString(event, str,
sizeof(str), keysym);
336 if (keysym > 0x1011 && keysym < 0x1016) {
339 Int_t mx, my, tx, ty;
341 gVirtualX->QueryPointer(wid, dum1, dum2, mx, my, mx, my, mask);
359 fCanvasContainer->GetId(),
360 mx, my, tx, ty, dum1);
362 previous_keysym = keysym;
366 previous_event =
event->fType;
375 if (!fCanvas)
return kTRUE;
399 if (!fCanvas)
return kTRUE;
412 if (!fCanvas)
return kTRUE;
437 if (!obj)
return kTRUE;
441 if (!
object)
return kTRUE;
446 else if (object->IsA()->GetMethodAllAny(
"Draw"))
451 else if (obj->IsA()->GetMethodAllAny(
"Draw"))
459 if (sfname.
Length() > 7) {
490 Int_t px = 0, py = 0;
494 gVirtualX->GetWindowID(fCanvas->GetCanvasID()),
495 xroot, yroot, px, py, wtarget);
497 TPad *pad = fCanvas->Pick(px, py, 0);
500 gROOT->SetSelectedPad(pad);
515 for (
int i = 0; typelist[i] !=
kNone; ++i) {
516 if (typelist[i] == rootObj)
518 if (typelist[i] == uriObj)
537 if (!GetCanvas())
return;
543 out << std::endl <<
" // embedded canvas" << std::endl;
544 out <<
" TRootEmbeddedCanvas *";
550 out <<
");" << std::endl;
557 if (option && strstr(option,
"keep_names"))
558 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
561 <<
"->GetCanvasWindowId();" << std::endl;
567 out << cname <<
" = new TCanvas(";
568 out << quote << cname.
Data() << quote <<
", 10, 10, w" 569 <<
GetName() <<
");" << std::endl;
570 out <<
" " <<
GetName() <<
"->AdoptCanvas(" << cname
571 <<
");" << std::endl;
virtual Bool_t HandleContainerKey(Event_t *ev)
Handle keyboard events in the canvas container.
const Mask_t kKeyReleaseMask
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual Bool_t HandleContainerCrossing(Event_t *ev)
Handle enter/leave events. Only leave is activated at the moment.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
virtual UInt_t GetOptions() const
virtual Bool_t HandleButton(Event_t *)
virtual Bool_t HandleKey(Event_t *)
virtual Bool_t HandleDoubleClick(Event_t *)
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
const Mask_t kKeyShiftMask
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
R__EXTERN TStyle * gStyle
const Mask_t kLeaveWindowMask
virtual Bool_t HandleDNDLeave()
Handle drag leave events.
virtual Bool_t HandleContainerDoubleClick(Event_t *ev)
Handle mouse button double click events in the canvas container.
Int_t LoadPlugin()
Load the plugin library for this handler.
virtual void Update()
Update pad.
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
virtual void * ReadObjectAny(const TClass *cast)
Read object from I/O buffer.
An abstract interface to image processing library.
virtual Bool_t HandleContainerConfigure(Event_t *ev)
Handle configure (i.e. resize) event.
void AdoptCanvas(TCanvas *c)
Canvas c is adopted from this embedded canvas.
void SetDNDTarget(Bool_t onoff)
const Mask_t kPointerMotionMask
virtual Atom_t HandleDNDEnter(Atom_t *typelist)
Handle drag enter events.
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
virtual Bool_t HandleExpose(Event_t *event)
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save an embedded canvas as a C++ statement(s) on output stream out.
virtual Bool_t HandleContainerExpose(Event_t *ev)
Handle expose events.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
const Mask_t kButtonPressMask
virtual Bool_t HandleContainerButton(Event_t *ev)
Handle mouse button events in the canvas container.
const Mask_t kKeyPressMask
virtual ~TRootEmbeddedCanvas()
Delete embedded ROOT canvas.
virtual Bool_t HandleDNDDrop(TDNDData *data)
Handle drop events.
virtual Atom_t HandleDNDPosition(Int_t, Int_t, Atom_t action, Int_t, Int_t)
Handle dragging position events.
Long_t ExecPlugin(int nargs, const T &... params)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
const Mask_t kExposureMask
The most important graphics class in the ROOT system.
char * Form(const char *fmt,...)
void SetReadMode()
Set buffer in read mode.
virtual void SetEditable(Bool_t=kTRUE)
virtual Bool_t HandleMotion(Event_t *)
virtual Bool_t HandleConfigureNotify(Event_t *event)
This event is generated when the frame is resized.
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
Mother of all ROOT objects.
void EmbedInto(Int_t winid, Int_t ww, Int_t wh)
Embedded a canvas into a TRootEmbeddedCanvas.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
Bool_t GetCanvasPreferGL() const
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
const Mask_t kAnyModifier
virtual Bool_t HandleCrossing(Event_t *)
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Int_t MustCleanup() const
virtual Bool_t HandleContainerMotion(Event_t *ev)
Handle mouse motion event in the canvas container.
const char * Data() const