Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "mfcpch.h"
00021 #include <stdlib.h>
00022 #ifdef __UNIX__
00023 #include <assert.h>
00024 #endif
00025 #include "scanutils.h"
00026 #include "fileerr.h"
00027 #include "blread.h"
00028
00029 #define UNLV_EXT ".uzn" // unlv zone file
00030
00031
00032
00033
00034
00035
00036
00037 bool read_unlv_file(
00038 STRING name,
00039 inT32 xsize,
00040 inT32 ysize,
00041 BLOCK_LIST *blocks
00042 ) {
00043 FILE *pdfp;
00044 BLOCK *block;
00045 int x;
00046 int y;
00047 int width;
00048 int height;
00049 BLOCK_IT block_it = blocks;
00050
00051 name += UNLV_EXT;
00052 if ((pdfp = fopen (name.string (), "rb")) == NULL) {
00053 return false;
00054 }
00055 else {
00056 while (fscanf (pdfp, "%d %d %d %d %*s", &x, &y, &width, &height) >= 4) {
00057
00058 block = new BLOCK (name.string (), TRUE, 0, 0,
00059 (inT16) x, (inT16) (ysize - y - height),
00060 (inT16) (x + width), (inT16) (ysize - y));
00061
00062 block_it.add_to_end (block);
00063 }
00064 fclose(pdfp);
00065 }
00066 return true;
00067 }
00068
00069 void FullPageBlock(int width, int height, BLOCK_LIST *blocks) {
00070 BLOCK_IT block_it(blocks);
00071 BLOCK* block = new BLOCK("", TRUE, 0, 0, 0, 0, width, height);
00072 block_it.add_to_end(block);
00073 }