Logo ROOT  
Reference Guide
TGTextViewStream.h
Go to the documentation of this file.
1 // @(#)root/gui:$Id$
2 
3 /*************************************************************************
4  * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 #ifndef ROOT_TGTextViewStream
12 #define ROOT_TGTextViewStream
13 
14 
15 #include "TGTextView.h"
16 #include <vector>
17 #include <streambuf>
18 #include <iostream>
19 
20 #if defined (R__WIN32) && defined (__MAKECINT__)
21 typedef basic_streambuf<char, char_traits<char> > streambuf;
22 #endif
23 
24 class TGTextViewStreamBuf : public std::streambuf
25 {
26 private:
28  std::vector<char> fLinebuffer;
29 
30 protected:
31  std::vector<char> fInputbuffer;
32  typedef std::char_traits<char> traits;
33  virtual int overflow(int = traits::eof());
34 
35 public:
37  virtual ~TGTextViewStreamBuf() { }
38 
39  ClassDef(TGTextViewStreamBuf, 0) // Specialization of std::streambuf
40 };
41 
42 
43 class TGTextViewostream : public TGTextView, public std::ostream
44 {
45 protected:
47 
48 public:
49  TGTextViewostream(const TGWindow* parent = nullptr, UInt_t w = 1, UInt_t h = 1,
50  Int_t id = -1, UInt_t sboptions = 0,
52  TGTextViewostream(const TGWindow *parent, UInt_t w, UInt_t h,
53  TGText *text, Int_t id, UInt_t sboptions, ULong_t back);
54  TGTextViewostream(const TGWindow *parent, UInt_t w, UInt_t h,
55  const char *string, Int_t id, UInt_t sboptions,
56  ULong_t back);
57  virtual ~TGTextViewostream() { }
58 
59  ClassDef(TGTextViewostream, 0) // Specialization of TGTextView and std::ostream
60 };
61 
62 #endif
TGTextViewStreamBuf::~TGTextViewStreamBuf
virtual ~TGTextViewStreamBuf()
Definition: TGTextViewStream.h:37
TGTextViewostream::fStreambuffer
TGTextViewStreamBuf fStreambuffer
Definition: TGTextViewStream.h:46
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGTextViewStreamBuf
Definition: TGTextViewStream.h:25
TGTextViewStreamBuf::TGTextViewStreamBuf
TGTextViewStreamBuf(TGTextView *textview)
TGTextViewStreamBuf constructor.
Definition: TGTextViewStream.cxx:31
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
TGTextViewStreamBuf::overflow
virtual int overflow(int=traits::eof())
Method called to put a character into the controlled output sequence without changing the current pos...
Definition: TGTextViewStream.cxx:43
TGTextViewStreamBuf::fTextView
TGTextView * fTextView
Definition: TGTextViewStream.h:27
TGText
A TGText is a multi line text buffer.
Definition: TGText.h:57
TGTextViewostream::TGTextViewostream
TGTextViewostream(const TGWindow *parent=nullptr, UInt_t w=1, UInt_t h=1, Int_t id=-1, UInt_t sboptions=0, Pixel_t back=TGTextView::GetWhitePixel())
TGTextViewostream constructor.
Definition: TGTextViewStream.cxx:64
text
TText * text
Definition: entrylist_figure1.C:10
h
#define h(i)
Definition: RSha256.hxx:106
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TGTextViewostream::~TGTextViewostream
virtual ~TGTextViewostream()
Definition: TGTextViewStream.h:57
unsigned int
TGTextView.h
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGTextView
A TGTextView is a text viewer widget.
Definition: TGTextView.h:22
TGTextViewostream
Definition: TGTextViewStream.h:44
TGFrame::GetWhitePixel
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition: TGFrame.cxx:709
TGTextViewStreamBuf::fInputbuffer
std::vector< char > fInputbuffer
Definition: TGTextViewStream.h:31
TGTextViewStreamBuf::fLinebuffer
std::vector< char > fLinebuffer
Definition: TGTextViewStream.h:28
TGTextViewStreamBuf::traits
std::char_traits< char > traits
Definition: TGTextViewStream.h:32
int