#ifndef _C2RW_GUI_H_
#define _C2RW_GUI_H_

#include "c2rw.h"

BYTE qs2rs(BYTE qs);                    // convertation: quad sector to real sector
BYTE qs2trailer(BYTE qs);               // convertation: quad sector to blk-trailer
BYTE rs2sblk(BYTE rs);                  // convertation: real sector to start block
BYTE rs2trailer(BYTE rs);               // convertation: real sector to blk-trailer
BYTE blk2rs(BYTE blk);                  // convertation: block to real sector
BOOL istrailer(BYTE blk);               // trailer check
BOOL blkstate(BYTE blk);                // block state: en or di
BOOL get_rsstate(BYTE blk);             // real sector state: en or di
void set_blkstate(BYTE blk, BOOL en);   // set new state to block
BOOL get_pgstate(BYTE pg);              // page state: en or di
void set_pgstate(BYTE pg, BOOL en);     // set new state to page

BOOL CenterWindow(HWND hwndChild, HWND hwndParent);
int dlg4err(DWORD nres_cap, DWORD nres1_msg, DWORD nres2_msg, DWORD boxflg);

void gui_setmenuicon(DWORD nres, DWORD mnu);
BOOL gui_gethex(DWORD nres, DWORD buflen, PBYTE buf);

void gui_setmenucheck(DWORD nres, BOOL chk);
BOOL gui_getmenucheck(DWORD nres);
void gui_setmenuicon(DWORD nres, DWORD mnu);

void gui_stbar(LPTSTR szText);
void gui_res2stbar(DWORD nres);
void gui_ok2stbar(void);

void gui_upzero(void);
BOOL gui_getzero(void);
void gui_settp(void);
BYTE gui_gettp(void);
void gui_setqs(void);
BYTE gui_getqs(void);
void gui_dupkeyA(void);
void gui_dupkeyB(void);
void gui_setdata(void);
BOOL gui_getall(DWORD flg);
void gui_disen(BOOL eidi);
void gui_uidfix(void);
void initrc(void);

#endif  // _C2RW_GUI_H_
