ktcc: rollback to r9529

git-svn-id: svn://kolibrios.org@9558 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2022-01-02 12:16:17 +00:00
parent 5c8619e65c
commit e08c6968ef
357 changed files with 17300 additions and 456 deletions

View File

@@ -1,11 +1,11 @@
#ifndef KOLIBRI_MSGBOX_H
#define KOLIBRI_MSGBOX_H
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
uint8_t retval; // 0 - win closed, 1 to n - button num, also default button on start
uint8_t reserv;
@@ -16,16 +16,16 @@ typedef struct {
typedef void (*msgbox_callback)(void);
extern void __stdcall (*mb_create)(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51
extern void __stdcall (*mb_setfunctions)(msgbox_callback*); // must be called immediately after create, zero-ended array
extern void __stdcall (*mb_reinit)(msgbox *); // recalc sizes when structure changes, called auto when MsgBoxCreate
extern void (*msgbox_create __attribute__((__stdcall__)))(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51
extern void (*msgbox_setfunctions __attribute__((__stdcall__)))(msgbox_callback*); // must be called immediately after create, zero-ended array
extern void (*msgbox_reinit __attribute__((__stdcall__)))(msgbox *) ; // recalc sizes when structure changes, called auto when MsgBoxCreate
static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, ...)
/// text can be multilined by code 13 = "\r"
/// def_but - highlighted and used on Enter (if zero - default is [X]), user may use Tabs or Arrows
/// last params are buttons text, max 8. last must set as NULL
{
va_list vl = 0;
va_list vl=0;
va_start(vl, def_but);
msgbox* box = calloc(sizeof(msgbox), 1);
box->retval = (uint8_t)def_but;
@@ -48,8 +48,8 @@ static inline msgbox* kolibri_new_msgbox(char* title, char* text, int def_but, .
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[])
{
mb_create(box, &box->top_stack);
if (cb) mb_setfunctions(cb);
(*msgbox_create)(box, &box->top_stack);
if (cb) (*msgbox_setfunctions)(cb);
}
#endif