Class MfCmdCreateRegion
- java.lang.Object
-
- org.pentaho.reporting.libraries.pixie.wmf.records.MfCmd
-
- org.pentaho.reporting.libraries.pixie.wmf.records.MfCmdCreateRegion
-
public class MfCmdCreateRegion extends MfCmd
Currently i have no clue, how this is implemented. From The WINE-Sources:The layout of the record looks something like this: rdParm meaning 0 Always 0? 1 Always 6? 2 Looks like a handle? - not constant 3 0 or 1 ?? 4 Total number of bytes 5 No. of separate bands = n [see below] 6 Largest number of x co-ords in a band 7-10 Bounding box x1 y1 x2 y2 11-... n bands Regions are divided into bands that are uniform in the y-direction. Each band consists of pairs of on/off x-coords and is written as m y0 y1 x1 x2 x3 ... xm m into successive rdParm[]s. This is probably just a dump of the internal RGNOBJ?
static BOOL MF_Play_MetaCreateRegion( METARECORD *mr, HRGN hrgn ) { WORD band, pair; WORD *start, *end; INT16 y0, y1; HRGN hrgn2 = CreateRectRgn( 0, 0, 0, 0 ); for(band = 0, start = &(mr->rdParm[11]); band < mr->rdParm[5]; band++, start = end + 1) { if(*start / 2 != (*start + 1) / 2) { WARN("Delimiter not even.\n"); DeleteObject( hrgn2 ); return FALSE; } end = start + *start + 3; if(end > (WORD *)mr + mr->rdSize) { WARN("End points outside record.\n"); DeleteObject( hrgn2 ); return FALSE; } if(*start != *end) { WARN("Mismatched delimiters.\n"); DeleteObject( hrgn2 ); return FALSE; } y0 = *(INT16 *)(start + 1); y1 = *(INT16 *)(start + 2); for(pair = 0; pair < *start / 2; pair++) { SetRectRgn( hrgn2, *(INT16 *)(start + 3 + 2*pair), y0, (INT16 *)(start + 4 + 2*pair), y1 ); CombineRgn(hrgn, hrgn, hrgn2, RGN_OR); } } DeleteObject( hrgn2 ); return TRUE; }
-
-
Constructor Summary
Constructors Constructor Description MfCmdCreateRegion()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getFunction()
Reads the function identifier.MfCmd
getInstance()
Creates a empty unintialized copy of this command implementation.MfRecord
getRecord()
Writer functionRectangle[]
getRects()
int
getRegionHeight()
int
getRegionWidth()
int
getRegionX()
int
getRegionY()
void
replay(WmfFile file)
Replays the command on the given WmfFile.protected void
scaleXChanged()
A callback function to inform the object, that the x scale has changed and the internal coordinate values have to be adjusted.protected void
scaleYChanged()
A callback function to inform the object, that the y scale has changed and the internal coordinate values have to be adjusted.void
setRecord(MfRecord record)
Reads the command data from the given record and adjusts the internal parameters according to the data parsed.void
setRects(Rectangle[] rects)
void
setRegionHeight(int regionHeight)
void
setRegionWidth(int regionWidth)
void
setRegionX(int regionX)
void
setRegionY(int regionY)
String
toString()
-
Methods inherited from class org.pentaho.reporting.libraries.pixie.wmf.records.MfCmd
applyScaleX, applyScaleY, getScaledHeight, getScaledWidth, getScaledX, getScaledY, scaleRect, setScale
-
-
-
-
Method Detail
-
setRecord
public void setRecord(MfRecord record)
Description copied from class:MfCmd
Reads the command data from the given record and adjusts the internal parameters according to the data parsed. After the raw record was read from the datasource, the record is parsed by the concrete implementation.
-
getRecord
public MfRecord getRecord()
Writer function
-
getFunction
public int getFunction()
Description copied from class:MfCmd
Reads the function identifier. Every record type is identified by a function number corresponding to one of the Windows GDI functions used.- Specified by:
getFunction
in classMfCmd
- Returns:
- the function identifier.
-
replay
public void replay(WmfFile file)
Description copied from class:MfCmd
Replays the command on the given WmfFile.
-
getInstance
public MfCmd getInstance()
Description copied from class:MfCmd
Creates a empty unintialized copy of this command implementation.- Specified by:
getInstance
in classMfCmd
- Returns:
- a new instance of the command.
-
scaleXChanged
protected void scaleXChanged()
Description copied from class:MfCmd
A callback function to inform the object, that the x scale has changed and the internal coordinate values have to be adjusted.- Specified by:
scaleXChanged
in classMfCmd
-
scaleYChanged
protected void scaleYChanged()
Description copied from class:MfCmd
A callback function to inform the object, that the y scale has changed and the internal coordinate values have to be adjusted.- Specified by:
scaleYChanged
in classMfCmd
-
getRegionX
public int getRegionX()
-
setRegionX
public void setRegionX(int regionX)
-
getRegionY
public int getRegionY()
-
setRegionY
public void setRegionY(int regionY)
-
getRegionWidth
public int getRegionWidth()
-
setRegionWidth
public void setRegionWidth(int regionWidth)
-
getRegionHeight
public int getRegionHeight()
-
setRegionHeight
public void setRegionHeight(int regionHeight)
-
getRects
public Rectangle[] getRects()
-
setRects
public void setRects(Rectangle[] rects)
-
-