Files
m3s_stm32/SW_APPs/windows.h
T

64 lines
1.1 KiB
C

/*
* windows.h
*
* Created on: Aug 6, 2021
* Author: wuwenfeng
*/
#ifndef WINDOWS_H_
#define WINDOWS_H_
#include "main.h"
#include "lcd.h"
typedef struct
{
uint16_t x;
uint16_t y;
uint16_t width;
uint16_t high;
COLOR_16 background;
char title[16];
}window;
typedef struct windows_stack
{
struct windows_stack *up;
window *window;
struct windows_stack *next;
}windows_stack;
typedef struct
{
COLOR_16 background;
uint16_t x;
uint16_t y;
uint16_t width;
uint16_t high;
windows_stack *windows;
windows_stack *last_windows;
window *moveed_windwos;//¼Ç¼ÕýÔÚ±»Òƶ¯µÄ´°¿Ú
int move_x;
int move_y;
uint8_t move_lock:1;
uint8_t First_click_flag:1;
uint8_t refresh_ui_flag:1;
}UI;
void Inteface_SetCursor(uint16_t Xpos, uint16_t Ypos);
void Inteface_SetColor(uint16_t color);
UI *UI_Init(COLOR_16 background);
window *New_Window(UI *ui,uint16_t x,uint16_t y,uint16_t width,uint16_t high,COLOR_16 background,const char *title);
void Refresh_UI(UI *ui);
void Set_Windows_Title(window *this_window,const char *title);
//void UI_Server(UI *ui);
#endif /* WINDOWS_H_ */