104 for (i = 0; i < int(
sizeof(aligns) /
sizeof(aligns[0])); i++) {
105 if (strcasecmp(aligns[i].zName, z) == 0) {
106 result = aligns[i].iValue;
127 if (pImage->
fW != newWidth || pImage->
fH != newHeight) {
130 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
131 pElem->
fW = newWidth;
132 pElem->
fH = newHeight;
135 pImage->
fW = newWidth;
136 pImage->
fH = newHeight;
140 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
146 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
168 if (zSrc == 0)
return 0;
171 if (zSrc == 0)
return 0;
180 if (strcmp(pImage->
fZUrl, zSrc) == 0
181 && strcmp(pImage->
fZWidth, zWidth) == 0
182 && strcmp(pImage->
fZHeight, zHeight) == 0) {
191 pImage =
new TGHtmlImage(
this, zSrc, zWidth, zHeight);
234 if (s.SendRaw(msg.
Data(), msg.
Length()) == -1)
236 Int_t size = 1024*1024;
237 buf = (
char *)calloc(size,
sizeof(
char));
239 if (s.RecvRaw(buf, size) == -1) {
245 tmp = fopen(pathtmp.
Data(),
"wb");
250 fwrite(buf,
sizeof(
char), size, tmp);
254 if (image && !image->
IsValid()) {
283 if ((w > 0 && h > 0) && ((w != (int)image->
GetWidth()) ||
303 if (!strchr(z,
'%'))
return z;
305 if (!sscanf(z,
"%d", &n))
return z;
306 if (n < 0 || n > 100)
return z;
313 snprintf(ret, 15,
"%d", val / n);
316 if (!pElem)
return z;
319 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &m)) {
320 snprintf(ret, 15,
"%d", m * 100 / n);
324 if (!pElem)
return z;
327 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &m)) {
328 snprintf(ret, 15,
"%d", m * 100 / n);
352 for (pElem = pBlock->
fPNext; pElem; pElem = pElem->
fPNext) {
const char * GetHost() const
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
#define IMAGE_ALIGN_TextTop
TGHtmlImageMarkup * fINext
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw region defined by [x,y] [w,h].
This class represents a WWW compatible URL.
virtual Bool_t IsValid() const
const char * GetProtocol() const
virtual UInt_t GetWidth() const
TGHtmlBlock * fFirstBlock
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
void ScheduleRedraw()
Make sure that a call to the Redraw() routine has been queued.
An abstract interface to image processing library.
void RedrawEverything()
Call this routine to force the entire widget to be redrawn.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
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...
virtual void Scale(UInt_t, UInt_t)
const char * Data() const
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Vc_ALWAYS_INLINE void free(T *p)
Frees memory that was allocated with Vc::malloc.
virtual const char * MarkupArg(const char *, const char *)
virtual char * ResolveUri(const char *uri)
This function resolves the specified URI and returns the result in a newly allocated string...
virtual UInt_t GetHeight() const
void ImageChanged(TGHtmlImage *image, int newWidth, int newHeight)
This routine is called when an image changes.
#define IMAGE_ALIGN_AbsBottom
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
R__EXTERN TSystem * gSystem
int GetImageAt(int x, int y)
This routine searchs for an image beneath the coordinates x,y and returns the token number of the the...
char * StrDup(const char *str)
Duplicate the string str.
virtual ~TGHtmlImage()
dtor.
static TImage * ReadRemoteImage(const char *url)
Temporary function to read remote pictures.
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
TGHtmlImage(const TGHtmlImage &)
#define IMAGE_ALIGN_Middle
#define IMAGE_ALIGN_AbsMiddle
int TokenNumber(TGHtmlElement *p)
Return the token number for the given TGHtmlElement.
#define IMAGE_ALIGN_Bottom
static TImage * Open(const char *file, EImageFileTypes type=kUnknown)
Open a specified image file.
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
#define IMAGE_ALIGN_Right
virtual TImage * LoadImage(const char *uri, int w=0, int h=0)
This is the default LoadImage() procedure.
virtual const char * MarkupArg(const char *tag, const char *zDefault)
Lookup an argument in the given markup with the name given.
TGHtmlImageMarkup * fPList
const char * GetFile() const
const char Int_t const char * image