Mercurial > dwindows
comparison dw.h @ 2396:5bb3491ceba2
iOS: Get iOS basic funcionality working by creating dwmain() macros.
This allows us to fork the main() entry point into the main thread to
essentially just call UIApplicationMain() and a secondary thread to call the
user's main() function. This is an experimental change... but required for
iOS functionality... May be changed further going forward.
Move more DW functions into thread safety since the user entry point is now
a secondary thread.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 25 Mar 2021 20:39:52 +0000 |
parents | e6449653a30b |
children | 4de830d3bf9e |
comparison
equal
deleted
inserted
replaced
2395:2618277de356 | 2396:5bb3491ceba2 |
---|---|
1612 /* Forwarder macros to the future names of these functions */ | 1612 /* Forwarder macros to the future names of these functions */ |
1613 #define dw_pointer_get_pos(a, b) dw_pointer_query_pos(a, b) | 1613 #define dw_pointer_get_pos(a, b) dw_pointer_query_pos(a, b) |
1614 #define dw_environment_get(a) dw_environment_query(a) | 1614 #define dw_environment_get(a) dw_environment_query(a) |
1615 #define dw_container_get_start(a, b) dw_container_query_start(a, b) | 1615 #define dw_container_get_start(a, b) dw_container_query_start(a, b) |
1616 #define dw_container_get_next(a, b) dw_container_query_next(a, b) | 1616 #define dw_container_get_next(a, b) dw_container_query_next(a, b) |
1617 | |
1618 /* Entrypoint handling macros */ | |
1619 #ifdef __IOS__ | |
1620 #define dwmain(a, b) \ | |
1621 _dwmain(a, b); \ | |
1622 void _dw_main_thread(int argc, char **argv); \ | |
1623 void _dw_main_launch(void **); \ | |
1624 int main(a, b) { \ | |
1625 void **data = calloc(sizeof(void *), 3); \ | |
1626 data[0] = DW_POINTER(_dwmain); \ | |
1627 data[1] = DW_INT_TO_POINTER(argc); \ | |
1628 data[2] = DW_POINTER(argv); \ | |
1629 dw_thread_new(_dw_main_launch, data, 0); \ | |
1630 _dw_main_thread(argc, argv); } \ | |
1631 int _dwmain(a, b) | |
1632 #else | |
1633 #define dwmain(a, b) main(a, b) | |
1634 #endif | |
1617 | 1635 |
1618 /* Public function prototypes */ | 1636 /* Public function prototypes */ |
1619 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | 1637 void API dw_box_pack_start(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); |
1620 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); | 1638 void API dw_box_pack_end(HWND box, HWND item, int width, int height, int hsize, int vsize, int pad); |
1621 void API dw_box_pack_at_index(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad); | 1639 void API dw_box_pack_at_index(HWND box, HWND item, int index, int width, int height, int hsize, int vsize, int pad); |