#include <stdio.h>
#include <stdlib.h>
#include <winb.h>
#include <te.h>
#include <fntb.h>
#include <gui.h>

extern int	idBackDialog ;
extern int	MJ_BASEOBJ ;
extern int	idDesktopSelectiveHyper ;
extern int	idDesktopWinAttachHyper ;
extern int	idDesktopToolAttachHyper ;
extern int	idDesktopDialog ;
extern int	idDesktopMenu ;
extern int	idDesktopMItem_System ;
extern int	idDesktopSystemMenu ;
extern int	idDesktopSystemMenuItem[3] ;
extern int	DesktopSystemAboutFunc() ;
extern int	DesktopExitFunc() ;
extern int	idDesktopMItem_file ;
extern int	idDesktopFileMenu ;
extern int	idDesktopFileMItem[8] ;
extern int	idDesktopLoadImageMenu ;
extern int	idDesktopLoadImageMItem[4] ;
extern int	DesktopFileLoadImageFunc() ;
extern int	idDesktopSaveImageMenu ;
extern int	idDesktopSaveImageMItem[2] ;
extern int	DesktopFileSaveImageFunc() ;
extern int	DesktopLoadPointsFunc() ;
extern int	DesktopSavePointsFunc() ;
extern int	DesktopClearPointsFunc() ;
extern int	DesktopMovSaveFunc() ;
extern int	DesktopMovPlayFunc() ;
extern int	idDesktopMItem_make ;
extern int	idDesktopMakeMenu ;
extern int	idDesktopMakeMItem[4] ;
extern int	DesktopMakeMorphFunc() ;
extern int	DesktopMakeTransformFunc() ;
extern int	DesktopMoviePlayFunc() ;
extern int	idDesktopExitIcon ;
extern int	idDesktopClockMsg ;
extern int	idDesktopAlertHyper ;
extern int	idDesktopSkbIcon ;
extern int	DesktopSkbFunc() ;

#define ALIGN	4
#define OFFSET(type) (sizeof(MMIPACKET) + (sizeof(type)+ALIGN-1)/ALIGN*ALIGN)

/*	MMI_init 用データ	*/

/*	ヘッダ	*/

MMIINIT	initDataZDESKTOP = { "MmiInit",  39, 0 } ;

/* idBackDialog */

static MMIPACKET d001 = {	&idBackDialog,
							&MJ_BASEOBJ,
							&MJ_DIALOGL40,
							OFFSET(DIALOGL40),
							MS_NONE
						} ;
static DIALOGL40	d001d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_FIXEDL40,
							   0,   0, 639, 479, 9, 7, 0,
							MS_NONEL40,
							NULL,   0,   0
						} ;

/* idDesktopSelectiveHyper */

static MMIPACKET d002 = {	&idDesktopSelectiveHyper,
							&idBackDialog,
							&MJ_HYPER,
							OFFSET(HYPER),
							MS_NONE
						} ;
static HYPER	d002d = {	MS_NONEL40,
							   0,   0,   5,   5, 0, 0, 0,
							MS_NONEL40,
						} ;

/* idDesktopWinAttachHyper */

static MMIPACKET d003 = {	&idDesktopWinAttachHyper,
							&idDesktopSelectiveHyper,
							&MJ_HYPER,
							OFFSET(HYPER),
							MS_NONE
						} ;
static HYPER	d003d = {	MS_NONEL40,
							   0,   0,   5,   5, 0, 0, 0,
							MS_NONEL40,
						} ;

/* idDesktopToolAttachHyper */

static MMIPACKET d004 = {	&idDesktopToolAttachHyper,
							&idDesktopSelectiveHyper,
							&MJ_HYPER,
							OFFSET(HYPER),
							MS_NONE
						} ;
static HYPER	d004d = {	MS_NONEL40,
							   0,   0,   5,   5, 0, 0, 0,
							MS_NONEL40,
						} ;

/* idDesktopDialog */

