|
Assembled 2
A column based text editor
|
Functions | |
| int | switch_to_screen (char *name) |
| int | switch_to_last_screen () |
| int | register_screen (char *name, void(*render)(struct AS_RenderCtx *), void(*update)(struct AS_RenderCtx *), void(*local)(int, int)) |
| void | draw_border (struct AS_Bound bound) |
Variables | |
| struct AS_Screen * | last_screen = NULL |
Assembled - Column based text editor Copyright (C) 2023-2024 awewsomegamer
This file is apart of Assembled.
Assembled is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
The screen manager.
| void draw_border | ( | struct AS_Bound | bound | ) |
Utility function to draw a border around a given boundary
| struct | AS_Bound bound - The boundary around which to draw the border. |
| int register_screen | ( | char * | name, |
| void(*)(struct AS_RenderCtx *) | render, | ||
| void(*)(struct AS_RenderCtx *) | update, | ||
| void(*)(int, int) | local ) |
Registers a screen in the hashmap.
The following initializes an entry in the hashmap with the given arguments. The index within the hashmap is calculated using the name parameter.
| char | *name - The string by which to calculate the index within the hashmap |
| void | (*render)(struct AS_RenderCtx *) - The render function of the screen. |
| void | (*update)(struct AS_RenderCtx *) - The update function of the screen. |
| void | (*local)(int, int) - The local function of the screen. |
| int switch_to_last_screen | ( | ) |
Switches to the last screen.
The function flips the as_ctx.screen and the internal last_screen pointers.
| int switch_to_screen | ( | char * | name | ) |
Switch to the given screen
Change as_ctx.screen to the screen found at the given name in the screens hashmap.
| char | *name - The name of the screen to switch to. |