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;
333 if (n <= 0 || n > 100)
return z;
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
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
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.
R__EXTERN TSystem * gSystem
virtual const char * MarkupArg(const char *, const char *)
TGHtmlImageMarkup * fINext
virtual ~TGHtmlImage()
dtor.
TGHtmlImageMarkup * fPList
TGHtmlImage(const TGHtmlImage &)=delete
virtual const char * MarkupArg(const char *tag, const char *zDefault)
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 the...
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.
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw region defined by [x,y] [w,h].
void RedrawEverything()
Call this routine to force the entire widget to be redrawn.
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
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
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.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
This class represents a WWW compatible URL.
const char * GetFile() const
const char * GetHost() const
const char * GetProtocol() const