| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
SWIM font manager
Simple Windows Interface manager (SWIM) graphics Library

## Detailed Description

This package provides basic SWIM font management capabilities such as font selection, text positioning, newline and window scrolling, and text display with multiple, selectable fonts.

## Functions
void | swim_put_text_xy (SWIM_WINDOW_T *win, const CHAR *text, int32_t x, int32_t y)
| Put text at x, y (char) position on screen.
void | swim_set_xy (SWIM_WINDOW_T *win, int32_t x, int32_t y)
| Sets the X, Y pixel coordinates for the next text operation.
void | swim_get_xy (SWIM_WINDOW_T *win, int32_t *x, int32_t *y)
| Returns the X, Y pixel coordinates for the next text operation.
void | swim_put_text (SWIM_WINDOW_T *win, const CHAR *text)
| Puts a string of text in a window.
void | swim_put_ltext (SWIM_WINDOW_T *win, const CHAR *text)
| Puts a string of text in a window with breaks.
void | swim_window_scroll (SWIM_WINDOW_T *win, int32_t lines)
| Scrolls the window up one line.
void | swim_put_char (SWIM_WINDOW_T *win, const CHAR textchar)
| Puts a single character in the window.
void | swim_put_newline (SWIM_WINDOW_T *win)
| Puts a newline in the window.
void | swim_set_font (SWIM_WINDOW_T *win, FONT_T *font)
| Sets the active font.
int16_t | swim_get_font_height (SWIM_WINDOW_T *win)
| Returns the active font's height in pixels.
void | swim_set_title (SWIM_WINDOW_T *win, const CHAR *title, COLOR_T ttlbkcolor)
| Creates a title bar for the window.
void | swim_set_font_trasparency (SWIM_WINDOW_T *win, int32_t trans)
| Enables and disables font backgrounds.

## Function Documentation

int16_t swim_get_font_height | ( | SWIM_WINDOW_T * | win | ) |

Returns the active font's height in pixels.

Parameters

  win | : Pointer to window data structure

Returns
  The height of the current font in pixels

Definition at line 339 of file lpc_swim_font.c.

void swim_get_xy | ( | SWIM_WINDOW_T * | win,
|  | int32_t * | x,
|  | int32_t * | y
| ) |  |

Returns the X, Y pixel coordinates for the next text operation.

Parameters

  win | : Pointer to window data structure
  x | : Address of where to return virtual X value
  y | : Address of where to return virtual X value

Returns
  Nothing

Note
  The logical X and Y positions are computed by subtracting the physical text position values by the physical minimum window limits.

Definition at line 132 of file lpc_swim_font.c.

void swim_put_char | ( | SWIM_WINDOW_T * | win,
|  | const CHAR | textchar
| ) |  |

Puts a single character in the window.

Parameters

  win | : Pointer to window data structure
  textchar | : Character to print

Returns
  Nothing

Note
  The character is placed at the end of the last text operation or the current text X, Y position.

Definition at line 237 of file lpc_swim_font.c.

void swim_put_ltext | ( | SWIM_WINDOW_T * | win,
|  | const CHAR * | text
| ) |  |

Puts a string of text in a window with breaks.

Parameters

  win | : Pointer to window data structure
  text | : Text string to output in window

Returns
  Nothing

Note
  Puts a string of text in a window, but will adjust the position of a word if the word length exceeds the edge of the display.

Definition at line 162 of file lpc_swim_font.c.

void swim_put_newline | ( | SWIM_WINDOW_T * | win | ) |

Puts a newline in the window.

Parameters

  win | : Pointer to window data structure

Returns
  Nothing

Definition at line 300 of file lpc_swim_font.c.

void swim_put_text | ( | SWIM_WINDOW_T * | win,
|  | const CHAR * | text
| ) |  |

Puts a string of text in a window.

Parameters

  win | : Pointer to window data structure
  text | : Text string to output in window

Returns
  Nothing

Note
  Each character will be routed to the swim_put_char function until a string terminator is reached. For newline characters, a newline will occur instead of a character output.

Definition at line 141 of file lpc_swim_font.c.

void swim_put_text_xy | ( | SWIM_WINDOW_T * | win,
|  | const CHAR * | text,
|  | int32_t | x,
|  | int32_t | y
| ) |  |

Put text at x, y (char) position on screen.

Parameters

  win | : Pointer to window data structure
  text | : Text string to output in window
  x | : Virtual X position of start of text
  y | : Virtual Y position of start of text

Returns
  Nothing

Note
  Sets the virtual (upper left) text position in the window and render the text string at this position.

Definition at line 95 of file lpc_swim_font.c.

void swim_set_font | ( | SWIM_WINDOW_T * | win,
|  | FONT_T * | font
| ) |  |

Sets the active font.

Parameters

  win | : Pointer to window data structure
  font | : Pointer to font data structure to use for font

Returns
  Nothing

Definition at line 321 of file lpc_swim_font.c.

void swim_set_font_trasparency | ( | SWIM_WINDOW_T * | win,
|  | int32_t | trans
| ) |  |

Enables and disables font backgrounds.

Parameters

  win | : Pointer to window data structure
  trans | : 1 for transparent backgrounds, 0 for solid color

Returns
  Nothing

Note
  Enables and disables font backgrounds. When set, the font background will not be drawn in the background color (useful for painting text over pictures).

Definition at line 409 of file lpc_swim_font.c.

void swim_set_title | ( | SWIM_WINDOW_T * | win,
|  | const CHAR * | title,
|  | COLOR_T | ttlbkcolor
| ) |  |

Creates a title bar for the window.

Parameters

  win | : Pointer to window data structure
  title | : Text for title bard
  ttlbkcolor | : Totle bar backgorund color

Returns
  Nothing

Note
  Creates a title bar in the window and adjusts the client area to be outside the title bar area.

Definition at line 345 of file lpc_swim_font.c.

void swim_set_xy | ( | SWIM_WINDOW_T * | win,
|  | int32_t | x,
|  | int32_t | y
| ) |  |

Sets the X, Y pixel coordinates for the next text operation.

Parameters

  win | : Pointer to window data structure
  x | : Virtual X position of start of text
  y | : Virtual Y position of start of text

Returns
  Nothing

Definition at line 108 of file lpc_swim_font.c.

void swim_window_scroll | ( | SWIM_WINDOW_T * | win,
|  | int32_t | lines
| ) |  |

Scrolls the window up one line.

Parameters

  win | : Pointer to window data structure
  lines | : Number of lines to scroll up

Returns
  Nothing

Definition at line 194 of file lpc_swim_font.c.