Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
21class TGTextViewStreamBuf : public std::streambuf
22{
23private:
25 std::vector<char> fLinebuffer;
26
27protected:
28 std::vector<char> fInputbuffer;
29 typedef std::char_traits<char> traits;
30 int overflow(int = traits::eof()) override;
31
32public:
35
36 ClassDef(TGTextViewStreamBuf, 0) // Specialization of std::streambuf
37};
38
39
40class TGTextViewostream : public TGTextView, public std::ostream
41{
42protected:
44
45public:
46 TGTextViewostream(const TGWindow* parent = nullptr, UInt_t w = 1, UInt_t h = 1,
47 Int_t id = -1, UInt_t sboptions = 0,
49 TGTextViewostream(const TGWindow *parent, UInt_t w, UInt_t h,
51 TGTextViewostream(const TGWindow *parent, UInt_t w, UInt_t h,
52 const char *string, Int_t id, UInt_t sboptions,
53 ULong_t back);
54 ~TGTextViewostream() override {}
55
56 ClassDefOverride(TGTextViewostream, 0) // Specialization of TGTextView and std::ostream
57};
58
59#endif
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define h(i)
Definition RSha256.hxx:106
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
#define ClassDef(name, id)
Definition Rtypes.h:344
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
Option_t Option_t TPoint TPoint const char text
static Pixel_t GetWhitePixel()
Get white pixel value.
Definition TGFrame.cxx:701
std::vector< char > fLinebuffer
std::char_traits< char > traits
TGTextViewStreamBuf(TGTextView *textview)
TGTextViewStreamBuf constructor.
std::vector< char > fInputbuffer
~TGTextViewStreamBuf() override
int overflow(int=traits::eof()) override
Method called to put a character into the controlled output sequence without changing the current pos...
A TGTextView is a text viewer widget.
Definition TGTextView.h:22
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.
TGTextViewStreamBuf fStreambuffer
~TGTextViewostream() override
A TGText is a multi line text buffer.
Definition TGText.h:57
ROOT GUI Window base class.
Definition TGWindow.h:23