2025-06-27 00:32:57 +08:00
|
|
|
|
#ifndef MYWIN_TOUCH_H__
|
|
|
|
|
|
#define MYWIN_TOUCH_H__
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>崥<EFBFBD><E5B4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#define TOUCH_NUM 20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
|
|
|
|
|
POINT_Struct start;
|
|
|
|
|
|
POINT_Struct route[TOUCH_NUM];
|
|
|
|
|
|
POINT_Struct end;
|
|
|
|
|
|
int route_num;
|
|
|
|
|
|
int down;
|
|
|
|
|
|
}TouchRouteStruct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_SLIDE_NONE 0x00000000
|
|
|
|
|
|
#define TOUCH_SLIDE_LEFT 0x00000001
|
|
|
|
|
|
#define TOUCH_SLIDE_RIGHT 0x00000002
|
|
|
|
|
|
#define TOUCH_SLIDE_UP 0x00000003
|
|
|
|
|
|
#define TOUCH_SLIDE_DOWN 0x00000004
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>Ϣ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#define TOUCH_CHILD_MOV_START 0x00000003
|
|
|
|
|
|
#define TOUCH_CHILD_MOV_END 0x00000004
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct _WIN_TouchWinStruct;
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ش<EFBFBD><D8B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
typedef struct
|
|
|
|
|
|
{
|
2025-07-05 19:47:28 +08:00
|
|
|
|
RECT_Struct start;//<2F><>ʼ<EFBFBD>㷶Χ<E3B7B6><CEA7><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Χ<EFBFBD>ڰ<EFBFBD><DAB0>²<EFBFBD><C2B2><EFBFBD>Ч
|
|
|
|
|
|
int slide; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>
|
|
|
|
|
|
int dis; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD><EBA3AC><EFBFBD><EFBFBD><EFBFBD>˾<EFBFBD><CBBE><EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>ʹ<EFBFBD>ɿ<EFBFBD><C9BF><EFBFBD>ĻҲ<C4BB>Զ<EFBFBD><D4B6><EFBFBD>ȫ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4>ڵĺ<DAB5><C4BA><EFBFBD>ָ<EFBFBD><D6B8>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
struct _WIN_TouchWinStruct *(*creat)(struct _WIN_TouchWinStruct *);
|
|
|
|
|
|
}TouchConditionStruct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_CON_DOWN_INIT(w,h,creat_) \
|
|
|
|
|
|
{\
|
|
|
|
|
|
.start.x=0,\
|
|
|
|
|
|
.start.y=0,\
|
|
|
|
|
|
.start.x_size=w,\
|
|
|
|
|
|
.start.y_size=10,\
|
|
|
|
|
|
.slide=TOUCH_SLIDE_DOWN,\
|
|
|
|
|
|
.dis=(h)/4,\
|
|
|
|
|
|
.creat=creat_,\
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_CON_UP_INIT(w,h,creat_) \
|
|
|
|
|
|
{\
|
|
|
|
|
|
.start.x=0,\
|
|
|
|
|
|
.start.y=(h)-10,\
|
|
|
|
|
|
.start.x_size=w,\
|
|
|
|
|
|
.start.y_size=10,\
|
|
|
|
|
|
.slide=TOUCH_SLIDE_UP,\
|
|
|
|
|
|
.dis=(h)/4,\
|
|
|
|
|
|
.creat=creat_,\
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_CON_LEFT_INIT(w,h,creat_) \
|
|
|
|
|
|
{\
|
|
|
|
|
|
.start.x=(w)-10,\
|
|
|
|
|
|
.start.y=0,\
|
|
|
|
|
|
.start.x_size=10,\
|
|
|
|
|
|
.start.y_size=h,\
|
|
|
|
|
|
.slide=TOUCH_SLIDE_LEFT,\
|
|
|
|
|
|
.dis=(h)/4,\
|
|
|
|
|
|
.creat=creat_,\
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_CON_RIGHT_INIT(w,h,creat_) \
|
|
|
|
|
|
{\
|
|
|
|
|
|
.start.x=0,\
|
|
|
|
|
|
.start.y=0,\
|
|
|
|
|
|
.start.x_size=10,\
|
|
|
|
|
|
.start.y_size=h,\
|
|
|
|
|
|
.slide=TOUCH_SLIDE_RIGHT,\
|
|
|
|
|
|
.dis=(h)/4,\
|
|
|
|
|
|
.creat=creat_,\
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TOUCH_CON_DOWN_PAR(w,h,creat_) &((TouchConditionStruct) TOUCH_CON_DOWN_INIT(w,h,creat_))
|
|
|
|
|
|
#define TOUCH_CON_UP_PAR(w,h,creat_) &((TouchConditionStruct) TOUCH_CON_UP_INIT(w,h,creat_))
|
|
|
|
|
|
#define TOUCH_CON_LEFT_PAR(w,h,creat_) &((TouchConditionStruct) TOUCH_CON_LEFT_INIT(w,h,creat_))
|
|
|
|
|
|
#define TOUCH_CON_RIGHT_PAR(w,h,creat_) &((TouchConditionStruct) TOUCH_CON_RIGHT_INIT(w,h,creat_))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>崥<EFBFBD><E5B4A5><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4>ڸ<EFBFBD><DAB8><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
#define TOUCHWIN_CHILD_MAX_NUM 4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _WIN_TouchWinStruct
|
|
|
|
|
|
{
|
|
|
|
|
|
WIN_WindowStruct win;
|
2025-07-05 19:47:28 +08:00
|
|
|
|
// TouchConditionStruct in; //<2F><><EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><DABD>뷽ʽ
|
|
|
|
|
|
TouchConditionStruct out; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD>ʽ
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int move_start; //<2F>Ƿ<C7B7><F1B4A5B7><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void (*msgloop)(struct _WIN_TouchWinStruct *win,WIN_MsgStruct *msg);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int timer_id; //<2F>Զ<EFBFBD><D4B6><EFBFBD>ȫʹ<C8AB>õĶ<C3B5>ʱ<EFBFBD><CAB1>
|
|
|
|
|
|
struct _WIN_TouchWinStruct *work; //<2F>ɱ<EFBFBD><C9B1><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF>ƵĴ<C6B5><C4B4><EFBFBD>ָ<EFBFBD><D6B8>
|
|
|
|
|
|
TouchConditionStruct work_con; //<2F><><EFBFBD>ڿ<EFBFBD><DABF>ƵĴ<C6B5><C4B4>ڶ<EFBFBD><DAB6><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
|
|
TouchConditionStruct child[TOUCHWIN_CHILD_MAX_NUM];
|
|
|
|
|
|
// struct _WIN_TouchWinStruct *(*child[TOUCHWIN_CHILD_MAX_NUM])(struct _WIN_TouchWinStruct *);
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int child_num; //<2F><>ǰ<EFBFBD><C7B0><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4>ڸ<EFBFBD><DAB8><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
int x_inertia; //x<><78><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>
|
|
|
|
|
|
int y_inertia; //y<><79><EFBFBD><EFBFBD><EFBFBD>Ĺ<EFBFBD><C4B9><EFBFBD>
|
|
|
|
|
|
int timer_inertia; //<2F><><EFBFBD>Զ<EFBFBD>ʱ<EFBFBD><CAB1>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
}WIN_TouchWinStruct;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TouchWinStruct *WIN_CreatTouch (WIN_WindowStruct *base,
|
|
|
|
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
|
|
|
|
int x,int y,int x_size,int y_size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int WIN_CreatTouchEx (WIN_TouchWinStruct *win,WIN_WindowStruct *base,
|
|
|
|
|
|
void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg),
|
|
|
|
|
|
int x,int y,int x_size,int y_size);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TouchWinStruct *WIN_CreatTouchChild(WIN_TouchWinStruct *base);
|
|
|
|
|
|
|
|
|
|
|
|
WIN_TouchWinStruct *WIN_CreatTouchBase(WIN_WindowStruct *base);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD>ʱ<EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int TOUCHWIN_AddChild(WIN_TouchWinStruct *touch,TouchConditionStruct *c);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int TOUCHWIN_ClearChild(WIN_TouchWinStruct *touch);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
int TOUCHWIN_SetOutCon(WIN_TouchWinStruct *touch,TouchConditionStruct *c);
|
|
|
|
|
|
|
2025-07-05 19:47:28 +08:00
|
|
|
|
//Ĭ<><C4AC><EFBFBD><EFBFBD>Ϣѭ<CFA2><D1AD>
|
2025-06-27 00:32:57 +08:00
|
|
|
|
void TOUCHWIN_DefaultMsgLoop(WIN_TouchWinStruct *touch,WIN_MsgStruct *msg);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|