📄 aw_control.h
字号:
*/
PHWND AWCreateWinControl(CHARSTR *lpClassName, CHARSTR *lpWindowName, INT32U dwStyle, INT16U x,
INT16U y, INT16U nWidth, INT16U nHeight, PHWND hwndParent, INT32S lpParam, WINPROC pCustomerProc);
/**
* @brief Destroy the specified control, and all of it's children.This is a recursive routine.
* @param [in] hwnd the handle of control which will be destoried.
* @param [in] bSendMsg defined if send WM_DESTROY message to the control and it's child control.
*/
void AWDestroyWinControl(PHWND hwnd,BOOLEAN bSendMsg);
/**
* @brief Get the control's ancestor, it's window in another word.
* @param [in] hwnd the handle of control which you want to get it's top level control.
* @return return the ancestor control.
*/
PHWND AWGetTopWindow(PHWND hwnd) ;
/**
* @brief To check if this control can get focus(that's means can get the message system
* send out) or not.
* @param [in] hwnd the handle of control which you want to check.
* @return return false or true.
* @retval 0 false.
* @retval 1 true.
*/
INT32S AWCanSetFocus(PHWND hwnd) ;
/**
* @brief Get the draw metedata of this control
* @param [in] hwnd the handle of control which you want to get its draw data.
* @param [out] info_num draw data num.
* @return return the array point(PDRAWINFO) of draw data.
*/
PDRAWINFO AWGetWinDrawInfo(PHWND hwnd, INT8U *info_num) ;
/**
* @brief According the handle to display the control.
* @param [in] hwnd the handle of control which you want display.
* @param [in] focus_flag define if change the focus to it after dispaly.
*/
void AWShowWinControl(PHWND hwnd, INT8U focus_flag) ;
/**
* @brief According the name to display the window, window is a special control, which is
* the container of other control, it'll initialize OSD/Screen buffer before show.
* @param [in] pWindowName the name of window which you want display.
* @param [in] auto_focus_flag the window have a special member data, which will save last foucused
* child control, if you set auto_focus_flag to 1, this function will set focus to the last focused
* control, otherwise set focus to self.
* @return return 0 if success.
* @retval 0 success.
* @retval 1 the control which found according pWindowName is not a window control(top control).
* @retval 2 the window already displayed.
*/
INT32S AWShowWindowByName(CHARSTR *pWindowName, INT8U auto_focus_flag);
/**
* @brief Same as AWShowWindowByName, the difference is AWShowWindowByName show the window
* by name, this function show the window by it's handle.
*/
INT32S AWShowWindow(PHWND hwnd, INT8U auto_focus_flag);
/*
* Reset windows draw area parameters for video system transfer (interlaced <-> progressive)
*/
INT32S AWResetWindowsDrawArea(HWND *win_hwnd);
/**
* @brief According the handle to hide the control.
* When a control be hided, it'll received WM_HIDEWINDOW message, after that, this control cannot
* get any message and don't get focus until it displayed again. And if it or it's children is
* current focused control, its parent will get focus.
* @param [in] hwnd the handle of control which you want hide.
*/
void AWHideWinControl(PHWND hwnd) ;
/**
* @brief According the name to hide the window, window is a special control, which is
* the container of other control, it'll close OSD/Screen buffer.
* @param [in] pWindowName the name of window which you want hide.
* @return return 0 if success.
* @retval 0 success.
* @retval 2 the control which found according pWindowName is not a window control(top control).
*/
INT32S AWHideWindowByName(CHARSTR *pWindowName);
/**
* @brief Same as AWHideWindowByName, the difference is AWHideWindowByName hide the window
* by name, this function hide the window by it's handle.
*/
INT32S AWHideWindow(PHWND hwnd);
/**
* @brief Draw the string data to display device(OSD/Screen).
* @param [in] pDrawData the mete string draw data of all control,It have position and data information.
* @param [in] auto_wrap_flag defined if auto change line when we draw a string.
* @param [in] length if length biger than 0, that means max draw string length.
*/
void AWPaintStringDrawInfo(PDRAWINFO pDrawData, INT8U auto_wrap_flag, INT8U length);
/**
* @brief Draw the graphic data to display device(OSD/Screen).
* @param [in] pDrawData the mete draw data of all control,It have position and data information.
* @param [in] auto_wrap_flag defined if auto change line when we draw a string.
*/
void AWPaintDrawInfo(PDRAWINFO pDrawData, INT8U auto_wrap_flag) ;
/**
* @brief Change the current focus to this control(that's means this control will get
* all message system generated).
* @param [in] hwnd the control handle which will get focus.
*/
PHWND AWSetFocus(PHWND hwnd) ;
/**
* @brief Set a new style for the control.
* @param [in] hwnd the control handle which will set new style.
* @param [in] new_style new style of this control.
*/
void AWSetWinControlStyle(PHWND hwnd, INT32U new_style) ;
/**
* @brief Move the control to a new position.
* @param [in] hwnd the control handle which will moved.
* @param [in] offset_x moved relative value on X coordinate.
* @param [in] offset_y moved relative value on Y coordinate.
*/
void AWWinControlMove(PHWND hwnd, INT16S offset_x, INT16S offset_y) ;
/**
* @brief Move the control to a new position.
* The difference between AWWinControlMove and AWWinControlMoveTo is AWWinControlMove is move
* to a relative position based on old position. the AWWinControlMoveTo is move to a given
* absolute position.
* @param [in] hwnd the control handle which will moved.
* @param [in] new_x new position on X coordinate.
* @param [in] new_y new position on Y coordinate.
*/
void AWWinControlMoveTo(PHWND hwnd, INT16U new_x, INT16U new_y) ;
/**
* @brief According the name string and parent control to search the children control
* which have same name as user want to get, if found, return the handle of this control,
* otherwise return NULL.
* @param [in] hwnd the parent control of searched control.
* @param [in] lpCtrlName the child control's name.
* @return return the handle of control if found, otherwise return NULL.
*/
PHWND AWFindChildCtrlByName(PHWND hwnd,CHARSTR *lpCtrlName) ;
/**
* @brief Search all control list to find the control which have same name.
* @param [in] lpCtrlName the control's name.
* @return return the handle of control if found, otherwise return NULL.
*/
PHWND AWFindWinCtrlByName(CHARSTR *lpCtrlName);
/**
* @brief Check the control is curent focused control.
* @param [in] hwnd the control which will be check.
* @return return 1 if the control is current focused control, otherwise return 0.
*/
INT32S AWIsFocusWinControl(PHWND hwnd) ;
/**
* @brief To check the draw data will take how much pixel in x and y coordinate.
* @param [in] pDrawData the draw which will be checked.
* @param [out] data_width the width this draw data will take.
* @param [out] data_height the height this draw data will take.
* @return return 0 success.
* @retval 0 success.
* @retval 1 there are no draw data.
* @retval 2 illegal draw data.
*/
INT32S AWGetDrawDataSize(PDRAWINFO pDrawData, INT16U *data_width, INT16U *data_height) ;
/**
* @brief return the root control of whole GUI.
*/
PHWND AWGetRootWin(void) ;
/**
* @brief return current focused control.
*/
PHWND AWGetFocusWin(void) ;
/**
* @brief Draw the control on display device(OSD/Screen).
*/
INT32S AWPaintWinControl(PHWND hwnd) ;
/**
* Control Message structure
*/
typedef struct {
list_t link; /* microwin*/
PHWND hwnd;
INT16U message;
INT32S msg_param;
INT32U time;
} WINMSG, *PWINMSG;
#define AW_DYNAMIC_MALLOC_WINMSG
#ifdef AW_DYNAMIC_MALLOC_WINMSG
void AWWinMsgInit(void) ;
#define AWWinMsgMalloc() (WINMSG *)AVMem_umalloc(sizeof(WINMSG))
#define AWWinMsgFree(a) AVMem_ufree((void *)a)
#else
void AWWinMsgInit(void) ;
PWINMSG AWWinMsgMalloc(void) ;
void AWWinMsgFree(PWINMSG pAWWinMsg) ;
#endif
/**
* @brief Send a special message to the control.
* @param [in] hwnd the control handle which will receive this message.
* @param [in] iMsgID message type.
* @param [in] lpParam the parameter which message taked, can be a int data or any address of piont.
* @return return 0 if message send success.
*/
INT32S AWSendMessage(PHWND hwnd, INT32U iMsgID,INT32S lpParam) ;
/**
* @brief Send a special message to the control, the difference between AWSendMessage
* is AWSendMessage will send message at once. AWPostMessage will send the message to
* a message list and wait control read it.
*/
BOOLEAN AWPostMessage(PHWND hwnd, INT32U iMsgID,INT32S lpParam) ;
/**
* @brief Get a message from message list.
* Check if the message queue have any message, if have, pop it from queue, according the
* wRemoveMsg flag, user can decide remove and free this message from queue or not.
* @param [in] lpMsg msg point which will hold msg, should malloc by caller
* @param [in] wRemoveMsg flag to decide if pop msg and free it from queue.
* @return return 1 if have message, otherwise return 0.
*/
BOOLEAN AWPeekMessage(PWINMSG lpMsg, BOOLEAN wRemoveMsg);
/**
* @brief this function is a sync read message call, it'll wait for a message and pop it.
*/
BOOLEAN AWGetMessage(PWINMSG lpMsg);
/**
* @brief This function is used to adjust this control is visable or not.
* This function will search all its parent, if it and its all parent are visable, this it's visable.
* @param [in] win_hwnd the control which is visable or not.
* @return retrun 0 if this control is disvisable, otherwise return 1 ;
*/
INT32S AWIsVisibleWinControl(HWND *win_hwnd) ;
extern PHWND gpFocusWin; /* focus window for keyboard */
extern PHWND gpMouseWin; /* window which mosue in it */
extern PHWND gpRootWin ; /* root window */
extern PHWND gpPrevWin ; /* last show window*/
#endif // end of _AW_CONTROL_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -