⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lcd_setapi.c

📁 ucgui V3.98 是目前网络上相对较新的ucgui高版本源码啦。有兴趣的可以下载试试
💻 C
字号:
/*
*********************************************************************************************************
*                                             uC/GUI V3.98
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : LCD_SetAPI.C
Purpose     : Implementation of said function
---------------------------END-OF-HEADER------------------------------
*/

#include <stddef.h>           /* needed for definition of NULL */
#include "GUI_Private.h"
#include "GUIDebug.h"
#include "LCD_Private.h"      /* Required for configuration, APIList */

#if GUI_SUPPORT_DEVICES

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_SetAPI
*
* Purpose:
*   Sets the API table for a layer.
*   Some high level software (such as the VNC server, but maybe also the mouse "Cursor" module)
*   may need to override these pointers in order to link itself into the chain
*   of drawing routines.
*/
const tLCDDEV_APIList* LCD_SetAPI(const tLCDDEV_APIList* pAPI, int Index) {
  const tLCDDEV_APIList* pOldAPI;
  pOldAPI = LCD_aAPI[Index];
  /* Also aplly changes to current context if LCD of this layer is selected */
  if ((GUI_Context.SelLayer == Index) && (GUI_Context.hDevData == 0)) {
    GUI_Context.pDeviceAPI = pAPI;
  }
  LCD_aAPI[Index] = pAPI;
  return pOldAPI;
}

#if GUI_OS

const tLCDDEV_APIList* LCD_SetAPIForAll(const tLCDDEV_APIList* pAPI, int Index) {
  const tLCDDEV_APIList* pOldAPI;
  GUI_CONTEXT * pContext;
  int i;
  pOldAPI = LCD_aAPI[Index];
  i = 0;
  while ((pContext = GUITASK_GetpContext(i++)) != NULL) {
    pContext->pDeviceAPI = pAPI;
  }
  LCD_aAPI[Index] = pAPI;
  return pOldAPI;
}

#endif

#else

void LCD_SetAPI_C(void);
void LCD_SetAPI_C(void) {}

#endif

/*************************** End of file ****************************/
	 	 			 		    	 				 	  			   	 	 	 	 	 	  	  	      	   		 	 	 		  		  	 		 	  	  			     			       	   	 			  		    	 	     	 				  	 					 	 			   	  	  			 				 		 	 	 			     			 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -