28 #include <oc_screens_cfg.c> 39 #define _________________________________________LOCAL_TYPES________________________________________________________________________________ 43 #undef _________________________________________LOCAL_TYPES________________________________________________________________________________ 50 #define _________________________________________VARIABLES_SECTION__________________________________________________________________________ 53 static const
char * DefaultScreenName = NULL;
58 #undef _________________________________________VARIABLES_SECTION__________________________________________________________________________ 66 #define _________________________________________FUNCTIONS__________________________________________________________________________________ 82 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
86 Screens = oC_List_New(&
Allocator,AllocationFlags_ZeroFill | AllocationFlags_CanWait1Second);
88 if(ErrorCondition(Screens !=
NULL , oC_ErrorCode_AllocationError))
90 errorCode = oC_ErrorCode_None;
92 #define CREATE_SCREEN( NAME , DRIVER_NAME , CONFIG_NAME ) \ 93 oC_Screen_t NAME = oC_Screen_New( &DRIVER_NAME , &CONFIG_NAME , #NAME ); 94 CFG_SCREENS_LIST(CREATE_SCREEN);
97 #define ADD_SCREEN( NAME , DRIVER_NAME , CONFIG_NAME ) \ 98 if(ErrorCondition( NAME != NULL , oC_ErrorCode_ObjectNotCorrect ))\ 100 bool success = oC_List_PushBack(Screens,NAME,&Allocator);\ 101 ErrorCondition(success, oC_ErrorCode_CannotAddObjectToList);\ 103 CFG_SCREENS_LIST(ADD_SCREEN)
106 DefaultScreenName = CFG_STRING_DEFAULT_SCREEN;
127 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
131 errorCode = oC_ErrorCode_None;
133 #define TAKE_SCREEN( NAME , DRIVER_NAME , CONFIG_NAME ) \ 134 oC_Screen_t NAME = oC_ScreenMan_GetScreen( #NAME ); \ 135 oC_List_RemoveAll(Screens,NAME); 136 CFG_SCREENS_LIST(TAKE_SCREEN);
139 #define DELETE_SCREEN(NAME , DRIVER_NAME , CONFIG_NAME ) \ 140 oC_Screen_Delete(&NAME); 141 CFG_SCREENS_LIST(DELETE_SCREEN);
144 ErrorCondition( oC_List_Delete(Screens,AllocationFlags_CanWait1Second) , oC_ErrorCode_ReleaseError);
168 oC_List_Foreach(Screens,screen)
193 oC_List_Foreach(Screens,screen)
266 oC_List_Foreach(Screens,screen)
270 defaultScreen = screen;
275 return defaultScreen;
293 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
299 bool pushed = oC_List_PushBack(Screens,Screen,&
Allocator);
301 if(ErrorCondition(pushed,oC_ErrorCode_CannotAddObjectToList))
303 errorCode = oC_ErrorCode_None;
326 oC_ErrorCode_t errorCode = oC_ErrorCode_ImplementError;
332 bool removed = oC_List_RemoveAll(Screens,Screen);
334 if(ErrorCondition(removed,oC_ErrorCode_CannotRemoveObjectFromList))
336 errorCode = oC_ErrorCode_None;
344 #undef _________________________________________FUNCTIONS__________________________________________________________________________________ oC_ErrorCode_t oC_ScreenMan_RemoveScreen(oC_Screen_t Screen)
removes screen from the screens list
void oC_ScreenMan_ConfigureAll(void)
configures all screens
const char * oC_Screen_GetName(oC_Screen_t Screen)
returns name of the screen
identifier for allocations
oC_ErrorCode_t oC_ScreenMan_TurnOn(void)
turns on the screen manager module
static oC_List(oC_Screen_t)
returns screens list
The file with interface of the Screen Manager module.
oC_ErrorCode_t oC_ScreenMan_TurnOff(void)
turns off screen manager
oC_Screen_t oC_ScreenMan_GetScreen(const char *Name)
returns selected screen
The file with interface for the module library.
static bool oC_Module_IsTurnedOn(oC_Module_t Module)
checks if the module is turned on
stores screen object data
The file with list library.
bool oC_Screen_IsConfigured(oC_Screen_t Screen)
checks if the screen is configured to work
oC_ErrorCode_t oC_Screen_Configure(oC_Screen_t Screen)
configures graphics driver to work
oC_Driver_t oC_Screen_GetDriver(oC_Screen_t Screen)
returns driver associated with the screen
static void oC_Module_TurnOn(oC_Module_t Module)
sets module as turned on
The file with drivers manager interface.
The file with interface for string library.
static bool oC_Module_TurnOffVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned off
void oC_ScreenMan_UnconfigureAll(void)
unconfigures all screens
static const oC_Allocator_t Allocator
static bool oC_Module_TurnOnVerification(oC_ErrorCode_t *outErrorCode, oC_Module_t Module)
verify if module is turned on
bool oC_Screen_IsCorrect(oC_Screen_t Screen)
checks if the Screen object is correct
oC_ErrorCode_t oC_Screen_Unconfigure(oC_Screen_t Screen)
unconfigures graphics driver
oC_Screen_t oC_ScreenMan_GetDefaultScreen(void)
returns default screen
#define NULL
pointer to a zero
oC_ErrorCode_t oC_ScreenMan_AddScreen(oC_Screen_t Screen)
adds screen to the screens list
static void oC_Module_TurnOff(oC_Module_t Module)
sets module as turned off