#include <filtirr.h>
Inheritance diagram for ImagemapRenderRegion:
Public Member Functions | |
ImagemapRenderRegion () | |
Default constructor. | |
ImagemapRenderRegion (ImagemapFilterOptions ifoOptions) | |
Specific constructor, using a set of ImagemapFilterOptions. | |
~ImagemapRenderRegion () | |
Destructor. | |
BOOL | Init () |
Initialise the render region. | |
BOOL | StopRender () |
void | DrawPathToOutputDevice (Path *PathToRender, PathShape shapePath) |
Renders this path into the ImagemapRenderRegion. | |
void | DrawRect (DocRect *RectToRender) |
Does nothing. | |
void | DrawDragRect (DocRect *RectToRender) |
Should not be called for this kind of render region. | |
void | DrawLine (const DocCoord &StartPoint, const DocCoord &EndPoint) |
None at present - this function should not be called during ink rendering. | |
void | DrawPixel (const DocCoord &Point) |
Should not be called for this kind of render region. | |
void | DrawBlob (DocCoord p, BlobType type) |
Should not be called for this kind of render region. | |
void | DrawCross (const DocCoord &Point, const UINT32 Size) |
Should not be called for this kind of render region. | |
void | DrawBitmap (const DocCoord &Point, KernelBitmap *pBitmap) |
void | DrawBitmap (const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID=NULL) |
void | DrawBitmapBlob (const DocCoord &Point, KernelBitmap *BlobShape) |
void | DrawBitmapBlob (const DocCoord &Point, ResourceID resID) |
void | GetRenderRegionCaps (RRCaps *pCaps) |
This function allows render regions to admit to what they can and can not render. This allows other areas of the program to come in and help render regions out in some situations, if they are unable to render everything. eg. an OSRenderRegion can not render transparancy. | |
virtual BOOL | WantsGrids () |
very little | |
INT32 | Write (CCLexFile *pfileToWrite=NULL, TCHAR *pcBuffer=NULL) |
Writes the imagemap HTML, either to the file or the text buffer or both:. | |
BOOL | IsEmpty () |
Protected Member Functions | |
void | InitClipping () |
void | InitAttributes () |
void | SetOSDrawingMode () |
void | SetQualityLevel () |
Does nothing. | |
MILLIPOINT | CalcPixelWidth () |
None for Imagemap render regions - just returns 1. | |
MILLIPOINT | CalcScaledPixelWidth () |
None for CMX render regions - just returns 1. | |
void | AddRectangleToImagemap (DocRect rectToAdd, WebAddressAttribute *pwaaCurrent) |
Scales the rectangle then adds it to the imagemap list. | |
void | AddCircleToImagemap (Path *ppthToAdd, WebAddressAttribute *pwaaCurrent) |
Scales the path then adds it to the imagemap list as a circle. | |
void | AddPathToImagemap (Path *ppthToScale, WebAddressAttribute *pwaaCurrent) |
This function goes through the subpaths of the path one by one. | |
Protected Attributes | |
ImagemapFilterOptions | m_Options |
Imagemap | m_Imagemap |
The render region works as follows. The Imagemap starts off empty. Then, whenever something is rendered into this render region and there is a current WebAddressAttribute with a non-empty URL, a clickable area is added to the imagemap.
Definition at line 129 of file filtirr.h.
|
Default constructor.
Definition at line 127 of file filtirr.cpp. 00127 : RenderRegion() 00128 { 00129 m_Options=ImagemapFilterOptions(); 00130 }
|
|
Specific constructor, using a set of ImagemapFilterOptions. > ImagemapRenderRegion::ImagemapRenderRegion(ImagemapFilterOptions ifoOptions)
RenderRegion(ClipRect, ConvertMatrix, ViewScale) with ClipRect derived from the ImagemapFilterOptions, ConvertMatrix set to the identity and ViewScale set to 1. Definition at line 151 of file filtirr.cpp. 00151 : 00152 RenderRegion(ImagemapFilterOptions::GetSizeOfExportArea(ifoOptions.m_stExportArea), Matrix(), 1) 00153 { 00154 m_Options=ifoOptions; 00155 }
|
|
Destructor. > ImagemapRenderRegion::~ImagemapRenderRegion()
Definition at line 169 of file filtirr.cpp. 00170 { 00171 m_Imagemap.DeleteAll(); 00172 }
|
|
Scales the path then adds it to the imagemap list as a circle.
Definition at line 523 of file filtirr.cpp. 00524 { 00525 //First get the origin of the export area and the DPI 00526 DocCoord dcOrigin=ImagemapFilterOptions::GetOriginOfExportArea(m_Options.m_stExportArea); 00527 double dDPI=m_Options.m_dDPI; 00528 00529 //Now make a copy of the path 00530 Path pthToAdd; 00531 00532 pthToAdd.Initialise(ppthToScale->GetNumCoords()); 00533 00534 pthToAdd.CopyPathDataFrom(ppthToScale); 00535 00536 //Scale it 00537 pthToAdd.Scale(dcOrigin, dDPI); 00538 00539 //And add it to the imagemap 00540 m_Imagemap.AddCircle(&pthToAdd, pwaaCurrent->m_url.GetWebAddress(), pwaaCurrent->m_pcFrame); 00541 00542 }
|
|
This function goes through the subpaths of the path one by one.
Definition at line 564 of file filtirr.cpp. 00565 { 00566 //First get the origin of the export area and the DPI 00567 DocCoord dcOrigin=ImagemapFilterOptions::GetOriginOfExportArea(m_Options.m_stExportArea); 00568 double dDPI=m_Options.m_dDPI; 00569 00570 //Now, how many subpaths are there in this path? 00571 INT32 lNumSubpaths=ppthToAdd->GetNumSubpaths(); 00572 00573 //For each subpath in the path 00574 for (INT32 l=0; l<lNumSubpaths; l++) 00575 { 00576 //Create a new path 00577 Path pthSubpath; 00578 00579 pthSubpath.Initialise(ppthToAdd->GetNumCoords()); 00580 00581 //And copy the next subpath into it 00582 ppthToAdd->MakePathFromSubPath(l, &pthSubpath); 00583 00584 //Now, if that subpath is closed 00585 if (pthSubpath.IsSubPathClosed(0)) 00586 { 00587 //Then we want to add it to the imagemap 00588 00589 //So scale it to dDPI and by dcOrigin 00590 pthSubpath.Scale(dcOrigin, dDPI); 00591 00592 //Now we need to flatten it. 00593 //This means creating a new path, because otherwise Path::Flatten 00594 //goes wrong 00595 00596 Path pthFlattened; 00597 00598 pthFlattened.Initialise(pthSubpath.GetNumCoords()); 00599 00600 //So, if we should flatten the path 00601 if (m_Options.m_ffApprox!=FF_NOTATALL) 00602 //Then do it 00603 pthSubpath.Flatten(m_Options.m_ffApprox, &pthFlattened); 00604 else 00605 //Otherwise, simply copy the path across 00606 pthFlattened.CopyPathDataFrom(&pthSubpath); 00607 00608 //Then add the flattened path to the imagemap 00609 m_Imagemap.AddPolygon(&pthFlattened, pwaaCurrent->m_url.GetWebAddress(), pwaaCurrent->m_pcFrame); 00610 } 00611 } 00612 00613 00614 }
|
|
Scales the rectangle then adds it to the imagemap list.
Definition at line 482 of file filtirr.cpp. 00483 { 00484 //First get the origin of the export area and the DPI 00485 DocCoord dcOrigin=ImagemapFilterOptions::GetOriginOfExportArea(m_Options.m_stExportArea); 00486 double dDPI=m_Options.m_dDPI; 00487 00488 //Scale the rectangle 00489 rectToScale.lo.Scale(dcOrigin, dDPI); 00490 rectToScale.hi.Scale(dcOrigin, dDPI); 00491 00492 //Now, in scaling the rectangle we may have made it invalid (for example, we 00493 //may have scaled rectToScale.lo so that it is actually higher than recToScale.hi). 00494 00495 //So create a new valid rectangle 00496 DocRect rectToAdd; 00497 00498 rectToAdd.lo.x=MIN(rectToScale.lo.x, rectToScale.hi.x); 00499 rectToAdd.hi.x=MAX(rectToScale.lo.x, rectToScale.hi.x); 00500 rectToAdd.lo.y=MIN(rectToScale.lo.y, rectToScale.hi.y); 00501 rectToAdd.hi.y=MAX(rectToScale.lo.y, rectToScale.hi.y); 00502 00503 //And add it to the imagemap 00504 m_Imagemap.AddRectangle(rectToAdd, pwaaCurrent->m_url.GetWebAddress(), pwaaCurrent->m_pcFrame); 00505 00506 }
|
|
None for Imagemap render regions - just returns 1.
Implements RenderRegion. Definition at line 371 of file filtirr.cpp.
|
|
None for CMX render regions - just returns 1.
Implements RenderRegion. Definition at line 390 of file filtirr.cpp.
|
|
Implements RenderRegion. Definition at line 156 of file filtirr.h.
|
|
Implements RenderRegion. Definition at line 155 of file filtirr.h.
|
|
Implements RenderRegion. Definition at line 159 of file filtirr.h.
|
|
Implements RenderRegion. Definition at line 158 of file filtirr.h.
|
|
Should not be called for this kind of render region.
Implements RenderRegion. Definition at line 220 of file filtirr.cpp.
|
|
Should not be called for this kind of render region.
Implements RenderRegion. Definition at line 237 of file filtirr.cpp.
|
|
Should not be called for this kind of render region.
Implements RenderRegion. Definition at line 186 of file filtirr.cpp.
|
|
None at present - this function should not be called during ink rendering.
Implements RenderRegion. Definition at line 353 of file filtirr.cpp. 00354 { 00355 ENSURE(FALSE, "ImagemapRenderRegion::DrawLine called - this should not happen!"); 00356 }
|
|
Renders this path into the ImagemapRenderRegion.
It does this by adding a clickable area into the imagemap list.
Implements RenderRegion. Definition at line 264 of file filtirr.cpp. 00265 { 00266 //First check our path parameter 00267 if (ppthRender==NULL) 00268 { 00269 ERROR2RAW("ImagemapRenderRegion::DrawPathToOutputDevice not given a path!"); 00270 return; 00271 } 00272 00273 //Now get the current WebAddressAttribute 00274 WebAddressAttribute* pwaaCurrent=(WebAddressAttribute*) GetCurrentAttribute(ATTR_WEBADDRESS); 00275 00276 if (pwaaCurrent==NULL) 00277 { 00278 ERROR2RAW("ImagemapRenderRegion::DrawPathToOutputDevice - no current WebAddressAttribute!"); 00279 return; 00280 } 00281 00282 00283 //IF the current WebAddressAttribute has a URL 00284 if (pwaaCurrent->HasURL()) 00285 { 00286 //Then we want to add a clickable area into the imagemap 00287 00288 //Now, if EITHER the user has specified that this clickable area is a rectangle 00289 //OR the user has specified all clickable areas should be rectangles 00290 //OR this path is a rectangle shape 00291 if (m_Options.m_fAllRectangles 00292 || pwaaCurrent->UseBoundingRectangle() 00293 || shapePath==PATHSHAPE_RECTANGLE 00294 || shapePath==PATHSHAPE_SQUARE) 00295 { 00296 //Then we want to add a clickable area into the imagemap 00297 00298 //So get the rectangle to add 00299 DocRect rectToAdd=pwaaCurrent->GetClickableRectangleInRendering(); 00300 00301 //And add it 00302 AddRectangleToImagemap(rectToAdd, pwaaCurrent); 00303 00304 } 00305 else 00306 { 00307 //It's not a rectangle 00308 00309 //So, what shape is the path? 00310 if (shapePath==PATHSHAPE_CIRCLE) 00311 //Circular. So add a circle to the imagemap 00312 AddCircleToImagemap(ppthRender, pwaaCurrent); 00313 else 00314 //Otherwise, add a polygon to the imagemap 00315 AddPathToImagemap(ppthRender, pwaaCurrent); 00316 00317 }//End if/else rectangle 00318 00319 } //ENd if/else has URL 00320 00321 }
|
|
Should not be called for this kind of render region.
Implements RenderRegion. Definition at line 203 of file filtirr.cpp.
|
|
Does nothing.
Implements RenderRegion. Definition at line 337 of file filtirr.cpp. 00338 { 00339 ENSURE(FALSE, "ImagemapRenderRegion::DrawRect called - this should not happen!"); 00340 }
|
|
This function allows render regions to admit to what they can and can not render. This allows other areas of the program to come in and help render regions out in some situations, if they are unable to render everything. eg. an OSRenderRegion can not render transparancy.
Reimplemented from RenderRegion. Definition at line 410 of file filtirr.cpp. 00411 { 00412 //This seems to be what all the other overrides do, so I guess 00413 //I'll do the same 00414 pCaps->CanDoNothing(); 00415 00416 }
|
|
Initialise the render region.
Reimplemented from RenderRegion. |
|
Implements RenderRegion. Definition at line 176 of file filtirr.h.
|
|
Implements RenderRegion. Definition at line 175 of file filtirr.h.
|
|
Definition at line 168 of file filtirr.h. 00169 { 00170 return m_Imagemap.IsEmpty(); 00171 }
|
|
Implements RenderRegion. Definition at line 177 of file filtirr.h.
|
|
Does nothing.
Reimplemented from RenderRegion. Definition at line 178 of file filtirr.h.
|
|
Implements RenderRegion. Definition at line 145 of file filtirr.h. 00145 {return TRUE;}
|
|
very little
Reimplemented from RenderRegion. Definition at line 432 of file filtirr.cpp. 00433 { 00434 return FALSE; 00435 }
|
|
Writes the imagemap HTML, either to the file or the text buffer or both:. > INT32 ImagemapRenderRegion::Write(CCLexFile* pfileToWrite=NULL, TCHAR* pcBuffer=NULL)
Definition at line 461 of file filtirr.cpp. 00462 { 00463 return m_Imagemap.Write(pfileToWrite, pcBuffer); 00464 00465 }
|
|
|
|
|