📄 pw_display.c
字号:
#include <i_pwin.h>/* -------------------------------------------------------------------------- *//** White pixel definition. *///const Pw_Color _white_pixel = {211, 239, 194};
//const Pw_Color _white_pixel = 255;//{255, 255, 255};/** Black pixel definition. *///const Pw_Color _black_pixel = 0;//{ 0, 0, 0};
/** Pointer to white pixel.*/ //Pw_Color pw_white_pixel = 255;;//(Pw_Color*)&_white_pixel;/** Pointer to black pixel. *///Pw_Color pw_black_pixel = 0;//(Pw_Color*)&_black_pixel;/* -------------------------------------------------------------------------- *//** * Opens a new display. * @param width display width * @param height display height * @param dd pointer to display specific functions * @param dpy pointer to display to open * @return pointer to newly opened display (same as @p dpy) * @internal */ Pw_Display* IPw_DisplayOpen(Pw_Coord width, Pw_Coord height, Pw_DD* dd, Pw_Display* dpy){ Pw_uInt i; IPW_TRACE_ENTER(DP2); IPW_CHECK_PTR2(dd, dpy); IPW_TRACE3M(DP1, p, dpy, d, width, d, height); /* * initialize display's fields and * create its root window with the * width and height of the display */ dpy->width = width; dpy->height = height; dpy->dd = dd; IPw_RootWindowCreate(dpy, width, height); dpy->focus_win = PW_NULL; dpy->timeouts = PW_NULL; for (i = 0; i < PW_XINPUTS_MAX_NUM; i++) dpy->xinput_win[i] = PW_NULL; dpy->close = FALSE; IPW_TRACE_EXIT_V(DP2, p, dpy); return(dpy);}/** * Closes the display @p dpy. * @param dpy pointer to display to close * @internal */ void IPw_DisplayClose(Pw_Display* dpy){ IPW_TRACE_ENTER(DP2); IPW_CHECK_PTR(dpy); IPW_TRACE1(DP1, p, dpy); /* * remove display's timeouts and * destroy its root window */ IPw_TimeoutRemoveAll(dpy); Pw_WindowDestroy(&dpy->root_win); IPW_TRACE_EXIT(DP2);}/** * Refreshes the display @p dpy. * Repaint all visible windows of display @p dpy. * @param dpy pointer to display to refresh * @internal */ void IPw_DisplayRefresh(Pw_Display* dpy){ IPW_TRACE_ENTER(DP2); IPW_CHECK_PTR(dpy); IPW_TRACE1(DP1, p, dpy); Pw_WindowRepaint(&dpy->root_win); IPW_TRACE_EXIT(DP2);} /* -------------------------------------------------------------------------- *//** * Gets the xinput number @p num value of display @p dpy. * @param dpy pointer to display * @param num xinput number * @return value of xinput number @p num */ Pw_Int Pw_DisplayGetXInputValue(Pw_Display* dpy, Pw_uInt num){ Pw_Int val; IPW_TRACE_ENTER(DP2); IPW_CHECK_PTR(dpy); IPW_TRACE1(DP1, p, dpy); val = dpy->dd->get_xinput_value(dpy, num); IPW_TRACE_EXIT_V(DP2, d, val); return(val);} /*---------------------------------------------------------------------------// end of pw_display.c //--------------------------------------------------------------------------- */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -