#include <IDrawCJKGrid.h>
|
| virtual void | Draw (const IPMUnknown *shape, const ICJKGridData *gridData, const ICJKGridManager *gridManager, const PMReal &lineWidth, const GraphicsData *gd, const int32 flags)=0 |
| |
| virtual PMRect | GetPaintedBBox (const IShape *iShape, const PMRect &itemBounds, const PMMatrix &innertoview) const =0 |
| |
| virtual void | Inval (IShape *iShape, const GraphicsData *gd, const ClassID reasonForInval, const int32 flags) const =0 |
| |
| virtual void | DrawOpenCell (const PMRect &rect, int32 &position) const =0 |
| |
| virtual void | DrawFilledCell (const PMRect &rect, int32 &position) const =0 |
| |
| virtual void | EndDraw (int32 &position) const =0 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
IDrawCJKGrid allows for custom CJK grid drawing.
Draw will be called to draw the grid.
The drawing of grid cells is optimized by calling DrawVisibleICFBoxRects and DrawVisibleEmBoxRects on the ICJKGridManager. This will in turn call your DrawOpenCell(), DrawFilledCell(), and EndDraw(). If you wish to use optimized grid drawing, you will need to save the GraphicsData from this Draw call and use it in your DrawOpenCell(), DrawFilledCell(), and EndDraw() methods. You will also need to call DrawVisibleEmBoxRects or DrawVisibleICFBoxRects on the ICJKGridManager for this object.
- Parameters
| shape | IN The shape the grid is drawing on. |
| gridData | IN The grids ICJKGridData. |
| gridManager | The grids ICJKGridManager. |
| lineWidth | IN The linewidth that should be used to draw this grid. |
| gd | IN The GraphicsData you are drawing into. |
| flags | IN The drawing flags this shape is drawing with. |
| virtual void IDrawCJKGrid::DrawFilledCell | ( | const PMRect & | rect, | | | int32 & | position | | ) | | const |
| pure virtual |
DrawFilledCell is called by the grid manager's optimized grid drawing code on filled cells. Your implementation can draw one filled cell any way you like it. It's best not to stroke the graphics port everytime. It however, may be useful to stroke every 1000 cells in case you are drawing a massive grid. Otherwise you should call stroke in EndDraw.
- Parameters
| rect | IN The rectangle bounds of the cell. |
| position | IN The cell number. |
| virtual void IDrawCJKGrid::DrawOpenCell | ( | const PMRect & | rect, | | | int32 & | position | | ) | | const |
| pure virtual |
DrawOpenCell is called by the grid manager's optimized grid drawing code. Your implementation can draw one open cell any way you like it. It's best not to stroke the graphics port everytime. It however, may be useful to stroke every 1000 cells in case you are drawing a massive grid. Otherwise you should call stroke in EndDraw.
- Parameters
| rect | IN The rectangle bounds of the cell. |
| position | IN The cell number. |
| virtual void IDrawCJKGrid::EndDraw | ( | int32 & | position | ) | const |
| pure virtual |
EndDraw is called after the last call to DrawOpenCell or DrawFilledCell.
- Parameters
| position | IN The last cell drawn. |
- Precondition
- You probably need to call stroke if position is > 0.
| virtual PMRect IDrawCJKGrid::GetPaintedBBox | ( | const IShape * | iShape, | | | const PMRect & | itemBounds, | | | const PMMatrix & | innertoview | | ) | | const |
| pure virtual |
GetPaintedBBox returns the rect of the grid in view coordinates. This most likely is just itemBounds, but in the event you wish the grid to extend beyond itemBounds, you need to return the extra area.
- Parameters
| iShape | IN The shape the grid is drawing on. |
| itemBounds | IN The items current bounds in view coordinates. |
| innertoview | IN InnerToView transform matrix. |
| virtual void IDrawCJKGrid::Inval | ( | IShape * | iShape, | | | const GraphicsData * | gd, | | | const ClassID | reasonForInval, | | | const int32 | flags | | ) | | const |
| pure virtual |
Inval, like it's namesake on IAdornmentShape is provided for completeness.
When the owning shape is invalidated it includes the adornment in it's bounding box. Under most circumstances the implemenation needs to do nothing in its inval method. There are times, however, when specific page items will get a specific reasonFoInval, and your implementation may want to know about that inval. This provides a mechanism to respond to such an event.
- Parameters
| iShape | IN The shape the grid is drawing on. |
| gd | IN The GraphicsData you are drawing into. |
| reasonForInval | IN Why we are invalidating. |
| flags | IN The drawing flags this shape is drawing with. |