/usr/include/root/TGView.h is in libroot-gui-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | // @(#)root/gui:$Id$
// Author: Fons Rademakers 30/6/2000
/*************************************************************************
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/
#ifndef ROOT_TGView
#define ROOT_TGView
//////////////////////////////////////////////////////////////////////////
// //
// TGView //
// //
// A TGView provides the infrastructure for text viewer and editor //
// widgets. It provides a canvas (TGViewFrame) and (optionally) a //
// vertical and horizontal scrollbar and methods for marking and //
// scrolling. //
// //
// The TGView (and derivatives) will generate the following //
// event messages: //
// kC_TEXTVIEW, kTXT_ISMARKED, widget id, [true|false] //
// kC_TEXTVIEW, kTXT_DATACHANGE, widget id, 0 //
// kC_TEXTVIEW, kTXT_CLICK2, widget id, position (y << 16) | x) //
// kC_TEXTVIEW, kTXT_CLICK3, widget id, position (y << 16) | x) //
// kC_TEXTVIEW, kTXT_F3, widget id, true //
// //
//////////////////////////////////////////////////////////////////////////
#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGWidget
#include "TGWidget.h"
#endif
#ifndef ROOT_TTimer
#include "TTimer.h"
#endif
class TGViewFrame;
class TGHScrollBar;
class TGVScrollBar;
class TGView : public TGCompositeFrame, public TGWidget {
friend class TGViewFrame;
public:
enum { kNoHSB = BIT(0), kNoVSB = BIT(1) };
enum { kHorizontal = 0, kVertical = 1 };
protected:
TGLongPosition fVisible; // position of visible region
TGLongPosition fMousePos; // position of mouse
TGLongPosition fScrollVal; // scroll value
TGDimension fVirtualSize; // the current virtual window size
TGRectangle fExposedRegion;// exposed area
Int_t fScrolling; // scrolling direction
Atom_t fClipboard; // clipboard property
UInt_t fXMargin; // x margin
UInt_t fYMargin; // y margin
TGViewFrame *fCanvas; // frame containing the text
TGHScrollBar *fHsb; // horizontal scrollbar
TGVScrollBar *fVsb; // vertical scrollbar
TGGC fWhiteGC; // graphics context used for scrolling
// generates GraphicsExposure events
virtual void DoRedraw();
virtual void UpdateRegion(Int_t x, Int_t y, UInt_t w, UInt_t h);
virtual Bool_t ItemLayout() { return kFALSE; }
private:
TGView(const TGView&); // not implemented
TGView& operator=(const TGView&); // not implemented
public:
TGView(const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1, Int_t id = -1,
UInt_t xMargin = 0, UInt_t yMargin = 0,
UInt_t options = kSunkenFrame | kDoubleBorder,
UInt_t sboptions = 0,
Pixel_t back = GetWhitePixel());
virtual ~TGView();
TGViewFrame *GetCanvas() const { return fCanvas; }
virtual void Clear(Option_t * = "");
virtual void SetVisibleStart(Int_t newTop, Int_t direction);
virtual void ScrollCanvas(Int_t newTop, Int_t direction);
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
virtual void DrawBorder();
virtual void Layout();
virtual void SetLayoutManager(TGLayoutManager*) { }
virtual void DrawRegion(Int_t x, Int_t y, UInt_t width, UInt_t height);
virtual void ScrollToPosition(TGLongPosition newPos);
void ScrollUp(Int_t pixels)
{ ScrollToPosition(TGLongPosition(fVisible.fX, fVisible.fY + pixels)); }
void ScrollDown(Int_t pixels)
{ ScrollToPosition(TGLongPosition(fVisible.fX, fVisible.fY - pixels)); }
void ScrollLeft(Int_t pixels)
{ ScrollToPosition(TGLongPosition(fVisible.fX + pixels, fVisible.fY)); }
void ScrollRight(Int_t pixels)
{ ScrollToPosition(TGLongPosition(fVisible.fX - pixels, fVisible.fY)); }
virtual TGDimension GetDefaultSize() const { return TGDimension(fWidth, fHeight); }
TGDimension GetVirtualSize() const { return fVirtualSize; }
TGLongPosition GetScrollValue() const { return fScrollVal; }
TGLongPosition GetScrollPosition() const { return fVisible; }
TGLongPosition ToVirtual(TGLongPosition coord) const { return coord + fVisible; }
TGLongPosition ToPhysical(TGLongPosition coord) const { return coord - fVisible; }
virtual Bool_t HandleButton(Event_t *event);
virtual Bool_t HandleExpose(Event_t *event);
virtual void ChangeBackground(Pixel_t);
virtual void SetBackgroundColor(Pixel_t);
virtual void SetBackgroundPixmap(Pixmap_t p);
virtual void UpdateBackgroundStart();
const TGGC &GetViewWhiteGC() { return fWhiteGC; }
ClassDef(TGView,0) // View widget base class
};
class TGViewFrame : public TGCompositeFrame {
private:
TGView *fView; // pointer back to the view
TGViewFrame(const TGViewFrame&); // not implemented
TGViewFrame& operator=(const TGViewFrame&); // not implemented
public:
TGViewFrame(TGView *v, UInt_t w, UInt_t h, UInt_t options = 0,
Pixel_t back = GetWhitePixel());
Bool_t HandleSelectionRequest(Event_t *event)
{ return fView->HandleSelectionRequest(event); }
Bool_t HandleSelectionClear(Event_t *event)
{ return fView->HandleSelectionClear(event); }
Bool_t HandleSelection(Event_t *event)
{ return fView->HandleSelection(event); }
Bool_t HandleButton(Event_t *event)
{ return fView->HandleButton(event); }
Bool_t HandleExpose(Event_t *event)
{ return fView->HandleExpose(event); }
Bool_t HandleCrossing(Event_t *event)
{ return fView->HandleCrossing(event); }
Bool_t HandleMotion(Event_t *event)
{ return fView->HandleMotion(event); }
Bool_t HandleKey(Event_t *event)
{ return fView->HandleKey(event); }
Bool_t HandleDoubleClick(Event_t *event)
{ return fView->HandleDoubleClick(event); }
ClassDef(TGViewFrame,0) // Frame containing the actual text
};
#endif
|