static MMIPACKET d005 = {	&idDesktopDialog,
							&idDesktopSelectiveHyper,
							&MJ_DIALOGL40,
							OFFSET(DIALOGL40),
							MS_NONE
						} ;
static DIALOGL40	d005d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_FIXEDL40,
							   0,   0, 639,  19, 0, 4, 0,
							MS_NONEL40,
							NULL,   0,   0
						} ;

/* idDesktopMenu */

static MMIPACKET d006 = {	&idDesktopMenu,
							&idDesktopDialog,
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d006d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40 | MS_HORIL40,
							   0,   0, 389,  19, 0, 4, 0,
							MS_NONEL40,
							NULL,   0
						} ;

/* idDesktopMItem_System */

static MMIPACKET d007 = {	&idDesktopMItem_System,
							&idDesktopMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d007d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							   0,   0,  92,  19, 6, 6, 8,
							MS_PANELL40,
							0,
							0x0000, 517,
							"          ",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopSystemMenu */

static MMIPACKET d008 = {	&idDesktopSystemMenu,
							&idDesktopMItem_System,
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d008d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40,
							   0,  27, 132, 210,15, 6, 0,
							MS_UFRAMEL40 | MS_FRAMEL40,
							NULL,   0
						} ;

/* idDesktopSystemMenuItem[0] */

static MMIPACKET d009 = {	&idDesktopSystemMenuItem[0],
							&idDesktopSystemMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d009d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							   1,  28, 129,  43, 8, 6, 8,
							MS_NONEL40,
							DesktopSystemAboutFunc,
							0x0000,  -1,
							"DolphMorph について...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopSystemMenuItem[1] */

static MMIPACKET d010 = {	&idDesktopSystemMenuItem[1],
							&idDesktopSystemMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d010d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							   4,  48, 115,  63, 8, 6, 8,
							MS_NONEL40,
							0,
							0x0000,  -1,
							NULL,
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopSystemMenuItem[2] */

static MMIPACKET d011 = {	&idDesktopSystemMenuItem[2],
							&idDesktopSystemMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d011d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							   8,  79, 119,  94, 8, 6, 8,
							MS_NONEL40,
							DesktopExitFunc,
							0x0000,  -1,
							"終了",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMItem_file */

static MMIPACKET d012 = {	&idDesktopMItem_file,
							&idDesktopMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d012d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 105,   0, 183,  19,12, 6, 8,
							MS_PANELL40,
							0,
							0x0000,  -1,
							"ファイル",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMenu */

static MMIPACKET d013 = {	&idDesktopFileMenu,
							&idDesktopMItem_file,
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d013d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40,
							 139,  26, 288, 199, 8, 6, 8,
							MS_UFRAMEL40 | MS_FRAMEL40,
							NULL,   0
						} ;

/* idDesktopFileMItem[0] */

static MMIPACKET d014 = {	&idDesktopFileMItem[0],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d014d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140,  27, 286,  42, 8, 6, 8,
							MS_NONEL40,
							0,
							0x0000,  -1,
							"静止画(TIFF)読み込み",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopLoadImageMenu */

static MMIPACKET d015 = {	&idDesktopLoadImageMenu,
							&idDesktopFileMItem[0],
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d015d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40,
							 139, 212, 351, 279, 8, 6, 8,
							MS_UFRAMEL40 | MS_FRAMEL40,
							NULL,   0
						} ;

/* idDesktopLoadImageMItem[0] */

static MMIPACKET d016 = {	&idDesktopLoadImageMItem[0],
							&idDesktopLoadImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d016d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 213, 322, 228, 8, 6, 8,
							MS_NONEL40,
							DesktopFileLoadImageFunc,
							0x0000,  -1,
							"操作点設定ウィンドウ(Ａ側)へ...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopLoadImageMItem[1] */

static MMIPACKET d017 = {	&idDesktopLoadImageMItem[1],
							&idDesktopLoadImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d017d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 228, 322, 243, 8, 6, 8,
							MS_NONEL40,
							DesktopFileLoadImageFunc,
							0x0000,  -1,
							"操作点設定ウィンドウ(Ｂ側)へ...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopLoadImageMItem[2] */

static MMIPACKET d018 = {	&idDesktopLoadImageMItem[2],
							&idDesktopLoadImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d018d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 244, 229, 259, 8, 6, 8,
							MS_NONEL40,
							DesktopFileLoadImageFunc,
							0x0000,  -1,
							"静止画倉庫へ...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopLoadImageMItem[3] */

static MMIPACKET d019 = {	&idDesktopLoadImageMItem[3],
							&idDesktopLoadImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d019d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 259, 232, 274, 8, 6, 8,
							MS_NONEL40,
							DesktopFileLoadImageFunc,
							0x0000,  -1,
							"動画倉庫へ...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[1] */

static MMIPACKET d020 = {	&idDesktopFileMItem[1],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d020d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140,  44, 286,  59, 8, 6, 8,
							MS_NONEL40,
							0,
							0x0000,  -1,
							"静止画(TIFF)保存",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopSaveImageMenu */

static MMIPACKET d021 = {	&idDesktopSaveImageMenu,
							&idDesktopFileMItem[1],
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d021d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40,
							 139, 284, 352, 336, 8, 6, 8,
							MS_UFRAMEL40 | MS_FRAMEL40,
							NULL,   0
						} ;

/* idDesktopSaveImageMItem[0] */

static MMIPACKET d022 = {	&idDesktopSaveImageMItem[0],
							&idDesktopSaveImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d022d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 285, 281, 300, 8, 6, 8,
							MS_NONEL40,
							DesktopFileSaveImageFunc,
							0x0000,  -1,
							"マーク画像(1枚)を保存...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopSaveImageMItem[1] */

static MMIPACKET d023 = {	&idDesktopSaveImageMItem[1],
							&idDesktopSaveImageMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d023d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 143, 302, 312, 317, 8, 6, 8,
							MS_NONEL40,
							DesktopFileSaveImageFunc,
							0x0000,  -1,
							"動画倉庫(番号付けでTIFF化)...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[2] */

static MMIPACKET d024 = {	&idDesktopFileMItem[2],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d024d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140,  60, 254,  75, 8, 6, 8,
							MS_NONEL40,
							DesktopLoadPointsFunc,
							0x0000,  -1,
							"操作点読み込み...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[3] */

static MMIPACKET d025 = {	&idDesktopFileMItem[3],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d025d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140,  76, 236,  91, 8, 6, 8,
							MS_NONEL40,
							DesktopSavePointsFunc,
							0x0000,  -1,
							"操作点保存...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[4] */

static MMIPACKET d026 = {	&idDesktopFileMItem[4],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d026d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 141,  94, 288, 109, 8, 6, 8,
							MS_NONEL40,
							DesktopClearPointsFunc,
							0x0000,  -1,
							"操作点クリア",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[5] */

static MMIPACKET d027 = {	&idDesktopFileMItem[5],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d027d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 112, 287, 127, 8, 6, 8,
							MS_NONEL40,
							0,
							0x0000,  -1,
							NULL,
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[6] */

static MMIPACKET d028 = {	&idDesktopFileMItem[6],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d028d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 139, 133, 286, 148, 8, 6, 8,
							MS_NONEL40,
							DesktopMovSaveFunc,
							0x0000,  -1,
							"動画(MOV)保存...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopFileMItem[7] */

static MMIPACKET d029 = {	&idDesktopFileMItem[7],
							&idDesktopFileMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d029d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 140, 150, 287, 165, 8, 6, 8,
							MS_NONEL40,
							DesktopMovPlayFunc,
							0x0000,  -1,
							"動画(MOV)再生...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMItem_make */

static MMIPACKET d030 = {	&idDesktopMItem_make,
							&idDesktopMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d030d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 188,   0, 266,  19,12, 6, 8,
							MS_PANELL40,
							0,
							0x0000,  -1,
							"画像作成",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMakeMenu */

static MMIPACKET d031 = {	&idDesktopMakeMenu,
							&idDesktopMItem_make,
							&MJ_MENUL40,
							OFFSET(MENUL40),
							MS_NONE
						} ;
static MENUL40	d031d = 	{	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_SKEYL40 | MS_CHECKL40,
							 293,  28, 450, 201, 0, 6, 0,
							MS_UFRAMEL40 | MS_FRAMEL40,
							NULL,   0
						} ;

/* idDesktopMakeMItem[0] */

static MMIPACKET d032 = {	&idDesktopMakeMItem[0],
							&idDesktopMakeMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d032d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 303,  35, 401,  54, 8, 6, 8,
							MS_NONEL40,
							DesktopMakeMorphFunc,
							0x0000,  -1,
							"モーフィング...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMakeMItem[1] */

static MMIPACKET d033 = {	&idDesktopMakeMItem[1],
							&idDesktopMakeMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d033d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 300,  58, 398,  77, 8, 6, 8,
							MS_NONEL40,
							DesktopMakeTransformFunc,
							0x0000,  -1,
							"変形アニメ...",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMakeMItem[2] */

static MMIPACKET d034 = {	&idDesktopMakeMItem[2],
							&idDesktopMakeMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d034d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 300,  82, 398, 101, 8, 6, 8,
							MS_NONEL40,
							0,
							0x0000,  -1,
							NULL,
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopMakeMItem[3] */

static MMIPACKET d035 = {	&idDesktopMakeMItem[3],
							&idDesktopMakeMenu,
							&MJ_MITEML40,
							OFFSET(MITEML40),
							MS_NONE
						} ;
static MITEML40	d035d = {	MS_BTLEFTL40 | MS_EVMOSONL40 | MS_LEFTL40,
							 300, 108, 398, 127, 8, 6, 8,
							MS_NONEL40,
							DesktopMoviePlayFunc,
							0x0000,  -1,
							"動画倉庫を再生表示",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0,
							   0
						} ;

/* idDesktopExitIcon */

static MMIPACKET d036 = {	&idDesktopExitIcon,
							&idDesktopDialog,
							&MJ_ICONL40,
							OFFSET(ICONL40),
							MS_NONE
						} ;
static ICONL40	d036d = 	{	MS_BTLEFTL40 | MS_EVMOSOFFL40 | MS_EVKEYONL40 | MS_LEFTL40,
							 605,   0, 624,  19, 0, 6, 8,
							MS_PANELL40,
							DesktopExitFunc,
							0x0000, 290
						} ;

/* idDesktopClockMsg */

static MMIPACKET d037 = {	&idDesktopClockMsg,
							&idDesktopDialog,
							&MJ_MSGL40,
							OFFSET(MSGL40),
							MS_NONE
						} ;
static MSGL40	d037d = 	{	MS_LEFTL40 | MS_DSPONLYL40,
							 420,   0, 554,  19, 8, 4,15,
							MS_OPAQUEL40,
							"1994.07.27",
							   1,  12,  12,
							MS_NONEL40,
							   0,   0
						} ;

/* idDesktopAlertHyper */

static MMIPACKET d038 = {	&idDesktopAlertHyper,
							&idBackDialog,
							&MJ_HYPER,
							OFFSET(HYPER),
							MS_NONE
						} ;
static HYPER	d038d = {	MS_NONEL40,
							   0,   0,   5,   5, 0, 0, 0,
							MS_NONEL40,
						} ;

/* idDesktopSkbIcon */

static MMIPACKET d039 = {	&idDesktopSkbIcon,
							&idDesktopAlertHyper,
							&MJ_ICONL40,
							0,
							MS_NONE
						} ;
static ICONL40	d039d = 	{	MS_BTLEFTL40 | MS_EVMOSOFFL40 | MS_EVKEYONL40 | MS_LEFTL40,
							 573,   0, 592,  19, 8, 6, 8,
							MS_PANELL40,
							DesktopSkbFunc,
							0x0000, 292
						} ;

