Example #1
0
void _wpolygon_rgn(
/*****************/

    int                 fill_type,
    int                 num_pts,
    wcoord              *pts,
    BOOL                rgn_on
) {
    HPEN                pen;
    HBRUSH              brush;
    WPI_POINT           *p_pts;
    int                 i;

    _new( p_pts, num_pts );

    for( i = 0; i < num_pts; ++i ) {
        /* assumption: sizeof(int)==sizeof(short) */
        convert_pt( pts[i].xcoord, pts[i].ycoord,
                    (int *) &p_pts[i].x, (int *) &p_pts[i].y );
    }

    get_obj_settings( fill_type, &pen, &brush );

    _wpi_polygon( Win_dc, p_pts, num_pts );

    if( rgn_on ) {
        rgn_polygon( p_pts, num_pts );
    }

    del_obj_settings( fill_type, pen, brush );

    _free( p_pts );
}
Example #2
0
Bool
apc_region_create( Handle self, PRegionRec rec)
{
	switch( rec-> type ) {
	case rgnEmpty:
		return rgn_empty(self);
	case rgnRectangle:
		return rgn_rect(self, rec->data.box);
	case rgnPolygon:
		return rgn_polygon(self, &rec->data.polygon);
	case rgnImage:
		return rgn_image(self, rec->data.image);
	default:
		return false;
	}
}
Example #3
0
void wrgn_polygon(
/****************/

    int                 num_pts,
    wcoord              *pts
) {
    WPI_POINT           *p_pts;
    int                 i;

    _new( p_pts, num_pts );

    for( i = 0; i < num_pts; ++i ) {
        /* assumption: sizeof(int)==sizeof(short) */
        convert_pt( pts[i].xcoord, pts[i].ycoord,
                    (int *) &p_pts[i].x, (int *) &p_pts[i].y );
    }

    rgn_polygon( p_pts, num_pts );

    _free( p_pts );
}