# modules/uwindows/UWindows.c File Reference

`#include <mios32.h>`
`#include <app_lcd.h>`
`#include "UWindows.h"`
`#include "UW_CharSet.h"`

## Defines
#define | MAX_X 128
#define | MAX_Y 64
#define | CURSOR_SIZE 3
## Functions
void | swap (u32 *a, u32 *b)
void | UW_Add (UW_Window *pWindow, UW_Type Type, UW_Window *pParent, void *ExtraProperties)
| API to add a new UWindow.
void | UW_DrawLine (s32 x1, s32 y1, s32 x2, s32 y2, u16 color)
void | UW_ListBoxSetItemHeight (UW_Window *pListBox, u8 value)
| API Set List Box Items Height.
void | UW_ListBoxAddItem (UW_Window *ListBox, UW_Window *Item)
| API add item to list box.
void | UW_ListBoxRemoveItem (UW_Window *ListBox, UW_Window *Item)
| API remove item from list box.
UW_Window * | UW_ListBoxGetActiveItem (UW_Window *ListBox)
| get active item
UW_Window * | UW_ListBoxGetItem (UW_Window *ListBox, u32 index)
| get item with a certain index
s32 | UW_ListBoxGetIndex (UW_Window *ListBox, UW_Window *Item)
void | ExitUWindows (void)
| Eixt Windows.
void | UW_Init (void)
| API to initialize UWindows.
void | UW_Run (void)
| API main running function of UWindows.
## Variables
const char | ExitLabel [] = "SHUT DOWN"
bool | Refresh
bool | bExit
UW_Window | UWindows
UW_Window | ExitBtn
u8 | UWImage [4 *1040]
u16 | Colors [4] = {BLACK,BLUE,GRAY,WHITE}
UW_Window * | pUW_Infocus
u8 | CursorXPos
u8 | CursorYPos
const u8 | CurrentFont [224 *14]

## Define Documentation

#define CURSOR_SIZE 3

#define MAX_X 128

#define MAX_Y 64

## Function Documentation

void ExitUWindows | ( | void |  | ) |

Eixt Windows.

set bExit Flag to exit Windows

Returns:
  none

void swap | ( | u32 * | a,
|  | u32 * | b |
| ) |  |  |

void UW_Add | ( | UW_Window * | pWindow,
|  | UW_Type | Type,
|  | UW_Window * | pParent,
|  | void * | ExtraProperties |
| ) |  |  |

API to add a new UWindow.

This function will : add a new UWindow Objet to pParent do all nessecary and default initializations attach the New Window to its extra properties if available

Parameters:

  `[in]` | pWindow | : Pointer to new window object
  `[in]` | Type | : Type of the new windows
  `[in]` | pParent | : Ponter to Parent window
  `[in]` | ExtraProperties | : Pointer to Extra properties object

Returns:
  none

void UW_DrawLine | ( | s32 | x1,
|  | s32 | y1,
|  | s32 | x2,
|  | s32 | y2,
|  | u16 | color |
| ) |  |  |

Here is the call graph for this function:

void UW_Init | ( | void |  | ) |

API to initialize UWindows.

This should be called at Application Init

Returns:
  none

Here is the call graph for this function:

void UW_ListBoxAddItem | ( | UW_Window * | ListBox,
|  | UW_Window * | Item |
| ) |  |  |

API add item to list box.

This is used add item to list box

Parameters:

  `[in]` | pListBox,: | pointer to UWindow Object treated as ListBox
  `[in]` | Item,: | a new Item, pointer t UWindow treated as EditBox

Returns:
  none

UW_Window* UW_ListBoxGetActiveItem | ( | UW_Window * | ListBox | ) |

get active item

This is used get current item currently pointed to in ListBox

Parameters:

  `[in]` | pListBox,: | pointer to UWindow Object treated as ListBox

Returns:
  pointer to UWindow Object Active Item in list Box

s32 UW_ListBoxGetIndex | ( | UW_Window * | ListBox,
|  | UW_Window * | Item |
| ) |  |  |

UW_Window* UW_ListBoxGetItem | ( | UW_Window * | ListBox,
|  | u32 | index |
| ) |  |  |

get item with a certain index

Items are indexed from 0 to TotalCount-1, This is used get item with certain index

Parameters:

  `[in]` | pListBox,: | pointer to UWindow Object treated as ListBox
  `[in]` | index,: | index of the Item

Returns:
  pointer to UWindow Object Active Item in list Box

void UW_ListBoxRemoveItem | ( | UW_Window * | ListBox,
|  | UW_Window * | Item |
| ) |  |  |

API remove item from list box.

This is used remove item from list box

Parameters:

  `[in]` | pListBox,: | pointer to UWindow Object treated as ListBox
  `[in]` | Item,: | a new Item, pointer t UWindow treated as EditBox

Returns:
  none

void UW_ListBoxSetItemHeight | ( | UW_Window * | pListBox,
|  | u8 | value |
| ) |  |  |

API Set List Box Items Height.

This should set List Box Items Height

Parameters:

  `[in]` | pListBox,: | pointer to UWindow Object treated as ListBox
  `[in]` | value | : Height of Items

Returns:
  none

void UW_Run | ( | void |  | ) |

API main running function of UWindows.

This should be called at Application Handler

Returns:
  none

## Variable Documentation

bool bExit

u16 Colors[4] = {BLACK,BLUE,GRAY,WHITE}

const u8 CurrentFont[224 *14]

u8 CursorXPos

u8 CursorYPos

UW_Window ExitBtn

const char ExitLabel[] = "SHUT DOWN"

UW_Window* pUW_Infocus

bool Refresh

u8 UWImage[4 *1040]

UW_Window UWindows