home *** CD-ROM | disk | FTP | other *** search
/ Phoenix Heaven Sunny 2 / APPARE2.BIN / oh_towns / art2 / src.lzh / IMAGEWIN.H < prev    next >
C/C++ Source or Header  |  1995-06-18  |  4KB  |  110 lines

  1. #ifndef    HEADER_IMWIN
  2. #define    HEADER_IMWIN
  3.  
  4. #include "pic.h"
  5. #include "screen.h"
  6. #include "fifo.h"
  7.  
  8.   /* 画像ウィンドウ */
  9.  
  10. #define    IMAGEWIN_TITLE    129
  11.  
  12.     typedef struct _imw {
  13.         struct _imw    *next;
  14.           /* 各部品ID */
  15.             int            win;            /* ウィンドウ部品の */
  16.             int            sbar_h;
  17.             int            sbar_v;
  18.             // int            btn;            /* 描画領域用ボタン */
  19.             int            erasebtn;
  20.             int            titlebar;
  21.             int            titlemsg;
  22.         char        title[IMAGEWIN_TITLE+1];
  23.         char        fname[_MAX_PATH];
  24.         PIC            *pic;
  25.         SCRBITMAP    bm;                // 画面出力用ビットマップ
  26.         int            zoom;            // 拡大率
  27.         BOOL        fBoxRubber;
  28.         FRAME        frBoxRubber;    // BOXラバーの PIC 領域(x,y,wid,ht)
  29.         BOOL        fBoxRubber2;
  30.         FRAME        frBoxRubber2;    // BOXラバー2
  31.         BOOL        fLineRubber;
  32.         LIST*        listLineRubber;
  33.         BOOL        fLineRubber2;
  34.         LIST*        listLineRubber2;
  35.     } IMWIN;
  36.  
  37.   // モジュール初期化
  38.     int imagewin_init(void);
  39.  
  40.   // 生成・消滅
  41.     IMWIN *imagewin_new(int pixelsize,int width, int height);
  42.     void imagewin_destroy(IMWIN *win);
  43.  
  44.   // リンク関連
  45.     IMWIN *imagewin_getfirst(void);
  46.     IMWIN *imagewin_getnext(void);
  47.     void imagewin_link(IMWIN *win);
  48.     void imagewin_unlink(IMWIN *win);
  49.     void imagewin_show(IMWIN *win);
  50.     IMWIN *imagewin_getWinFromPart(int objId);
  51.         // オブジェクトIDからウィンドウを検索する
  52.     IMWIN *imagewin_getCurrentWin(void);
  53.     void imagewin_setCurrentWin(IMWIN *win);
  54.  
  55.   // 座標変換
  56.     void imagewin_getScrFrame(IMWIN *win, FRAME *frPic, FRAME *frBitmap);
  57.         // PIC領域(x,y,wid,ht)から、SCRBITMAP領域(x,y,wid,ht)へと変換
  58.     void imagewin_getDispFrame(IMWIN *win,FRAME* frPic);
  59.         // ウィンドウのユーザー領域を、表示画像の PIC 領域(x,y,wid,ht)に変換
  60.     void imagewin_getPosFromMos(IMWIN *win, POINT *mos, POINT *pos);
  61.         // 画面上のマウス座標から、画像内での位置を得る
  62.     BOOL imagewin_PtInPic(IMWIN* win, POINT* pt);
  63.         // 画面座標 pt がウィンドウ内の画像領域にあるかどうか
  64.  
  65.   // 表示内容更新
  66.     void imagewin_updateBuf(IMWIN *win);
  67.         // PIC内容から、SCRBITMAP全体を再生成する
  68.     void imagewin_updateScr(IMWIN *win);
  69.         // SCRBITMAPの内容を画面に表示。同時にラバー描画も行う
  70.     void imagewin_updateScrPart(IMWIN *win, FRAME *updatefr);
  71.         // PIC領域 updatefr に対応する SCRBITMAP / 画面を更新する
  72.  
  73.   // ラバー制御
  74.     void imagewin_setBoxRubber(IMWIN* win, FRAME *fr);
  75.         // fr : PIC領域(x,y,wid,ht)
  76.     void imagewin_setBoxRubber2(IMWIN* win, FRAME *fr);
  77.     void imagewin_clearBoxRubber(IMWIN* win);
  78.     void imagewin_clearBoxRubber2(IMWIN* win);
  79.     void imagewin_resetLineRubber(IMWIN* win);
  80.     void imagewin_addLineRubber(IMWIN* win,POINT* p1,POINT* p2);
  81.         // p1,p2 : PIC 座標   p2 が NULL のとき、リストの最初の点とむすぶ
  82.     int imagewin_nLineRubber(IMWIN* win);
  83.     void imagewin_clearLineRubber(IMWIN* win);
  84.     void imagewin_resetLineRubber2(IMWIN* win);
  85.     void imagewin_addLineRubber2(IMWIN* win,POINT* p1,POINT* p2);
  86.         // p1,p2 : PIC 座標   p2 が NULL のとき、リストの最初の点とむすぶ
  87.     int imagewin_nLineRubber2(IMWIN* win);
  88.     void imagewin_clearLineRubber2(IMWIN* win);
  89.  
  90.   // リサイズ処理
  91.     int imagewin_resize(IMWIN *win, BOOL fRedraw);
  92.         // 子ウィンドウの再配置
  93.     void imagewin_setZoom(IMWIN *win, int zoom);
  94.     void imagewin_updateTitle(IMWIN *win, BOOL fShow);
  95.     void imagewin_setFileName(IMWIN *win, char *fname, BOOL fShow);
  96.  
  97.   // 画像編集
  98.     void imagewin_storeUndo(IMWIN* win);
  99.     void imagewin_recoverUndo(void);
  100.     void imagewin_copy(IMWIN* srcwin,FRAME* frSrc,
  101.                        IMWIN* destwin,POINT *ptDest);
  102.         // frSrc:PIC領域(x,y,wid,ht)
  103.         // ptDest:PIC座標
  104.     void imagewin_copyarea(IMWIN* srcwin,AREA areaSrc,
  105.                            IMWIN* destwin,POINT *ptDest);
  106.  
  107. #define    BAR_SIZE    16
  108.  
  109. #endif    HEADER_IMWIN
  110.