Foenix A2650 OS/f Library
 
Loading...
Searching...
No Matches
sys.h File Reference
#include "list.h"
#include "theme.h"
#include "control_template.h"
#include "font.h"
#include <stdbool.h>
#include <mcp/syscalls.h>
#include "a2560k.h"
#include "general.h"
#include "text.h"
#include "bitmap.h"
#include "window.h"

Go to the source code of this file.

Data Structures

struct  System
 

Functions

SystemSys_New (void)
 Allocate a System object.
 
bool Sys_Destroy (System **the_system)
 
void Sys_Exit (System **the_system, bool error_condition)
 Exit to MCP Destroys the system on the way out. More...
 
bool Sys_InitSystem (System *the_system)
 Initialize the system (primary entry point for all system initialization activity) Starts up the memory manager, creates the global system object, runs autoconfigure to check the system hardware, loads system and application fonts, allocates a bitmap for the screen.
 
bool Sys_SetVideoMode (Screen *the_screen, screen_resolution new_mode)
 Change video mode to the one passed. More...
 
bool Sys_SetModeText (System *the_system, bool as_overlay)
 Switch machine into text mode. More...
 
bool Sys_SetGraphicMode (System *the_system, bool enable_sprites, bool enable_bitmaps, bool enable_tiles, bool enable_text_overlay, bool enable_text)
 Switch machine into graphics mode, text mode, sprite mode, etc. More...
 
bool Sys_EnableTextModeCursor (System *the_system, Screen *the_screen, bool enable_it)
 Enable or disable the hardware cursor in text mode, for the specified screen. More...
 
bool Sys_SetBorderSize (System *the_system, Screen *the_screen, uint8_t border_width, uint8_t border_height)
 Set the left/right and top/bottom borders This will reset the visible text columns as a side effect Grotesquely large values will be accepted as is! More...
 
bool Sys_AddToWindowList (System *the_system, Window *the_new_window)
 Add this window to the list of windows and make it the currently active window. More...
 
bool Sys_CreateBackdropWindow (System *the_system)
 
WindowSys_GetActiveWindow (System *the_system)
 
WindowSys_GetBackdropWindow (System *the_system)
 
WindowSys_GetNextWindow (System *the_system)
 
WindowSys_GetPreviousWindow (System *the_system)
 
WindowSys_GetWindowAtXY (System *the_system, int16_t x, int16_t y)
 
bool Sys_SetActiveWindow (System *the_system, Window *the_window)
 Set the passed window to the active window, and marks the previously active window as inactive NOTE: This will resort the list of windows to move the (new) active one to the front NOTE: The exception to this is that the backdrop window is never moved in front of other windows. More...
 
void Sys_IssueDamageRects (System *the_system)
 Issue damage rects from the Active Window down to each other window in the system so that they can redraw portions of themselves Note: does not call for system re-render.
 
void Sys_IssueMenuDamageRects (System *the_system)
 Issue damage rects from the menu down to every other window in the system so that they can redraw portions of themselves when menu closes Note: does not call for system re-render.
 
void Sys_CollectDamageRects (System *the_system, Window *the_future_active_window)
 Collect damage rects for a window that is about to be made the active (foremost) window, so it can redraw portions of itself that may have been covered up by other windows Note: does not call for system re-render.
 
FontSys_GetSystemFont (System *the_system)
 
FontSys_GetAppFont (System *the_system)
 
ScreenSys_GetScreen (System *the_system, int16_t channel_id)
 
MenuSys_GetMenu (System *the_system)
 
ThemeSys_GetTheme (System *the_system)
 
BitmapSys_GetScreenBitmap (System *the_system, bitmap_layer the_layer)
 NOTE: Foenix systems only have 1 screen with bitmap graphics, even if the system has 2 screens overall. More...
 
EventManagerSys_GetEventManager (System *the_system)
 
void Sys_SetSystemFont (System *the_system, Font *the_font)
 
void Sys_SetAppFont (System *the_system, Font *the_font)
 
void Sys_SetScreen (System *the_system, int16_t channel_id, Screen *the_screen)
 
void Sys_SetScreenBitmap (System *the_system, Bitmap *the_bitmap, bitmap_layer the_layer)
 NOTE: Foenix systems only have 1 screen with bitmap graphics, even if the system has 2 screens overall. More...
 
bool Sys_SetTheme (System *the_system, Theme *the_theme)
 Set the passed theme as the System's current theme Note: this will dispose of the current theme after setting the new one. More...
 
bool Sys_SetVRAMAddr (System *the_system, uint8_t the_bitmap_layer, unsigned char *the_address)
 Tell the VICKY to use a different address for the specified bitmap layer. More...
 
void Sys_Render (System *the_system)
 Render all visible windows NOTE: this will move to a private Sys function later, once event handling is available. More...
 

Function Documentation

◆ Sys_AddToWindowList()

bool Sys_AddToWindowList ( System the_system,
Window the_new_window 
)

Add this window to the list of windows and make it the currently active window.

Parameters
the_system– valid pointer to system object
Returns
Returns false if adding this window would exceed the system's hard cap on the number of available windows

◆ Sys_CreateBackdropWindow()

bool Sys_CreateBackdropWindow ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_Destroy()

