Subversion Repositories Kolibri OS

Rev

Rev 9558 | Rev 9810 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9558 Rev 9620
Line 1... Line 1...
1
#ifndef KOLIBRI_MSGBOX_H
1
#ifndef KOLIBRI_MSGBOX_H
2
#define KOLIBRI_MSGBOX_H
2
#define KOLIBRI_MSGBOX_H
-
 
3
 
3
#include 
4
#include 
4
#include 
5
#include 
5
#include 
6
#include 
6
#include 
7
#include 
Line 7... Line -...
7
 
-
 
8
 
8
 
9
typedef struct {
9
typedef struct {
10
    uint8_t     retval;  // 0 - win closed, 1 to n - button num, also default button on start
10
    uint8_t     retval;  // 0 - win closed, 1 to n - button num, also default button on start
11
    uint8_t     reserv;
11
    uint8_t     reserv;
12
    char        texts[2048];      // must be enough ;-)
12
    char        texts[2048];      // must be enough ;-)
13
    char        msgbox_stack[1024];
13
    char        msgbox_stack[1024];
14
    uint32_t    top_stack;
14
    uint32_t    top_stack;
Line 15... Line 15...
15
}__attribute__((packed)) msgbox;
15
}__attribute__((packed)) msgbox;
Line 16... Line 16...
16
 
16
 
17
typedef void (*msgbox_callback)(void);
17
typedef void (*msgbox_callback)(void);
18
 
18
 
Line 19... Line 19...
19
extern void (*msgbox_create __attribute__((__stdcall__)))(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51
19
extern void __stdcall (*mb_create)(msgbox *, void *thread); // clears callbacks, ! if fix lib, we can return eax as of Fn51
20
extern void (*msgbox_setfunctions __attribute__((__stdcall__)))(msgbox_callback*); // must be called immediately after create, zero-ended array
20
extern void __stdcall (*mb_setfunctions)(msgbox_callback*); // must be called immediately after create, zero-ended array
21
extern void (*msgbox_reinit __attribute__((__stdcall__)))(msgbox *) ;  // recalc sizes when structure changes, called auto when MsgBoxCreate
21
extern void __stdcall (*mb_reinit)(msgbox *);  // recalc sizes when structure changes, called auto when MsgBoxCreate
22
 
22
 
Line 46... Line 46...
46
    return box;
46
    return box;
47
}
47
}
Line 48... Line 48...
48
 
48
 
49
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[])
49
static inline void kolibri_start_msgbox(msgbox* box, msgbox_callback cb[])
50
{
50
{
51
    (*msgbox_create)(box, &box->top_stack);
51
    mb_create(box, &box->top_stack);
52
    if (cb) (*msgbox_setfunctions)(cb);
52
    if (cb) mb_setfunctions(cb);
Line 53... Line 53...
53
}
53
}