105 for (i = 0; i <
int(
sizeof(aligns) /
sizeof(aligns[0])); i++) {
106 if (strcasecmp(aligns[i].zName, z) == 0) {
107 result = aligns[i].iValue;
128 if (pImage->
fW != newWidth || pImage->
fH != newHeight) {
131 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
132 pElem->
fW = newWidth;
133 pElem->
fH = newHeight;
136 pImage->
fW = newWidth;
137 pImage->
fH = newHeight;
141 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
147 for (pElem = pImage->
fPList; pElem; pElem = pElem->
fINext) {
169 if (zSrc == 0)
return 0;
172 if (zSrc == 0)
return 0;
181 if (strcmp(pImage->
fZUrl, zSrc) == 0
182 && strcmp(pImage->
fZWidth, zWidth) == 0
183 && strcmp(pImage->
fZHeight, zHeight) == 0) {
192 pImage =
new TGHtmlImage(
this, zSrc, zWidth, zHeight);
224 if ((
w > 0 &&
h > 0) && ((
w != (
int)image->
GetWidth()) ||
244 if (!strchr(z,
'%'))
return z;
246 if (!sscanf(z,
"%d", &
n))
return z;
249 val =
fCanvas->GetHeight() * 100;
251 val =
fCanvas->GetWidth() * 100;
257 if (!pElem)
return z;
260 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &
m)) {
265 if (!pElem)
return z;
268 if (tz && !strchr(tz,
'%') && sscanf(tz,
"%d", &
m)) {
293 for (pElem = pBlock->
fPNext; pElem; pElem = pElem->
fPNext) {
#define IMAGE_ALIGN_Bottom
#define IMAGE_ALIGN_AbsMiddle
#define IMAGE_ALIGN_Right
#define IMAGE_ALIGN_TextTop
#define IMAGE_ALIGN_AbsBottom
#define IMAGE_ALIGN_Middle
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
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