bool Sys_Destroy ( System **  the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_EnableTextModeCursor()

bool Sys_EnableTextModeCursor ( System the_system,
Screen the_screen,
bool  enable_it 
)

Enable or disable the hardware cursor in text mode, for the specified screen.

Parameters
the_system– valid pointer to system object
the_screen– valid pointer to the target screen to operate on
enable_it– If true, turns the hardware blinking cursor on. If false, hides the hardware cursor;
Returns
returns false on any error/invalid input.

◆ Sys_Exit()

void Sys_Exit ( System **  the_system,
bool  error_condition 
)

Exit to MCP Destroys the system on the way out.

Parameters
the_system– valid pointer to system object
error_condition– true if error, false if a normal exit. Use PARAM_EXIT_ON_ERROR/PARAM_EXIT_NO_ERROR

◆ Sys_GetActiveWindow()

Window * Sys_GetActiveWindow ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetAppFont()

Font * Sys_GetAppFont ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetBackdropWindow()

Window * Sys_GetBackdropWindow ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetEventManager()

EventManager * Sys_GetEventManager ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetMenu()

Menu * Sys_GetMenu ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetNextWindow()

Window * Sys_GetNextWindow ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetPreviousWindow()

Window * Sys_GetPreviousWindow ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetScreen()

Screen * Sys_GetScreen ( System the_system,
int16_t  channel_id 
)
Parameters
the_system– valid pointer to system object

◆ Sys_GetScreenBitmap()

Bitmap * Sys_GetScreenBitmap ( System the_system,
bitmap_layer  the_layer 
)

NOTE: Foenix systems only have 1 screen with bitmap graphics, even if the system has 2 screens overall.

The bitmap returned will always be from the appropriate channel (A or B).

Parameters
the_system– valid pointer to system object

◆ Sys_GetSystemFont()

Font * Sys_GetSystemFont ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetTheme()

Theme * Sys_GetTheme ( System the_system)
Parameters
the_system– valid pointer to system object

◆ Sys_GetWindowAtXY()

Window * Sys_GetWindowAtXY ( System the_system,
int16_t  x,
int16_t  y 
)
Parameters
the_system– valid pointer to system object
x– global horizontal coordinate
y– global vertical coordinate

◆ Sys_Render()

void Sys_Render ( System the_system)

Render all visible windows NOTE: this will move to a private Sys function later, once event handling is available.

Parameters
the_system– valid pointer to system object

◆ Sys_SetActiveWindow()

bool Sys_SetActiveWindow ( System the_system,
Window the_window 
)

Set the passed window to the active window, and marks the previously active window as inactive NOTE: This will resort the list of windows to move the (new) active one to the front NOTE: The exception to this is that the backdrop window is never moved in front of other windows.

Parameters
the_system– valid pointer to system object

◆ Sys_SetAppFont()

void Sys_SetAppFont ( System the_system,
Font the_font 
)
Parameters
the_system– valid pointer to system object

◆ Sys_SetBorderSize()

bool Sys_SetBorderSize ( System the_system,
Screen the_screen,
uint8_t  border_width,
uint8_t  border_height 
)

Set the left/right and top/bottom borders This will reset the visible text columns as a side effect Grotesquely large values will be accepted as is!

Parameters
border_width– width in pixels of the border on left and right side of the screen. Total border used with be the double of this.
border_height– height in pixels of the border on top and bottom of the screen. Total border used with be the double of this.
Returns
returns false on any error/invalid input.

◆ Sys_SetGraphicMode()

bool Sys_SetGraphicMode ( System the_system,
bool  enable_sprites,
bool  enable_bitmaps,
bool  enable_tiles,
bool  enable_text_overlay,
bool  enable_text 
)

Switch machine into graphics mode, text mode, sprite mode, etc.

Parameters
the_system– valid pointer to system object Use PARAM_SPRITES_ON/OFF, PARAM_BITMAP_ON/OFF, PARAM_TILES_ON/OFF, PARAM_TEXT_OVERLAY_ON/OFF, PARAM_TEXT_ON/OFF

◆ Sys_SetModeText()

bool Sys_SetModeText ( System the_system,
bool  as_overlay 
)

Switch machine into text mode.

Parameters
the_system– valid pointer to system object
as_overlay– If true, sets text overlay mode (text over graphics). If false, sets full text mode (no graphics);
Returns
returns false on any error/invalid input.

◆ Sys_SetScreen()

void Sys_SetScreen ( System the_system,
int16_t  channel_id,
Screen the_screen 
)
Parameters
the_system– valid pointer to system object

◆ Sys_SetScreenBitmap()

void Sys_SetScreenBitmap ( System the_system,
Bitmap the_bitmap,
bitmap_layer  the_layer 
)

NOTE: Foenix systems only have 1 screen with bitmap graphics, even if the system has 2 screens overall.

The bitmap returned will always be from the appropriate channel (A or B).

Parameters
the_system– valid pointer to system object

◆ Sys_SetSystemFont()

void Sys_SetSystemFont ( System the_system,
Font the_font 
)
Parameters
the_system– valid pointer to system object

◆ Sys_SetTheme()

bool Sys_SetTheme ( System the_system,
Theme the_theme 
)

Set the passed theme as the System's current theme Note: this will dispose of the current theme after setting the new one.

Parameters
the_system– valid pointer to system object
Returns
Returns false on any error condition

◆ Sys_SetVideoMode()

bool Sys_SetVideoMode ( Screen the_screen,
screen_resolution  new_mode 
)

Change video mode to the one passed.

Parameters
the_screen– valid pointer to the target screen to operate on
new_mode– One of the enumerated screen_resolution values. Must correspond to a valid VICKY video mode for the host machine. See VICKY_IIIA_RES_800X600_FLAGS, etc. defined in a2560_platform.h
Returns
returns false on any error/invalid input.

◆ Sys_SetVRAMAddr()

bool Sys_SetVRAMAddr ( System the_system,
uint8_t  the_bitmap_layer,
unsigned char *  the_address 
)

Tell the VICKY to use a different address for the specified bitmap layer.

Parameters
the_system– valid pointer to system object
the_bitmap_layer– 0 or 1, the bitmap layer to get a new address
the_address– The address within the VRAM zone that the bitmap layer should be repointed to