#ifndef YSGUIMDL
#define YSGUIMDL




/* Following Functions should be called by GUI-PARTS directly */

/* YsAbort.c */
int	YsAbortGuiLoop();
int	YsExitProgram();




/* Following Functions should be called by Application Program */

/* YsSelect.c */
int YsSelectPanelSingle(int ba,int *ret,char *av[],char *ms,char *y,char *n);
int YsSelectPanelPararel(int ba,int ret[],char *av[],char *ms,char *y,char *n);
/*
 ba    : Base Object Id 
 ret   : Return Value Pointer
 av    : Argunets (should be terminated with NULL)
 ms    : Information Message
 y     : Message on Yes Button
 n     : Message on No Button
*/


/* YsQue.c */
int YsYesNoQuestion(int basobj,char *msg,char *yesbtn,char *nobtn);
int YsConfirm(int basobj,char *msg,char *btn);
int YsConfirm3(int bas,char *msg[3],char *btn);
int YsConfPrintf(int bas,const char *fom, ... );
/*
 basobj: Base Object Id
 msg   : Information Message
 yesbtn: Message On Yes Button
 nobtn : Message On No Button
 btn   : Message On Confirm Button

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.
*/



/* YsRepaint.c */
void YsRepaintWindow(int WinId);
void YsRepaintWindowUserArea(int WinId);
/*
 WinId : Id Of Window to repaint
*/

void YsExecAlertObj(int alertObj,int basobj);
/*
alertObj : alert object-ID to EXEC
basobj   : base Object -ID to ATTACH
*/


/* YsAbout.c */
void YsSetIntroTitle(char *title);
void YsSetIntroName(char *name);
void YsSetIntro3Lines(char *str[3]);
void YsIntroMessage(int basobj,int colmod);
/*
 title : Program Title
 name  : Author Name
 str[3]: String for more information(NULL available)

 basobj: Base Object Id
 colmod: 16Colors→0  256Color→1  32KColors→2
*/


/* YsPoint3.c */
int YsInputPoint3(int bas,int pnt[3],char *ms,int mn,int mx);
int YsInputPointAngle3(int bas,int pos[6],char *ms,int mn,int mx);
/*
 bas   : Base Object Id
 pt    : Return Pointer for DPOINT
 an    : Return Pointer for DANGLE
 ms    : Information Message(NULL is available.)
 mn    : Minimum Point Value
 mx    : Maximum Point Value

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.
*/



/* YsPoint2.c */
int YsInputPoint2(int bas,int *x,int *y,char *mes,int pntmin,int pntmax);
/*
 bas   : Base Object Id
 x     : Return Pointer for x
 y     : Return Pointer for y
 mes   : Information Message
 pntmin: Minimum Point Value
 pntmax: Maximum Point Value

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.
*/




/* YsIntInp.c */
int YsIntInputPanel
        (int bs,int *nm,int df,int mn,int mx,char *ms,char *y,char *n);
/*
 bs    : Base Object Id
 nm    : Return Value
 df    : Default Value
 mn    : Minimum Value
 mx    : Maximum Value
 ms    : Information Message
 y     : Message on Yes Button
 n     : Message on No Button

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.
*/




/* YsIcon.c */
int YsAllocIconTable(int *num,unsigned char *icndat);
/*
 num    : Return Value Pointer for Icon Number
 icndat : ICON Data (Should Be Static : See Reference MMI_SetIconTable)

 Return
 YSTRUE : Successed To Allocate
 YSFALSE: Failed To Allocate
*/

int YsFreeIconTable(int num);
/*
 num    : ICON Number

 Return
 YSTRUE : Successed
 YSFALSE: ICON[num] was not used
*/



/* YsFdlg.c
  YsFileSelect
    bas   : ファイルセレクタを接続するベースオブジェクト
    ful   : 復帰情報
    def   : 入力がなかったときのデフォルトのファイル名
    tit   : タイトル(NULL可)
    y     : 確定メッセージ(NULL可)
    n     : 取消メッセージ(NULL可)
	ext   : 拡張子(最終的に自動的にこの拡張子を付加します)

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.
*/
int YsFileSelect
		(int bas,char *ful,char *def,char *tit,char *y,char *n,char *ext);



/*
  YsParaFileSelect
    bas   : ファイルセレクタを接続するベースオブジェクト
	def   : デフォルトパス
	nf    : 選択数を返すポインタ
    tit   : タイトル(NULL可)
    y     : 確定メッセージ(NULL可)
    n     : 取消メッセージ(NULL可)
	ext   : 拡張子(最終的に自動的にこの拡張子を付加します)

 Return
   YSYES   if a user clicked YES button.
   YSNO    if a user clicked NO button.


  YsParaFileGetPathName
    ful   : パス名を格納する領域のポインタ
    n     : パスの通し番号

  return
    YSTRUE : 正常終了
    YSFALSE: だめだった
*/
int YsParaFileSelect
	(int bas,char *path,int *nf,char *tit,char *y,char *n,char *ext);
int YsParaFileGetPathName(char *ful,int n);



/*
  YsExtractFont
	*lx   : Input & Output.  String Bitmap Width  (Not Font Width)
	*ly   : Input & Output.  String Bitmap Height (Not Font Height)
	*bmSiz: Output Bitmap Size (N bytes)
    bmp   : Output Bitmap Pattern
    fnt   : Font ID
    atr   : Font Attribute
	str   : String

  Return
    YSTRUE  Successed to Extract
    YSFALSE Failed to Extract

  注意:
    FNT_init  FNT_end  FNT_setMemoryFunc等は,ユーザーアプリがやること.
*/
int YsExtractFont
	(int *lx,int *ly,int *bms,unsigned char **bmp,int fnt,int atr,char *str);


/*
  YsSetInputStringPosition
    x     : X Coordinate
    y     : Y Coordinate
  YsInputString
    basobj: Base Object Id
    str   : return string (should be more than 256 bytes of arrays.)
*/
int YsSetInputStringPosition(int x,int y);
int YsInputString(int basobj,char *str,char *dflt);


/*
  YsFindButtonNumber
    num   : Return Value
    kobj  : Key Object (First Argument of any function called by GUI-LIB)
    nId   : The Number of Possible Button Id List
    idLst : Possible Id List */
int YsFindButtonNumber(int *num,int kobj,int nId,int *idLst);


/*
  YsPrintSimpleMessage
  YsEraseSipmleMessage 
    bas   :  Base Object ID
    fom   :  Format            */
void YsPrintSimpleMessage(int bas,char *fom, ... );
void YsEraseSimpleMessage();

#endif /* #ifndef YSGUIMDL */
