Lephisto/src/toolkit.h

68 lines
2.0 KiB
C

#pragma once
#include <SDL.h>
#include "opengl.h"
#include "font.h"
extern int toolkit;
// Creation.
unsigned int window_create(char* name, const int x, const int y,
const int w, const int h);
void window_addButton(const unsigned int wid, const int x, const int y,
const int w, const int h, char* name, char* display,
void(*call)(char*));
void window_addText(const unsigned int wid, const int x, const int y,
const int w, const int h, const int centered, char* name,
glFont* font, glColour* colour, char* string);
void window_addImage(const unsigned int wid, const int x, const int y,
char* name, glTexture* image);
void window_addList(const unsigned int wid,
const int x, const int y, // Position.
const int w, const int h, // Size.
char* name, char** items, int nitems, int defitem,
void(*call)(char*));
void window_addRect(const unsigned int wid,
const int x, const int y, // Position.
const int w, const int h, // size.
char* name, glColour* colour, int border); // Properties.
void window_addCust(const unsigned int wid,
const int x, const int y, // Position.
const int w, const int h, // Size.
char* name, const int border,
void(*render) (double x, double y, double w, double h),
void(*mouse) (SDL_Event* event, double x, double y));
// Popups and alerts.
void toolkit_alert(const char* fmt, ...);
// Modification
void window_modifyText(const unsigned int wid, char* name, char* newstring);
void window_modifyImage(const unsigned int wid, char* name, glTexture* image);
// Get the window by name.
int window_exists(const char* wdwname);
unsigned int window_get(const char* wdwname);
char* toolkit_getList(const unsigned int wid, char* name);
// Destroy window.
void window_destroy(const unsigned int wid);
void window_destroyWidget(unsigned wid, const char* wgtname);
// Render.
void toolkit_render(void);
// Input.
int toolkit_input(SDL_Event* event);
void toolkit_update(void);
// Init/Exit.
int toolkit_init(void);
void toolkit_exit(void);