Files
player/Project/Src/MyWin/MyWinCore/mywin_msg.h

114 lines
3.0 KiB
C
Raw Normal View History

2025-06-27 00:32:57 +08:00
#ifndef MYWIN_MSG_H__
#define MYWIN_MSG_H__
/*****************************窗口消息处理******************************************/
//存储触摸信息0成功非0失败
int WIN_StorTouchStruct (WIN_TouchStruct *t);
//存储按键信息返回0成功非0失败
int WIN_StorKeyStruct (WIN_KeyStruct *k);
//清空按键队列
void WIN_ClearKeyQueue (void);
//清空触摸队列
void WIN_ClearTouchQueue (void);
//屏蔽按键和触屏
void WIN_KeyShieldOn (void);
//不屏蔽按键和触屏
void WIN_KeyShieldOff (void);
//窗口默认消息循环
void WIN_DefaultMsgLoop (WIN_WindowStruct *win,WIN_MsgStruct *msg);
//设备窗口的消息循环
void *WIN_SetMsgCallBack (WIN_WindowStruct *win, void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg));
//设置窗口消息循环
void *WIN_SetMsgLoopCallBack (WIN_WindowStruct *win,void (*msgLoop)(struct _WIN_WindowStruct *win,WIN_MsgStruct *msg));
//窗口运行
int WIN_Working (WIN_WindowStruct *win);
//以非阻塞方式运行所有窗口
void WIN_Delay (int ms);
//以阻塞方式运行指定窗口
int WIN_RunBlock (WIN_WindowStruct *win);
//发送消息到指定窗口
int WIN_SendMsg (WIN_WindowStruct *win,WIN_WindowStruct *dscWin,WIN_MsgStruct *msg);
//发送消息到父窗口
int WIN_SendMsgToPrent (WIN_WindowStruct *win,u32 type,u32 data);
//清空消息队列
void WIN_ClearMsgQueue (WIN_WindowStruct *win);
//查找指定类型的消息,返回消息所在指针
WIN_MsgStruct *WIN_CheckMsg (WIN_WindowStruct *win,u32 msgType);
//发送触摸消息,同时发送给窗口所在的父窗口
void WIN_SendTouchMsg (WIN_WindowStruct *win,int lcd_x,int lcd_y);
//发送滑动信息,同时发送给父窗口
void WIN_SendTouchMove (WIN_WindowStruct *win,int move_x,int move_y);
//发送按键消息,同时发送给父窗口
void WIN_SendKeyMsg (WIN_WindowStruct *win,WIN_KeyStruct *k);
//广播触屏消息
int WIN_TouchMsgBroad (WIN_WindowStruct *base);
//广播按键消息
int WIN_KeyMsgBroad (WIN_WindowStruct *base);
//广播按键和触屏消息,处理过消息返回1否则返回0
int WIN_MsgBroad (WIN_WindowStruct *base);
//把窗口设置为无效
void WIN_SetInvalid (WIN_WindowStruct *win);
//当窗口是最顶窗口时,设置为无效
void WIN_SetInvalidWhenTop (WIN_WindowStruct *win);
//把窗口指定区域设置为无效
void WIN_SetInvalidRect (WIN_WindowStruct *win,int x,int y,int x_size,int y_size);
//当窗口是最顶窗口时,设置为无效
void WIN_SetInvalidRectWhenTop (WIN_WindowStruct *win,int x,int y,int x_size,int y_size);
//存储外部消息到活动窗口返回0成功非0失败
int WIN_StorExtMsg (void *msgData,int size);
//发送外部信息到指定窗口
int WIN_WinStorExtMsg (WIN_WindowStruct *win,void *msgData,int size);
//窗口移动
void WIN_Move(WIN_WindowStruct *win,int x_move,int y_move);
//设置窗口坐标
void WIN_SetPos(WIN_WindowStruct *win,int x,int y);
//设置窗口尺寸
void WIN_SetSize(WIN_WindowStruct *win,int x_size,int y_size);
#endif