108 for (i = 0; i <
int(
sizeof(aligns) /
sizeof(aligns[0])); i++) {
109 if (strcasecmp(aligns[i].zName, z) == 0) {
110 result = aligns[i].iValue;
131 if (pImage->
fW != newWidth || pImage->
fH != newHeight) {
134 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
135 pElem->
fW = newWidth;
136 pElem->
fH = newHeight;
139 pImage->
fW = newWidth;
140 pImage->
fH = newHeight;
144 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
150 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
172 if (zSrc == 0)
return 0;
175 if (zSrc == 0)
return 0;
184 if (strcmp(pImage->
fZUrl, zSrc) == 0
185 && strcmp(pImage->
fZWidth, zWidth) == 0
186 && strcmp(pImage->
fZHeight, zHeight) == 0) {
195 pImage =
new TGHtmlImage(
this, zSrc, zWidth, zHeight);
241 ::Error(
"ReadRemoteImage",
"library compiled without SSL, https not supported");
269 tmp = fopen(pathtmp.
Data(),
"wb");
275 fwrite(buf,
sizeof(
char),
size, tmp);
279 if (image && !image->
IsValid()) {
310 if ((w > 0 &&
h > 0) && ((w != (
int)image->
GetWidth()) ||
330 if (!strchr(z,
'%'))
return z;
332 if (!sscanf(z,
"%d", &
n))
return z;
335 val =
fCanvas->GetHeight() * 100;
337 val =
fCanvas->GetWidth() * 100;
343 if (!pElem)
return z;
346 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &
m)) {
351 if (!pElem)
return z;
354 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &
m)) {
379 for (pElem = pBlock->
fPNext; pElem; pElem = pElem->
fPNext) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
int Int_t
Signed integer 4 bytes (int).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
static TImage * ReadRemoteImage(const char *url)
Temporary function to read remote pictures.
#define IMAGE_ALIGN_Bottom
#define IMAGE_ALIGN_AbsMiddle
#define IMAGE_ALIGN_Right
#define IMAGE_ALIGN_TextTop
#define IMAGE_ALIGN_AbsBottom
#define IMAGE_ALIGN_Middle
char * StrDup(const char *str)
Duplicate the string str.
virtual const char * MarkupArg(const char *, const char *)
TGHtmlImageMarkup * fINext
TGHtmlImageMarkup * fPList
TGHtmlImage(const TGHtmlImage &)=delete
~TGHtmlImage() override
dtor.
const char * MarkupArg(const char *tag, const char *zDefault) override
Lookup an argument in the given markup with the name given.
const char * GetPctWidth(TGHtmlElement *p, char *opt, char *ret)
Return the height and width, converting to percent if required ret must be at least 16 characters lon...
void ScheduleRedraw()
Make sure that a call to the Redraw() routine has been queued.
void ImageChanged(TGHtmlImage *image, int newWidth, int newHeight)
This routine is called when an image changes.
virtual TImage * LoadImage(const char *uri, int w=0, int h=0)
This is the default LoadImage() procedure.
int GetImageAt(int x, int y)
This routine searchs for an image beneath the coordinates x,y and returns the token number of the ima...
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
TGHtmlBlock * fFirstBlock
int TokenNumber(TGHtmlElement *p)
Return the token number for the given TGHtmlElement.
virtual char * ResolveUri(const char *uri)
This function resolves the specified URI and returns the result in a newly allocated string.
void RedrawEverything()
Call this routine to force the entire widget to be redrawn.
void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Draw region defined by [x,y] [w,h].
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an <IMG> markup, find or create an appropriate TGHtmlImage object and return a pointer to that ...
TGViewFrame * fCanvas
frame containing the text
An abstract interface to image processing library.
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
virtual UInt_t GetWidth() const
virtual Bool_t IsValid() const
virtual void Scale(UInt_t, UInt_t)
virtual UInt_t GetHeight() const
A TSocket wrapped in by SSL.
This class implements client sockets.
virtual Int_t RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Receive a raw buffer of specified length bytes.
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
virtual Bool_t IsValid() const
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
This class represents a WWW compatible URL.
const char * GetFile() const
const char * GetHost() const
const char * GetProtocol() const