Class 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 Detail

      • MfCmdCreateRegion

        public MfCmdCreateRegion()
    • 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.

        Specified by:
        setRecord in class MfCmd
        Parameters:
        record - the raw data that makes up the record.
      • getRecord

        public MfRecord getRecord()
        Writer function
        Specified by:
        getRecord in class MfCmd
        Returns:
        the created record.
      • 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 class MfCmd
        Returns:
        the function identifier.
      • replay

        public void replay​(WmfFile file)
        Description copied from class: MfCmd
        Replays the command on the given WmfFile.
        Specified by:
        replay in class MfCmd
        Parameters:
        file - the meta file.
      • getInstance

        public MfCmd getInstance()
        Description copied from class: MfCmd
        Creates a empty unintialized copy of this command implementation.
        Specified by:
        getInstance in class MfCmd
        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 class MfCmd
      • 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 class MfCmd
      • 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)
      • setRects

        public void setRects​(Rectangle[] rects)